Skip to content
digiwleeaTools
LearnGlossaryAboutCheat sheetHow a CPU worksBuild a CPUToolsOpen the lab →

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.

Big circuit: pinch, scroll or tap + to zoom in, then drag to move around.

Live circuit: click the inputs to toggle them and watch the outputs update. It runs the real simulator, right here on the page.

Open this circuit in the lab →

Embed or cite this circuit

Free to embed on a course page, blog or worksheet: paste this code. The circuit stays live, and the small digiwleea badge links back here.

To cite it: digiwleea, “16-to-1 multiplexer”, https://digiwleea.wleeaf.dev/tools/build/multiplexer-16to1/

What you need

Step by step

  1. Place inputs D0 to D15, select inputs S3 to S0, five 4-to-1 multiplexers and a probe Y.
  2. 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.
  3. Feed the four first-level outputs into the fifth mux, in order, and drive its selects with S3 S2.
  4. 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 S0Y
0000D0
0001D1
0010D2
0011D3
0100D4
0101D5
0110D6
0111D7
1000D8
1001D9
1010D10
1011D11
1100D12
1101D13
1110D14
1111D15

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.