1
Dr. Wissam Hasan Mahdi Alagele
e-mail:[email protected]
http://edu-clg.kufauniv.com/staff/Mr.Wesam
العلمي والبحث العالي التعليم وزارةالكوفة الحاسوب- – جامعة علوم قسم التربية كلية
Chapter 3Combinational Design
Digital Logic Design III
Combinational CircuitsOutput is function of input only
i.e. no feedback
When input changes, output may change (after a delay)
CombinationalCircuits
••••••
n inputs m outputs
3
Combinational CircuitsAnalysis
◦Given a circuit, find out its function◦Function may be expressed as:
Boolean function Truth table
Design◦Given a desired function, determine its circuit
◦Function may be expressed as: Boolean function Truth table
CBA
CBA
BA
CA
CB
F1
F2
?
?
?
4
Analysis ProcedureBoolean Expression Approach
CBA
CBA
BA
CA
CB
F1
F2
T2=ABC T1=A+B+
C
F2=AB+AC+BC
F’2=(A’+B’)(A’+C’)(B’+C’)
T3=AB'C'+A'BC'+A'B'C
F1=AB'C'+A'BC'+A'B'C+ABCF2=AB+AC+BC
5
CBA
CBA
BA
CA
CB
F1
F2
Analysis ProcedureTruth Table Approach
A B C F1 F2
0 0 0= 0 = 0= 0= 0= 0= 0= 0= 0
= 0= 0= 0= 0
0
0
0
0
0
0
1
0
00 0
6
CBA
CBA
BA
CA
CB
F1
F2
Analysis ProcedureTruth Table Approach
= 0 = 0= 1= 0= 0= 1= 0= 0
= 0= 1= 0= 1
0
1
0
0
0
0
1
1
1 A B C F1 F2
0 0 0 0 00 0 1 1 0
7
CBA
CBA
BA
CA
CB
F1
F2
Analysis ProcedureTruth Table Approach
= 0 = 1= 0= 0= 1= 0= 0= 1
= 0= 0= 1= 0
0
1
0
0
0
0
1
1
1A B C F1 F2
0 0 0 0 00 0 1 1 00 1 0 1 0
8
CBA
CBA
BA
CA
CB
F1
F2
Analysis ProcedureTruth Table Approach
= 0 = 1= 1= 0= 1= 1= 0= 1
= 0= 1= 1= 1
0
1
0
0
1
1
0
0
0A B C F1 F2
0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 1
9
CBA
CBA
BA
CA
CB
F1
F2
Analysis ProcedureTruth Table Approach
= 1 = 0= 0= 1= 0= 0= 1= 0
= 1= 0= 0= 0
0
1
0
0
0
0
1
1
1A B C F1 F2
0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 1 0
10
CBA
CBA
BA
CA
CB
F1
F2
Analysis ProcedureTruth Table Approach= 1 = 0= 1= 1= 0= 1= 1= 0
= 1= 1= 0= 1
0
1
0
1
0
1
0
0
0A B C F1 F2
0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 1 01 0 1 0 1
11
CBA
CBA
BA
CA
CB
F1
F2
Analysis ProcedureTruth Table Approach
= 1 = 1= 0= 1= 1= 0= 1= 1
= 1= 0= 1= 0
0
1
1
0
0
1
0
0
0 A B C F1 F2
0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 1 01 0 1 0 11 1 0 0 1
12
CBA
CBA
BA
CA
CB
F1
F2
Analysis ProcedureTruth Table Approach
= 1 = 1= 1= 1= 1= 1= 1= 1
= 1= 1= 1= 1
1
1
1
1
1
1
0
0
1A B C F1 F2
0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 1 01 0 1 0 11 1 0 0 11 1 1 1 1
B
0 1 0 1A 1 0 1 0
C
B
0 0 1 0A 0 1 1 1
C
F1=AB'C'+A'BC'+A'B'C+ABC F2=AB+AC+BC
13
Design ProcedureGiven a problem statement:
◦Determine the number of inputs and outputs◦Derive the truth table◦Simplify the Boolean expression for each
output◦Produce the required circuit
Example: Design a circuit to convert a “BCD” code to “Excess 3”
code 4-bits 0-9 values
4-bits Value+3
?
14
Design ProcedureBCD-to-Excess 3 Converter
A B C D w x y z0 0 0 0 0 0 1 10 0 0 1 0 1 0 00 0 1 0 0 1 0 10 0 1 1 0 1 1 00 1 0 0 0 1 1 10 1 0 1 1 0 0 00 1 1 0 1 0 0 10 1 1 1 1 0 1 01 0 0 0 1 0 1 11 0 0 1 1 1 0 01 0 1 0 x x x x1 0 1 1 x x x x1 1 0 0 x x x x1 1 0 1 x x x x1 1 1 0 x x x x1 1 1 1 x x x x
C
1 1 1 BA
x x x x1 1 x x
D
C
1 1 11 B
Ax x x x
1 x xD
C
1 11 1 B
Ax x x x1 x x
D
C
1 11 1 B
Ax x x x1 x x
D
w = A+BC+BD x = B’C+B’D+BC’D’
y = C’D’+CD z = D’
15
Design ProcedureBCD-to-Excess 3 Converter
A B C D w x y z0 0 0 0 0 0 1 10 0 0 1 0 1 0 00 0 1 0 0 1 0 10 0 1 1 0 1 1 00 1 0 0 0 1 1 10 1 0 1 1 0 0 00 1 1 0 1 0 0 10 1 1 1 1 0 1 01 0 0 0 1 0 1 11 0 0 1 1 1 0 01 0 1 0 x x x x1 0 1 1 x x x x1 1 0 0 x x x x1 1 0 1 x x x x1 1 1 0 x x x x1 1 1 1 x x x x
w
x
D
C
z
y
B
A
w = A + B(C+D)x = B’(C+D) + B(C+D)’
y = (C+D)’ + CDz = D’
16
Seven-Segment Decoderw x y z a b c d e f g
0 0 0 0 1 1 1 1 1 1 00 0 0 1 0 1 1 0 0 0 00 0 1 0 1 1 0 1 1 0 10 0 1 1 1 1 1 1 0 0 10 1 0 0 0 1 1 0 0 1 10 1 0 1 1 0 1 1 0 1 10 1 1 0 1 0 1 1 1 1 10 1 1 1 1 1 1 0 0 0 01 0 0 0 1 1 1 1 1 1 11 0 0 1 1 1 1 1 0 1 11 0 1 0 x x x x x x x1 0 1 1 x x x x x x x1 1 0 0 x x x x x x x1 1 0 1 x x x x x x x1 1 1 0 x x x x x x x1 1 1 1 x x x x x x x
1 1 11 1 1
x x x x1 1 x x
?
wxyz
abcdefg
BCD code
a = w + y + xz + x’z’
b = x’+yz+y’z’c = x+y’+zd = x’z’+yz’+x’y+xy’z
e = x’z’+yz’
f = w+x+y’z’g = w+x’y+xy’+x’y+xz’
f
e
g
d
a
b
c
17
18
19
20
Problem Design a circuit which displays the letters A through J on a seven-segment indicator. The circuit has four inputs W, X, Y, Z which represent the last 4 bits of the ASCII code for the letter to be displayed. For example, if WXYZ = 0001, “A” will be displayed. The letters should be displayed in the following form:
Design your circuit using only two-, three-, and four-input NOR gates and inverters. Any solution with 22 or fewer gates and inverters (not counting the four inverters for the inputs) is acceptable.
21
Binary AdderHalf Adder
◦Adds 1-bit plus 1-bit◦Produces Sum and Carry
HAxy
SC
x y C S0 0 0 00 1 0 11 0 0 11 1 1 0
x+ y───C S
x
y
S
C
22
Binary AdderFull Adder
◦Adds 1-bit plus 1-bit plus 1-bit◦Produces Sum and Carry
x y z C S0 0 0 0 00 0 1 0 10 1 0 0 10 1 1 1 01 0 0 0 11 0 1 1 01 1 0 1 01 1 1 1 1
x+ y+ z───C S
FAxyz
SC
y
0 1 0 1x 1 0 1 0
z
y
0 0 1 0x 0 1 1 1
z
S = xy'z'+x'yz'+x'y'z+xyz = z’(xy’+x’y)+z(x’y’+xy) =z’(x y) + z(x y)’ = x y z
C = xy + xz + yz
23
Binary AdderFull Adder
xyzxyzxyzxyz
x
y
z
S
C
xy
xzyz
xyzx
y
z
xy
xzyz
S
C
S = xy'z'+x'yz'+x'y'z+xyz=x y z
C = xy + xz + yz
24
Binary AdderFull Adder
x
y
z
S
C
HAxy
z
HA S
C
QUIZ
?
?
Q#1- This combinational logic circuit is described as a(n) ___.
ANS: full-adder
Q#2- What are the sum and carry out outputs of thisfull-adder circuit?
Cin = 0
A = 0
B = 0
ANS: Sum=0, Carry out=0
Q#3- What are the sum and carry out outputs of thisfull-adder circuit?
Cin = 0
A = 0
B = 1
ANS: Sum=1, Carry out=0
Q#4- What are the sum and carry out outputs of thisfull-adder circuit?
Cin = 1
A = 0
B = 1
ANS: Sum=0, Carry out=1
Q#5- What are the sum and carry out outputs of thisfull-adder circuit?
Cin = 1
A = 1
B = 1
ANS: Sum=1, Carry out=1
Q#6- What are the sum and carry out outputs of thisfull-adder circuit?
Cin = 0
A = 1
B = 1
ANS: Sum=0, Carry out=1
26
Binary Adderc3 c2 c1 .
+ x3 x2 x1 x0
+ y3 y2 y1 y0
────────Cy S3 S2 S1
S0
FA
x3 x2 x1 x0
FAFAFA
y3 y2 y1 y0
S3 S2 S1 S0
C4 C3 C2 C1
0
Binary Adder
x3x2x1x0 y3y2y1y0
S3S2S1S0
C0CyCarry Propagate Addition
74x2834-bit adder
Uses carry look-ahead internally
28
Binary AdderCarry Propagate Adder
CPA
A3 A2 A1 A0 B3 B2 B1 B0
S3 S2 S1 S0
C0CyCPA
A3 A2 A1 A0 B3 B2 B1 B0
S3 S2 S1 S0
C0Cy
x3 x2 x1 x0y3 y2 y1 y0
x7 x6 x5 x4y7 y6 y5 y4
S3 S2 S1 S0S7 S6 S5 S4
0
c3 c2 c1 . x3 x2 x1 x0
y3 y2 y1 y0
────────Cy S3 S2 S1 S0
c7 c6 c5 Cy .+ x7 x6 x5 x4
+ y7 y6 y5 y4
────────Cy S7 S6 S5 S4
Subtractors
Half SubtractorFull SubtractorAdder/Subtractor - 1Adder/Subtractor - 2
Half Subtractor
A
B
Di (difference)
B0 (borrow out)
HalfSubtractor
Input Logic
Symbol:
Logic Diagram:
A B Di
Bo
Bo A B Di 0 0 0 00 1 1 11 0 1 01 1 0 0
0-1 1
21
Output
QUIZ
?
?
Q#1- What is the difference and borrow outputs fromThis half-subtractor circuit?
(A – B)
A = 0
B = 0
ANS: Di= 0, Bo= 0
Q#2- What is the difference and borrow outputs fromthis half-subtractor circuit?
(A – B)
A = 1
B = 0
ANS: Di= 1, Bo= 0
Q#3- What is the difference and borrow outputs fromthis half-subtractor circuit?
(A – B)
A = 1
B = 1
ANS: Di= 0, Bo= 0
Q#4- What is the difference and borrow outputs fromthis half-subtractor circuit?
(A – B)
A = 0
B = 1
ANS: Di= 1, Bo= 1
Full Subtractor
Logic Diagram:
Logic Symbol: A
B
Di (difference)
B0 (borrow out)
FullSubtractor
Input Output
Bin
AB
DiB0H. S.
H. S.Bin
A B
D
C
C i+1
i i
i
i
half subtractor
half subtractorBo
Full Subtractor
0 0 0 0 00 0 1 1 10 1 0 1 00 1 1 0 01 0 0 1 11 0 1 0 11 1 0 0 01 1 1 1 1
Ci A B Di Bo
Di Same as S in full adder
0 1 0 01 1 1 0
Bo
00 01 11 1001
1 1
1 1
Ci
A B 00 01 11 10
0
1
Di
QUIZ
?
?
Q#1- What are the Difference and Borrow out output fromthis full-subtractor circuit?
(A – B - Bin)Bin = 0
A = 0
B = 0
HINT: truth table from textbook (Fig. 10-10) is helpfulANSWER: Di = 0, Bo = 0
Q#2- What are the Difference and Borrow out output fromthis full-subtractor circuit?
(A – B - Bin)Bin = 1
A = 0
B = 0
ANSWER: Di = 1, Bo = 1
Q#3- What are the Difference and Borrow out output fromthis full-subtractor circuit?
(A – B - Bin)Bin = 1
A = 1
B = 1
ANSWER: Di = 1, Bo = 1
Q#4- What are the Difference and Borrow out output fromthis full-subtractor circuit?
(A – B - Bin)Bin = 1
A = 0
B = 1
ANSWER: Di = 0, Bo = 1
Q#5- What are the Difference and Borrow out output fromthis full-subtractor circuit?
(A – B - Bin)Bin = 0
A = 1
B = 0
ANSWER: Di = 1, Bo = 0
Q#6- What are the Difference and Borrow out output fromthis full-subtractor circuit?
(A – B - Bin)Bin = 0
A = 1
B = 1
ANSWER: Di = 0, Bo = 0
Adder/Subtractor - 1
A B Di
Bo
A B S
C
A 0 B 0 0
CB1 E
SD
Half adder Half subtractor
E = 0: Half adderE = 1: Half subtractor
i
o
Adder/Subtractor-1
A B
Di C
Bo
i
E
E = 0: Full adderE = 1: Full subtractor
Adder/Subtractor-2
Full Adder
A B
C
0 0
1
0
Full Adder
A B
C
1 1
2
1
Full Adder
A B
C
2 2
3
2
Full Adder
A B
C SD
3 3
4 3 SD SD SD
E
E = 0: 4-bit adderE = 1: 4-bit subtractor