21 Multiplexers
21 Multiplexers
21 Multiplexers
Digital Logic
http://www.ece.iastate.edu/~alexs/classes/
Multiplexers
x1 0
f
x2 1
Where should we
put the negation signs?
s x1 x2
s x1 x2
s x1 x2
s x1 x2
Let’s Derive the SOP form
s x1 x2
s x1 x2
s x1 x2
s x1 x2
Let’s Derive the SOP form
s x1 x2
s x1 x2
s x1 x2
s x1 x2
x1 s
f x1 0
f
s x2 1
x2
x1 x1
1 x1
f
s 0 0
x2 0
Analysis of the 2-1 Multiplexer
(when the input s=1)
x1 0
0 x2
f
s 1 1
x2 x2
Analysis of the 2-1 Multiplexer
(when the input s=0)
x1
Analysis of the 2-1 Multiplexer
(when the input s=1)
x2
More Compact Truth-Table Representation
(a)Truth table
[http://www.absoluteastronomy.com/topics/Multiplexer]
4-1 Multiplexer (SOP circuit)
f = s 1 s0 w0 + s1 s0 w1 + s1 s0 w2 + s1 s0 w3
[ Figure 4.2c from the textbook ]
Analysis of the 4-1 Multiplexer
( s1=0 and s0=0 )
0
0
Analysis of the 4-1 Multiplexer
( s1=0 and s0=0 )
0
1
0 1
0
1
1
0
0
0
Analysis of the 4-1 Multiplexer
( s1=0 and s0=0 )
0
1 w0
0 1
0 0
1
1 0
0
0 0
0
Analysis of the 4-1 Multiplexer
( s1=0 and s0=0 )
0
1 w0
0 1
0 0
1 w0
1 0
0
0 0
0
Analysis of the 4-1 Multiplexer
( s1=0 and s0=1 )
1
0 0
0 1
1 w1
1 w1
0 0
0
1 0
0
Analysis of the 4-1 Multiplexer
( s1=1 and s0=0 )
0
1 0
1 0
0 0
0 w2
1 w2
1
0 0
1
Analysis of the 4-1 Multiplexer
( s1=1 and s0=1 )
1
0 0
1 0
1 0
0 w3
0 0
1
1 w3
1
Analysis of the 4-1 Multiplexer
( s1=0 and s0=0 )
0
0
w0
Analysis of the 4-1 Multiplexer
( s1=0 and s0=1 )
1
0
w1
Analysis of the 4-1 Multiplexer
( s1=1 and s0=0 )
0
1
w2
Analysis of the 4-1 Multiplexer
( s1=1 and s0=1 )
1
1
w3
Using three 2-to-1 multiplexers
to build one 4-to-1 multiplexer
s1
s0
w0 0
w1 1
0
f
1
w2 0
w3 1
w1
s1 f
s0
w2
w3
That is different from the SOP form of the 4-1
multiplexer shown below, which uses less gates
Analysis of the Hierarchical Implementation
( s1=0 and s0=0 )
0
0
0
w0
0
w1
1
w2
1
w3
w0
w3
w4 s2
s3
w7
f
w8
w11
w12
w15
[ Figure 4.4 from the textbook ]
Multiplexers Are Special
The Three Basic Logic Gates
x1 x1
x x x1 x 2 x1 + x2
x2 x2
x x
x x
0 1
1 0
Truth Table for AND
x1
x1 x2
x2
Truth Table for OR
x1
x1 + x2
x2
Building an AND Gate with 4-to-1 Mux
Building an AND Gate with 4-to-1 Mux
x x
x x
0 1
1 0
Building a NOT Gate with 4-to-1 Mux
x x
x y f
0 0 1
0 1 1
1 0 0
1 1 0
x x
x y f
0 0 1
0 1 1
1 0 0
1 1 0
Building a NOT Gate with 4-to-1 Mux
x x
x y f
0 0 1
0 1 1
1 0 0
1 1 0
x x
x x
0 1
1 0
x2
Building an OR Gate with 2-to-1 Mux
Building an OR Gate with 2-to-1 Mux
Building an OR Gate with 2-to-1 Mux
x2
1
Building a NOT Gate with 2-to-1 Mux
x x
x x
0 1
1 0
Building a NOT Gate with 2-to-1 Mux
x x
x x
0 1
1 0
Implications
x1 y1
x2 y2
x1 y1
x2 y2
s=1
x1 y1
x2 y2
Implementation of a 2 x 2 crossbar
switch with multiplexers
x1 0
y1
1
x2 0
y2
1
x1
y1
x2
y2
Implementation of a logic function
with a 4x1 multiplexer
w2
w1 w2 f
w1
0 0 0
0
0 1 1
1
1 f
1 0 1
1 1 0 0
w1 w2 f
w1 f
w1
0 0 0 w2
0
0 1 1
1 w2 w2
1 0 1 f
1 1 0
f
Implementation of the XOR Logic Gate
with a 2-to-1 multiplexer and one NOT
f
y
Implementation of the XOR Logic Gate
with a 2-to-1 multiplexer and one NOT
f
y
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w3
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
w1
w2
w3
f
w1
w2
w3
f
Shannon’s Expansion Theorem
cofactor cofactor
Shannon’s Expansion Theorem
(Example)
Shannon’s Expansion Theorem
(Example)
(w1 + w1)
Shannon’s Expansion Theorem
(Example)
(w1 + w1)
Shannon’s Expansion Theorem
(In terms of more than one variable)
g
f
h
Factor and implement the following
function using only 2x1 multiplexers
Factor and implement the following
function using only 2x1 multiplexers
Factor and implement the following
function using only 2x1 multiplexers
w2 w2
0 w3
g h
w3 1
Finally, we are ready to draw the circuit
w2
0 w1
g
w3
g
f
w2 h
w3
h
1
Finally, we are ready to draw the circuit
w2
0 g w1
w3
1 h
Finally, we are ready to draw the circuit
w2 w1
0
w3