8 Topic 5 - Karnaugh Map Quine-McCluskey Method
8 Topic 5 - Karnaugh Map Quine-McCluskey Method
1
Introduction to Karnaugh
Map
Systematic method to obtain simplified
sum-of-products (SOPs) Boolean
expressions.
Objective: Fewest possible terms/literals.
Diagrammatic technique based on a special
form of Venn diagram.
Advantage: Easy with visual aid.
Disadvantage: Limited to 5 or 6 variables.
2
Venn Diagrams
a'b'
ab' ab a'b
a
b
3
Karnaugh Map Methods
4
Karnaugh Map Methods
5
Karnaugh Map Methods
6
Karnaugh Map Methods
7
Karnaugh Map Methods
8
Different Types of K-maps
2-variables
3-variables
4-variables
5-variables
Larger K-maps
9
2-variable K-maps
10
2-variable K-maps
Alternative layouts of a 2-variable (a, b) K-map
Alternative 1: Alternative 2:
a
b b a
OR OR
a'b a'b m0 m1 a'b ab' m0 m2
' '
a ab a m3 b ab b m1 m3
ab' m2 a'b
Alternative 3:
a a
OR
b ab a'b b m3 m1 and others…
ab' a'b m2 m0
'
11
2-variable K-maps
Equivalent labeling:
b b
a 0 1
0
equivalent to:
a
1
a a
b 1 0
equivalent to: 0
b
1
12
2-variable K-maps
b b
0 0 0 1
a 0 1 a 1 0
C = ab S = ab' + a'b
13
Karnaugh Map Methods
0 0 1
Z A B AB
1 1 0
Z=1 for (A,B) = (0,1) put 1 in box
Z=1 for (A,B) = (1,0) put 1 in box
put 0 everywhere else.
14
3-variable K-maps
c
c
15
3-variable K-maps
bc
a
00 01 11 10
0 m0 m1 m3 m2
m4 m5 m7 m6
1
16
Karnaugh Map Methods
E.g.
Z ABC A BC A B C A B C
BC
A 00 01 11 10
0 0 0 1 0 3 variables
1 1 1 1 0
Karnaugh Map 17
Karnaugh Map Methods
Þ any two squares that are adjacent differ in only one variable
Karnaugh Map 18
Karnaugh Map Methods
Consider a grouping of two of the circled terms which are
adjacent we can see that
A B C A B C A B C C A B
Karnaugh Map 19
Karnaugh Map Methods
Then can form final simplified expression from the minimum
number of circles required to encompass all the ones.
BC
A 00 01 11 10
0 0 0 1 0
minimum expression1 1 1 1 0
we could also include the third circle and thus
Z A B BC
but this is not a minimum expression.
Two loops cover all the ones.
Z A B AC BC
20
4-variable K-maps
y
yz
wx 00 01 11 10
00 m0 m1 m3 m2
m4 m5 m7 m6
01
x
m1 m1 m1 m1
11 2 3 5 4
w
m8 m9 m1 m1
10 1 0
21
4-variable K-maps
yz y
wx
m0 m1 m3 m2
m4 m5 m7 m6
x
m1 m1 m1 m1
w 2 3 5 4
m8 m9 m1 m1
1 0
22
Exercise - Karnaugh Map Methods
Z A B CD A B C D A B C D A BCD AB C D ABCD A B CD
CD
AB
23
Answer - Karnaugh Map Methods
CD
AB 00 01 11 10
00 0 0 1 0
01 1 1 1 0
11 0 1 1 0
10 0 0 1 0
Z CD BD A B C
24
Karnaugh Map Methods
for which an implementation would be
A A.B.C
B.D
C
C.D
D
Karnaugh Map 25
Karnaugh Map Methods
00 0 0 1 0
01 1 1 1 0
11 0 1 1 0
10 0 0 1 0
Z CD C B AD
Karnaugh Map 26
Karnaugh Map Methods
for which an implementation would be
A
Z
B
Z C D C B AD
Z C D C B A D
Karnaugh Map 27
Karnaugh Map Methods
A
B
Z
C
This is equivalent to A
B
Z
C
B Z
C
Karnaugh Map 28
5-variable K-maps
Karnaugh Map 29
5-variable K-maps
Organised as two 4-variable K-maps:
v' v
y y
yz yz
wx 00 01 11 10 wx 00 01 11 10
00 m0 m1 m3 m2 00 m1 m1 m1 m1
6 7 9 8
m4 m5 m7 m6 m2 m2 m2 m2
01 01 0 1 3 2
x x
m1 m1 m1 m1 m2 m2 m3 m3
11 2 3 5 4 11 8 9 1 0
w w
m8 m9 m1 m1 m2 m2 m2 m2
10 1 0 10 4 5 7 6
z z
Karnaugh Map 30
Larger K-maps
Karnaugh Map 31
Larger K-maps w
b
ef a‘.b' a‘.b ef
cd 00 01 11 10 10 11 01 00 cd
00 m0 m1 m3 m2 m1 m1 m1 m1 00
8 9 7 6
m4 m5 m7 m6 m2 m2 m2 m2
2 3 1 0
01 m1 m1 m1 m1 m3 m3 m2 m2 01
2 3 5 4 0 1 9 8
m8 m9 m1 m1 m2 m2 m2 m2 11
11 1 0 6 7 5 4
10 10
10 m4 m4 m4 m4 m5 m5 m5 m5 10
0 1 3 2 8 9 7 6
m4 m4 m4 m4 m6 m6 m6 m6
a 4 5 7 6 2 3 1 0
m3 m3 m3 m3 m5 m5 m5 m5
11 6 7 9 8 4 5 3 2
11
m3 m3 m3 m3 m5 m5 m4 m4
01 2 3 5 4 0 1 9 8 01
cd cd
00 01 11 10 10 11 01 00 ef
00ef a.b' a.b 00
Karnaugh Map 32
NAND and NOR Implementations
and
Karnaugh Map 33
NAND and NOR Implementations
A
A B A B
B
A A
A
AB
B B
B
Karnaugh Map 34
NAND and NOR Implementations
A A
AB
B B
Karnaugh Map 35
NAND and NOR Implementations
Z A B C D A B C D A B C D A B C D A BCD A BC D AB C D
ABCD ABC D A B C D A B C D
CD
AB 00 01 11 10
00 1 1 0 1
01 0 1 1 1
11 0 1 1 1
10 1 1 0 0
Karnaugh Map 36
NAND and NOR Implementations
Minimum expression
Karnaugh Map 37
NAND and NOR Implementations
A C D
A
B C
B
Z
C
B C
D
C D
or
Z B C BD BC A C D
Karnaugh Map 38
NAND and NOR Implementations
CD
AB 00 01 11 10
00 1 1 0 1
01 0 1 1 1
11 0 1 1 1
10 1 1 0 0
Z B C D A B C B CD
Karnaugh Map 39
NAND and NOR Implementations
eqn (2)
Z B C D A B C B CD
A B C
B B C D Z
D
B C D
Karnaugh Map 40
NAND and NOR Implementations
Z B C D A B C B CD
Z B C D A BC BC D eqn (3) POS
B
B C D Z
D
B C D
Karnaugh Map 41
NAND and NOR Implementations
Z B C D A B C B CD
eqn (4) Use NOR
Z B C D A BC BC D
A B C
B
B C D Z
D
B C D
Karnaugh Map 42
NAND and NOR Implementations
Z B C C D BC A C D
A C D
A
B C
B
Z
C
B C
D
C D
Karnaugh Map 43
Implementation of Minimum Functions
Z A B C D A B C D A B C D A B C D A BCD A BC D AB C D
ABCD ABC D A B C D A B C D
Karnaugh Map 44
Implementation of Minimum Functions
Karnaugh Map 45
Implementation of Minimum Functions
Karnaugh Map 46
Conversion of POS to NOR Gates
A B C
B B C D Z
D
B C D
Z B C D A B C B C D
Karnaugh Map 47
Don’t Cares
When an output value is term is known for every possible
combination of input variables.
function said to be completely specified.
Karnaugh Map 48
Quine-McCluskey Method
Quine-McCluskey 49
Quine-McCluskey Method
The Quine-McCluskey method reduces the minterm
expansion (standard sum-of-products form) of a function
to obtain a minimum sum of products. The procedure
consists of two main steps:
1. Eliminate as many literals as possible form each term by
systematically applying the theorem XY + XY’ = X. The
resulting terms are called prime implicants.
2. Use a prime implicant chart to select a minimum set of
prime implicants which, when Ored together, are equal to
the function being simplified and which contain a
minimum number of literals.
Quine-McCluskey 50
Step I: Determination of
Prime Implicants
AB`CD` + AB`CD = AB`C
1 0 1 0 + 1 0 1 1 = 101- (the dash indicates a missing variable)
X Y X Y`
A`BC`D + A`BCD` ?
0101+ 0110
Will not combine as two minterms will combine
if they differ in exactly one variable.
Quine-McCluskey 51
FLB 20203
DIGITAL
SYSTEMS Karnaugh Map 52
Step I: Determination of
Prime Implicants
f(a,b,c,d) = ∑ m (0, 1, 2, 5, 6, 7, 8, 9, 10, 14) is represented by
following list of
minterms:
group 0 0 0000
1 0001
group 1 2 0010
In this list, the term in
8 1000
group 0 has zero 1’s,
5 0101 the terms in group 1
group 2 6 0110 have one 1, those in
9 1001 group 2 have two 1’s,
and those in group 3
10 1010 have three 1’s.
group 3 7 0111
14 1110
Quine-McCluskey 53
Step I: Determination of
Prime Implicants
Column I Column II Column III
Group 0 0 0000 0,1 000- 0,1,8,9 -00-
1 0001 0,2 00-0 0,2,8,10 -0-0
Group 1 2 0010 0,8 -000 0,8,1,9 -00-
8 1000 1,5 0-01 0,8,2,10 -0-0
5 0101 1,9 -001 2,6,10,14 --10
Group 2 6 0110 2,6 0-10 2,10,6,14 --10
9 1001 2,10 -010
10 1010 8,9 100-
Group 3 7 0111 8,10 10-0
14 1110 5,7 01-1
6,7 011-
6,14 -110
10,14 1-10
Quine-McCluskey 54
Step I: Determination of
Prime Implicants
Terms which have not been checked off because they
cannot be combined with other terms are called prime
implicants. Because every minterm has been included in at
least one of the prime implicants, the function is equal to the
sum of its prime implicants. In this example we have
f= a`c`d + a`bd + a`bc + b`c` + b`d` + cd`
(1,5) (5,7) (6,7) (0,1,8,9) (0,2,8,10) (2,6,10,14)
In this expression, each term has a minimum number
of literals, but the number of terms is not minimum. Using the
consensus theorem to eliminate redundant terms yields
f = a`bd + b`c` + cd`
Quine-McCluskey 55
Step II: The Prime
Implication Chart (to calculate
essential prime implicants)
0 1 2 5 6 7 8 9 10 14
(0,1,8,9) b`c` x x x x
(0,2,8,10) b`d` x x x x
(2,6,10,14) cd` x x x x
(1,5) a`c`d x x
(5,7) a`bd x x
(6,7) a`bc x x
Quine-McCluskey 56
Step II: The Prime
Implication Chart (essential
prime implicants and the crossed out)
0 1 2 5 6 7 8 9 10 14
(0,1,8,9) b`c` x x x x
(0,2,8,10) b`d` x x x x
(2,6,10,14) cd` x x x x
(1,5) a`c`d x x
(5,7) a`bd x x
(6,7) a`bc x x
If a minterm is covered by only one prime implicant, then the prime implicant is
called essential prime implicant and must be included in the minimum sum of
product.
Essential prime implicants are easy to find using prime implicants chart. If a
given column contains only one X, then the corresponding row is an essential
prime implicant.
f = b`c` + cd` + a`bd
Quine-McCluskey 57
Cyclic Prime Implicant Chart
F = ∑ m (0,1,2,5,6,7)
Quine-McCluskey 58
Cyclic Prime Implicant Chart
0 000 0,1 00-
1 001 0,2 0-0
2 010 1,5 -01
5 101 2,6 -10
6 110 5,7 1-1
7 111 6,7 11-
0 1 2 5 6 7
0,1 a`b` x x
0,2 a`c` x x
1,5 b`c x x
2,6 bc` x x
5,7 ac x x
6,7 ab x x
f = a`b` + bc`+ ac
Quine-McCluskey 59
Cyclic Prime Implicant Chart
0 000 0,1 00-
1 001 0,2 0-0
2 010 1,5 -01
5 101 2,6 -10
6 110 5,7 1-1
7 111 6,7 11-
0 1 2 5 6 7
0,1 a`b` x x
0,2 a`c` x x
1,5 b`c x x
2,6 bc` x x
5,7 ac x x
6,7 ab x x
f = a`c` + b`c + ab
Quine-McCluskey 60
Simplification of
Incompletely Specified
Functions
F (A,B,C,D) = ∑m (2,3,7,9,11,13) + ∑d (1,10,15)
Quine-McCluskey 61
Refresh Your Mind!
Find a minterm sum-of-products expression for the following
1. f (a,b,c,d,e) = ∑m (0,2,3,5,7,9,11,13,14,16,18,24,26,28,30)
Quine-McCluskey 62