Ch4 (1)
Ch4 (1)
Chapter 4
Combinational Logic
Switching Theory & Logic Design
1403271-4
Main Ref: M. Morris Mano and Michael D. Ciletti, Digital Design, Prentice Hall
Content
Combinational Logic
• 4.1 Introduction 125
• 4.2 Combinational Circuits 125
• 4.3 Analysis Procedure 126
• 4.4 Design Procedure 129
• 4.5 Binary Adder–Subtractor 133
• 4.6 Decimal Adder 144
• 4.7 Binary Multiplier 146
• 4.8 Magnitude Comparator 148
• 4.9 Decoders 150
• 4.10 Encoders 155
• 4.11 Multiplexers 158
2
4.1 Introduction
• Logic Circuits: Combinational or Sequential
• Combinational
– No Memory (No Storage)
– Outputs fully based on combination of inputs
• Sequential
– Memory (Storage) + Combinational Logic
3
Sequential
Analysis Example
Find F1 & F2 in terms of inputs?
Truth Table
Code
Conversion
Example
10
11
Chapter 4 14
X 12 3 X 2 13
S = X ⋅Y + X⋅Y = X ⊕ Y
S = (X + Y ) ⋅ (X + Y )
and
C = X ⋅Y
C = ( ( X⋅ Y ) )
These equations lead to several implementations.
Chapter 4 15
Chapter 4 16
S Y C Y
0
11 3
12 0 1
13 2
X 14 17 X 15 17 16
5 6 4
Z Z
Chapter 4 18
Equations: Full-Adder
Chapter 4 19
Chapter 4 20
21
Binary Adders
Chapter 4 22
C3 C2 C1
FA FA FA FA C0
C4 S3 S2 S1 S0
Chapter 4 23
Chapter 4 24
Chapter 4 26
r =2, n=3
Chapter 4 27
Signed-Magnitude Arithmetic
Chapter 4 28
Example 1: 0010
+0101
Example 2: 0010
+1101
Example 3: 1010
− 0101
Chapter 4 29
Signed-Complement Arithmetic
Addition:
1. Add the numbers including the sign bits,
discarding a carry out of the sign bits (2's
Complement), or using an end-around carry (1's
Complement).
2. If the sign bits were the same for both
numbers and the sign of the result is different, an
overflow has occurred.
3. The sign of the result is computed in step 1.
Subtraction:
Form the complement of the number you are
subtracting and follow the rules for addition.
Chapter 4 30
Example 1: 1101
+0011
Example 2: 1101
−0011
Chapter 4 31
Binary Subtractor
32
of B is formed by using S
passed through
unchanged C
4 S3 S S
2 S 1 0
Chapter 4 33
Overflow
34
Overflow Detection
Chapter 4 35
Overflow Detection
Signed number cases with carries Cn and Cn−1 shown for correct
result signs:
0 00 01 11 1
0 0 1 1
+ 0 −1 − 0 + 1
0 0 1 1
Signed number cases with carries shown for erroneous result signs
(indicating overflow):
0 10 11 01 0
0 0 1 1
+ 0 − 1 −0 + 1
1 1 0 0
Simplest way to implement overflow V = Cn + Cn − 1
This works correctly only if 1’s complement and the addition of the
carry in of 1 is used to implement the complementation! Otherwise
fails for − 10 ... 0
Chapter 4 36
37
BCD Adder
C=K+Z8Z4+Z8Z2
38
39
40
41
42
43
4.9 Decoders
3 x 8 Decoder
44
Complemented Decoder
with Active Low Enable
45
4 x 16 Decoder
made from two 3 x 8 decoders
46
47
4.10 Encoders
48
Priority Encoder
49
50
4.11 Multiplexers
2 x 1 Mux
51
4 x 1 Mux
52
53
54
55
56