16-to-1 multiplexer: a mux tree of 4-to-1 muxes, live
A 16-to-1 multiplexer connects one of sixteen data inputs, D0 to D15, to its output Y, chosen by four select lines S3 S2 S1 S0. This one is a mux tree: four 4-to-1 multiplexers each pick one input from a group of four using S1 S0, and a fifth 4-to-1 mux picks one of those four results using S3 S2.
Building a big multiplexer from smaller ones is the standard way to scale it. The low select bits choose within a group and the high select bits choose the group, so input number S3 S2 S1 S0 is the one that reaches Y: with S = 1011 (11), the first level passes D3, D7, D11 and D15 (position 3 in each group), and the second level picks the third group, giving D11. Five 4-to-1 multiplexers do the job, the same way three 2-to-1 muxes make a 4-to-1 in the 4-to-1 mux from 2-to-1 muxes. A 16-to-1 mux can also implement any Boolean function of four variables: put the function's truth table on D0 to D15 and the variables on the select lines.
Open this circuit in the lab →
What you need
- 4× 4-to-1 multiplexer: first level: one per group of four inputs, all selected by S1 S0
- 1× 4-to-1 multiplexer: second level: picks a group's result by S3 S2
Step by step
- Place inputs
D0toD15, select inputsS3toS0, five 4-to-1 multiplexers and a probeY. - Wire D0 to D3 into the first mux, D4 to D7 into the second, D8 to D11 into the third and D12 to D15 into the fourth, and drive all four muxes' selects with S1 S0.
- Feed the four first-level outputs into the fifth mux, in order, and drive its selects with S3 S2.
- Its output is Y. Set a select value and toggle the matching data input: only that one moves Y.
16-to-1 multiplexer function table
| S3 S2 S1 S0 | Y |
|---|---|
| 0000 | D0 |
| 0001 | D1 |
| 0010 | D2 |
| 0011 | D3 |
| 0100 | D4 |
| 0101 | D5 |
| 0110 | D6 |
| 0111 | D7 |
| 1000 | D8 |
| 1001 | D9 |
| 1010 | D10 |
| 1011 | D11 |
| 1100 | D12 |
| 1101 | D13 |
| 1110 | D14 |
| 1111 | D15 |
The full truth table has 2^20 rows, over a million, so the circuit is checked on the rows that prove it right: for every one of the 16 select values, with the data all 0, all 1, and each one-hot and one-cold pattern (544 rows). Y must equal the selected input every time, which shows the right input gets through and no other input leaks into the output. One size down, the same split gives the 8-to-1 mux using 4-to-1 muxes. Two 8-to-1 muxes and a 2-to-1 mux make the same thing: 16-to-1 mux using 8-to-1 muxes.
You can also read the full theory in the lesson on the multiplexer. 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 16-to-1 multiplexer in the lab →Frequently asked
How do you make a 16 to 1 multiplexer?
Use four 4-to-1 multiplexers for the inputs in groups of four, all selected by the two low select bits, and a fifth 4-to-1 mux that picks among their outputs using the two high select bits. Five 2-level 4:1 muxes in total, or fifteen 2-to-1 muxes in a four-level tree.
How many select lines does a 16 to 1 multiplexer have?
Four, because 2^4 = 16. In general an n-input multiplexer needs log2(n) select lines.
How many 4 to 1 multiplexers are needed for a 16 to 1 multiplexer?
Five: four on the first level and one on the second.
Can a 16 to 1 multiplexer implement any 4-variable function?
Yes. Connect the four variables to the select lines and put the function's output for each row (0 or 1) on the matching data input; the mux then outputs the function's value for any input.