Professional Documents
Culture Documents
Basic logic
Boolean algebra, proofs by re-writing, proofs by perfect induction
logic functions, truth tables, and switches
NOT, AND, OR, NAND, NOR, XOR, . . ., minimal set
Logic realization
two-level logic and canonical forms
incompletely specified functions
Simplification
uniting theorem
grouping of terms in Boolean functions
Alternate representations of Boolean functions
cubes
Karnaugh maps
X F
Y
thus, because NOT, NOR, and NAND are the cheapest they are the
functions we implement the most in practice
Can we implement all logic functions from NOT, NOR, and NAND?
For example, implementing X and Y
is the same as implementing not (X nand Y)
In fact, we can do it with only NOR or only NAND
NOT is just a NAND or a NOR with both inputs tied together
X Y X nor Y X Y X nand Y
0 0 1 0 0 1
1 1 0 1 1 0
Boolean algebra
Boolean algebra
B = {0, 1}
variables
+ is logical OR, • is logical AND
’ is logical NOT
All algebraic axioms hold
X Y X’ Y’ X•Y X’ • Y’ ( X • Y ) + ( X’ • Y’ )
0 0 1 1 0 1 1
0 1 1 0 0 0 0
( X • Y ) + ( X’ • Y’ ) ≡ X=Y
1 0 0 1 0 0 0
1 1 0 0 1 0 1
identity
1. X + 0 = X 1D. X • 1 = X
null
2. X + 1 = 1 2D. X • 0 = 0
idempotency:
3. X + X = X 3D. X • X = X
involution:
4. (X’)’ = X
complementarity:
5. X + X’ = 1 5D. X • X’ = 0
commutativity:
6. X + Y = Y + X 6D. X • Y = Y • X
associativity:
7. (X + Y) + Z = X + (Y + Z) 7D. (X • Y) • Z = X • (Y • Z)
distributivity:
8. X • (Y + Z) = (X • Y) + (X • Z) 8D. X + (Y • Z) = (X + Y) • (X + Z)
uniting:
9. X • Y + X • Y’ = X 9D. (X + Y) • (X + Y’) = X
absorption:
10. X + X • Y = X 10D. X • (X + Y) = X
11. (X + Y’) • Y = X • Y 11D. (X • Y’) + Y = X + Y
factoring:
12. (X + Y) • (X’ + Z) = 12D. X • Y + X’ • Z =
X • Z + X’ • Y (X + Z) • (X’ + Y)
concensus:
13. (X • Y) + (Y • Z) + (X’ • Z) = 13D. (X + Y) • (Y + Z) • (X’ + Z) =
X • Y + X’ • Z (X + Y) • (X’ + Z)
de Morgan’s:
14. (X + Y + ...)’ = X’ • Y’ • ... 14D. (X • Y • ...)’ = X’ + Y’ + ...
generalized de Morgan’s:
15. f’(X1,X2,...,Xn,0,1,+,•) = f(X1’,X2’,...,Xn’,1,0,•,+)
Duality
a dual of a Boolean expression is derived by replacing
• by +, + by •, 0 by 1, and 1 by 0, and leaving variables unchanged
any theorem that can be proven is thus also proven for its dual!
a meta-theorem (a theorem about theorems)
duality:
16. X + Y + ... ⇔ X • Y • ...
generalized duality:
17. f (X1,X2,...,Xn,0,1,+,•) ⇔ f(X1,X2,...,Xn,1,0,•,+)
Activity
identity 1. X + 0 = X 1D. X • 1 = X
null 2. X + 1 = 1 2D. X • 0 = 0
complementarity: 5. X + X’ = 1 5D. X • X’ = 0
commutativity: 6. X + Y = Y + X 6D. X • Y = Y • X
associativity: 7. (X + Y) + Z = X + (Y + Z) 7D. (X • Y) • Z = X • (Y • Z)
distributivity: 8. X • (Y + Z) = (X • Y) + (X • Z) 8D. X + (Y • Z) = (X + Y) • (X + Z)
factoring: 12. (X + Y) • (X’ + Z) = X • Z + X’ • Y 12D. X • Y + X’ • Z = (X + Z) • (X’ + Y)
(X • Y) + (Y • Z) + (X’ • Z)
identity (X • Y) + (1) • (Y • Z) + (X’ • Z)
complementarity (X • Y) + (X’ + X) • (Y • Z) + (X’ • Z)
distributivity (X • Y) + (X’ • Y • Z) + (X • Y • Z) + (X’ • Z)
commutativity (X • Y) + (X • Y • Z) + (X’ • Y • Z) + (X’ • Z)
factoring (X • Y) • (1 + Z) + (X’ • Z) • (1 + Y)
null (X • Y) • (1) + (X’ • Z) • (1)
identity (X • Y) + (X’ • Z) 9
identity 1. X + 0 = X 1D. X • 1 = X
null 2. X + 1 = 1 2D. X • 0 = 0
complementarity: 5. X + X’ = 1 5D. X • X’ = 0
commutativity: 6. X + Y = Y + X 6D. X • Y = Y • X
associativity: 7. (X + Y) + Z = X + (Y + Z) 7D. (X • Y) • Z = X • (Y • Z)
distributivity: 8. X • (Y + Z) = (X • Y) + (X • Z) 8D. X + (Y • Z) = (X + Y) • (X + Z)
factoring: 12. (X + Y) • (X’ + Z) = X • Z + X’ • Y 12D. X • Y + X’ • Z = (X + Z) • (X’ + Y)
X Y X’ Y’ (X + Y)’ X’ • Y’
(X + Y)’ = X’ • Y’ 0 0 1 1
NOR is equivalent to AND 0 1 1 0
1 0 0 1
with inputs complemented 1 1 0 0
X Y X’ Y’ (X • Y)’ X’ + Y’
(X • Y)’ = X’ + Y’ 0 0 1 1
NAND is equivalent to OR 0 1 1 0
with inputs complemented 1 0 0 1
1 1 0 0
Inputs: A, B, Carry-in A A A A A
Outputs: Sum, Carry-out B B B B B
S S S S S
A
S
A B Cin Cout S B
0 0 0 Cout
Cin
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Inputs: A, B, Carry-in A A A A A
Outputs: Sum, Carry-out B B B B B
S S S S S
A
S
A B Cin Cout S B
0 0 0 0 0 Cout
Cin
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
S = A’ B’ Cin + A’ B Cin’ + A B’ Cin’ + A B Cin
1 0 1 1 0 Cout = A’ B Cin + A B’ Cin + A B Cin’ + A B Cin
1 1 0 1 0
1 1 1 1 1
Activity
Truth-table for a circuit that tallies the number of inputs that are 1
X1 X2 X3 T2 T1
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
X1 X2 X3 T2 T1
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1 T1 = X1’ X2’ X3 + X1’ X2 X3’
0 1 1 1 0 + X1 X2’ X3’ + X1 X2 X3
1 0 0 0 1
1 0 1 1 0 = (X1’ X2’ + X1 X2) X3
1 1 0 1 0
+ (X1’ X2 + X1 X2’) X3’
= (X1 xor X2)’ X3
1 1 1 1 1
+ (X1 xor X2) X3’
= X1 xor X2 xor X3
T2 = X1’ X2 X3 + X1 X2’ X3
+ X1 X2 X3’ + X1 X2 X3
X Y
NOT X’ X ~X X Y 0 1
1 0
X Y Z
X 0 0 0
AND X • Y XY X∧Y Y
Z 0 1 0
1 0 0
1 1 1
X Y Z
OR X+Y X∨Y X
Z
0
0
0
1
0
1
Y
1 0 1
1 1 1
X Y Z
X 0 0 1
NAND Z 0 1 1
Y
1 0 1
1 1 0
X Y Z
NOR X 0 0 1
Z 0 1 0
Y 1 0 0
1 1 0
XOR X Y Z
X 0 0 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 0 0 1 X xnor Y = X Y + X’ Y’
X=Y Z 0 1 0 X and Y are the same
Y
1 0 0
1 1 1 ("equality", "coincidence")
Autumn 2006 CSE370 - II - Combinational Logic 25
A B C Z
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1 two-level realization
1 0 0 0 (we don’t count NOT gates)
1 0 1 1
1 1 0 1
1 1 1 0
multi-level realization
(gates with fewer inputs)
Technology independent
canonical forms
two-level forms
multi-level forms
Technology choices
packages of a few gates
regular logic
two-level programmable logic
multi-level programmable logic
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) = Σm(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
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
Sum-of-products of complement
F’ = A’B’C’ + A’BC’ + AB’C’
Apply de Morgan’s and get the product-of-sums form
(F’)’ = (A’B’C’ + A’BC’ + AB’C’)’
F = (A + B + C) (A + B’ + C) (A’ + B + C)
Product-of-sums of complement
F’ = (A + B + C’) (A + B’ + C’) (A’ + B + C’) (A’ + B’ + C) (A’ + B’ + C’)
Apply de Morgan’s and get the sum-of-product form
(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
canonical sum-of-products
minimized sum-of-products
canonical product-of-sums
minimized product-of-sums
F = A’B’+AB’ = (A’+A)B’ = B’
A B F
B has the same value in both on-set rows
0 0 1
– B remains, actually B’ because B is 0 in both cases
0 1 0
1 0 1 A has a different value in the two rows
– A is eliminated
1 1 0
Boolean cubes
01 11
0 1
Y 2-cube
1-cube
X 10
00
X
111 1111
0111
3-cube Y 4-cube
Z 101
Y
Z
000 X W
1000
0000 X
1 0 1 00 10
A
1 1 0
Cout = BCin+AB+ACin
F(A,B,C) = Σm(4,5,6,7)
on-set forms a square
011 111 i.e., a cube of dimension 2
110 represents an expression in one variable
010
i.e., 3 dimensions – 2 dimensions
B 001
C 101 A is asserted (true) and unchanged
B and C vary
000 A 100
This subcube represents the
literal A
1 0 0 1 0 1
1 3
1 1 0
AB A
C 00 01 11 10
A
0
0 2 6 4
0 4 12 8
C 1
1 3 7 5
B
1 5 13 9 D
A 3 7 15 11
C
2 6 14 10
0 2 6 4
B
C 13 = 1101= ABC’D
1 3 7 5
B
011 111
A
110
000 010 110 100 010
B 001
C 001 011 111 101 C 101
B 100
000 A
F= A
1 1
Cout = B 0 0
f(A,B,C) = Σm(0,4,5,7)
A
0 0 1 0
Cin 0 1 1 1
B
A
1 0 0 1
C 0 0 1 1
B
A
0 0 1 1
G(A,B,C) = A
C 0 0 1 1
B
A
1 0 0 1
F(A,B,C) = Σm(0,4,5,7) = AC + B’C’
C 0 0 1 1
B
A
0 1 1 0 F' simply replace 1's with 0's and vice versa
F'(A,B,C) = Σ m(1,2,3,6)= BC’ + A’C
C 1 1 0 0
B
F(A,B,C,D) = Σm(0,2,3,5,6,7,8,10,11,14,15)
F = C + A’ B D + 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
A
1 0 X 1
0 0 X X
D
X 1 1 0
C
1 X 1 0
B
Activity
F = BC + A’B’D’ + B’C’D’ 0 0 X X
D
F = A’C + AB + B’C’D’ X 1 1 0
C
1 X 1 0
B
Autumn 2006 CSE370 - II - Combinational Logic 60
Combinational logic summary