CE2704 · Digital Logic Design
Theme 4 · Combinational building blocks

Multiplexer & demultiplexer

Two blocks that move data instead of computing it: pick one of many signals onto a single wire — or send one signal to a chosen destination.

Built from first principles.

Before you start

What you need first

  • The design method — reading a function as a Boolean expression.
  • Powers of two — n select lines choose among 2n lines.

What you'll be able to do

  • Explain a multiplexer (data selector) and write a 2:1 MUX.
  • Size the select lines for any MUX (8:1, 16:1…).
  • Explain a demultiplexer — the MUX run backwards.

The multiplexer: a data selector

A multiplexer (MUX) has several data inputs, one output, and some select lines. The select value chooses which input is connected to the output — like a rotary switch you can flip electronically.

D0 D1 Y S MUX
2:1 MUX — select S picks D0 or D1.

For a 2:1 MUX with one select line S:

SY
0D0
1D1
$$ Y = S'\cdot D_0 + S\cdot D_1 $$

S = 0 enables the D0 term; S = 1 enables the D1 term.

Sizing rule: a MUX with 2n data inputs needs n select lines. So 4:1 needs 2 selects, 8:1 needs 3, 16:1 needs 4 (since 24 = 16).
📐 Worked example

A 4:1 MUX with selects S₁S₀ = 10

Four inputs D0…D3, two selects. The full function is:

$$ Y = S_1'S_0'D_0 + S_1'S_0 D_1 + S_1 S_0' D_2 + S_1 S_0 D_3 $$

With S₁S₀ = 10 (binary 2), only the term S₁S₀′ is 1, so:

$$ Y = D_2 $$
The select value, read as a binary number, is the index of the input that gets through — 10₂ = 2 → D2.

The demultiplexer: a MUX in reverse

A demultiplexer (DEMUX) is the opposite: one data input, several outputs, and select lines that choose which output the input is routed to. Every other output stays at 0.

D Y0 Y1 S DEMUX
1:2 DEMUX — select S sends D to Y0 or Y1.

For a 1:2 DEMUX (input D, select S):

$$ Y_0 = S'\cdot D \qquad Y_1 = S\cdot D $$

When S = 0, D appears on Y0 (and Y1 = 0); when S = 1, D appears on Y1. Same select-line sizing rule: 1-to-2n needs n selects.

Where these earn their keep: a MUX lets many sensors share one ADC or one bus wire (pick whose turn it is); a DEMUX sends a single serial stream out to the right channel. Together they are how one wire serves many.

✏️ Try it yourself

(a) In one sentence, what does a MUX do? (b) How many select lines does a 16:1 MUX need? (c) For a 4:1 MUX with S₁S₀ = 01, which input reaches Y? (d) Write the two outputs of a 1:2 DEMUX.

(a) it selects one of several data inputs and routes it to a single output. (b) 4 (since 24 = 16). (c) 01₂ = 1 → D1. (d) Y0 = S′·D,  Y1 = S·D.

Recap — the whole topic on one screen

BlockDoesKey fact
MUXmany inputs → one output2n inputs need n selects; Y = Σ (select-term · D)
DEMUXone input → many outputsroutes D to the selected output; others 0
Select valueread as binary= index of the chosen line

Next topic

Decoder & encoder

A DEMUX with its data input held at 1 becomes a decoder: turn an n-bit code into one active line. Next we meet decoders, their reverse (encoders), and what "one-hot" means.

→ Decoder & encoder