LogicDesign-2
LogicDesign-2
Ch 2
Combinational Logic
note 6
Topics
¨ Define
¤ the kind of digital system whose output behavior depends only
on the current inputs è each output is defined as a function
(combination) of inputs
¤ memoryless: its outputs are independent of the historical sequence of
values presented to it as inputs
¤ (cf.) sequential logic
¨ Many ways to describe combination logic
¤ Boolean algebra expression
¤ wired up logic gates
¤ truth tables tabulating input and output combinations
¤ graphical maps
¤ program statements in a hardware description language (e.g. Verilog)
3 Digital Logic Design
Examples of combinational logic
¨ Binary Adder
X Y Cout S X Y Cin Cout S
0 0 0 0 0 0 0 0 0
0 1 0 1 0 0 1 0 1
1 0 0 1 0 1 0 0 1
1 1 1 0 0 1 1 1 0
1 0 0 0 1
< Half-adder> 1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
< Full-adder>
4 Digital Logic Design
Laws and theorems of Boolean logic
¨ Basic concept
¤ Boolean algebra is the mathematical foundation of digital systems
¤ laws (axioms) : the properties to which the operations of Boolean
algebra must adhere
¤ axioms can be used to prove more general laws
¨ Boolean operations
¤ operation order
COMPLEMENT à AND à OR
¤ parentheses : change the default order of evaluation
¤ examples :
(( ) )
1) A · B + C = A · B + C
2) A + B · C = (A ) + (B · C )
¨Duality:
14. (X + Y + Z + ...)D 14D. (X • Y • Z • ...)D
= X • Y • Z • ... = X + Y + Z + ...
¨ General form:
º implies º
X F
Y
X Y Z
¨ NOR X 0 0 1
Z 0 1 0
Y 1 0 0
1 1 0
¨ XOR X
X
0
Y
0
Z
0 X xor Y = X Y’ + X’ Y
XÅY Y
Z 0 1 1 X or Y but not both
1 0 1 ("inequality", "difference")
1 1 0
¨ XNOR X Y Z
X xnor Y = X Y + X’ Y’
X=Y X 0 0 1
Z 0 1 0 X and Y are the same
Y
1 0 0
1 1 1 ("equality", "coincidence")
15 Digital Logic Design
Realizing Boolean formulas: logic blocks
& hierarchy
¨ Complex logic function can be constructed from more
primitive functions by wiring up logic gates
¨ example : 2-bit adder Full Adder
A S Cin S
Half Adder HA
A Cout
B C HA
B
2 bit Adder
C0 =0
A0 S0
FA
B0 C1
S1
A1 FA Cout
B1 Cout
A0 2 bit Adder
A1
C0 =0
B0
S0
B1 A0 FA
B0 C1
C0 S1
A1
C1 FA C2
B1 C2
S0
2 units 2 units
S1
3 units
C2
1 unit for HA (xor, and)
Digital Logic Design
Minimizing the number of gates & wires
¨ Different implementations of one function
A B C Z
0 0 0 0
0 0 1 1 8+6+6+8 transistors
0 1 0 0
0 1 1 1 two-level realization
1 0 0 0 Z1 = Z = A’B’C+A’BC+AB’C+ABC’
1 0 1 1 = ABC’+A’(B’+B)C+(A’+A)B’C
1 1 0 1
1 1 1 0 = ABC’+A’C+B’C
A B C F F’
0 0 0 0 1
0 0 1 1 0
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 0 F’ = A’B’C’ + A’BC’ + AB’C’
A B C minterms
F in canonical form:
0 0 0 A’B’C’ m0
F(A, B, C) = Sm(1,3,5,6,7)
0 0 1 A’B’C m1
= m1 + m3 + m5 + m6 + m7
0 1 0 A’BC’ m2
= A’B’C + A’BC + AB’C + ABC’ + ABC
0 1 1 A’BC m3
1 0 0 AB’C’ m4
canonical form ¹ minimal form
1 0 1 AB’C m5
F(A, B, C) = A’B’C + A’BC + AB’C + ABC + ABC’
1 1 0 ABC’ m6
= (A’B’ + A’B + AB’ + AB)C + ABC’
1 1 1 ABC m7
= ((A’ + A)(B’ + B))C + ABC’
= C + ABC’
short-hand notation for = ABC’ + C
minterms of 3 variables = AB + C
22 Digital Logic Design
Product-of-sums canonical forms
A B C maxterms
F in canonical form:
0 0 0 A+B+C M0
F(A, B, C) = PM(0,2,4)
0 0 1 A+B+C’ M1
= M0 • M2 • M4
0 1 0 A+B’+C M2
= (A + B + C) (A + B’ + C) (A’ + B + C)
0 1 1 A+B’+C’ M3
1 0 0 A’+B+C M4
canonical form ¹ minimal form
1 0 1 A’+B+C’ M5
F(A, B, C) = (A + B + C) (A + B’ + C) (A’ + B + C)
1 1 0 A’+B’+C M6
= (A + B + C) (A + B’ + C)
1 1 1 A’+B’+C’ M7
(A + B + C) (A’ + B + C)
= (A + C) (B + C)
short-hand notation for
maxterms of 3 variables
¨ Sum-of-products
¤ F’ = A’B’C’ + A’BC’ + AB’C’
¨ Apply DeMorgan’s
¤ (F’)’ = (A’B’C’ + A’BC’ + AB’C’)’
¤ F = (A + B + C) (A + B’ + C) (A’ + B + C)
¨ Product-of-sums
¤ F’ = (A + B + C’) (A + B’ + C’) (A’ + B + C’) (A’ + B’ + C) (A’ + B’ + C’)
¨ Apply DeMorgan’s
¤ (F’)’ = ( (A + B + C’)(A + B’ + C’)(A’ + B + C’)(A’ + B’ + C)(A’ + B’ + C’) )’
¤ F = A’B’C + A’BC + AB’C + ABC’ + ABC
B canonical sum-of-products
F1
F1 = A’B’C + A’BC + AB’C + ABC’ + ABC
C
minimized sum-of-products
F2
F2 = AB + C
= ((AB+C)‘)’ = ((A’+B’)C’)’
= (A’C’+B’C’)’
canonical product-of-sums
F3 F3 = (A + B + C)(A + B’ + C)(A’ + B + C)
minimized product-of-sums
F4 F4 = (A + C)(B + C)
111 1111
0111
3-cube Y Z 4-cube
101
Y
Z W
000 X 1000
0000 X
32 Digital Logic Design
Mapping truth tables onto Boolean cubes
1 0 0 1 0 1
1 3
1 1 0
Digital Logic Design
Karnaugh maps (K-Maps)
000
001
011
¨ Numbering scheme based on Gray–code 010
¤ e.g., 00, 01, 11, 10 (for every advancement, a single bit changes) 110
111
¤ only a single bit changes in code for adjacent map cells 101
100
AB A K-map for five/six (=2+2/3+3) variables
C 00 01 11 10 Is in theory possible… but…
A
0
0 2 6 4
0 4 12 8
C 1
1 3 7 5
1 5 13 9 D
B
A 3 7 15 11
C
0 2 6 4 2 6 14 10
B
C
1 3 7 5
B 13 = 1101= ABC’D
1 5 13 9 D
011 111
110 3 7 15 11
010
C
001 2 6 14 10
B C 101 B
000 A 100
¨ 2-variable maps
¤ F = AB’ + AB = A
A B F
A
0 0 0
0 1
0 1 0
A
1 0 1 B 0 1
1 1 1
A B G A
¤ G = A’B’ + AB’ = B’
0 0 1 1 1
B’
0 1 0
B 0 0
1 0 1
1 1 0
A
1 0 0 1 F(A,B,C) = Sm(0,4,5,7) = AC + B’C’
C 0 0 1 1 How to get the maxterms for F from K-Map?
¨ F(A,B,C,D) = Sm(0,2,3,5,6,7,8,10,11,14,15)
F = C + A’BD + B’D’
A 1111
0111
1 0 0 1
0 1 0 0
D
C
1 1 1 1 D
C A
1000
1 1 1 1 0000 B
B
find the smallest number of the largest possible
subcubes to cover the On-set
(fewer terms with fewer inputs per term)
A
0 0 X 0
1 1 X 1
D
1 1 0 0
C
0 X 0 0
B
A
by using don't care as a "1"
0 0 X 0
a 2-cube can be formed
1 1 X 1 rather than a 1-cube to cover
D this node
1 1 0 0
C don't cares can be treated as
0 X 0 0 1s or 0s
B depending on which is more
advantageous