Skip to content
BetterDL

Multiplexer implementation

Also called: MUX implementation, MUX function generator, multiplexer function generator, implementing logic with a multiplexer, MUX-based logic, leftover variable

Building any Boolean function from a multiplexer: put variables on the select lines and wire each data input to 0, 1, or a leftover variable or its complement.

A multiplexer looks up an answer: the select lines say which row, and the data inputs hold the answers. So a MUX can build any function, with no gates at all.

All variables on the selects. For an n-variable function, use a 2ⁿ:1 MUX. Put the variables on the selects (MSB variable on the MSB select), and tie each data input Iᵢ to F's value on row i. The data inputs, read from I0 up, are the truth table's output column.

One variable fewer. Use a 2ⁿ⁻¹:1 MUX. Put n − 1 variables on the selects. The remaining variable, the leftover, goes to the data inputs. Each data input now covers two truth-table rows that differ only in the leftover variable x. Read F on those two rows (x = 0 first):

  • 0 0 → 0
  • 1 1 → 1
  • 0 1 → x
  • 1 0 → x', the complement of x

That always works, because a function of one variable can only be one of those four. Each data input is a shannon expansion cofactor.

Recipe:

  1. Write down which variable goes on S1 and which on S0.
  2. For each Iᵢ, translate the code i into your variables and find its two rows.
  3. Match the pair, as above.
  4. Verify by expanding .
0001
0010
0100
0110
1000
1011
1101
1111

Worked examples

Example

F = Σm(0, 5, 6, 7) with a 4:1 MUX

Selects S1 = A, S0 = B. C is the leftover variable.

  1. 1.

    Output column, rows 0–7: 1 0 0 0 0 1 1 1.

  2. 2.

    I0 (AB = 00): rows 0, 1 → F = 1, 0 → I0 = .

  3. 3.

    I1 (AB = 01): rows 2, 3 → 0, 0 → I1 = 0.

  4. 4.

    I2 (AB = 10): rows 4, 5 → 0, 1 → I2 = C.

  5. 5.

    I3 (AB = 11): rows 6, 7 → 1, 1 → I3 = 1.

  6. 6.

    Verify: F = = m0 + m5 + m6 + m7. ✓

Example

The same function on an 8:1 MUX

Selects S2 S1 S0 = A B C. No leftover variable.

  1. 1.

    Each data input is just F on its row.

  2. 2.

    I0…I7 = 1 0 0 0 0 1 1 1.

  3. 3.

    Selects 101 pick I5 = 1, and row 5 is in the list. ✓

Common mistakes

  • Forgetting which variable is on S1. Swapping the selects swaps I1 and I2, while I0 and I3 stay put, so a wrong answer can look half right.

  • Pairing neighboring rows when the leftover isn't the LSB. If the selects are B and C, the leftover is A, and each pair is rows i and i + 4.

  • Getting x and x' backwards. Pair 0 1 (F follows x) means x; pair 1 0 means x'.

Practice Multiplexer implementation

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

Learn it step by step

Multiplexer implementation is taught in Combinational Logic.