Chapter 4new - 2025
Chapter 4new - 2025
Nabil Sabor
Associate Professor at Electrical Engineering Department
Faculty of Engineering, Assiut University
2024/2025
Combinational
n inputs •
•
•
•
m outputs
• Circuits •
Analysis
Given a circuit, find out its function A
B
C
A
F1
?
B
C
A
C
F2
?
B
Boolean function
C
Truth table
Design
Given a desired function, determine its circuit
Function may be expressed as:
Boolean function
Truth table ?
A
F2
C
AB+AC+BC
B
C F1=AB'C'+A'BC'+A'B'C+ABC
F2=AB+AC+BC
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 6
Analysis Procedure (cont.)
Truth Table Approach A B C F1 F2
A=0 0 0 0 0 0 0
B=0 0
F1
C= 0
A=0 0
B=0 0
C= 0
1
A=0 0
B=0
A=0 0 0
F2
C= 0
B=0 0
C
=0
A 0 0
=0 F2
C
=1
B
C= 0 0
=1
A 0 0
=0 F2
C
=0
B
C= 1 0
=0
A 0 1
=0 F2
C
=1
B
C= 1 1
=1
A 0 0
=1 F2
C
=0
B
C= 0 0
=0
A 1 1
=1 F2
C
=1
B
C= 0 0
=1
F1=AB'C'+A'BC'+A'B'C+ABC F2=AB+AC+BC
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 14
Design Procedure
4-bits ? 4-bits
0-9 values Value+3
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 15
Design Procedure (cont.)
BCD-to-Excess 3 Converter
A B C D w x y z
C C
0 0 0 0 0 0 1 1
1 1 1
0 0 0 1 0 1 0 0
1 1 1 1
0 0 1 0 0 1 0 1
x x x x
B x x x x
B
0 0 1 1 0 1 1 0 A 1 1 x x
A 1 x x
0 1 0 0 0 1 1 1
D D
0 1 0 1 1 0 0 0
0 1 1 0 1 0 0 1 w = A+BC+BD x = B’C+B’D+BC’D’
0 1 1 1 1 0 1 0
1 0 0 0 1 0 1 1 C C
1 0 0 1 1 1 0 0 1 1 1 1
1 0 1 0 x x x x 1 1 1 1
x x x x
B x x x x
B
1 0 1 1 x x x x
A 1 x x
A 1 x x
1 1 0 0 x x x x
1 1 0 1 x x x x D D
1 1 1 0 x x x x
y = C’D’+CD z = D’
1 1 1 1 x x x x
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 16
Design Procedure (cont.)
BCD-to-Excess 3 Converter
A B C D w x y z
0 0 0 0 0 0 1 1 A
0 0 0 1 0 1 0 0
w
0 0 1 0 0 1 0 1
0 0 1 1 0 1 1 0
0 1 0 0 0 1 1 1
0 1 0 1 1 0 0 0 x
B
0 1 1 0 1 0 0 1
0 1 1 1 1 0 1 0
1 0 0 0 1 0 1 1
1 0 0 1 1 1 0 0 C y
1 0 1 0 x x x x
1 0 1 1 x x x x D z
1 1 0 0 x x x x
1 1 0 1 x x x x w = A + B(C+D) y = (C+D)’ + CD
1 1 1 0 x x x x x = B’(C+D) + B(C+D)’ z = D’
1 1 1 1 x x x x
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 17
Seven-Segment Decoder
w x y z abcdefg
0 0 0 0 1111110 w a
0 0 0 1 0110000 b
x c a
0 0 1 0 1101101 d
0 0 1 1 1111001 y ? e
z f
0 1 0 0 0110011 g f b
0 1 0 1 1011011 g
0 1 1 0 1011111 BCD code
0 1 1 1 1110000 e c
1 0 0 0 1111111 y
1 0 0 1 1111011 1 1 1
1 0 1 0 xxxxxxx 1 1 1
x d
1 0 1 1 xxxxxxx x x x x
w 1 1 x x b=...
1 1 0 0 xxxxxxx
z c=…
1 1 0 1 xxxxxxx d=…
1 1 1 0 xxxxxxx a = w + y + xz + x’z’ e=…
1 1 1 1 xxxxxxx f=…
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano g=… 18
Binary Adder
Half Adder
x S
Adds 1-bit plus 1-bit HA
y C
Produces Sum and Carry
x
+ y
───
x y C S
C S
0 0 0 0
0 1 0 1
x S
1 0 0 1
1 1 1 0
C
y
z C
x
S
y
C
Subscript i 3 2 1 0
Input carry 0 1 1 0 Ci
1 0 1 1 xi
0 0 1 1 yi
Sum 1 1 1 0 Si
x3 x2 x1 x0
y3 y2 y1 y0
0
FA FA FA FA
C4 C3 C2 C1
S3 S2 S1 S0
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 24
Binary Adder (cont.)
Carry Propagate Adder
x7 x6 x5 x4 x3 x2 x1 x0
y7 y6 y5 y4 y3 y2 y1 y0
A3 A2 A1 A0 B3 B2 B1 B0 A3 A2 A1 A0 B3 B2 B1 B0
Cy CPA C0 Cy CPA C0 0
S3 S2 S1 S0 S3 S2 S1 S0
S7 S6 S5 S4 S3 S2 S1 S0
x3 x2 x1 x0 y3 y2 y1 y0
A3 A2 A1 A0 B3 B2 B1 B0
Cy Binary Adder Ci 1
S3 S2 S1 S0
F3 F2 F1 F0
M=1
y 1 = y' A3 A2 A1 A0 B3 B2 B1 B0
➔F=x–y Cy Binary Adder Ci
S3 S2 S1 S0
F3 F2 F1 F0
When two numbers with n digits each are added and the sum is a
number occupying n + 1 digits, we say that an overflow occurred.
When two unsigned numbers are added, an overflow is detected
from the end carry out.
x3 x2 x1 x0
1 y3 y2 y1 y0
70 1000110 0
80 1010000
FA FA FA FA
150 0010110
C4 C3 C2 C1
S3 S2 S1 S0
Overflow
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 28
Overflow (Signed numbers)
An overflow may occur when the two numbers added are both (+)
or both (-).
When two signed binary numbers, +70 and +80, are stored in two
eight-bit registers, are added:
x3 x2 x1 x0
y3 y2 y1 y0
0
FA FA FA FA
Overflow C4
S3
C3
S2
C2
S1
C1
S0
0 1 2 3
1
x1 0 0
Binary
0
x0 0 Decoder
0 Only one
lamp will
turn on
Example: 2-bit Binary Number
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 36
Decoders (cont.)
2-to-4 Line Decoder
Y3
y3 Y2
Decoder
I1 Binary
y2
y1 Y1
I0 y0
Y0
I1 I0 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
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 37
Decoders (cont.)
3-to-8 Line Decoder Y7 = I 2 I1 I 0
Y6 = I 2 I1 I 0
Y7
Y6 Y5 = I 2 I1 I 0
Y5 Y4 = I 2 I1 I 0
Decoder
I2 Y4
Binary
Y3
Y3 = I 2 I1 I 0
I1
I0 Y2 Y2 = I 2 I1 I 0
Y1 Y1 = I 2 I1 I 0
Y0
Y0 = I 2 I1 I 0
Decoder
I1 Y2
Y1 Binary
I0
E Y0 Y1
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
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 40
Decoders (cont.)
3 x8 decoder constructed with two 2 x 4 decoders
I I I Y Y Y Y Y Y Y Y I 2 I1 I0
2 1 0 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 1 0 0 0 0 0 0 1 0 0 Y3 Y7
Decoder
I0 Y2 Y6
0 1 1 0 0 0 0 1 0 0 0
Binary
I1 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
1 1 1 1 0 0 0 0 0 0 0 Y3 Y3
Y2
Decoder
I0 Y2
Binary
I1 Y1 Y1
E Y0 Y0
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 41
4 x16 decoder constructed with two 3 x 8 decoders
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
Y2
Decoder
I1 Y2 I1 Decoder
Binary
Binary
Y0
Y1 Y1
I0 Y0 I0 Y0
I1
I0
1 x1 y1 x0 x1 x2 x3 y1 y0
Binary 1 0 0 0 0 0
x2 Encoder y0
2 0 1 0 0 0 1
0 0 1 0 1 0
0 0 0 1 1 1
3 x3
Encoder
I5
Octal-to-Binary Encoder (8-to-3)
Binary
I4 Y2
I3 Y1
I7 I6 I5 I4 I3 I2 I1 I0 Y2 Y1 Y0 I2
Y0
I1
0 0 0 0 0 0 0 1 0 0 0 I0
0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 1 0 0 0 1 0 I7
I6 Y2
0 0 0 0 1 0 0 0 0 1 1 I5
0 0 0 1 0 0 0 0 1 0 0 I4
I3 Y1
0 0 1 0 0 0 0 0 1 0 1 I2
0 1 0 0 0 0 0 0 1 1 0 I1
I0 Y0
1 0 0 0 0 0 0 0 1 1 1
Limitation:
1- Only one of the input is allowed to be 1 Y2 = I 7 + I 6 + I 5 + I 4
2- When all inputs are zeros, the output is zero Y1 = I 7 + I 6 + I 3 + I 2
but this situation is the same as input Y0=1!!
Y0 = I 7 + I 5 + I 3 + I1
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 46
Priority Encoders
D3
Encoder
V
Priority
D2 y
D1 x
D0
7 I7 Y7
7
6 I6 Y6
6
5 I5 Y2
Y5 5
4 I4 Y1
I2 Y4 4
3 I3 Y0
I1 Y3 3
2 I2
I0 Y2 2
1 I1 Y1 1
0 I0 Y0 0
S 1 S0 Y
0 0 I0
0 1 I1
(2n input lines and n selection lines) 1 0 I2
1 1 I3
I1 I3
MUX Y
I2
I3
S 1 S0
Faculty of Eng., Assiut University@ 2018 S1 S0
Digital Design 5th ed Morris Mano 52
Multiplexers (cont.)
Quad 2-to-1 MUX A3
Y3
A2
A3 I0 Y2
B3 MUX Y A1
I1 Y1
S A0
Y0
A2 I0 B3
B2 MUX Y A3
I1 B2
S A2
A1
B1 Y3
A0
A1 I0 Y2
MUX Y
B1 MUX Y B0 1
I1 B3
S Y0
B2
B1
A0 I0 S E B0
MUX Y S E
B0 I1
S
(two 4-bits input, one 4-bits output)
S
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 53
Multiplexers (cont.)
Quad 2-to-1 MUX
A3
Y3
A2
Y2
A1
Y1 A3
A0
Y0 A2
B3 A1 Y3
B2
A0 Y
MUX 2
B1 Y1
B3
B0 Y0
B2
B1
Extra B0
Buffers S E
S E
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 54
Implementation Using Multiplexers
Any Boolean function of n-variables can be
implemented using a MUX with n-1 selection lines
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
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 I5
1 I6
1 0 0 0
1 I7
1 0 1 0 S2 S 1 S 0
1 1 0 1
1 1 1 1 x y z
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 56
Implementation Using Multiplexers (cont.)
Example
F(x, y, z) = ∑(1, 2, 6, 7)
x y z F
0 0 0 0 z I0
0 0 1 1
F=z z I1 F
MUX Y
0 1 0 1 0 I2
0 1 1 0 F=z 1 I3
S 1 S0
1 0 0 0
F=0 x y
1 0 1 0
1 1 0 1
F=1
1 1 1 1
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 57
Implementation Using Multiplexers (cont.)
Example
F(A, B, C, D) = ∑(1, 3, 4, 11, 12, 13, 14, 15)
A B C D F
0 0 0 0 0 D I0
0 0 0 1 1 F=D
0 0 1 0 0
D I1
0 0 1 1 1
F=D D I2
0 1 0 0 1
0 1 0 1 0
F=D 0 I3
MUX Y F
0 1 1 0 0
F=0
0 I4
0 1 1 1 0
1 0 0 0 0
D I5
1 0 0 1 0 F=0 1 I6
1 0 1 0 0
1 0 1 1 1 F=D 1 I7
1 1 0 0 1 S2 S 1 S 0
F=1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
F=1 A B C
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 58
Multiplexer Expansion
I0 I0
I1 I1
MUX Y
I2 I2
I3 I3
S1 S0 I0
I1 MUX Y Y
I0 S
I4
I5 I1
MUX Y
I6 I2
I7 I3
S 1 S0
1 0 0
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano S S1 S 0
2 59
DeMultiplexers
Y3
Y2
I DeMUX
Y1
S S Y0
1 0
Y3
Y2
I
S1 S0 Y3 Y2 Y1 Y0
Y1
0 0 0 0 0 I
Y0 0 1 0 0 I 0
1 0 0 I 0 0
S1
S0 1 1 I 0 0 0
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 60
Multiplexer / DeMultiplexer Pairs
MUX DeMUX
7 I7 Y7
7
6 I6 Y6
6
5 I5 Y5 5
4 I4 Y4 4
3 I3
Y I Y3 3
2 I2 Y2 2
1 I1 Y1 1
0 I0 Y0 0
S2 S1 S0 S2 S1 S0
x2 x1 x0 Synchronize y2 y1 y0
Faculty of Eng., Assiut University@ 2018
Digital Design 5th ed Morris Mano 61
DeMultiplexers / Decoders
Y3 Y3
Decoder
I1 Y2
Binary
Y2
I DeMUX I0 Y1
Y1
E Y0
S S Y0
1 0
E I 1 I0 Y3 Y2 Y1 Y0
S 1 S0 Y3 Y2 Y1 Y0 0 x x 0 0 0 0
0 0 0 0 0 I 1 0 0 0 0 0 1
0 1 0 0 I 0 1 0 1 0 0 1 0
1 0 0 I 0 0 1 1 0 0 1 0 0
1 1 I 0 0 0 1 1 1 1 0 0 0