Chapter 4
Chapter 4
Combinational Logic
• Combinational Circuits • Magnitude Comparator
• Analysis Procedure • Decoders
• Design Procedure • Encoders
• Binary Adder-Subtractor • Priority Encoder
• Decimal Adder • Multiplexers
• Binary Multiplier
Combinational Circuits
Input Output
BCD Excess-3 Code
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
K-Maps
C = xy + xz + yz
Simplified Expressions for Full Adder
Half adder
Binary Adder
Subscript i 3 2 1 0
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
Carry Propagation
Note: Negative
numbers are in
2’s complement
form
Overflow
• If we just consider the 8-bit result from the last
example, we go wrong as we
– Add two positive numbers and obtain a negative number
– Add two negative numbers and obtain a positive number
• The carry out of sign bit position is taken as the sign
bit of the result, then the 9-bit answer so obtained will
be correct
• This answer can’t be accommodated within 8-bits we
say that an overflow has occurred
• An overflow has occurred if carry into the sign bit
position and carry out of the sign bit position are not
equal
• This can be found by applying the two carries to an
exclusive-OR gate
• A ‘1’ at the output of the gate indicates overflow
– V = 0, no overflow; V = 1, overflow
Decimal Adder
Decides to add 6
Adds 6
BCD Adder – Block Diagram
Numbers that need correction (add 6) are:
K Z8 Z4 Z2 Z1
0 1 0 1 0 (10)
0 1 0 1 1 (11)
0 1 1 0 0 (12)
0 1 1 0 1 (13)
0 1 1 1 0 (14)
0 1 1 1 1 (15)
1 0 0 0 0 (16)
1 0 0 0 1 (17)
1 0 0 1 0 (18)
1 0 0 1 1 (19)
C = K + Z8Z4 +Z8Z2
Binary Multiplier
B3 B2 B1 B0
X A2 A1 A0
x3A2'B2
= A3'B3+x3A2'B2+x3x2A1'B1+x3x2x1 A0'B0
= A3B3'+x3A2B2'+x3x2A1B1'+x3x2x1 A0B0'
Decoder
Inputs Outputs
X Y Z D0 D1 D2 D3 D4 D5 D6 D7
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
Decoder Example (Code Converter)
Generates from
0000 to 0111
Generates from
1000 to 1111
Combination Logic Implementation
• A decoder provides the 2n minterms of n input
variables
• Any function is can be expressed in sum of minterms.
• Use a decoder to make the minterms and an external
OR gate to make the logical sum
• In this way any combinational circuit with n inputs and
m outputs can be implemented with an n-to-2n line
decoder and m OR gates
• Such implementation needs that the Boolean function
is expressed in sum of minterms x y z c s
0 0 0 0 0
• For example: consider a full adder 0 0 1 0 1
0 1 0 0 1
– S(x,y,z) = Σ(1,2,4,7) 0 1 1 1 0
– C(x,y,z) = Σ (3,5,6,7) 1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
Implementation of Full Adder with a Decoder
Outputs Inputs
X Y Z D0 D1 D2 D3 D4 D5 D6 D7
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
Input Output
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
– an example: F(A,B,C)=S(1,2,6,7)
Procedure:
• Assign an ordering sequence of the input variable
• The rightmost variable (D) will be used for the input
lines
• Assign the remaining n-1 variables to the selection lines
w.r.t. their corresponding sequence
• Construct the truth table
• Consider a pair of consecutive minterms starting from
m0
• Determine the input lines
Implementing a Full Adder with Two 4 x 1
Multiplexers
x y z c s
0 0 0 0 0 x
0 0 1 0 1 y
0 1 0 0 1
0 1 1 1 0 z S
1 0 0 0 1 z’
1 0 1 1 0 z’
1 1 0 1 0
z
1 1 1 1 1 x
y
0 C
z
z
1
Implementing a 4-Input Function with 8x1 Multiplexer
F= Σ (1,3,4,11,12,13,14,15)
• Make a table with two rows and Minterms /2 per column
• Each Row corresponds to Least Significant Input normal and primed
• Each Column corresponds to one of the inputs to Mux
• List Minterms in two rows with even terms in top row and odd in lower row
• Encircle the minterms for which F=1
• An input column having no minterm encircled shall have a value “0”
• An input column having both minterms encircled shall have a value “1”
• An input column having a circle in upper row shall have a value “D’”
• An input column having a circle in lower row shall have a value “D”
Inputs I0 I1 I2 I3 I4 I5 I6 I7
D’ 0 2 4 6 8 10 12 14
D 1 3 5 7 9 11 13 15
F D D D’ 0 0 D 1 1
Implementing a 4-Input Function with 8x1 Multiplexer
F= Σ (1,3,4,11,12,13,14,15)
Implementing a 4-Input Function with 4 x 1Multiplexer
F(A,B,C,D)= Σ (1,3,4,11,12,13,14,15)
• Use AB as selection lines and CD as data lines
• Make a table with four rows and four columns
• Each Row corresponds to Least Significant Inputs normal and primed
• Each Column corresponds to one of the inputs to Mux
• List Minterms in four rows with C’D’ terms in top row, C’D in 2nd row,
• CD’ in third and CD in fourth row
• Encircle the minterms for which F=1
• An input column having no minterm encircled shall have a value “0”
• An input column having all minterms encircled shall have a value “1”
Inputs I0 I1 I2 I3
C’D’ 0 4 8 12
C’D 1 5 9 13
CD’ 2 6 10 14
CD 3 7 11 15
F D C’D’ CD 1
Implementing a 4-Input Function with 4 x 1 Multiplexer
A
B
C’D’
CD
1
Implementing a 4-Input Function with 4 x 1 Multiplexer
F(A,B,C,D)= Σ (1,3,4,11,12,13,14,15)
• Use CD as selection lines and AB as data lines
• Make a table with four rows and four columns
• Each Row corresponds to Least Significant Inputs normal and primed
• Each Column corresponds to one of the inputs to Mux
• List minterms in four rows with A’B’ terms in top row, A’B in 2nd row, AB’ in
third and AB in fourth row
Minterms CD AB Inputs
00 00 00 00 00 00 (m0)
00 01 01 00 00 01 (m4)
00 10 10 00 00 10 (m8) C’D’ C’D CD’ CD
00 11 11 00 00 11(m12)
01 00 00 01 01 00 (m1)
Inputs I0 I1 I2 I3
01 01 01 01 01 01 (m5) A’B’ 0 1 2 3
01 10 10 01 01 10 (m9)
01 11 11 01 01 11(m13) A’B 4 5 6 7
10 00 00 10 10 00 (m2)
10 01 01 10 10 01 (m6)
AB’ 8 9 10 11
10 10 10 10 10 10 (m10) AB 12 13 14 15
10 11 11 10 10 11(m14)
11 00 00 11 11 00 (m3) F B (A+B)’ AB A+B’
11 01 01 11 11 01 (m7)
11 10 10 11 11 10 (m11)
11 11 11 11 11 11(m15)
Implementing a 4-Input Function with 4 x 1 Multiplexer
C
D
B
(A + B)’
AB
A + B’
Three-state gates