Lecture 5: Karnaugh Maps: CS1104: Computer Organisation
Lecture 5: Karnaugh Maps: CS1104: Computer Organisation
http://www.comp.nus.edu.sg/~cs1104
Simplification techniques:
Algebraic Simplification.
simplify symbolically using theorems/postulates.
requires skill but extremely open-ended.
Karnaugh Maps.
¾ diagrammatic technique using ‘Venn-like diagram’.
¾ easy for humans (pattern-matching skills).
¾ simplified standard forms.
¾ limited to not more than 6 variables.
X Half S X Y C S
adder (X+Y) 0 0 0 0
Y C
0 1 0 1
1 0 0 1
1 1 1 0
a'.b'
a a m3 b b m1 m3
ab' ab m2 a'b ab
Alternative 3:
a a
OR
b ab a'b b m3 m1 and others…
ab' a'b' m2 m0
a a
b 1 0
equivalent to: 0
b
1
0 0 0 1
a 0 1 a 1 0
1 m4 m5 m7 m6
a 0 1 0 0
1
y
yz
wx 00 01 11 10
00 m0 m1 m3 m2
01 m4 m5 m7 m6
x
m12 m13 m15 m14
11
w
m8 m9 m11 m10
10
z
m4 m5 m7 m6
x
m12 m13 m15 m14
w
m8 m9 m11 m10
01 1 1
x (cells with ‘0’ are not
1 1
w
11 shown for clarity)
1 1
10
z
z
CS1104-5 Simplification Using K-maps 33
Simplification Using K-maps (6/9)
Each product term of a group, w'.x.y' and w.y,
represents the sum of minterms in that group.
Boolean function is therefore the sum of product terms
(SOP) which represent all groups of the minterms of
the function.
F(w,x,y,z) = A + B = w'.x.y' + w.y
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1 1 1
1
3 3 3
1 1 1 1
1 1 1
1 1 1 1 1
2 2
CS1104-5 Simplification Using K-maps 37
Converting to Minterms Form (1/2)
The K-map of a function is easily drawn when the
function is given in canonical sum-of-products, or sum-
of-minterms form.
What if the function is not in sum-of-minterms?
Convert it to sum-of-products (SOP) form.
Expand the SOP expression into sum-of-minterms
expression, or fill in the K-map directly based on the SOP
expression.
1 1 1 1 1 1
1
3
1 1 1 1 1
2
1
1
1
1
2 1
1
1
1
3
1 1 1 1
00 1 1
All prime implicants
01 1 1
D
11 1 1 1
C
10 1 1
C
11 1 1 1 01 1 1
implicants
10 1 1 D
11 1 1 1
B C
10 1 1
B
A
AB
CD 00 01 11 10
00 1 1 Minimum cover
01 1 1
D
11 1 1 1
C
10 1 1
A'B'C
00 1
01 1 1 1
D
11 1 1 1
C
10 1
5-5 to 5-7.
00 1 0 0 1
01 1 1 0 1
D
11 1 1 0 1
C
10 1 0 0 1
K-map 00 1 0 0 1 00 0 1 1 0 K-map
of F 01 1 1 0 1 01 0 0 1 0 of F'
D D
11 1 1 0 1 11 0 0 1 0
C C
10 1 0 0 1 10 0 1 1 0
B B
WITHOUT don’t-cares: AB 00 01 11 10
00
P = A'.B'.C'.D’ + A'.B'.C.D + A'.B.C'.D 1 1
01 1
+ A'.B.C.D' + A.B'.C'.D 1
B
11
A
10 1
WITH don’t-cares: D
Karnaugh Maps.
can obtain simplified standard forms.
easy for humans (pattern-matching skills).
limited to not more than 6 variables.
CS1104-5 Review 55
Review – K-maps (1/4)
Characteristics of K-map layouts:
(i) each minterm in one square/cell
(ii) adjacent/neighbouring minterms differ by only 1 literal
(iii) n-literal minterm has n neighbours/adjacent cells
a'b' a'b m0 m1
OR
a ab' ab a m2 m3
CS1104-5 Review 56
Review – K-maps (2/4)
b b
bc bc
a a
00 01 11 10 00 01 11 10
0 a'b'c' a'b'c a'bc a'bc' 0 m0 m1 m3 m2
c c
y
yz
wx 00 01 11 10
00 m0 m1 m3 m2
01 m4 m5 m7 m6
x
11 m12 m13 m15 m14
w
10 m8 m9 m11 m10
CS1104-5 Review 57
Review – K-maps (3/4)
Groupings to select product-terms must be:
(i) rectangular in shape
(ii) in powers of twos (1, 2, 4, 8, etc.)
(iii) always select largest possible groupings of minterms
(i.e. prime implicants)
(iv) eliminate redundant groupings
CS1104-5 Review 58
Review – K-maps (4/4)
Product-of-sums (POS) form obtained by selecting
groupings of maxterms (corresponding to sum terms)
and by applying DeMorgan’s theorem.
Don’t cares, marked by X (or d), can denote either 1 or
0. They could therefore be selected as 1 or 0 to further
simplify expressions.
CS1104-5 Review 59
Examples (1/11)
Example #1:
f(A,B,C,D) = ∑ m(2,3,4,5,7,8,10,13,15)
A
AB
CD 00 01 11 10
00 1 1
Fill in the 1’s.
01 1 1
D
11 1 1 1
C
10 1 1
CS1104-5 Examples 60
Examples (2/11)
Example #1:
f(A,B,C,D) = ∑ m(2,3,4,5,7,8,10,13,15)
A
AB
CD 00 01 11 10
These are all the
00 1 1 prime implicants; but
01 1 1 do we need them
D
11 1 1 1
all?
C
10 1 1
CS1104-5 Examples 61
Examples (3/11)
Example #1:
f(A,B,C,D) = ∑ m(2,3,4,5,7,8,10,13,15)
A
AB
CD 00 01 11 10
00 1 1
Essential prime implicants:
01 1 1
D
11 1 1 1
B.D
C
10 1 1 A'.B.C'
B A.B'.D'
CS1104-5 Examples 62
Examples (4/11)
Example #1:
f(A,B,C,D) = ∑ m(2,3,4,5,7,8,10,13,15)
A
AB
CD 00 01 11 10
00 1 1
Minimum cover.
01 1 1
D EPIs: B.D, A'.B.C', A.B'.D'
11 1 1 1
C
1 1
+
10
B
A'.B'.C
C
11 1 1 1 01 1 1
implicants
10 1 1 D
11 1 1 1
B C
10 1 1
SUMMARY
A B
AB
CD 00 01 11 10
00 1 1
Minimum cover
01 1 1
D
11 1 1 1
C
10 1 1
f(A,B,C,D) = B.D + A'.B'.C + A.B'.D' + A'.B.C'
B
CS1104-5 Examples 64
Examples (6/11)
Example #2:
f(A,B,C,D) = A.B.C + B'.C.D' + A.D + B'.C'.D'
A
AB
CD 00 01 11 10
00 1 1
Fill in the 1’s.
01 1 1
D
11 1 1
C
10 1 1 1
CS1104-5 Examples 65
Examples (7/11)
Example #2:
f(A,B,C,D) = A.B.C + B'.C.D' + A.D + B'.C'.D'
A
AB
CD 00 01 11 10
00 1 1
Find all PIs:
01 1 1
D A.D
11 1 1
C A.C
10 1 1 1
B'.D'
B A.B'
A.D, A.C and B'.D' are EPIs, and they cover all the minterms.
So the answer is: f(A,B,C,D) = A.D + A.C + B'.D'
CS1104-5 Examples 66
Examples (8/11)
Example #3 (with don’t cares):
f(A,B,C,D) = ∑ m(2,8,10,15) + ∑ d(0,1,3,7)
A
AB
CD 00 01 11 10
00 X 1
Fill in the 1’s and X’s.
01 X
D
11 X X 1
C
10 1 1
CS1104-5 Examples 67
Examples (9/11)
Example #3 (with don’t cares):
f(A,B,C,D) = ∑ m(2,8,10,15) + ∑ d(0,1,3,7)
A
AB
CD 00 01 11 10 Do we need to have an
00 X 1 additional term A'.B' to
01 X cover the 2 remaining x’s?
D
11 X X 1 No, because all the 1’s
C
1 1 (minterms) have been
10
covered.
B
CS1104-5 Examples 68
Examples (10/11)
To find simplest POS expression for example #2:
f(A,B,C,D) = A.B.C + B'.C.D' + A.D + B'.C'.D'
Draw the K-map of the complement of f, f '.
A From K-map,
AB
CD 00 01 11 10
f ' = A'.B + A'.D + B.C'.D'
00 1 1
Using DeMorgan’s theorem,
01 1 1
D
11 1 1 f = (A'.B + A'.D + B.C'.D')'
C
10 1 = (A+B').(A+D').(B'+C+D)
B
CS1104-5 Examples 69
Examples (11/11)
To find simplest POS expression for example #3:
f(A,B,C,D) = ∑ m(2,8,10,15) + ∑ d(0,1,3,7)
Draw the K-map of the complement of f, f '.
f '(A,B,C,D) = ∑ m(4,5,6,9,11,12,13,14) + ∑ d(0,1,3,7)
A
AB
CD 00 01 11 10
From K-map,
00 X 1 1 f ' = B.C' + B.D' + B'.D
01 X 1 1 1 Using DeMorgan’s theorem,
D
11 X X 1
C f = (B.C' + B.D' + B'.D)'
10 1 1
= (B'+C).(B'+D).(B+D')
B
CS1104-5 Examples 70
End of file