Chapter 4 Combinational Logic Decoderencoder Mux
Chapter 4 Combinational Logic Decoderencoder Mux
Combinational Logic
Decoders
A decoder is a combinational
circuit that converts binary
information from n input lines
to 2n unique output lines
2 / 65
Decoders
0 1
x1 0
Binary
0 Decoder 0
x0 0
3 / 65
Decoders
y3 Y2
Decoder
I1 Binary
y2
Y1
y1
I0
y0 Y0
I1 I 0 Y3 Y2 Y1 Y0
I1
0 0 0 0 0 1 I0
0 1 0 0 1 0
Y3 I1 I 0 Y2 I1 I 0
1 0 0 1 0 0
1 1 1 0 0 0 Y1 I1 I 0 Y0 I1 I 0
4 / 65
5 / 65
Decoders
I2
Y4 Y3 I 2 I1 I 0
I1
Y3 Y2 I 2 I1 I 0
I0
Y2
Y1 I 2 I1 I 0
Y1
Y0 Y0 I 2 I1 I 0
I2
I1
I0
6 / 65
Decoders
“Enable” Control Y3
Y3 Y2
Decoder
I1
Binary Y2
I0
Y1 Y1
E
Y0
Y0
E I1 I 0 Y3 Y2 Y1 Y0
0 x x 0 0 0 0
I1
1 0 0 0 0 0 1 I0
E
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 0
7 / 65
Decoders
Expansion I2 I 1 I 0
I2 I 1 I 0 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
0 0 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0 Y3 Y7
Decoder
I0
Binary
0 1 0 0 0 0 0 0 1 0 0 Y2 Y6
I1
0 1 1 0 0 0 0 1 0 0 0 Y1 Y5
1 0 0 0 0 0 1 0 0 0 0 E
Y0 Y4
1 0 1 0 0 1 0 0 0 0 0
1 1 0 0 1 0 0 0 0 0 0 Y3
Decoder
I0
Binary
1 1 1 1 0 0 0 0 0 0 0 Y2 Y3
I1
Y1 Y2
E
Y0 Y1
Y0
8 / 65
Decoders
Active-High / Active-Low
I1 I0 Y3 Y2 Y1 Y0 I1 I0 Y3 Y2 Y1 Y0
0 0 0 0 0 1 0 0 1 1 1 0
0 1 0 0 1 0 0 1 1 1 0 1
1 0 0 1 0 0 1 0 1 0 1 1
Y3
1 1 1 0 0 0 1 1 0 1 1 1
Y2
Y3 Y3 Y1
Decoder
I1 I1 Decoder
Binary
Binary
Y2 Y2 Y0
Y1 Y1
I0 I0 I1
Y0 Y0 I0
9 / 65
Implementation Using Decoders
S C 10 / 65
A+B = [(A+B)’]’
= [A’ B’]’
11 / 65
Implementation Using Decoders
Binary Binary
Decoder Decoder
Y7 Y7
Y6 Y6
Y5 Y5
x I2 x I2
Y4 Y4
y I1 y I1
z Y3 z Y3
I0 I0
Y2 Y2
Y1 Y1
Y0 Y0
S C
S C
12 / 65
Encoders
Encoder
I5 Y2
Binary
0 0 0 0 0 0 1 0 0 0 1 I4 Y1
0 0 0 0 0 1 0 0 0 1 0
I3 Y0
0 0 0 0 1 0 0 0 0 1 1
I2
0 0 0 1 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0 1 0 1 I1
0 1 0 0 0 0 0 0 1 1 0 I7
I0
1 0 0 0 0 0 0 0 1 1 1 I6 Y2
I5
Y2 I 7 I 6 I 5 I 4 I4
I3 Y1
Y1 I 7 I 6 I 3 I 2 I2
I1
Y0 I 7 I 5 I 3 I1 I0 Y0
14 / 65
Priority Encoders
15 / 65
V=D0+D1+D2+D3
Encoder
Priority
I3 I 2 I 1 I 0 Y1 Y0 V
I2 Y1
0 0 0 0 0 0 0 I1 Y0
0 0 0 1 0 0 1 I0
0 0 1 x 0 1 1
0 1 x x 1 0 1
I3 Y0
1 x x x 1 1 1
I2
Y1 I1 I1
Y1 I 3 I 2 Y1
1 1 1 1
1 1 1 1
I2 Y0 I 3 I 2 I1
I3 1 1 1 1 I0 V
I0 V I 3 I 2 I1 I 0
18 / 65
Encoder / Decoder Pairs
Binary Binary
Encoder Decoder
I7 Y7
I6 Y6
I5 Y5
Y2 I2
I4 Y4
Y1 I1
I3 Y3
Y0 I0
I2 Y2
I1 Y1
I0 Y0
19 / 65
Multiplexers
S1 S0 Y I0
0 0 I0 I1 MUX
Y
0 1 I1 I2
1 0 I2 I3 S1 S0
1 1 I3
20 / 65
Multiplexers
2-to-1 MUX
I0
I0 Y
MUX Y
I1 I1
S
S
I0
4-to-1 MUX I1
Y
I0 I2
I1 MUX I3
Y
I2
I3 S1 S0
S1 S0
21 / 65
Multiplexers
S
x0 22 / 65
Multiplexers
Example
F(x, y) = ∑(0, 1, 3)
x y F I0
1
0 0 1 1 I1 MUX
Y F
0 1 1 0 I2
1 0 0 1 I3 S1 S0
1 1 1
x y
24 / 65
Implementation Using Multiplexers
Example
F(x, y, z) = ∑(1, 2, 6, 7)
0 I0
x y z F 1 I1
0 0 0 0 1 I2
0 0 1 1 0 I3 MUX Y F
0 1 0 1 0
I4
0 1 1 0 0
1 I5
1 0 0 0 I6
1
1 0 1 0 I7 S2 S1 S0
1 1 0 1
1 1 1 1 x y z
25 / 65
Implementation Using Multiplexers
Example
F(x, y, z) = ∑(1, 2, 6, 7)
x y z F
0 0 0 0 z I0
F=z z F
0 0 1 1 I1 MUX
0 Y
0 1 0 1 I2
F=z 1
0 1 1 0 I3 S1 S0
1 0 0 0
F=0 x y
1 0 1 0
1 1 0 1
F=1
1 1 1 1
26 / 65
Implementation Using Multiplexers
Example
F(A, B, C, D) = ∑(1, 3, 4, 11, 12, 13, 14, 15)
A B C D F
0 0 0 0 0
F=D
D I0
0 0 0 1 1
D I1
0 0 1 0 0
F=D D
0 0 1 1 1
0 1 0 0 1
I2
F=D 0
0 1 0 1 0
0
I3 MUX Y F
0 1 1 0 0
0 1 1 1 0
F=0 I4
D
1 0 0 0 0
1 0 0 1 0 F=0 1 I5
1 0 1 0 0
F=D 1 I6
1 0 1 1 1
1 1 0 0 1 F=1 I7 S2 S1 S0
1 1 0 1 1
1 1 1 0 1 F=1
1 1 1 1 1 A B C
27 / 65
Multiplexer Expansion
I0 I0
I1 I1 MUX
Y
I2 I2
I3 I3 S1 S0
I0
MUX Y Y
I1
I0 S
I4 I1 MUX
I5 Y
I2
I6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