k-maps-11,12,13
TRANSCRIPT
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 1/36
prepared by :M. OMARI ١
Function Minimization:
Karnaugh Maps
Maher al omari
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 2/36
prepared by :M. OMARI ٢
Introduction
• Karnaugh maps provide a systematic method toobtain simplified Boolean functions.
• Objective: Fewest possible terms/literals.
• Advantage: Easy with visual aid.
• Disadvantage: Limited to 5 variables.
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 3/36
prepared by :M. OMARI ٣
2-variable K-mapsF (a,b) = a b + a' b'
equivalent to:
ab
0 1
0
1
11
01
10
00
ba
1
0
0
1
F
= m0 + m3
1
1
0
0
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 4/36
prepared by :M. OMARI ٤
2-variable K-maps
• Equivalent labelling:
a
b
equivalent to:
ab
0 1
0
1
b
a
equivalent to:
ba
1 0
0
1
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 5/36
prepared by :M. OMARI ٥
2-variable K-maps
a'b' a'b
ab' aba
b
m 0 m 1
m 2 m 3 a
b
OR
Karnaugh-map (K-map) is organised as a matrix of squares, where
each square represents a minterm
adjacent squares always differ by just
one literal (so that the unifying
theorem may apply: a + a' = 1)
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 6/36
prepared by :M. OMARI ٦
2-variable K-maps
• The K-map for a function is specified by putting – a ‘1’ in the square corresponding to a minterm
– a ‘0’ otherwise
• For example:
0 0
0 1a
b
0 1
1 0a
b
C = ab S = ab' + a'b
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 7/36
prepared by :M. OMARI ٧
3-variable K-maps
• There are 8 minterms for 3 variables (a, b, c).
Therefore, there are 8 cells in a 3-variable K-map.
ab'c' ab'ca
b
abc abc'
a'b'c' a'b'c a'bc a'bc'
0
1
00 01 11 10
c
abc
ORm 4 m 5 a
b
m 7 m 6
m 0 m 1 m 3 m 2 0
1
00 01 11 10
c
a
bc
Note Gray code sequenceAbove arrangement ensures that mintermsof adjacent cells differ by only ONE literal .
(Other arrangements which satisfy thiscriterion may also be used.)
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 8/36
prepared by :M. OMARI ٨
3-variable K-maps
• There is wrap-around in the K-map:
– a'b'c' (m0) is adjacent to a'bc' (m2) – ab'c' ( m4) is adjacent to abc' (m6 )
m 4 m 5 m 7 m 6
m 0 m 1 m 3 m 2 0
1
00 01 11 10abc
Each cell in a 3-variable K-map has 3 adjacent neighbours.In general, each cell in an n -variable K-map has n adjacent
neighbours.
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 9/36
prepared by :M. OMARI ٩
4-variable K-maps
m 4 m 5
w
y
m 7 m 6
m 0 m 1 m 3 m 2
z
w xyz
m 1 2 m 1 3 m 1 5 m 1 4
m 8 m 9 m 1 1 m 1 0
x
16 cellsEvery cell has 4
neighbours
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 10/36
prepared by :M. OMARI ١٠
Simplification Using K-maps• Example:
F (w,x,y,z) = w'xy'z' + w'xy'z + wx'yz'
+ wx'yz + wxyz' + wxyz
z
1 1
w
y
00
01
11
10
00 01 11 10w x
yz
1 1
1 1
x
(cells with ‘0’ are notshown for clarity)
= Σ m(4, 5, 10, 11, 14, 15)
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 11/36
prepared by :M. OMARI ١١
Simplification Using K-maps
• Each group of adjacent minterms corresponds to a possible
product term of the given function.
1 1
w
00
01
11
10
00 01 11 10
z
w xyz
1 1
1 1
x
A
B
y
F (w,x,y,z) =Σ
m(4, 5,) +Σ
m(10, 11, 14, 15,)
= A + B
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 12/36
prepared by :M. OMARI ١٢
Simplification Using K-maps• There are 2 groups of minterms: A and B, where:
A = w'xy'z' + w'xy'z
= w'xy'(z' + z)
= w'xy'
1 1
w
00
01
11
10
00 01 11 10
z
w x
yz
1 1
1 1
x
A
B
y
B = wx'yz' + wx'yz + wxyz' + wxyz
= wx'y(z' + z) + wxy(z' + z)
= wx'y + wxy
= w(x'+x)y
= wy
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 13/36
prepared by :M. OMARI ١٣
Simplification Using K-maps
1 1
w
00
01
11
10
00 01 11 10
z
w x
yz
1 1
1 1
x
A
B
y
w'xy'
wy
•Each product term of agroup, represents the sum
of minterms in that group.
F (w,x,y,z) = A + B = w'xy' + wy
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 14/36
prepared by :M. OMARI ١٤
Simplification Using K-
maps• Based on the Unifying Theorem:
A + A' = 1• Each group of adjacent cells must have size in
powers of twos: 1, 2, 4, 8, …)
• Grouping 2 adjacent squares eliminates 1 variable,grouping 4 squares eliminates 2 variables,grouping 8 squares eliminates 3 variables, and so
on. In general, grouping 2n squares eliminates nvariables.
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 15/36
prepared by :M. OMARI ١٥
Simplification Using K-
maps• Group as many squares as possible.
– The larger the group is, the fewer the number of literalsin the resulting term.
• Select as few groups as possible to cover all the
squares (minterms/maxterms) of the function. – The fewer the groups, the fewer the number of terms in
the minimized function.
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 16/36
prepared by :M. OMARI ١٦
Simplification Using K-maps• Other possible valid groupings of a 4-variable K-map
include:
1
11
1
1
1
1
11
11
1 1
111
1
11
1
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 17/36
prepared by :M. OMARI ١٧
Simplification Using K-maps• Larger groups correspond to product terms of
fewer literals. In the case of a 4-variable K-map:
1 cell = 4 literals, e.g.: wxyz, w'xy'z
2 cells = 3 literals, e.g.: wxy, wy'z'
4 cells = 2 literals, e.g.: wx, x'y
8 cells = 1 literal, e.g.: w, y', z
16 cells = no literal, e.g.: 1
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 18/36
prepared by :M. OMARI ١٨
Simplification Using K-maps• Groups of minterms must be
(1) rectangular, and(2) have size in powers of 2’s.
Otherwise they are invalid groups. Some
examples of invalid groups:1
11
1 1
111
1
1
1
1
1
1
1
1
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 19/36
prepared by :M. OMARI ١٩
Drawing the K-map
1
1
C
A
00
01
11
10
00 01 11 10
B
CD
AB
D
1
or
= A(C'D')(B'+D') + BC + CC' + A'CD
= AB'C'D' + AC'D' + BC + A'CD
=AB'C'D' + ABC'D' + ABCD + ABCD' +
A'BCD + A'BCD' + A'B'CD
f(A,B,C,D) = A(C+D)'(B'+D') +C(B+C'+A'D)
1
1
11
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 20/36
prepared by :M. OMARI ٢٠
prime implicant • A prime implicant is a product term obtained by
combining the maximum possible number of minterms from adjacent squares in the map.
• Use bigger groupings (prime implicants) where
possible.11 1
111
11 1
111
Sec 3-2
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 21/36
prepared by :M. OMARI ٢١
prime implicants 1
All prime implicants
1
1
C
A
00
01
11
10
00 01 11 10
B
CD
AB
1
1
1
1
D
1
1
1
Sec 3-2
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 22/36
prepared by :M. OMARI ٢٢
prime implicants 2
All prime implicants
1
1
C
A
00
01
11
10
00 01 11 10
B
CD
AB
1
1
1
D
1
1
is not fully contained in any one other implicant .
Sec 3-2
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 23/36
prepared by :M. OMARI ٢٣
All prime implicants
Example: find all prime implicats for
F = y’z’ + wyz + w’xz
Y
Y Z
Z
11
W
00
01
11
10
00 01 11 10
X
W X
1
1
1
1 1
1
Sec 3-2
y’z’
w’xzw’xy’
WyZxyZ
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 24/36
prepared by :M. OMARI ٢٤
NOT Essential
prime implicant
essential prime implicant
1
1*
C
A
00
01
11
10
00 01 11 10
B
CD
AB
1
1
1*
D
1*
1
* Essential prime implicant
includes at least one 1 that is not included
in any other prime implicant.Sec 3-2
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 25/36
prepared by :M. OMARI ٢٥
NOT Essential
prime implicant1
Y
W
00
01
11
10
00 01 11 10
X
Y Z
W X
1
1
1
1*
Z
1*
1
* Essential prime implicant
includes at least one 1 that is not included
in any other prime implicant.
1
Example: find all essential prime implicants for
F = y’z’ + wyz + w’xz
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 26/36
prepared by :M. OMARI ٢٦
Simplest SOP Expressions – bigger groupings of minterms ( prime
implicants)
– no redundant groupings (look for
essential prime implicants)
–minimum number of
literals per product term
–minimum number of productterms
Leads to
Leads to
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 27/36
prepared by :M. OMARI ٢٧
no redundant groupings
1
1
1
11
1
1
1
1
1
1
11
1 1
1
redundant
group
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 28/36
prepared by :M. OMARI ٢٨
Simplest SOP Expressions• Algorithm
1. Identify & Circle all essential prime implicants onthe K-map.
.
2. Select a minimum prime implicants to cover those mintermsnot covered by the essential prime implicants.
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 29/36
prepared by :M. OMARI ٢٩
1
1
C
A
00
01
11
10
00 01 11 10
B
CD
AB
1
1
1
1
D
1
1
1
Essential prime
implicants
Minimum cover
• Example f(A,B,C,D) = ∑ m(2,3,4,5,7,8,10,13,15)
BD
AB'D'A'BC'
A'B'C
f(A,B,C,D) = BD + A'B'C + AB'D' + A'BC'
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 30/36
prepared by :M. OMARI ٣٠
Getting POS Expressions
• This gives the SOP of F' to be:
F' = BD' + AB
• To get POS of F, we have:
F = (BD' + AB)'
= (BD')'(AB)' DeMorgan
= (B'+D)(A'+B') DeMorgan
0
0
C
A
00
01
11
10
00 01 11 10
B
CD
AB
0
1
0
0
D
0
0
0 0
01
11
1 1
A
CD
1
1
C
00
01
11
10
00 01 11 10
B
AB
1
0
1
1
D
1
1
1 1
10
00
0 0K-map
of F
K-map
of F'
Sec 3-4
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 31/36
prepared by :M. OMARI ٣١
Getting POS Expressions• Simplified POS expression can be obtained by
grouping the maxterms (i.e. 0s) of given function.
• Example:
Given F=∑m(0,1,2,3,5,7,8,9,10,11), we first
draw the K-map, then group the maxtermstogether:
1
1
C
A
00
01
11
10
00 01 11 10
B
CD
AB
1
0
1
1
D
1
1
1 1
10
00
0 0(B'+D) (A'+B')
Sec 3-4
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 32/36
prepared by :M. OMARI ٣٢
No. A B C D P
0 0 0 0 0 1
1 0 0 0 1 0
2 0 0 1 0 0
3 0 0 1 1 1
4 0 1 0 0 0
5 0 1 0 1 1
6 0 1 1 0 1
7 0 1 1 1 0
8 1 0 0 0 0
9 1 0 0 1 1
10 1 0 1 0 X
11 1 0 1 1 X
12 1 1 0 0 X
13 1 1 0 1 X
14 1 1 1 0 X
15 1 1 1 1 X
Don’t-care Conditions• In certain problems, some
outputs are not specified.
• These outputs can be either ‘1’or ‘0’.
• They are called don’t-careconditions, denoted by X.
• Example: An odd parity
generator for BCD code whichhas 6 unused combinations.
Sec 3-5
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 33/36
prepared by :M. OMARI ٣٣
Don’t-care Conditions
• Don’t-care conditions can be used to help simplifyBoolean expression further in K-maps.
• They could be chosen to be either ‘1’ or ‘0’,
depending on which gives the simpler expression.
Sec 3-5
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 34/36
prepared by :M. OMARI ٣٤
Don’t-care Conditions SOP
WITH Don’t-cares:
P =
1
A
C
00
01
11
10
00 01 11 10
D
AB
CD
1
B
1
1
1
1
A
C
00
01
11
10
00 01 11 10
D
AB
CD
1
B
1
1
1
X X
XXXX
Can you find Pin simplest POS?
WITHOUT Don’t-cares:
P =
No. A B C D P
0 0 0 0 0 1
1 0 0 0 1 0
2 0 0 1 0 0
3 0 0 1 1 1
4 0 1 0 0 0
5 0 1 0 1 16 0 1 1 0 1
7 0 1 1 1 0
8 1 0 0 0 0
9 1 0 0 1 1
10 1 0 1 0 X
11 1 0 1 1 X
12 1 1 0 0 X
13 1 1 0 1 X
14 1 1 1 0 X
15 1 1 1 1 X
Sec 3-5
1
A
C
00
01
11
10
00 01 11 10
D
AB
CD
1
B
1
11
X X
XXXX
00
00
0
8/4/2019 k-maps-11,12,13
http://slidepdf.com/reader/full/k-maps-111213 35/36
prepared by :M. OMARI ٣٥
5-variable K-maps• Organised as two 4-variable K-maps:
Corresponding squares of each map are adjacent.Can visualise this as being one 4-variable map on TOP of the
other 4-variable map .
m 2 0 m 2 1
w
y
m 2 3 m 2 2
m 1 6 m 1 7 m 1 9 m 18 00
01
11
10
00 01 11 10
z
w x
yz
m 2 8 m 2 9 m 3 1 m 30
m 2 4 m 2 5 m 2 7 m 26
x
m 4 m 5
w
y
m 7 m 6
m 0 m 1 m 3 m 2 00
01
11
10
00 01 11 10
z
w x
yz
m 1 2 m 13 m 1 5 m 1 4
m 8 m 9 m 1 1 m 1 0
x
v ' v
Sec 3-3