8-to-1 multiplexer using 2-to-1 multiplexers, live
An 8-to-1 multiplexer can be built from seven 2-to-1 multiplexers arranged as a tree: four muxes pick within each pair of inputs using S0, two pick between those pairs using S1, and the last picks between the two halves using S2.
Each level of the tree halves the number of candidates and uses one select bit, least significant bit first: S0 chooses D0 or D1, D2 or D3 and so on; S1 chooses between the winners of each pair of pairs; S2 chooses the lower or the upper half. In general a 2n-to-1 mux needs 2n - 1 two-to-one muxes in n levels, so 8-to-1 takes 4 + 2 + 1 = 7. The 2-to-1 mux here is the verified 2-to-1 multiplexer, saved as a part. The same idea one size down is the 4-to-1 mux from 2-to-1 muxes, and the flat gate version is the 8-to-1 multiplexer; with 4-to-1 muxes as the building block, the 16-to-1 multiplexer uses five.
Open this circuit in the lab →
What you need
- 4× 2-to-1 MUX: first level, select S0: D0/D1, D2/D3, D4/D5, D6/D7
- 2× 2-to-1 MUX: second level, select S1
- 1× 2-to-1 MUX: last level, select S2: output Y
Step by step
- Place data inputs
D0toD7, selectsS2,S1,S0and a probeY. - First level: four 2-to-1 muxes on the pairs D0/D1, D2/D3, D4/D5 and D6/D7, all with S0 as select.
- Second level: two muxes choose between the first-level outputs, with S1.
- Last level: one mux chooses between the two second-level outputs, with S2, and drives Y.
- Set S2 S1 S0 to any number from 0 to 7: Y follows that data input.
8-to-1 mux from 2-to-1 muxes: truth table
| S2 | S1 | S0 | Y |
|---|---|---|---|
| 0 | 0 | 0 | D0 |
| 0 | 0 | 1 | D1 |
| 0 | 1 | 0 | D2 |
| 0 | 1 | 1 | D3 |
| 1 | 0 | 0 | D4 |
| 1 | 0 | 1 | D5 |
| 1 | 1 | 0 | D6 |
| 1 | 1 | 1 | D7 |
Before the page is built, all 2,048 combinations of the eight data inputs and three selects are checked on the live circuit.
You can also read the full theory in the lesson on multiplexers. 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.
More builds: Selecting, routing and decoding
All 246 build guides, by topic
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 8-to-1 multiplexer from 2-to-1 muxes in the lab →Frequently asked
How many 2-to-1 multiplexers are needed for an 8-to-1 multiplexer?
Seven: four in the first level, two in the second and one in the last, one level per select bit.
How do you build an 8-to-1 mux from 2-to-1 muxes?
Use a tree. The first level picks within each pair of inputs using S0, the second picks between pairs using S1, and the last picks between the two halves using S2.
How many 2-to-1 muxes make a 2^n-to-1 mux?
2^n - 1, arranged in n levels: for example 3 for a 4-to-1 mux, 7 for 8-to-1 and 15 for 16-to-1.