2-to-4 Decoder
A 2-to-4 decoder takes a two-bit number and lights exactly one of four outputs — the one whose number it is. It is how a computer picks one memory chip, one register or one display out of several.
Try it live
This is the Circuit Simulator itself, running in the page — it is LogicsBench's own example design, read-only. Open it full size, and sign in to make your own copy to change.
- Count through 00, 01, 10, 11 and watch the lit output step along.
- Fork it and add a third input to make a 3-to-8 decoder, like the 74LS138.
2-to-4 decoder truth table
| A | B | Y0 | Y1 | Y2 | Y3 |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 |
How it works
Y0 = A′B′Y1 = A′BY2 = AB′Y3 = AB
Each output is one minterm of A and B: an AND of the inputs, each straight or inverted.
Because every minterm has its own output, a decoder and an OR gate can build any function of its inputs — OR together the outputs where the function is 1.
The 74LS139 holds two of these, with active-low outputs (the chosen line goes to 0) and an enable input on each.