Lec 5
Lec 5
KARNAUGH MAPS
Fall 2024
Karnaugh Maps
2 © Iris H.-R. Jiang
¨ Contents
¤ Minimum forms of switching functions
¤ Two- and three-variable Karnaugh maps
Karnaugh maps
Recap: Logic Design
3 © Iris H.-R. Jiang
¨ Design a combinational logic circuit starting with a word
description of the desired circuit behavior
¨ Steps:
1. Translate the word description into a switching function (Unit 4)
n Truth table
n Boolean expression: SOP/POS derived from minterm/maxterm
expansion (Unit 4)
2. Simplify the function
n Boolean algebra (Units 2&3)
n Karnaugh map (Unit 5)
n Quine-McCluskey (Unit 6)
n … etc
3. Realize it using available logic gates
n Minimum SOP/POS
1. Minimum # of terms (i.e., # of gates)
2. Minimum # of literals (i.e., # of gate inputs)
¨ Solutions: systematic methods
1. Karnaugh map (K-map) (Unit 5)
n Especially useful for 3 or 4 variables
n Faster and easier than other methods
2. Quine-McCluskey (Unit 6)
3. … etc.
Karnaugh maps
5 Two- & Three-Variable Karnaugh Maps
Karnaugh maps
Two-Variable Karnaugh Maps (1/2)
6 © Iris H.-R. Jiang
¨ Truth table = minterm expansion = Karnaugh map
¤ Each square of the K-map corresponds to a combination of
values of inputs
¤ i.e., each square = a minterm = a row in truth table
Karnaugh maps
Two-Variable Karnaugh Maps (2/2)
7 © Iris H.-R. Jiang
¨ e.g.,
1. Truth table 2. K-map 3. Simplification in K-map
XY'+XY = X(Y'+Y) = X
mi A B F A A
B 0 1 B 0 1
0 0 0 1 One circle
1 0 1 1 0 1 0 0 1 0 eliminates one
2 1 0 0 variable
3 1 1 0 1 1 0 1 1 0
Karnaugh maps
Three-Variable Karnaugh Maps
8 © Iris H.-R. Jiang
¨ Minterms in adjacent squares of K-map differ in only ONE bit
¨ Þ Combine them, XY'+XY = X(Y'+Y) = X
A
A A
BC 0 1 BC 0 1
00 000 100 00 m0 m4
Karnaugh maps
Example: F(A, B, C) = S m(1, 3, 5)
9 © Iris H.-R. Jiang
¨ e.g., F(A, B, C) = S m(1, 3, 5) = P M(0, 2, 4, 6, 7)
1. Truth table 2. K-map
mi A B C F A
BC 0 1
0 0 0 0 0
1 0 0 1 1 00 0 0
2 0 1 0 0 0 4
3 0 1 1 1
4 1 0 0 0 01 1 1
1 5
5 1 0 1 1
6 1 1 0 0
11 1 0
7 1 1 1 0 3 7
10 0 0
2 6
F
3. Simplification in K-map
F = A'B'C + A'BC + AB'C = A'C + B'C
Karnaugh maps Þ Minimum SOP form
Product Terms in Karnaugh Maps
10 © Iris H.-R. Jiang
¨ e.g.,
A A A
A A A
BC 0 1 BC 0 1 BC 0 1
00 00 00 1
01 01 01
C C C
11 1 1 11 11
B B B
10 1 1 10 1 1 10 1
B BC' AC'
(A'BC + ABC + A'BC' + ABC' = B)
Karnaugh maps
Example: f(a, b, c) = abc' + b'c + a'
11 © Iris H.-R. Jiang
¨ e.g., f(a, b, c) = abc' + b'c + a'
1. Mark 1’s
2. Make circles (simplify) a
a a
bc 0 1 bc 0 1
00 1 00 1
b'c simplify
01 1 1 01 1 1
c
11 1 11 1
b
10 1 1 10 1 1
00 00
YZ (consensus term)
01 1 01 1
X'Z
Z simplify Z
11 1 1 11 1 1
Y Y
10 1 XY 10 1
Karnaugh maps
All Solutions Are Shown in Karnaugh Maps
13 © Iris H.-R. Jiang
¨ All possible minimum SOPs can be determined from K-map
¤ # of terms and # of literals
¨ e.g., F = S m(0, 1, 2, 5, 6, 7)
¤ Make each circle as large as possible
00 1 00 1 00 1
01 1 1 01 1 1 01 1 1
simplify
11 1 11 1 11 1
10 1 1 10 1 1 10 1 1
Karnaugh maps
15 Four-Variable Karnaugh Maps
Karnaugh maps
Four-Variable Karnaugh Maps
16 © Iris H.-R. Jiang
¨ Adjacent squares differ in only one bit
¨ e.g., f(a, b, c, d) = acd + a'b + d'
A
AB ab
CD 00 01 11 10 cd 00 01 11 10
00 0 4 12 8 00 1 1 1 1
01 1 5 13 9 01 1 a'b
D d'
11 3 7 15 11 11 1 1 1 acd
C
10 2 6 14 10 10 1 1 1 1
f2 = S
f1 = S m(1,3,4,5,10,12,13)
m(0,2,3,5,6,7,8,10,11,14,15)
Four corner terms
ab ab combined into b'd'
cd 00 01 11 10 cd 00 01 11 10
00 1 1 00 1 1
01 1 1 1 01 1
11 1 11 1 1 1 1
10 1 10 1 1 1 1
Karnaugh maps
Karnaugh Maps with Don’t Cares
18 © Iris H.-R. Jiang
¨ Don’t cares can be assigned with 0’s or 1’s
¨ After assignment, the function becomes completely specified
¨ e.g., f(a, b, c, d) = S m(1, 3, 5, 7, 9) + S d(6, 12, 13)
ab
cd 00 01 11 10
00 X
01 1 1 X 1
11 1 1
10 X
Karnaugh maps
Minimum POS?
19 © Iris H.-R. Jiang
¨ Minimum SOP = circle 1’s of f
¨ Minimum POS = circle 0’s of f'
¤ Find min. SOP of f', then complement it
11 1 0 1 1
10 1 0 0 1
Karnaugh maps
20 Prime Implicants
Karnaugh maps
Prime Implicants (1/2)
21 © Iris H.-R. Jiang
¨ Implicant: a product term
¤ i.e., any single 1 or any group of 1’s in the K-map
¨ Prime implicant (PI): an implicant that cannot be covered by
other implicants
¤ i.e., a circle that cannot be enlarged any more
abc'
11 1
a'b'c
Not PI
Karnaugh maps
a'c'd' 10 1 1 PI
Prime Implicants (2/2)
22 © Iris H.-R. Jiang
¨ Cover: a set of prime implicants which covers all 1’s
¨ A minimum SOP contains only prime implicants (Why?)
¤ Þ Minimum cover = (min # of PIs, min # of literals)
11 1 1 1
10 1 1
Karnaugh maps
Essential Prime Implicants
23 © Iris H.-R. Jiang
¨ Essential prime implicant: If a minterm is covered by only one
PI, the PI is essential
¤ Essential PI MUST be included in minimum SOP
¤ Find essential PI’s = find the 1’s circled only once
¨ e.g., f = CD + BD + B'C + AC
AB AB
CD 00 01 11 10 CD 00 01 11 10
00 00
m5
01 1 1 01 1 1
Essential
11 1 1 1 1 11 1 1 1 1
m14
10 1 1 1 10 1 1 1
m2
Karnaugh maps f = BD + B'C + AC
One More General Example
24 © Iris H.-R. Jiang
¨ Find minimum cover:
1. Find all PI’s
2. Find essential PI’s
3. Find a minimum set of PI’s to cover the remaining 1’s
AB AB
CD 00 01 11 10 CD 00 01 11 10
00 1 1 00 1 1
0 4 12 8 0 4 12 8
01 1 1 01 1 1
1 5 13 9 1 5 13 9
Essential
11 1 1 1 11 1 1 1
3 7 15 11 3 7 15 11
10 1 10 1
2 6 14 10 2 6 14 10
A'BD
f = A'C' + A'B'D' + ACD +
Karnaugh maps BCD
Summary
25 © Iris H.-R. Jiang
¨ Minimum SOP = minimum cover = a minimum set of PI’s which
cover all 1’s
¤ Minimum cover = (min # of PIs, min # of literals)
¨ Steps:
1. Find all PI’s
2. Find essential PI’s
3. Find a minimum set of PI’s to cover the remaining 1’s
¨ Recap: steps of simplification in Karnaugh maps
1. Mark 1’s
2. Make circles
n Make each circle as large as possible = find PI
n Select as few circles as possible to cover all 1’s = find min
cover
Karnaugh maps
Flowchart Chooses a uncovered 1
26 © Iris H.-R. Jiang
11 X7 X15 Y
That term is an essential
prime implicant. Loop it.
10 16 110
All uncovered N
Note: All essential PI’s 1’s checked?
have been determined Y
at this point Find a min. set of prime
implicants which cover the
Karnaugh maps remaining 1’s on the map. stop
27 Five-Variable Karnaugh Maps
Karnaugh maps
Five-Variable Karnaugh Maps
28 © Iris H.-R. Jiang
¨ e.g.,
BC These terms do not combine
DE 00 01 11 10
16 20 28 24
1 1 1
00 1 1 1
0 4 12 8
17 21 29 25
1 1 These 8 terms
01
A 1 1 combine into BD'
1/0 1 5 13 9
19 23 31 27
11 1 1
1 1 These 4 terms
3 7 15 11 combine into CDE’
18 22 30 26
10 1 1
2 6 14 10
Karnaugh maps These 2 terms combine into AB'DE'
Adjacency in 5-Variable Karnaugh Maps
29 © Iris H.-R. Jiang
¨ 4 in the same layer, one in the other layer
BC
DE 00 01 11 10
00 1
1
A 01
1 1 1
1/0
11
1
10
Karnaugh maps
30 Other Forms of 5-Variable K-Maps
Karnaugh maps
Form 1
31 © Iris H.-R. Jiang
¨ Two maps side-by-side
BC BC
DE 00 01 11 10 DE 00 01 11 10
00 1 1 1 1 00 1 1 1 1
01 1 1 01 1 1
11 1 11 1 1
10 1 10
A=0 A=1
Karnaugh maps
Form 2
32 © Iris H.-R. Jiang
¨ A mirror image map A
B
1 1 1 1 1 1 1 1
1 1 1 1
E
1 1 1
D
1
C C
F = D'E' + B'C'D' + BCE + A'BC'E' + ACDE
Karnaugh maps
33 Other Uses of Karnaugh Maps
Karnaugh maps