How to build a 1-to-8 demultiplexer from logic gates
A 1-to-8 demultiplexer sends one data input D to one of eight outputs, Y0 to Y7, chosen by the 3-bit select S2 S1 S0, and holds every other output at 0. Each output is D ANDed with the decoding of its own number: Y5 = D AND S2 AND NOT S1 AND S0.
It is a 3-to-8 decoder with D ANDed into every output, and the reverse of an 8-to-1 multiplexer. To save gates this one predecodes: four ANDs decode S1 S0 once, two more combine D with S2 and NOT S2, and each output ANDs one line from each group. The smallest demultiplexer, 1-to-2, is just Y0 = D AND NOT S and Y1 = D AND S, and the 1-to-4 demultiplexer sits in between. All 16 combinations of D and the select are checked before the page is built.
Open this circuit in the lab →
What you need
- 3× NOT: NOT S2, NOT S1 and NOT S0
- 4× AND: decode S1 S0 into four lines
- 2× AND: D AND NOT S2, D AND S2
- 8× AND: Yi = (the D line for S2) AND (the line for S1 S0)
Step by step
- Place inputs
D,S2,S1andS0and probesY0toY7. - Decode S1 S0 with two NOT gates and four ANDs into four lines, one per value 00 to 11.
- AND D with NOT S2 and with S2 to get two lines, one for each half of the outputs.
- For each output i, AND the S2 line for i div 4 with the S1 S0 line for i mod 4.
- Turn D on and count S2 S1 S0 from 000 to 111: the 1 walks from Y0 to Y7.
1-to-8 demultiplexer truth table
| S2 S1 S0 | Output that gets D |
|---|---|
| 000 | Y0 |
| 001 | Y1 |
| 010 | Y2 |
| 011 | Y3 |
| 100 | Y4 |
| 101 | Y5 |
| 110 | Y6 |
| 111 | Y7 |
With D = 0 every output is 0, whatever the select. Tie D to 1 and the same circuit is a 3-to-8 decoder; used the other way round, D works as an enable input.
You can also read the full theory in the lesson on encoders and demultiplexers. Prefer to build it yourself from scratch? Open the digiwleea lab and place the gates on the canvas, or start from the logic gate simulator.
Build more parts from gates
Each of these is one step from a transistor to a working CPU. Build every gate from CMOS transistors and work all the way up in the free digiwleea lab, with the free theory reference alongside.
Open the 1-to-8 demultiplexer in the lab →Frequently asked
What is a 1 to 8 demultiplexer?
A circuit with one data input, three select inputs and eight outputs that routes the data input to the output numbered by the select value. All other outputs stay 0.
How many select lines does a 1-to-8 demultiplexer have?
Three, because 2 to the power 3 is 8. A 1-to-n demultiplexer needs log2(n) select lines.
What is a 1 to 2 demultiplexer?
The smallest demultiplexer: one select line S, with Y0 = D AND NOT S and Y1 = D AND S. It takes one NOT and two AND gates.
What is the difference between a demultiplexer and a decoder?
A decoder turns a number into one active line; a demultiplexer also has a data input that it steers to that line. A decoder with an enable input is the same circuit as a demultiplexer, with the enable as the data input.