Multiplexers (MUX) Demystified: The Data Traffic Controller
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?
A 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

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).
The Boolean expression for a 2-to-1 MUX:
Y = S'Ā·Iā + SĀ·Iā

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
A 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.

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 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.

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:

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!
- Build a 2-to-1 MUX: Use 2 AND gates, 1 OR gate, and 1 NOT gate
- Expand to 4-to-1: Add more AND gates and select lines
- TV Selector: Wire 4 switches (channels) to a MUX
- Build DEMUX: Reverse the logicāone input to multiple outputs
Ā© 2026 DigiSim.io ā The Interactive Digital Logic Simulator
digisim.io ⢠Blog ⢠Lessons