Karnaugh Maps Objectives For Karnaugh Maps of up to 5 variables Plot a function from algebraic, minterm or maxterm form Obtain minimum Sum of Products and Product of Sums Understand the relationship between the map and algebraic operations Handle don t cares using Karnaugh maps Determine the Prime Implicants
What are Karnaugh Maps? A simpler way to handle most (but not all) jobs of manipulating logic functions. The map is a diagram made up of squares, each small square represents a minterm. Any function is made up of minterms and can be represented on the map. Adjacent minterms can be combined to form simpler terms. Karnaugh Map Advantages Can be done more systematically Much simpler to find minimum solutions Easier to see what is happening
2 Variable Karnaugh Map B B A A A=, B= A B A=, B= A=, B= A=, B= A B F = A B + AB F = B A B F B B A B = A = or A
3 Variable Karnaugh Map Note the order of the B C variables: BC A A B C = A B C =
3 Variable Karnaugh Map A B C F BC A BC A =, B =, C = don t care A A =, C =, B = don t care F = AC + A B
Minterm Expression to Karnaugh Map BC A 3 2 4 5 7 6 Each minterm corresponds to a location on the Karnaugh Map m m 7
Minterm Expression to Karnaugh Map F (A,B,C) = m (, 4, 5, 6 ) BC A Remaining maps spaces are.
Maxterm Expression to Karnaugh Map Each maxterm in the expression corresponds to a on the Karnaugh Map M M 7 BC A 3 2 4 5 7 6
Maxterm Expression to Karnaugh Map F (A,B,C) = M(2, 3, 4 ) BC A 3 2 4 5 7 6 Remaining maps spaces are
Adjacent Spaces BC A A'B'C Adjacent spaces on the map differ by complementing exactly one variable. AB'C' AB'C ABC BC A Note that the map wraps around so edge spaces are also adjacent. AB'C' ABC'
Combining Terms Adjacent spaces can be combined using: XY + XY = X BC A A'B'C AB'C' AB'C ABC' A B C + AB C = B C AB C + ABC = AC
Combining Terms Adjacent spaces can be combined using: XY + XY = X BC A A'B'C' A'B'C AB'C' AB'C A B C + AB C + A B C + AB C B C (A + A ) + B C (A + A ) B (C + C ) B
Boolean Algebra to Karnaugh Map bc a Plot: ab c + bc + a
Mapping Sum of Product Terms The 3 variable map has 8 possible terms with 3 literals The 3 variable map has 2 possible terms with 2 literals The 3 variable map has 6 possible terms with literal X X X X X Y Z Y Z Y Z Y Z Y Z X X Y Z Y Z XY Z etc. X X Z
4 Variable Karnaugh Map YZ WX W X Y Z = WXY Z The map of four variables is shown beside. It consists of sixteen small squares, arranged as a 4 x 4 small squares. Each small square represents one minterm. Each minterm has four neighboring (or adjacent) minterms. The map minimization of four variable functions depends on combining adjacent squares. The combination of adjacent squares help in the simplification of the functions. One square represents minterm (4 literals). Two adjacent squares represent a term with three literals. Four adjacent squares represent a term of two literals. Eight adjacent squares represent a term of one literal. Sixteen adjacent squares represent the function (F = )
Boolean Algebra to Karnaugh Map Plot: A B + BD + AB C D + B CD CD AB
Karnaugh Map to Boolean Algebra (Simplification) Plot: A B + BD + AB C D + B CD Generate: A B + CD + AD CD AB
Complement Functions The Complement of a Karnaugh Map is formed by inverting every location. NP LM F F NP LM
Finding a Function Through Product of Sums Sometimes it is easier to plot the Product of Sums: F = MN P + LM NP NP LM F = (M + N + P) (L + M + N + P )
Karnaugh Map with Don t Care Values When we design combinational logic circuits, we sometimes encounter situations where combinations of the input variables will never occur. In such cases, we can assume that these conditions can take on the value or, whichever going to give us a simpler expression. These conditions are indicated by letter X or D. Simplify: F (A,B,C,D) = m (, 5, 6,,, 4 ) + d (, 7, 9, 5 ) = AC + BC + A C D CD AB X 3 2 X 4 5 7 6 2 3 5 4 X X 8 9
Minimum Sum of Products A minimum sum of products is a sum of products expression which has a minimum number of terms has a minimum number of literals for all expressions with a minimum number of terms Minimum CD AB CD AB F = CD + AD + BC F = CD + AD + A BCD
Minimum Product of Sums A minimum product of sums is a product of sums expression which has a minimum number of products has a minimum number of literals for all expressions with a minimum number of products F = (A + B) (B + C) (A + D) F = (A + B) (B + C) (A + D) (B + D)
Prime Implicants A group of s which are adjacent and can be combined on a Karnaugh Map is called an implicant. If it can not be combined with another term to eliminate a variable, it is called a prime implicant. A minimum sum of products will contain only prime implicants. Not all prime implicants are needed in a minimum sum of products CD AB A B CD AC D ABC D Prime Implicants AB D AB Prime Implicants AB C B CD Prime Implicants
Prime Implicants This function has exactly 4 prime implicants CD AB Only 3 are needed in the minimum sum of products BC C D F = BC + ABD + B D ABD B D
Essential Prime Implicants An essential prime implicant is one which covers a minterm NOT covered by any other prime implicant. All essential prime implicants are part of the minimum sum of products. BC is an essential prime implicant since it is the only one which covers A BC D C D is not an essential prime implicant since the minterms it covers are covered by other prime implicants BC C D CD AB ABD B D
Finding the Minimum Sum of Products. Find each essential prime implicant and include it in the solution. 2. Determine if any minterms are not yet covered. 3. Pick a prime implicant which covers it. 4. Continue until all minterm are covered. 5. Return to step 3 and check other combinations of (non-essential) prime implicants to find the minimum set.
Find the Minimum Sum of Products. Find all the prime implicants CD AB 3. Select a set of non-essential prime implicants which covers all minterms F = BC + B C + AB OR F = BC + B C + AC 2. Find all the essential prime implicants F = BC + B C +... CD AB CD AB
5 Variable Karnaugh Map D E D E B C B C 3 2 6 7 9 8 4 5 7 6 2 2 23 22 2 3 5 4 28 29 3 3 8 9 24 25 27 26 A = A = AB CDE A BC D E Choice of variable A allows easier ordering of minterms
5 Variable Karnaugh Map C D C D A B A B 2 6 4 3 7 5 8 E = E = Choice of variable E is harder; other choices are worse
5 Variable Karnaugh Map Find the minimum sum-of-products for: H(A,B,C,D,E) = m (,2,3,7,8-,3,4,6,23,24,27,28) + B C D E D E B C X X X A = A =. Find prime implicants of size 6 2. Find prime implicants of size 8 3. Find prime implicants of size 4 4. Find prime implicants of size 2 d (, 6, 22) A C A DE A B D C D E A BD E ABD E AB CE B CDE BC DE
Summary For Karnaugh Maps of up to 5 variables Plot a function from algebraic, minterm or maxterm form Determine the Prime Implicants Obtain minimum Sum of Products and Product of Sums Understand the relationship between the map and algebraic operations Handle don t cares using Karnaugh maps