Transcript 3

Chapter 3
The Karnaugh Map
A
B
f
m
0
0
?
0
0
1
?
1
1
0
?
2
1
1
?
3
These K-maps are described by the location.
Next, each square will be 1 or 0 depending on the value of the function.
A
B
C
f
m
0
0
0
?
0
0
0
1
?
1
0
1
0
?
2
0
1
1
?
3
1
0
0
?
4
1
0
1
?
5
1
1
0
?
6
1
1
1
?
7
A three variable function can be configured multiple ways.
The K-maps are described by the location.
Next, each square will be 1 or 0 depending on the value of the function.
Gray code:
only 1 variable changes
Consider what DOES NOT change
An implicant of a function is a product term that can be used in an SOP.
Minterm is a product term that includes each variable of the problem,
either uncomplemented or complemented.
From the point of view of the map, an implicant is a rectangle of 1, 2, 4, 8, . . .
(any power of 2) 1’s. That rectangle may not include any 0’s.
The implicants of F are
Minterms – groups of 1
A´B´C´D´
A´B´CD
A´BCD
ABC´D´
ABC´D
ABCD
AB´CD
Groups of 2
A´CD
BCD
ACD
B´CD
ABC´
ABD
Groups of 4
CD
A prime implicant is an implicant that (from
the point of view of the map) is not fully
contained in any one other implicant.
Each set of circles is a prime implicant.
An essential prime implicant is a prime
implicant that includes at least one 1 that is
not included in any other prime implicant.
ABD is not essential, all other circles are.
f=∑m(0, 3, 7, 11, 12, 13, 15)
Consider what DOES NOT change
Minimum SOP using K map
Map Method 1
1.
Find all essential prime implicants. Circle them on the map and
mark the minterm(s) that make them essential with an asterisk (*).
Do this by examining each 1 on the map that has not already
been circled. It is usually quickest to start with the most isolated
1’s, that is, those that have the fewest adjacent squares with 1’s in
them.
2.
Find enough other prime implicants to cover the function.
Do this using two criteria:
a. Choose a prime implicant that covers as many new 1’s
(that is, those not already covered by a chosen prime
implicant).
b. Avoid leaving isolated uncovered 1’s.
Essential, can’t cover the 1 some other way.
minimum
all prime implicants
f = y´z´ + wyz + w´xz
Consider what DOES NOT change
Given: function
Make: k map
Minimize function
x´yz´ + x´yz + xy´z´ + xy´z + xyz
x´ y + x y´ + x z
x´ y + x y´ + y z
Essential PI *,
not covered by any other
Given: function
Make: k map
Minimize function
Some not used
minimum
G = A´BC´ + A´CD + ABC + AC´D
More than one way to skin a cat.
g = xz + wz + w´yz´ + wx´y
g = xz + wz + w´yz´ + x´yz´
g = xz + wz + x´yz´ + w´xy
All these are minimum.
All will give same result
All variations have this in common – the grayed area
F = A´C´D´ + AC´D + A´CD + ACD´ + …
F = A´C´D´ + AC´D + A´CD + ACD´ + B´D´ + AB´ - this is the vertical 4
F = A´C´D´ + AC´D + A´CD + ACD´ + B´D´ + B´C - this is the corner 4
F = A´C´D´ + AC´D + A´CD + ACD´ + AB´ + B´C – this is 2 by 2
Map Method 2
1.
Circle all of the prime implicants.
2.
Select all essential prime implicants; they are easily
identified by finding 1’s that have only been circled
once.
3.
Then choose enough of the other prime implicants (as
in Method 1). Of course, these prime implicants have
already been identified in step 1.
G= Σm(0,1,3,7,8,11,12,13,15)
All PI circled
A minimum
Another minimum
No essential PI
f = a´c´d´ + bc´d + acd + b´cd´
f = a´b´d´ + a´bc´ + abd + ab´c
A prime implicant is a rectangle of 1, 2, 4, 8, …
1’s or X’s not included in any one larger rectangle.
Thus, from the point of view of finding prime implicants,
X’s (don’t cares) are treated as 1’s.
An essential prime implicant is a prime implicant that
covers at least one 1 not covered by any other prime
implicant (as always).
Don’t cares (X’s) do not make
a prime implicant essential.
F=∑m(1,7,10,11,13) + ∑d(5,8,15)
minimum
F = BD + A´C´D + AB´C
Consider what DOES NOT change
other p.i.s
Only essential PI: c’d’
Other PI used in all solutions: ab
Use b’d’ – the corners
g1 = c´d´ + ab + b´d´ + a´cd
g2 = c´d´ + ab + b´d´ + a´b´c
Use ad’ – rt top & bot
g3 = c´d´ + ab + ad´ + a´b´c
Finding a minimum product of sums expression requires no new
theory. The following approach is the simplest:
1. Map the complement of the function. (If there is already a map for
the function, replace all 0’s by 1’s, all 1’s by 0’s and leave X’s
unchanged.)
2. Find the minimum sum of products expression for the complement
of the function (using the techniques of the last two sections).
3. Use DeMorgan’s theorem (P11) to complement that expression,
producing a product of sums expression.
Minimum Product of Sum
f =Σm(0,1,4,5,10,11,14)
f = a´c´ + ab´c + acd´
f ’=Σm(2,3,6,7,8,9,12,13,15)
f ´ = ac´ + a´c + abd
f ´ = ac´ + a´c + bcd
Use DeMorgan
f = (a´ + c)(a + c´)(a´ + b´ + d´)
f = (a´ + c)(a + c´)(b´ + c´ + d´)
f = ∏m(2,3,6,7,8,9,12,13,15)
Minimum Product of Sum
Finding a minimum product of sums
expression can equally be done
using the zero locations :
1.Circle the zeros.
2.Each literal is complemented.
3.Write in POS form.
0
0
0
0
F = (a’ + c)(a + c’)(a’ + b’ + d’)
0
0
0
0
0
5 variable maps
Use 2 layers
Tedious
Still use grey – reflective code
Decimal number of grid
5 variable maps
Use 2 layers
Adjacent
6 variable maps
Use 4 layers
Very Tedious
Forget It!
F = A´B´C + A´BE + AB´C´E´ + ABCD´E´ + BDE
F = A´C´E´ + ABCD + CD´E + BCE + B´C´DE´ + A´CD´
F = A´C´E´ + ABCD + CD´E + BCE + B´C´DE´ + A´D´E´
Multiple functions can be covered simultaneously
Can keep separate – that is OK.
May be able to save a few gates by combining systems.
More important when we get to memory devices.
Two functions F & G on separate K-maps
Note AB term is common
So can use that gate for both.
F = A´C´ + AB
G = A´C + AB
Two functions F & G
Note AB term is common
So can use that gate for both.
Common gate
Separate functions, separate gates
Two functions
Treat separately
F = Σm(0,1,6)
F = A´B´ + ABC´
G= Σm(2,3,6)
G = A´B + BC´
Two functions
Use common terms
F = A´B´ + ABC´
Which has the least cost?
The least number of gates?
G = A´B + ABC´
F=∑m(0,2,3,4,6,7,10,11)
G=∑m(0,4,8,9,10,11,12,13)
Circle the essential PI
for each function.
Then find the common
terms.
G can be circled many
ways.
F = A´C + A´C´D´ + AB´C
G = AC´ + A´C´D´ + AB´C
Build the function with logic symbols.
Really see the benefit of sharing functions.
Again, that will be more obvious with memory devices.
F = A´C + A´C´D´ + AB´C
G = AC´ + A´C´D´ + AB´C
Three functions (3.38)
Look for common terms
F = B´C + AB´C´ + A´BD + ABD
G = C + A´BD
H = BC + AB´C + ABD