2:4 decoder with enable
A 2-to-4 decoder converts a 2-bit binary input into a one-hot output: exactly one of four lines is 1.
Open this circuit in LogicLab →
Boolean expressions
- Y0 = EN·A1′A0′
- Y1 = EN·A1′A0
- Y2 = EN·A1A0′
- Y3 = EN·A1A0
Truth table
| A1 | A0 | EN | Y0 | Y1 | Y2 | Y3 |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 0 | 0 | 1 |
How it works
Each output is an AND gate that recognises one input combination, using inverters for the bits that must be 0. The enable input is ANDed into every output so the whole decoder can be switched off.
Try it yourself
Turns a 2-bit number into one of four active outputs; with EN low every output stays 0. Open the circuit, click the switches to change the inputs, and watch the LEDs and the waveform panel respond. You can edit the circuit, convert it to NAND-only or NOR-only gates, and save or export your version.
Related circuits
Reference: en.wikipedia.org/wiki/Binary_decoder