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

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.

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, “8-to-1 multiplexer from 2-to-1 muxes”, https://digiwleea.wleeaf.dev/tools/build/multiplexer-8to1-from-2to1/

What you need

Step by step

  1. Place data inputs D0 to D7, selects S2, S1, S0 and a probe Y.
  2. First level: four 2-to-1 muxes on the pairs D0/D1, D2/D3, D4/D5 and D6/D7, all with S0 as select.
  3. Second level: two muxes choose between the first-level outputs, with S1.
  4. Last level: one mux chooses between the two second-level outputs, with S2, and drives Y.
  5. 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

S2S1S0Y
000D0
001D1
010D2
011D3
100D4
101D5
110D6
111D7

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.