Multiplexers (MUX) Demystified: The Data Traffic Controller

Denny Denny
3 min read

Digital Logic 101

šŸ“… January 2026 ā€¢ ā±ļø 16 min read ā€¢ šŸŽ“ Beginner-Intermediate

How does a CPU choose which register to read? How does a TV select between input channels? The answer is the Multiplexer (MUX)—one of the most essential circuits in digital design. In this tutorial, you'll learn how MUX works and build one from basic gates.

What is a Multiplexer?

multiplexer is a combinational circuit that selects one of several inputs and forwards it to a single output. Think of it as a digital switch with multiple inputs and one output—the select lines determine which input gets through.

MUX: The Data Selector

Inputs: Multiple data inputs (Iā‚€, I₁, Iā‚‚, ...) + Select lines (Sā‚€, S₁, ...)

Output: One output (Y) that equals the selected input

Rule: n select lines can choose from 2ⁿ inputs

4-to-1 Multiplexer with truth table

A 4-to-1 multiplexer: 2 select lines choose between 4 inputs. The selected input appears at the output.

The 2-to-1 MUX

Let's start with the simplest MUX: 2-to-1. It has 2 data inputs (Iā‚€, I₁), 1 select line (S), and 1 output (Y).

Select (S)Output (Y)
0Y = Iā‚€
1Y = I₁

The Boolean expression for a 2-to-1 MUX:

Y = S'Ā·Iā‚€ + SĀ·I₁

2-to-1 Multiplexer lesson

A 2-to-1 MUX built from AND, OR, and NOT gates. When S=0, Iā‚€ passes through; when S=1, I₁ passes through.

Scaling Up: 4-to-1 MUX

4-to-1 MUX has 4 data inputs and 2 select lines. The select lines form a 2-bit binary number that chooses which input to route.

S₁Sā‚€Output (Y)
00Iā‚€
01I₁
10Iā‚‚
11Iā‚ƒ
4-to-1 Multiplexer lesson with scaling pattern

4-to-1 MUX with function table and scaling pattern. n select lines → 2ⁿ inputs!

Key Insight: The Scaling Pattern

Multiplexers follow a simple rule: n select lines select from 2ⁿ inputs. So 1 select = 2 inputs (2:1), 2 selects = 4 inputs (4:1), 3 selects = 8 inputs (8:1), and so on.

Real-World Analogy: TV Channel Selector

Imagine you have 4 video sources (gaming console, cable box, Blu-ray, streaming stick) and one TV. A MUX is like the input selector—the remote's button (select lines) determines which source appears on screen (output).

TV Channel Selector MUX real-world analogy

TV channel selector as a MUX: select lines choose which input source appears on the TV!

Applications of Multiplexers

  • CPU Register File: Select which register's value to read
  • ALU Input Selection: Choose operands for arithmetic operations
  • Memory Bank Selection: Route data from different memory chips
  • Data Routing: Switch between different data sources
  • Function Generation: Implement any Boolean function with a MUX

The Demultiplexer (DEMUX)

The opposite of a MUX is a Demultiplexer (DEMUX). It takes ONE input and routes it to one of MANY outputs based on select lines.

1-to-4 Demultiplexer lesson

A 1-to-4 DEMUX: one input is routed to one of four outputs based on 2 select lines.

Building an 8-to-1 MUX

Larger MUXes can be built by cascading smaller ones:

8-to-1 Multiplexer lesson

An 8-to-1 MUX with 3 select lines. This can be built from two 4-to-1 MUXes and one 2-to-1 MUX!

Try It Yourself!

  1. Build a 2-to-1 MUX: Use 2 AND gates, 1 OR gate, and 1 NOT gate
  2. Expand to 4-to-1: Add more AND gates and select lines
  3. TV Selector: Wire 4 switches (channels) to a MUX
  4. Build DEMUX: Reverse the logic—one input to multiple outputs

Ā© 2026 DigiSim.io — The Interactive Digital Logic Simulator

digisim.io ā€¢ Blog ā€¢ Lessons