Desoders & Multiplexers
Desoders & Multiplexers
Programmable Logic
Decoders
• Next, we’ll look at some commonly used circuits: decoders and
multiplexers.
– These serve as examples of the circuit analysis and design
techniques from last week.
– They can be used to implement arbitrary functions.
– We are introduced to abstraction and modularity as hardware
design principles.
• Throughout the semester, we’ll often use decoders and multiplexers as
building blocks in designing more complex hardware.
S1 S0 Q0 Q1 Q2 Q3
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1
• In this case there’s not much to be simplified. Here are the equations:
Q0 = S1’ S0’
Q1 = S1’ S0
Q2 = S1 S0’
Q3 = S1 S0
S1 S0 Q0 Q1 Q2 Q3
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1
EN S1 S0 Q0 Q1 Q2 Q3
• We can abbreviate the table by
0 x x 0 0 0 0
writing x’s in the input columns 1 0 0 1 0 0 0
for S1 and S0. 1 0 1 0 1 0 0
1 1 0 0 0 1 0
1 1 1 0 0 0 1
Q0 = S1’ S0’
Q1 = S1’ S0
Q2 = S1 S0’
Q3 = S1 S0
S2 S1 S0 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0 Q0 = S2’ S1’ S0’
0 1 0 0 0 1 0 0 0 0 0 Q1 = S2’ S1’ S0
0 1 1 0 0 0 1 0 0 0 0 Q2 = S2’ S1 S0’
1 0 0 0 0 0 0 1 0 0 0 Q3 = S2’ S1 S0
1 0 1 0 0 0 0 0 1 0 0
Q4 = S2 S1’ S0’
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1 Q5 = S2 S1’ S0
Q6 = S2 S1 S0’
Q7 = S2 S1 S0
S1 S0 Q0 Q1 Q2 Q3
0 0 1 0 0 0
0 1 0 1 0 0 Q0 = S1’ S0’
1 0 0 0 1 0 Q1 = S1’ S0
1 1 0 0 0 1 Q2 = S1 S0’
Q3 = S1 S0
X Y Z C S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1 C(X,Y,Z) = Σm(3,5,6,7)
0 + 1 + 1 = 10 0 1 1 1 0 S(X,Y,Z) = Σm(1,2,4,7)
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1 1 + 1 + 1 = 11
C(X,Y,Z) = Σm(3,5,6,7)
S(X,Y,Z) = Σm(1,2,4,7)
C(X,Y,Z) = Σm(3,5,6,7)
S(X,Y,Z) = Σm(1,2,4,7)
S2 S1 S0 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0 Q0 = S2’ S1’ S0’ = m0
0 1 0 0 0 1 0 0 0 0 0 Q1 = S2’ S1’ S0 = m1
0 1 1 0 0 0 1 0 0 0 0
Q2 = S2’ S1 S0’ = m2
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0 Q3 = S2’ S1 S0 = m3
1 1 0 0 0 0 0 0 0 1 0 Q4 = S2 S1’ S0’ = m4
1 1 1 0 0 0 0 0 0 0 1
Q5 = S2 S1’ S0 = m5
Q6 = S2 S1 S0’ = m6
Q7 = S2 S1 S0 = m7
S2 S1 S0 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
• You could verify that this circuit is a 3-to-8 decoder, by using equations
for the 2-to-4 decoders to derive equations for the 3-to-8.
Q3 = S1 S0
Q2 = S1 S0’
Q1 = S1’ S0
Q0 = S1’ S0’
f = Σm(0,1,2,3,6)
f’ = Σm(4,5,7) -- f’ contains all the minterms not in f
= m4 + m 5 + m7
(f’)’ = (m4 + m5 + m7)’ -- complementing both sides
f = m4’ m5’ m7’ -- DeMorgan’s law
= M4 M5 M7 -- from the previous page
= ∏M(4,5,7)
• The easy way is to replace minterms with maxterms, using maxterm
numbers that don’t appear in the sum of minterms:
f = Σm(0,1,2,3,6)
= ∏M(4,5,7)
• The same thing works for converting in the opposite direction, from a
product of maxterms to a sum of minterms.
Q = S’ D0 + S D1
• The select bit S controls which of the data bits D0-D1 is chosen:
– If S=0, then D0 is the output (Q=D0).
– If S=1, then D1 is the output (Q=D1).
EN’ S1 S0 Q
0 0 0 D0
0 0 1 D1
0 1 0 D2
0 1 1 D3
1 x x 1
x y z f
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
X Y Z C
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
With S1=X and S0=Y, then
Q=X’Y’D0 + X’YD1 + XY’D2 + XYD3
X Y Z C
0 0 0 0
0 0 1 0
When XY=00, C=0
0 1 0 0
0 1 1 1
1 0 0 0 When XY=01, C=Z
1 0 1 1
1 1 0 1
1 1 1 1 When XY=10, C=Z
C = X’ Y’ D0 + X’ Y D1 + X Y’ D2 + X Y D3
= X’ Y’ 0 + X’ Y Z + X Y’ Z + X Y 1
= X’ Y Z + X Y’ Z + XY
= Σm(3,5,6,7)
X Y Z S
0 0 0 0
0 0 1 1
0 1 0 1 When XY=00, S=Z
0 1 1 0
1 0 0 1 When XY=01, S=Z’
1 0 1 0
1 1 0 0
1 1 1 1 When XY=10, S=Z’
S = X’ Y’ D0 + X’ Y D1 + X Y’ D2 + X Y D3
= X’ Y’ Z + X’ Y Z’ + X Y’ Z’ + X Y Z
= Σm(1,2,4,7)
Ai 0 Ai
1 0 1
Ai Bi Sum Carry Bi Bi
0 0 0 0 0 0 1 0 0 0
0 1 1 0
1 0 1 0 1 0
1 1 0 1
1 1 0 1
Sum = Ai Bi + Ai Bi Carry = Ai Bi
= Ai + Bi
Ai
Sum
Bi Half-adder Schematic
Carry
1
0011 A B CI S CO AB
Co Cin
0 0 0 0 0 CI 00 01 11 10
+ 0010 B 0 0 1 1 0 0 0 1 0 1
0 1 0 1 0 S
0101 A 0 1 1 0 1 1 1 0 1 0
1 0 0 1 0
S 1 0 1 0 1
1 1 0 0 1 AB
1 1 1 1 1 CI 00 01 11 10
0 0 0 1 0
CO
1 0 1 1 1
S = CI xor A xor B
CO = B CI + A CI + A B = CI (A + B) + A B
A3 B3 A2 B2 A1 B1 A0 B0
+ + + +
S3 C3 S2 C2 S1 C1 S0
A S
A+B S
A + B + CI S
Half Half
AdderCO A B AdderCO CI (A + B)
B
CI
CO
A B + CI (A xor B) = A B + B CI + A CI
@0 A @1
late @0 B
@N+1
arriving @N CI CO
signal
@0 A @N+2 two gate delays
@0 B
@1 to compute CO
C0
A0 S0 @2
0
B0 C1 @2
4 stage
adder A1
1
S1 @3
B1 C2 @4
A2 S2 @5
2
B2 C3 @6
A3 S3 @7
B3
3
C4 @8 final sum and
MSI and PLD components carry 1
Ripple Carry Timing
Critical delay: the propagation of carry from low to high order stages
S0, C1 Valid S1, C2 Valid S2, C3 Valid S3, C4 Valid
1111 + 0001
worst case
addition
T0 T2 T4 T6 T8
b0 a0
c7 c6 c5 c4 c3 c2
c0
FA
s7 s6 c1 s0
= Ai Bi + Ci (Ai + Bi)
Gi
= Ai Bi + Ci (Ai xor Bi)
Ci Ci+1
= Gi + Ci Pi Pi
C2 = G1 + P1 C1 = G1 + P1 G0 + P1 P0 C0
C3 = G2 + P2 C2 = G2 + P2 G1 + P2 P1 G0 + P2 P1 P0 C0
C4 = G3 + P3 C3 = G3 + P3 G2 + P3 P2 G1 + P3 P2 P1 G0 + P3 P2 P1 P0 C0