Skip to content
BetterDL

Multiplexer (MUX)

Also called: data selector, multiplexor, selector circuit, multiplexers

A combinational circuit that copies one of its 2ⁿ data inputs to a single output, chosen by n select lines read as a binary number.

A multiplexer is a digitally controlled switch. It has several data inputs, one output, and a few select lines. The select lines, read as a binary number, say which data input to pass through.

  • A 2:1 MUX has inputs I0, I1 and one select S.
  • A 4:1 MUX has I0–I3 and selects S1 S0.
  • In general a 2ⁿ:1 MUX has 2ⁿ data inputs and n select lines.

Inside, each data input is ANDed with the minterm of the select code that picks it, and an OR gate combines the results. For a 4:1 MUX:

Y =

Exactly one of those AND gates is open at a time, so exactly one data input reaches Y.

Where you'll meet it:

  • Inside a CPU's datapath, MUXes choose which register feeds the ALU, or whether the next address is the next instruction or a jump target.
  • As a function generator: with the variables on the selects and constants on the data inputs, a MUX is a lookup table that can build any function. See multiplexer implementation.

Its mirror image is the demultiplexer: one input, many outputs.

S1S0I0I1I2I3Y

Worked examples

Example

Which input reaches the output?

A 4:1 MUX has I0 = 0, I1 = 1, I2 = 1, I3 = 0. Find Y for each select code (S1 is the MSB).

  1. 1.

    S1 S0 = 00 → 0 → Y = I0 = 0.

  2. 2.

    S1 S0 = 01 → 1 → Y = I1 = 1.

  3. 3.

    S1 S0 = 10 → 2 → Y = I2 = 1.

  4. 4.

    S1 S0 = 11 → 3 → Y = I3 = 0.

  5. 5.

    Check 10 with the equation: only can be 1, and it is 1 · 1 · 1 = 1. ✓

Example

Sizing a MUX

How many select lines does a 32:1 MUX need, and how many data inputs does a MUX with 6 select lines have?

  1. 1.

    32 = 2⁵, so a 32:1 MUX needs 5 select lines.

  2. 2.

    6 select lines make 2⁶ = 64 different codes, so the MUX chooses among 64 data inputs.

  3. 3.

    Either way it has exactly one output.

Common mistakes

  • Swapping S1 and S0. S1 is the MSB, so S1 S0 = 01 selects I1 and 10 selects I2.

  • Thinking the select lines are data. They only choose; the value that comes out is whatever sits on the chosen data input.

  • Counting select lines as half the inputs. A 2ⁿ:1 MUX needs n selects: 8 inputs need 3, not 4.

Practice Multiplexer (MUX)

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Multiplexer (MUX) is taught in Combinational Logic and Basic CPU / Computer Architecture.