Professional Documents
Culture Documents
CSEE 3827: Fundamentals of Computer Systems: Standard Forms and Simplification With Karnaugh Maps
CSEE 3827: Fundamentals of Computer Systems: Standard Forms and Simplification With Karnaugh Maps
• Standard Forms
• Product-of-Sums (PoS)
• Sum-of-Products (SoP)
• converting between
• Min-terms and Max-terms
• Simplification via Karnaugh Maps (K-maps)
• 2, 3, and 4 variable
• Implicants, Prime Implicants, Essential Prime Implicants
• Using K-maps to reduce
• PoS form
• Don’t Care Conditions
2
Standard Forms
• Sum-of-products (SOP)
• Product-of-sums (POS)
Product and sum terms
5
PoS & SoP
• Sum of products (SoP): OR of ANDs
e.g., F = Y + XYZ + XY
6
Converting from PoS (or any form) to SoP
Just multiply through and simplify, e.g.,
G = X(Y + Z)(X + Y + Z)
= XY + XY + XYZ + XZ + XZY + XZ
= XY + XZ
7
Converting from SoP to PoS
Complement, multiply through, complement via DeMorgan, e.g.,
Note: X’ = X
F' = (Y+Z)(X’+Y+Z’)(X’+Y’+Z)
F = (Y’+Z’)(X+Y’)(X+Z’)
8
Minterms
e.g., Minterms for 3 variables A,B,C
A B C minterm
• A product term in which all variables
0 0 0 m0 ABC
appear once, either complemented or
0 0 1 m1 ABC uncomplemented (i.e., an entry in the
truth table).
0 1 0 m2 ABC
0 1 1 m3 ABC
• Each minterm evaluates to 1 for
1 0 0 m4 ABC exactly one variable assignment, 0 for
all others.
1 0 1 m5 ABC
9
Minterms to describe a function
sometimes also called a minterm expansion or disjunctive normal form (DNF)
A B C minterm F
0 0 0 m0 ABC 0
0 0 1 m1 ABC 1
F = ABC + ABC + ABC
0 1 0 m2 ABC 1
= m1 + m2 + m3
0 1 1 m3 ABC 1
= ∑m(1,2,3)
1 0 0 m4 ABC 0
1 0 1 m5 ABC 0
1 1 0 m6 ABC 0
1 1 1 m7 ABC 0
11
Minterm form cont’d
(variables appear once in each minterm)
A B C F F minterm
0 0 0 1 0 m0 ABC
F = ABC + ABC + ABC + ABC + ABC
0 0 1 1 0 m1 ABC
0 m0 + m1 + m2 + m4 + m5
0 1 0 1 0 m2 ABC
0 ∑m(0,1,2,4,5)
0 1 1 0 1 m3 ABC
1 0 0 1 0 m4 ABC
F = ABC + ABC + ABC
1 0 1 1 0 m5 ABC
0 m3 + m6 + m7
1 1 0 0 1 m6 ABC 0 ∑m(3,6,7)
1 1 1 0 1 m7 ABC
Minterms as a circuit
A B C
Standard form is
not minimal form!
Maxterms
A B C maxterm
• A sum term in which all variables
0 0 0 M0 A+B+C appear once, either complemented or
uncomplemented.
0 0 1 M1 A+B+C
0 1 0 M2 A+B+C
• Each maxterm evaluates to 0 for
0 1 1 M3 A+B+C exactly one variable assignment, 1 for
all others.
1 0 0 M4 A+B+C
14
Maxterm description of a function
sometimes also called a maxterm expansion or conjunctive normal form (CNF)
A B C maxterm F
0 0 0 M0 A+B+C 0
1 0 1 M5 A+B+C 0
1 1 0 M6 A+B+C 0
1 1 1 M7 A+B+C 0
16
One final example
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 0 1
F F
Minterms
(SOP)
Maxterms
(POS)
Summary of Minterms and Maxterms
F F
Minterms
∑m(F = 1) ∑m(F = 0)
(SOP)
Maxterms
∏M(F = 0) ∏M(F = 1)
(POS)
Relations between standard forms
19
Simplification with Karnaugh Maps
Cost criteria
• Literal cost: the number of literals in an expression
• Gate-input cost: the literal cost + all terms with more than one literal +
(optionally) the number of distinct, complemented single literals
21
Karnaugh maps (a.k.a., K-maps)
• All functions can be expressed with a map
• There is one square in the map for each minterm in a function’s truth table
X Y F
Y
0 0 m0
X 0 1
0 1 m1 m0 m1
0
XY XY
1 0 m2
1 1 m3 m2 m3
1
XY XY
22
Karnaugh maps express functions
• Fill out table with value of a function
X Y F
Y
0 1
0 0 0 X
0 1 1 0
1 0 1
1
1 1 1
23
Simplification using a k-map
• Whenever two squares share an edge and both are 1, those two terms can be
combined to form a single term with one less variable
Y
0 1
X
0 0 1
Y 1 1 1 Y
0 1 0 1
X X
0 0 1 0 0 1
F = Y + XY
1 1 1 1 1 1
Y
0 1
X
F = XY + XY + XY 0 0 1 F=X+Y
1 1 1
F = X + XY
24
Simplification using a k-map (2)
• Circle contiguous groups of 1s (circle sizes must be a power of 2)
• Add circles (and terms) until all 1s on the k-map are circled
Y
0 1
X
0 0 1
1 1 1
F=X+Y
25
3-variable Karnaugh maps
• Use gray ordering on edges with multiple variables
• Gray encoding: order of values such that only one bit changes at a time
• Two minterms are considered adjacent if they differ in only one variable (this
means maps “wrap”)
YZ
Y=1
X 00 01 11 10
m0 m1 m3 m2
0
XYZ XYZ XYZ XYZ
m4 m5 m7 m6
X=1 1
XYZ XYZ XYZ XYZ
Z=1
26
4-variable Karnaugh maps
Extension of 3-variable maps
WXYZ or W+X+Y+Z
YZ Y
WX 00 01 11 10
0 0 m0 m1 m3 m2
0 1 m4 m5 m7 m6
X
1 1 m12 m13 m15 m14
W
1 0 m8 m9 m11 m10
27
Implicants
Implicant: a product term, which, viewed in a K-Map is a 2i x 2j size
“rectangle” (possibly wrapping around) where i=0,1,2, j=0,1,2
YZ Y YZ Y
WX 00 01 11 10 WX 00 01 11 10
0 0 m0 m1 m3 m2 0 0 m0 m1 m3 m2
0 1 m4 m5 m7 m6 0 1 m4 m5 m7 m6
X X
1 1 m12 m13 m15 m14 1 1 m12 m13 m15 m14
W W
1 0 m8 m9 m11 m10 1 0 m8 m9 m11 m10
Z Z
28
Implicants
• Implicant: a product term, which, viewed in a K-Map is a 2i x 2j size
“rectangle” (possibly wrapping around) where i=0,1,2, j=0,1,2
YZ Y YZ Y
WX 00 01 11 10 WX 00 01 11 10
0 0 m0 m1 m3 m2 WXYZ 0 0 m0 m1
W
m3 m2
WY
0 1 m4 m5 WXYm6
m7 0 1 m4 m5 m7 m6
X X
1 1 m12 m13 m15 m14 WX
1 1 m12 m13 m15 m14
W WZ W
1 0 m8 m9 m11 m10 1 0 m8 m9 m11 m10
Z Z
WXZ
30
Implicant terminology
• implicant: a product term, which, viewed in a K-Map is a 2i x 2j size
“rectangle” (possibly wrapping around) where i=0,1,2, j=0,1,2
31
4-variable Karnaugh maps (3)
• List all all of the prime implicants for this function
YZ Y
WX 00 01 11 10
00 0 0 1 0
01 1 1 1 0
X
11 0 1 1 1
W
10 0 1 0 0
Z
32
Using K-maps to build simplified circuits
• Step 1: Identify all PIs and essential PIs
• Step 3: If any 1-valued minterms are uncovered by EPIs, choose PIs that are
“big” and do a good job covering
1 1 1 0 1 1 0 0
0 1 1 0 0 1 1 0
1 1 1 1 0 0 1 1
1 1 0 1 1 0 0 1
33
Design example : 2-bit multiplier
a1 a0 b1 b0 z3 z2 z1 z0 two 2-bit #’s multiplied together to give a 4-bit solution
0 0 0 0
e.g., a1a0 = 10, b1b0 = 11, z3z2z1z0 = 0110
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
34
K-Maps: Complements, PoS, don’t care conditions
Finding F
Find prime implicants corresponding to the 0s on a k-map
YZ YZ
WX 00 01 11 10 WX 00 01 11 10
00 1 1 0 1 00 0 0 1 0
01 1 1 0 1 01 0 0 1 0
11 1 1 0 0 11 0 0 1 1
10 1 1 0 1 10 0 0 1 0
F = Y + XZ + WZ F = YZ + WXY
36
PoS expressions from a k-map
Find F as SoP and then apply DeMorgan’s
YZ
WX 00 01 11 10
00 1 1 0 1
01 1 0 0 0 F = YZ + XZ + YX
11 1 0 0 0
DeMorgan’s
F = (Y+Z)(Z+X)(Y+X)
10 1 1 0 1
37
Don’t care conditions
There are circumstances in which the value of an output doesn’t matter
d2 = ∑m(0,1,2,3,4,8,12) 1 1 0 1 0 0 1 1
1 1 1 0 0 1 1 0
1 1 1 1 1 0 0 1
38
2-bit multiplier non-0 multiplier
a1 a0 b1 b0 z3 z2 z1 z0
1’s must be covered
0 0 0 0 X X X X
0’s must not be covered
0 0 0 1 X X X X
X’s are optionally covered
0 0 1 0 X X X X
0 0 1 1 X X X X
0 1 0 0 X X X X
0 1 0 1 0 0 0 1
b0 b0
0 1 1 0 0 0 1 0 X X X X X X X X
0 1 1 1 0 0 1 1
X 0 0 0 X 0 0 0 a0
1 0 0 0 X X X X a0
X 0 1 0 X 0 0 1
1 0 0 1 0 0 1 0
a1 a1
1 0 1 0 0 1 0 0 X 0 0 0 X 0 1 1
1 0 1 1 0 1 1 0
1 1 0 0 X X X X b1 b1
1 1 0 1 0 0 1 1
1 1 1 0 0 1 1 0
z3 = z2 =
1 1 1 1 1 0 0 1
39
2-bit multiplier non-0 multiplier (2)
a1 a0 b1 b0 z3 z2 z1 z0
0 0 0 0 X X X X b0 b0
0 0 0 1 X X X X
X X X X X X X X
0 0 1 0 X X X X
0 0 1 1 X X X X X 0 1 1 X 1 1 0
0 1 0 0 X X X X X 1 0 1
a0 X 1 1 0
a0
0 1 0 1 0 0 0 1 a1 a1
0 1 1 0 0 0 1 0 X 1 1 0 X 0 0 0
0 1 1 1 0 0 1 1 b1 b1
1 0 0 0 X X X X
1 0 0 1 0 0 1 0 z1 = z0 =
1 0 1 0 0 1 0 0
1 0 1 1 0 1 1 0
1 1 0 0 X X X X
1 1 0 1 0 0 1 1
1 1 1 0 0 1 1 0
1 1 1 1 1 0 0 1
40
Final thoughts on Don’t care conditions
Sometimes “don’t cares” greatly simplify circuitry
D
1 X X X
X 1 X X
B
0 0 1 X
A
0 0 X 1
C
41