THE K-MAP
Karnaugh Map (K-Map) Karnaugh Mapping is used to minimize the number of logic gates that are required in a digital circuit. This will replace Boolean reduction when the circuit is large. Write the Boolean equation in a SOP form first and then place each term on a map.
Karnaugh Map (K-Map) The map is made up of a table of every possible SOP using the number of variables that are being used. If 2 variables are used then a 2X2 map is used If 3 variables are used then a 4X2 map is used If 4 variables are used then a 4X4 map is used If 5 Variables are used then a 8X4 map is used
K-Map SOP Minimization
2 Variables Karnaugh Map B B A Notice that the map is going false to true, left to right and top to bottom 0 1 2 3 B B The upper right hand cell is A B if X= A B then put an X in that cell A 1 This show the expression true when A = 0 and B = 0
2 Variables Karnaugh Map B B If X=AB + AB then put an X in both of these cells A 1 1 From Boolean reduction we know that A B + A B = B B B From the Karnaugh map we can circle adjacent cell and find that X = B A 1 1
3 Variables Karnaugh Map 0 1 C C Gray Code 00 A B 01 A B 11 A B 10 A B 0 1 2 3 6 7 4 5
3 Variables Karnaugh Map (cont’d) X = A B C + A B C + A B C + A B C Gray Code 00 A B 01 A B 11 A B 10 A B 0 1 C C 1 1 Each 3 variable term is one cell on a 4 X 2 Karnaugh map 1 1
3 Variables Karnaugh Map (cont’d) X = A B C + A B C + A B C + A B C Gray Code 00 A B 01 A B 11 A B 10 A B 0 1 C C One simplification could be X = A B + A B 1 1 1 1
3 Variables Karnaugh Map (cont’d) X = A B C + A B C + A B C + A B C Gray Code 00 A B 01 A B 11 A B 10 A B 0 1 C C Another simplification could be X = B C + B C A Karnaugh Map does wrap around 1 1 1 1
3 Variables Karnaugh Map (cont’d) X = A B C + A B C + A B C + A B C Gray Code 00 A B 01 A B 11 A B 10 A B 0 1 C C The Best simplification would be X = B 1 1 1 1
On a 3 Variables Karnaugh Map One cell requires 3 Variables Two adjacent cells require 2 variables Four adjacent cells require 1 variable Eight adjacent cells is a 1
4 Variables Karnaugh Map Gray Code 00 A B 01 A B 11 A B 10 A B 0 0 0 1 1 1 1 0 C D C D C D C D 0 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10
Simplify : X = A B C D + A B C D + A B C D + A B C D + A B C D + A B C D Gray Code 00 A B 01 A B 11 A B 10 A B 0 0 0 1 1 1 1 0 C D C D C D C D Now try it with Boolean reductions 1 1 1 1 1 1 X = ABD + ABC + CD
On a 4 Variables Karnaugh map One Cell requires 4 variables Two adjacent cells require 3 variables Four adjacent cells require 2 variables Eight adjacent cells require 1 variable Sixteen adjacent cells give a 1 or true
Simplify : Z = B C D + B C D + C D + B C D + A B C Gray Code 00 A B 01 A B 11 A B 10 A B 00 01 11 10 C D C D C D C D 1 1 1 1 1 1 1 1 1 1 1 1 Z = C + A B + B D
Simplify using Karnaugh map First, we need to change the circuit to an SOP expression
Simplify using Karnaugh map (cont’d) Y= A + B + B C + ( A + B ) ( C + D) Y = A B + B C + A B ( C + D ) Y = A B + B C + A B C + A B D Y = A B + B C + A B C A B D Y = A B + B C + (A + B + C ) ( A + B + D) Y = A B + B C + A + A B + A D + B + B D + AC + C D SOP expression
Simplify using Karnaugh map (cont’d) Gray Code 00 A B 01 A B 11 A B 10 A B 00 01 11 10 C D C D C D C D Y = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
K-Map POS Minimization
3 Variables Karnaugh Map Gray Code 0 0 0 1 1 1 1 0 C 0 1 AB 0 1 2 3 6 7 4 5
3 Variables Karnaugh Map (cont’d) Example from text book - FLOYD (page 208)
4 Variables Karnaugh Map 0 0 0 1 1 1 1 0 C D 0 0 0 1 1 1 1 0 A B 0 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10
4 Variables Karnaugh Map (cont’d) Example from text book - FLOYD (page 208)
4 Variables Karnaugh Map (cont’d)
Karnaugh Map - Example Mapping a Standard SOP expression Example: Answer: Mapping a Standard POS expression Using K-Map, convert the following standard POS expression into a minimum SOP expression Y = AB + AC or standard SOP :
K-Map with “Don’t Care” Conditions Example : Input Output 3 variables with output “don’t care (X)”
K-Map with “Don’t Care” Conditions (cont’d) 4 variables with output “don’t care (X)”
K-Map with “Don’t Care” Conditions (cont’d) Example: Determine the minimal SOP using K-Map: Answer:
Minimum SOP expression is Solution : CD 00 01 11 10 AB 0 1 1 0 1 X 1 0 X X X X 0 0 1 0 00 01 11 10 0 1 3 2 5 7 6 13 15 14 8 9 11 10 AD BC CD Minimum SOP expression is