Professional Documents
Culture Documents
Textbook: Digital Design, 6 - Edition: M. Morris Mano and Michael D. Ciletti
Textbook: Digital Design, 6 - Edition: M. Morris Mano and Michael D. Ciletti
Textbook: Digital Design, 6 - Edition: M. Morris Mano and Michael D. Ciletti
P-1/74 2019/5/9
教 師 : 蘇 慶 龍
Instructor : Ching-Lung Su
E-mail: kevinsu@yuntech.edu.tw
Chapter 4
P-2/74 2019/5/9
Chapter 4
Combinational Logic
Outline of Chapter 4
P-3/74 2019/5/9
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits
4.1 Introduction
P-4/74 2019/5/9
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits
4.1 Introduction
P-5/74 2019/5/9
Combinational Circuit:
Output only depends on the present
combination of inputs
Specified by a set of Boolean Functions
Logic Circuit
Sequential Circuit:
Output depends on the input and the state of
the storage (past inputs)
4.2 Combinational Circuits
P-6/74 2019/5/9
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits
4.2 Combinational Circuits
P-7/74 2019/5/9
2n-input
Combinations
0/1
Combinational Circuits
n inputs 0/1 m outputs
Logic Gates
0/1
4.3 Analysis Procedure
P-8/74 2019/5/9
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits
4.3 Analysis Procedure
P-9/74 2019/5/9
◼ Procedure Example
A T2
B F1
C
A T1
B T3
C
F2'
A
B
A
C F2
B
C
4.3 Analysis Procedure
P-12/74 2019/5/9
◼ Procedure Example
F2 = AB + AC + BC
Step 1: T1 = A + B + C
T2 = ABC
T3 = F2’T1
Step 2:
F1 = T3 + T2
F1 = T3 + T2 = F2’T1 + ABC
Step 3-4: = ( AB + AC + BC )’ ( A+B+C ) + ABC
= A’BC’ + A’B’C + AB’C’ + ABC
4.3 Analysis Procedure
P-13/74 2019/5/9
◼ Procedure Example
Procedure
A B C F2 F2 T1 T2 T3 F1
0 0 0 0 1 0 0 0 0
0 0 1 0 1 1 0 1 1
0 1 0 0 1 1 0 1 1
0 1 1 1 0 1 0 0 0
1 0 0 0 1 1 0 1 1
1 0 1 1 0 1 0 0 0
1 1 0 1 0 1 0 0 0
1 1 1 1 0 1 1 0 1
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits
4.4 Design Procedure
P-16/74 2019/5/9
A B C D w x y z
0 0 0 0 0 0 1 1
0 0 0 1 0 1 0 0
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
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
x x x x x x x x
4.4 Design Procedure
P-18/74 2019/5/9
01 1 1 01 1 1
B B
11 X X X X 11 X X X X
A A
10 1 X X 10 1 X X
D D
z=D y = CD + C D
CD C CD C
AB 00 01 11 10 AB 00 01 11 10
00 1 1 1 00
01 1 01 1 1 1
B
11 X X X X 11 X X X X
A A
10 1 X X 10 1 1 X X
D D
x = B C + B D + BC D w = A + BC + BD
4.4 Design Procedure
P-19/74 2019/5/9
z=D
y = CD + C D = CD + ( C+D )
x = B C + B D + BC D = B ( C+D ) + BC D
= B ( C+D ) + B ( C+D )
w = A + BC + BD = A + B ( C+D )
4.4 Design Procedure
P-20/74 2019/5/9
B x
A w
4.5 Binary Adder-Subtractor
P-21/74 2019/5/9
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits
4.5 Binary Adder-Subtractor
P-22/74 2019/5/9
+ 0 + 1
0 1
1 1
+ 0 + 1
1 10
Carry
4.5 Binary Adder-Subtractor
P-23/74 2019/5/9
◼ Half Adder
x S (Sum) x y C S
Half
Adder
y C (Carry) 0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
S = x y + xy
C = xy Half Adder Truth Table
4.5 Binary Adder-Subtractor
P-24/74 2019/5/9
x
y x
S y S
x
y
x
y C C
S = x y + xy S = x+y
C = xy C = xy
4.5 Binary Adder-Subtractor
P-25/74 2019/5/9
◼ Full Adder
1. Full adders perform the arithmetic sum of three bits
2. Full adders is implemented by a 3-input 2-output
combinational circuit
3. Truth Table:
x y z C S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
4.5 Binary Adder-Subtractor
P-26/74 2019/5/9
yz y=1 yz y=1
x 00 01 11 10 x 00 01 11 10
0 1 1 0 1
x=1 1 1 1 x=1 1 1 1 1
z=1 z=1
S = x y z + x yz + xyz + x y z C = xy + xz + yz
= x+y+z = xy + xy z + x yz
= xy + z(x + y)
4.5 Binary Adder-Subtractor
P-27/74 2019/5/9
◼ Binary Adders
Input Carry 0 1 1 0 Ci
Augend 1 0 1 1 Ai
Addend + 0 0 1 1 Bi
Sum 1 1 1 0 Si
Output Carry 0 0 1 1 Ci+1
B3 A3 B2 A2 B1 A1 B0 A0
C3 C2 C1
C4 FA FA FA FA C0
S3 S2 S1 S0
4-bit Adder
4.5 Binary Adder-Subtractor
P-31/74 2019/5/9
Cn-1 Cn-2 C2 C1
Cn FA FA FA FA C0
Sn-1 Sn-2 S1 S0
n-bit Adder
4.5 Binary Adder-Subtractor
P-32/74 2019/5/9
Ai Pi
Bi Si
Gi
Ci+1
Ci
Pi = Ai + Bi Si = P i + C i
Gi = AiBi Ci+1 = Gi + PiCi
4.5 Binary Adder-Subtractor
P-34/74 2019/5/9
C3
P2
G2
C2
P1
G1
P0 C1
G0
C0
4.5 Binary Adder-Subtractor
P-36/74 2019/5/9
A1
B1 P1 P1
C1 S1
G1
A0
B0 P0 P0
C0 S0
G0
C0 C0
4.5 Binary Adder-Subtractor
P-37/74 2019/5/9
◼ Binary Subtractor
1. Implement subtraction with 2’s complement number
system
2. A-B = A + (-B) = A + 1’sc (B) + 1
3. Implement 1’sc with XOR gates:
B M Output
M: M=0 A+B
M=1 A-B
C4 C3 C2 C1 C0
C FA FA FA FA
S3 S2 S1 S0
4.5 Binary Adder-Subtractor
P-39/74 2019/5/9
V V
Cout Cin
0 1 1 0
+70 0 1000110 -70 1 0111010
+80 0 1010000 -80 1 0110000
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits
4.6 Decimal Adder
P-41/74 2019/5/9
K Z8 Z4 Z2 Z1 C S8 S4 S2 S1
0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 2
0 0 0 1 1 0 0 0 1 1 3
0 0 1 0 0 0 0 1 0 0 4
0 0 1 0 1 0 0 1 0 1 5
0 0 1 1 0 0 0 1 1 0 6
0 0 1 1 1 0 0 1 1 1 7
0 1 0 0 0 0 1 0 0 0 8
0 1 0 0 1 1'sc 0 1 0 0 1 Copy 9
0 1 0 1 0 1 0 0 0 0 10
0 1 0 1 1 1 0 0 0 1 11
0 1 1 0 0 1 0 0 1 0 12
0 1 1 0 1 1 0 0 1 1 13
0 1 1 1 0 1 0 1 0 0 14
>9
0 1 1 1 1 1 0 1 0 1 15
1 0 0 0 0 +6 1 0 1 1 0 16
1 0 0 0 1 1 0 1 1 1 17
1 0 0 1 0 1 1 0 0 0 18
1 0 0 1 1 1 1 0 0 1 19
4.6 Decimal Adder
P-42/74 2019/5/9
◼ BCD Adders
Addend Augend
+6
Output Carry
Detect>9
S8 S4 S2 S1
4.7 Binary Multiplier
P-43/74 2019/5/9
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits
4.7 Binary Multiplier
P-44/74 2019/5/9
A1
B1 B0
B1 B0
A1 A0
A0B1 A0B0
A1B1 A1B0
C3 C2 C1 C0
HA HA
C3 C2 C1 C0
4.7 Binary Multiplier
P-45/74 2019/5/9
A1
B3 B2 B1 B0 0
Addend Augend
4-Bit Adder
Sum and Carry Output
B3 B2 B1 B0
x A2 A1 A0 A2
B3 B2 B1 B0
Addend Augend
4-Bit Adder
Sum and Carry Output
C6 C5 C4 C3 C2 C1 C0
4.8 Magnitude Comparator
P-46/74 2019/5/9
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits
4.8 Magnitude Comparator
P-47/74 2019/5/9
◼ Magnitude Comparator
A= A3 A2 A1 A0
Input A, B
B= B3 B2 B1 B0
A3=B3 and A2=B2 and A1=B1 A0>B0
If A=B A3=B3 and A2=B2 and A1=B1 and A0=B0
A=B x3x2x1x0
B3
A2 A<B
x2
B2
A1
x1
B1
A0
x0
A>B
B0
A=B
4.9 Decoders
P-50/74 2019/5/9
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits
4.9 Decoders
P-51/74 2019/5/9
◼ Decoders
m2n-1
4.9 Decoders
P-52/74 2019/5/9
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
4.9 Decoders
P-53/74 2019/5/9
D2= x y z
y
D3= x y z
x D4= x y z
D5= x y z
D6= x y z
m7
D7= x y z
4.9 Decoders
P-54/74 2019/5/9
◼ 2-to-4-line Decoder
1. Constructed with NAND Gates
2. Economical Implementation
3. Additional Enable Input
4. Truth Table:
E A B D0 D1 D2 D3
1 x x 1 1 1 1
0 0 0 0 1 1 1
0 0 1 1 0 1 1
0 1 0 1 1 0 1
0 1 1 1 1 1 0
4.9 Decoders
P-55/74 2019/5/9
D0
A D1
B D2
D3
E
4.9 Decoders
P-56/74 2019/5/9
w
38
x Decoder D0 to D7
y Output
E
z 1 0 Enable
38
Decoder D8 to D15
E
Disable
4.9 Decoders
P-57/74 2019/5/9
m0
m1
x m2
m3 Sum
38
y Decoder m4
m5 Carry
z m6
m7
4.10 Encoders
P-59/74 2019/5/9
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits
4.10 Encoders
P-60/74 2019/5/9
◼ Encoders
1. Encoders perform the inverse operation of decoders
2. 2n input n output
4.10 Encoders
P-61/74 2019/5/9
◼ Octal-to-Binary Encoders
Inputs Outputs
D0 D1 D2 D3 D4 D5 D6 D7 x y z
1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 0 1 1 1 1
z = D1 + D3 + D5 + D7
y = D2 + D3 + D6 + D7
x = D4 + D5 + D6 + D7
4.10 Encoders
P-62/74 2019/5/9
◼ Priority Encoder
The operation of the priority encoder is such that if two
or more inputs are equal to 1 at the same time, the
input having the highest priority will take precedence.
Example
Priority
Inputs Outputs
D0 D1 D2 D3 x y V
0 0 0 0 x x 0
1 0 0 0 0 0 1
x 1 0 0 0 1 1
x x 1 0 1 0 1
x x x 1 1 1 1
x = D2 + D3
y = D3 + D1D2
V = D0 + D1 + D2 + D3
4.10 Encoders
P-63/74 2019/5/9
00 01 11 10 00 01 11 10
00 x 1 1 1 00 x 1 1
01 1 1 1 01 1 1 1
D1 D1
11 1 1 1 11 1 1 1
D0 D0
10 1 1 1 10 1 1
D3 D3
x = D2 + D3 y = D3 + D1D2
4.10 Encoders
P-64/74 2019/5/9
D3
D2 y
D1
x
V
D0
4.11 Multiplexers
P-65/74 2019/5/9
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits
4.11 Multiplexers
P-66/74 2019/5/9
◼ Multiplexer
◼ 2-to-1-line Multiplexer
I0 If S=0 : I0=Y
Logic Diagram :
1 Y
I1
0
S 0
I0 0
Block Diagram : MUX Y
I1 1
S
4.11 Multiplexers
P-68/74 2019/5/9
◼ 4-to-1-line Multiplexer
I0 0
0
I1 0
1
Y
I2 1 S0 S1 Y
0
I3 1 0 0 I0
1
0 1 I1
1 0 I2
1 1 I3
S1 Truth Table
S0
Logic Diagram
4.11 Multiplexers
P-69/74 2019/5/9
B3
S=0 S=1
S
E
4.11 Multiplexers
P-70/74 2019/5/9
x y z F y S0
0 0 0 0 x S1
F=z
0 0 1 1
0 1 0 1 z
F=z 41 MUX F
0 1 1 0
1 0 0 0 z
1 0 1 0 F=0
0
1 1 0 1
1 1 1 1 F=1 1
4.11 Multiplexers
P-71/74 2019/5/9
Input Output
A C Y
I1
A Y I2
I3
B
Select
0
Select 24 1
Decoder 2
Enable
3
4.1 Introduction
4.2 Combinational Circuits
4.3 Analysis Procedure
4.4 Design Procedure
4.5 Binary Adder-Subtractor
4.6 Decimal Adder
4.7 Binary Multiplier
4.8 Magnitude Comparator
4.9 Decoders
4.10 Encoders
4.11 Multiplexers
4.12 HDL for Combinational Circuits