01 04 SOP & POS + K-Map
01 04 SOP & POS + K-Map
&
Karnaugh Maps (K-Maps)
1
1.0 Boolean Algebra
• VERY nice machinery used to manipulate
(simplify) Boolean functions
• George Boole (1815-1864): “An investigation
of the laws of thought”
• Terminology:
– Literal: A variable or its complement
– Product term: literals connected by •
– Sum term: literals connected by +
2
1.1 Boolean Algebra Properties
Let X: Boolean variable,
0,1: constants
1. X + 0 = X -- Zero Axiom
2. X • 1 = X -- Unit Axiom
3. X + 1 = 1 -- Unit Property
4. X • 0 = 0 -- Zero Property
5. X + X = X -- Idepotence
6. X • X = X -- Idepotence
7. X + X’ = 1 -- Complement
8. X • X’ = 0 -- Complement
9. (X’)’ = X -- Involution
3
1.2 Duality
• The dual of an expression is obtained by
exchanging (• and +), and (1 and 0) in it, provided
that the precedence of operations is not changed.
• Example:
– Find H(x,y,z), the dual of F(x,y,z) = x’yz’ + x’y’z
• H = (x’+y+z’) (x’+y’+ z)
4
1.2 Duality (cont’d) …
With respect to duality, Identities 1 – 8 have the
following relationship:
In general,
( X1 + X2 + … + Xn )’ = X1’•X2’ • … •Xn’, and
( X1•X2•… •Xn )’ = X1’ + X2’ + … + Xn’
6
1.3 Absorption Property
1. x + x•y = x
2. x•(x+y) = x (dual)
• Proof:
x + x•y = x•1 + x•y
= x•(1+y)
= x•1
=x
QED (2 true by duality, why?)
7
1. 4 Power of Duality
• x + x•y = x is true, so (x + x•y)’=x’
• (x + x•y)’=x’•(x’+y’)
• x’•(x’+y’) =x’
• Let X=x’, Y=y’
• X•(X+Y) =X, which is the dual of x + x•y = x.
9
1.6 Truth Tables
• Enumerates all possible x y z F1 F2 F3
combinations of variable values 0 0 0 0 1 1
and the corresponding function
value. 0 0 1 0 0 1
0 1 0 0 0 1
• Truth tables for some arbitrary 0 1 1 0 1 1
functions
1 0 0 0 1 0
F1(x,y,z), F2(x,y,z), and F3(x,y,z)
are shown to the right. 1 0 1 0 1 0
1 1 0 0 0 0
10
1 1 1 1 0 1
1.6 Truth Tables (cont.)
• Truth table: a unique representation of a Boolean
function.
• Proof:
x’y’z’+ x’yz’+ xyz’
= x’y’z’ + x’yz’ + x’yz’ + xyz’
= x’z’(y’+y) + yz’(x’+x)
= x’z’•1 + yz’•1
= x’z’ + yz’
14
1.9 Complement of a Function
• The complement of a function is derived by
interchanging (• and +), and (1 and 0), and
complementing each variable.
17
1.10.1 Definitions
• Literal: A variable or its complement
21
1.10.4 Canonical Forms (Unique)
• Any Boolean function F( ) can be expressed as a
unique sum of minterms and a unique product
of maxterms (under a fixed variable ordering).
22
1.10.4 Canonical Forms(cont.)
• Canonical Sum-Of-Products:
The minterms included are those mj such that
F( ) = 1 in row j of the truth table for F( ).
• Canonical Product-Of-Sums:
The maxterms included are those Mj such that
F( ) = 0 in row j of the truth table for F( ).
23
1.10.4 Canonical Forms :Example
• Truth table for f1(a,b,c) at right
a b c f1
• The canonical sum-of-products form for 0 0 0 0
f1 is
0 0 1 1
f1(a,b,c) = m1 + m2 + m4 + m6
= a’b’c + a’bc’ + ab’c’ + abc’ 0 1 0 1
0 1 1 0
• The canonical product-of-sums form for
1 0 0 1
f1 is
f1(a,b,c) = M0 • M3 • M5 • M7 1 0 1 0
= (a+b+c)•(a+b’+c’)• 1 1 0 1
(a’+b+c’)•(a’+b’+c’). 1 1 1 0
24
1.10.5 Shorthand: ∑ and ∏
• f1(a,b,c) = ∑ m(1,2,4,6), where ∑ indicates that this is
a sum-of-products form, and m(1,2,4,6) indicates that
the minterms to be included are m1, m2, m4, and m6.
• Replace ∑ with ∏ (or vice versa) and replace those j’s that
appeared in the original form with those that do not.
• Example:
f1(a,b,c) = a’b’c + a’bc’ + ab’c’ + abc’
= m1 + m2 + m4 + m6
= ∑(1,2,4,6)
= ∏(0,3,5,7)
= (a+b+c)•(a+b’+c’)•(a’+b+c’)•(a’+b’+c’)
26
1.10.7 Standard Forms (NOT Unique)
• Standard forms are “like” canonical forms,
except that not all variables need appear in the
individual product (SOP) or sum (POS) terms.
• Example:
f1(a,b,c) = a’b’c + bc’ + ac’
is a standard sum-of-products form
• f1(a,b,c) = (a+b+c)•(b’+c’)•(a’+c’)
is a standard product-of-sums form.
27
1.10.7 Conversion of SOP from standard to
canonical form
• Expand non-canonical terms by inserting
equivalent of 1 in each missing variable x:
(x + x’) = 1
• Remove duplicate minterms
• f1(a,b,c) = a’b’c + bc’ + ac’
= a’b’c + (a+a’)bc’ + a(b+b’)c’
= a’b’c + abc’ + a’bc’ + abc’ + ab’c’
= a’b’c + abc’ + a’bc + ab’c’
28
1.10.8 Conversion of POS from standard to
canonical form
• Expand non-canonical terms by adding 0 in terms of
missing variables (e.g., xx’ = 0) and using the
distributive law.
• Example:
m0 (=x1’x2’) is adjacent to m1 (=x1’x2) and m2
(=x1x2’) but NOT m3 (=x1x2)
33
2.1 Two-Variable Map :Example
• f(x1,x2) = x1’x2’+ x1’x2 + x1x2’
= m0 + m1 + m2
= x1’ + x2’
x2
• 1s placed in K-map for specified
minterms m0, m1, m2 x1 0 1
0 1
• Grouping (ORing) of 1s allows
simplification 0
2
1 3
1
• What (simpler) function is
represented by each dashed
rectangle? 1 1 0
– x1’ = m0 + m1
– x2’ = m0 + m2 34
2.2 Minimization as SOP using K-map
• Enter 1s in the K-map for each product term in the
function.
1 m4 m5 m7 m6
group of 2 terms
group of 4 terms
37
2.4 Simplification
• Enter minterms of the Boolean function into
the map, then group terms
• Example: f(a,b,c) = a’c + abc + bc’
• Result: f(a,b,c) = a’c+ b
a bc
1 1 1
1 1 1 1 1
1 1
38
2.5 More Examples
yz
X 00 01 11 10
• f1(x, y, z) = ∑ m(2,3,5,7) 0 1 1
1 1 1
f1(x, y, z) = x’y + xz
• f2(x, y, z) = ∑ m (0,1,2,3,6)
1 1 1 1
f2(x, y, z) = x’+yz’
1
39
2.6 Four-Variable Maps
YZ
00 01 11 10
WX
00 m0 m1 m3 m2
01 m4 m5 m7 m6
10 m8 m9 m11 m10
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1
1 1 1 1 1 1
g(A,B,C,D) = c’+b’d’+a’bd
42
2.7 Don't Care Conditions
• There may be a combination of input values which
– will never occur
– if they do occur, the output is of no concern.
X
• Which one is cheaper for this problem: The SoP or the PoS?
49
2.8.2 Example- Implementation
• The minimal Sum implementation : F = W+X.Z+X.Y
W
X
F
Y
Z
W W
X X
F F
Y Y
Z Z
50
• How to choose?
2.9 Another Example
• Minimizing a Function with Don’t Cares.
f(A,B,C,D) = m(1,3,4,7,11) + d(5,12,13,14,15)
= M(0,2,6,8,9,10) D(5,12,13,14,15)
AB A AB A
CD 00 01 11 10 CD 00 01 11 10
0 4 12 8 0 4 12 8
00 1 d 00 0 d 0
1 5 13 9 1 5 13 9
01 1 d d 01 d d 0
3 7 15 11 D 3 7 15 11 D
11 1 1 d 1 11 d
C 2 6 14 10
C 2 6 14 10
10 d 10 0 0 d 0
B B
(a ) (b )
SOP POS
Algorithmic minimization
• What do we do for functions with more
variables?
• You can “code up” a minimizer (Computer-
Aided Design, CAD)
– Quine-McCluskey algorithm
– Iterated consensus
• We won’t discuss these techniques here
52
More Logic Gates
• NAND and NOR Gates
– NAND and NOR circuits
– Two-level Implementations
– Multilevel Implementations
• Exclusive-OR (XOR) Gates
– Odd Function
– Parity Generation and Checking
53
More Logic Gates
• We can construct any combinational circuit with
AND, OR, and NOT gates
54
BUFFER, NAND and NOR
55
NAND Gate
• Known as a “universal” gate because ANY
digital circuit can be implemented with
NAND gates alone.
• To prove the above, it suffices to show that
AND, OR, and NOT can be implemented
using NAND gates only.
56
NAND Gate Emulation
F = (X•X)’ X F = X’
X
= X’+X’
= X’
X X F X•Y
F = ((X•Y)’)’
Y Y
= (X’+Y’)’
= X’’•Y’’
= X•Y
X X
F = (X’•Y’)’ F = X+Y
= X’’+Y’’
Y Y
= X+Y
57
NAND Circuits
• To easily derive a NAND implementation of a
boolean function:
– Find a simplified SOP
– SOP is an AND-OR circuit
– Change AND-OR circuit to a NAND circuit
– Use the alternative symbols below
58
AND-OR (SOP) Emulation
Using NANDs
Two-level implementations
a) Original SOP
b) Implementation with NANDs
59
AND-OR (SOP) Emulation
Using NANDs (cont.)
Verify:
(a) G = WXY + YZ
(b) G = ( (WXY)’ • (YZ)’ )’
= (WXY)’’ + (YZ)’’ = WXY + YZ
60
SOP with NAND
62
Example (cont.)
64
Example
Use NAND gates
and NOT gates to
implement
Z=E’F(AB+C’+D’)+GH
AB
AB+C’+D’
E’F(AB+C’+D’)
E’F(AB+C’+D’)+GH
65
Yet Another Example!
66
NOR Gate
• Also a “universal” gate because ANY digital
circuit can be implemented with NOR gates
alone.
• This can be similarly proven as with the
NAND gate.
67
NOR Circuits
• To easily derive a NOR implementation of a
boolean function:
– Find a simplified POS
– POS is an OR-AND circuit
– Change OR-AND circuit to a NOR circuit
– Use the alternative symbols below
68
Two-Level NOR Gate
Implementation - Example
F(X,Y,Z) = m(0,6)
1. Express F’ in SOP form:
1. F’ = m(1,2,3,4,5,7)
= X’Y’Z + X’YZ’ + X’YZ + XY’Z’ + XY’Z + XYZ
2. F’ = XY’ + X’Y + Z
2. Take the complement of F’ to get F in the POS
form: F = (F’)' = (X'+Y)(X+Y')Z'
3. Obtain the OR-AND implementation for F.
4. Add bubbles and inverters to transform OR-AND
implementation to NOR-NOR implementation.
69
Example (cont.)
70
XOR and XNOR
X Y F = XY
XOR: “not-equal” gate 0 0 0
X F 0 1 1
1 0 1
Y
1 1 0
X Y F = XY
XNOR: “equal” gate 0 0 1
0 1 0
X F
1 0 0
Y 1 1 1
71
Exclusive-OR (XOR) Function
• XOR (also ) : the “not-equal” function
• XOR(X,Y) = X Y = X’Y + XY’
• Identities:
– X0=X
– X 1 = X’
– XX=0
– X X’ = 1
• Properties:
– XY=YX
– (X Y) W = X ( Y W)
72
XOR function implementation
• XOR(a,b) = ab’ + a’b
• Straightforward: 5 gates
– 2 inverters, two 2-input ANDs, one 2-input OR
– 2 inverters & 3 2-input NANDs
• Nonstraightforward:
– 4 NAND gates
73
XOR circuit with 4 NANDs
74