Title: 07 KM
1Karnaugh Maps
2What are Karnaugh Maps?
- A simpler way to handle most (but not all) jobs
of manipulating logic functions.
Hooray !!
3Karnaugh Map Advantages
- Minimization can be done more systematically
- Much simpler to find minimum solutions
- Easier to see what is happening (graphical)
- Almost always used instead
- of boolean minimization.
4Gray Codes
- Gray code is a binary value encoding in which
adjacent values only differ by one bit
2-bit Gray Code
00
01
11
10
5Truth Table Adjacencies
These are adjacent in a gray code sense -
they differ by 1 bit We can apply XY XY
X AB AB A(BB) A(1) A
F A
F B
Same idea AB AB B
Key idea Gray code adjacency allows use of
simplification theorems
Problem Physical adjacency in truth table does
not indicate gray code adjacency
62-Variable Karnaugh Map
A B F
0 0
0 1
1 0
1 1
A1, B0
A0, B0
A1, B1
A0, B1
A different way to draw a truth table by folding
it
7Karnaugh Map
- In a K-map, physical adjacency does imply gray
code adjacency
F AB AB B
F AB AB A
82-Variable Karnaugh Map
92-Variable Karnaugh Map
102-Variable Karnaugh Map
112-Variable Karnaugh Map
122-Variable Karnaugh Map
F AB AB A
132-Variable Karnaugh Map
A 0
F A
14Another Example
F AB AB AB (AB AB) (AB AB)
A B
15Another Example
A 1
B 1
F A B
16Yet Another Example
F 1
Groups of more than two 1s can be combined
173-Variable Karnaugh Map Showing Minterm Locations
Note the order of the B C variables 0 0
0 1 1 1 1 0
ABC 101
ABC 010
183-Variable Karnaugh Map Showing Minterm Locations
Note the order of the B C variables 0 0
0 1 1 1 1 0
ABC 101
ABC 010
19Adjacencies
- Adjacent squares differ by exactly one variable
There is wrap-around top and bottom rows are
adjacent
20Truth Table to Karnaugh Map
0
0
1
0
1
1
0
1
21Minimization Example
ABCABC AC
ABCABC AB
F AB AC
22Another Example
ABCABC AC
ABCABC AC
F AC AC A ? C
23Minterm Expansion to K-Map
F ?m( 1, 3, 4, 6 )
0
1
1
0
1
0
0
1
Minterms are the 1s, everything else is 0
24Maxterm Expansion to KMap
F ?M( 0, 2, 5, 7 )
0
1
1
0
1
0
0
1
Maxterms are the 0s, everything else is 1
25Yet Another Example
2n 1s can be circled at a time 1, 2, 4, 8,
OK 3 not OK
ABCABCABCABC B
ABCABC AC
F B AC
The larger the group of 1s the simpler the
resulting product term
26Boolean Algebra to Karnaugh Map
27Boolean Algebra to Karnaugh Map
28Boolean Algebra to Karnaugh Map
29Boolean Algebra to Karnaugh Map
30Boolean Algebra to Karnaugh Map
Remaining spaces are 0
31Boolean Algebra to Karnaugh Map
Now minimize . . .
This is a simpler equation thanwe started
with. Do you see how we obtained it?
32Mapping Sum of Product Terms
- The 3-variable map has 12 possible groups of 2
spaces - These become terms with 2 literals
33Mapping Sum of Product Terms
- The 3-variable map has 6 possible groups of 4
spaces - These become terms with 1 literal
344-Variable Karnaugh Map
ABC
D
ABC
F ABC ABC D
Note the rowand column orderings. Required for
adjacency
35Find a POS Solution
BC
CD
F CD BC ABCD F (CD)(BC)(ABCD
)
ABCD
Find solutions to groups of 0s to find F Invert
to get F then use DeMorgans
36Dealing With Dont Cares
F ?m(1, 3, 7) ?d(0, 5)
37Dealing With Dont Cares
F ?m(1, 3, 7) ?d(0, 5)
ABCABCABCABC C
F C
Circle the xs that help get bigger groups of 1s
(or 0s if POS) Dont circle the xs that dont
38Minimal K-Map Solutions
- Some Terminology
- and
- An Algorithm to Find Them
39Prime Implicants
- A group of one or more 1s which are adjacent and
can be combined on a Karnaugh Map is called an
implicant. - The biggest group of 1s which can be circled to
cover a given 1 is called a prime implicant. - They are the only implicants we care about.
40Prime Implicants
Prime Implicants
Non-prime Implicants
Are there any additional prime implicants in the
map that are not shown above?
41All The Prime Implicants
Prime Implicants
When looking for a minimal solution only
circle prime implicants A minimal solution will
never contain non-prime implicants
42Essential Prime Implicants
Not all prime implicants are required
A prime implicant which is the only cover of some
1 is essential a minimal solution requires it.
Essential Prime Implicants
Non-essential Prime Implicants
43A Minimal Solution Example
Not required
F AB BC AD
Minimum
44Another Example
45Another Example
AB is not requiredEvery one one of
itslocations is covered by multiple
implicants After choosing essentials, everything
is covered
F AD BCD BD
Minimum
46Finding the Minimum Sum of Products
- 1. Find each essential prime implicant and
include it in the solution. - 2. Determine if any minterms are not yet covered.
- 3. Find the minimal of remaining prime
implicants which finish the cover.
47Yet Another Example(Use of non-essential primes)
48Yet Another Example(Use of non-essential primes)
AD
CD
AC
Essentials AD and ADNon-essentials AC and
CD Solution AD AD AC
or AD AD CD
AD
49K-Map Solution Summary
- Identify prime implicants
- Add essentials to solution
- Find a minimum non-essentials required to cover
rest of map
505- and 6-Variable K-Maps
515-Variable Karnaugh Map
This is the A0 plane
This is the A1 plane
The planes are adjacent to one another (one is
above the other in 3D)
52Some Implicants in a 5-Variable KMap
DE
ABCDE
A0
A1
ABCD
ABCD
BCDE
Some of these are not prime
535-Variable KMap Example
Find the minimum sum-of-products for F ? m
(0,1,4,5,11,14,15,16,17,20,21,30,31)
A0
A1
545-Variable KMap Example
Find the minimum sum-of-products for F ? m
(0,1,4,5,11,14,15,16,17,20,21,30,31)
A0
A1
F BD BCD ABDE
556-Variable Karnaugh Map
AB00
AB10
AB01
AB11
56AB00
AB10
AB01
AB11
Solution ACD CDEF
CDEF
ACD
57KMap Summary
- A Kmap is simply a folded truth table
- where physical adjacency implies logical
adjacency - KMaps are most commonly used hand method for
logic minimization - KMaps have other uses for visualizing Boolean
equations - you may see some later.