3.3.5Combinational Circuits

Multiplexers (2 - 1, 4 - 1, n - 1)

1,880 words9 min readdifficulty · medium6 backlinks

WHY do we need a MUX?


WHAT is a multiplexer — the definition

The number of select lines needed for NN inputs: since nn bits address 2n2^n inputs, n=log2N.n = \lceil \log_2 N \rceil.


HOW to derive the Boolean expression (from scratch)

We build the equation the way a decoder does: each input is ANDed with the minterm of the selects that "point at" it", and all these products are ORed.

2:1 MUX derivation

We want Y=I0Y = I_0 when S=0S=0 and Y=I1Y=I_1 when S=1S=1. "When S=0S=0" is captured by the term Sˉ\bar S; "when S=1S=1" by SS. So:

Y=SˉI0+SI1Y = \bar S\,I_0 + S\,I_1

4:1 MUX derivation

Two selects S1S0S_1 S_0 give four minterms. Input IkI_k is passed when S1S0S_1S_0 spells kk:

S1S_1 S0S_0 minterm passes
0 0 Sˉ1Sˉ0\bar S_1\bar S_0 I0I_0
0 1 Sˉ1S0\bar S_1 S_0 I1I_1
1 0 S1Sˉ0S_1\bar S_0 I2I_2
1 1 S1S0S_1 S_0 I3I_3

General n:1 MUX

Y=k=02n1mkIk\boxed{Y = \sum_{k=0}^{2^n-1} m_k \, I_k} where mkm_k is the minterm of the select variables corresponding to kk. This sum-of-products is literally a decoder (the minterms) feeding AND–OR logic.

Figure — Multiplexers (2 - 1, 4 - 1, n - 1)

MUX as a universal function generator (the 80/20 gem)

Trick (Shannon expansion): to build an nn-variable function with a smaller 2n1:12^{n-1}:1 MUX, put n1n-1 variables on selects; each data input becomes one of {0,1,v,vˉ}\{0, 1, v, \bar v\} of the leftover variable vv.


Enable line

Real MUX chips add an enable EE. Typically Y=E(MUX expression)Y = E\cdot(\text{MUX expression}) (active-high), so E=0E=0 forces Y=0Y=0 (or high-Z on tri-state parts). Enable lets you cascade and tri-state onto a shared bus.


Common mistakes


Recall Feynman: explain to a 12-year-old

Imagine 4 water pipes and one tap that can drink from only one pipe at a time. You turn a little dial with 2 clicks (that's 2 select bits = 4 positions). Whatever number the dial shows, that pipe's water comes out. The MUX is that magic tap for electricity — it copies just ONE chosen input to the single output wire, ignoring the rest.


Connections

  • Decoders — the minterm generator inside every MUX (a MUX = decoder + OR).
  • Demultiplexers — the exact inverse operation (one to many).
  • Boolean Algebra Minterms — the SOP form we derived.
  • Shannon Expansion — how to shrink functions onto smaller MUXes.
  • Tri-state Buffers — enable line and bus sharing.
  • Combinational Logic Design — MUX as universal function block.

Flashcards

Number of select lines for an N-input MUX?
log2N\lceil \log_2 N\rceil.
Boolean expression of a 2:1 MUX?
Y=SˉI0+SI1Y=\bar S I_0 + S I_1.
Boolean expression of a 4:1 MUX?
Y=Sˉ1Sˉ0I0+Sˉ1S0I1+S1Sˉ0I2+S1S0I3Y=\bar S_1\bar S_0 I_0+\bar S_1 S_0 I_1+S_1\bar S_0 I_2+S_1 S_0 I_3.
Which data input is selected when S1S0=10S_1S_0=10?
I2I_2 (since 102=210_2=2).
General n:1 MUX equation?
Y=kmkIkY=\sum_{k} m_k I_k, minterm of selects times input.
Why can a 2n:12^n:1 MUX implement any n-variable function?
Wire each input to the truth-table value of its row; MUX selects the correct row.
Implement XOR(A,B) on a 4:1 MUX (selects A,B). Inputs?
I0=0,I1=1,I2=1,I3=0I_0=0, I_1=1, I_2=1, I_3=0.
Implement XOR(A,B) on a 2:1 MUX with A on select. Inputs?
I0=B, I1=BˉI_0=B,\ I_1=\bar B.
Difference between MUX and DEMUX?
MUX = many inputs to one output; DEMUX = one input to many outputs.
Role of the enable line?
Gates output; E=0E=0 forces output 0 / high-Z, enabling cascading and bus sharing.
How to build an 8:1 MUX from smaller ones?
Two 4:1 MUXes (select S1S0S_1S_0) feeding a 2:1 MUX (select S2S_2).

Concept Map

motivates

has

has

has

address count

chooses

selects

generalises to

generalises to

built from

implemented as

acts as

copies

Multiplexer n:1 digital switch

2^n data inputs

n select lines

One output Y

Share one bus/output

n = ceil log2 N

2:1 MUX

4:1 MUX

General n:1 SOP

Minterms of selects

Decoder AND-OR logic

Universal function generator

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, multiplexer ek digital switch hai — bahut saare inputs aate hain, lekin output sirf ek. Kaunsa input output pe jayega, ye decide karti hain select lines. Jaise ek rotary knob hota hai: knob ki position number batati hai, aur us number wala input bahar aa jata hai. Isiliye 2:1 MUX me 1 select line hoti hai (2 positions), 4:1 me 2 select lines (4 positions), aur general n select lines se 2n2^n inputs address hote hain. Yaad rakhna: number of select lines =log2(inputs)=\log_2(\text{inputs}), na ki inputs ke barabar.

Equation banane ka logic simple hai: har input ko us select combination ke minterm se AND karo jo us input ko point karta hai, phir sab ko OR kar do. Isiliye 2:1 ke liye Y=SˉI0+SI1Y=\bar S I_0 + S I_1. Jab S=0S=0, sirf SˉI0\bar S I_0 bachta hai, baaki 0 ho jate hain — clean selection. Yehi wajah hai ki kabhi do inputs leak nahi karte: kisi bhi select value pe exactly ek hi minterm 1 hota hai.

Sabse powerful baat — ek 2n:12^n:1 MUX se koi bhi Boolean function ban sakta hai. Variables ko select pe lagao, aur har data input pe uss truth-table row ka answer (0 ya 1) daal do. MUX automatically sahi row select kar leta hai. Aur agar chota MUX use karna ho, to Shannon expansion se ek variable ko baahar factor karke inputs ko 0,1,v,vˉ0,1,v,\bar v me convert kar sakte ho. Exam me ye trick bahut marks deti hai, isliye XOR wala example zaroor practice karo.

Go deeper — visual, from zero

Test yourself — Combinational Circuits

Connections