4-5 Karnaugh Map Method A graphical method of simplifying logic equations or truth tables. Also called a K map. Theoretically can be used for any number of input variables, but practically limited to 5 or 6 variables. 109 4-5 Karnaugh Map Method The truth table values are placed in the K map as shown in figure 4-11. Adjacent K map square differ in only one variable both horizontally and vertically. The pattern from top to bottom and left to right must be in the form AB, AB, AB, AB A SOP expression can be obtained by ORing all squares that contain a 1. 110 1
Karnaugh maps and truth tables for (a) two, (b) three, and (c) four variables. The K map shows the output value for each input combination same as truth table. The K map squares are labeled so that horizontally adjacent squares differ only in one variable. Think of the table as top being wrapped around to touch the bottom, same for left and right columns. Top-to-bottom labeling: AB, AB, AB, AB, same for left to-right. SoP by ORing squares that has a 1. 111 4-5 Karnaugh Map Method - Looping Looping adjacent groups of 2, 4, or 8 1s will result in further simplification. When the largest possible groups have been looped, only the common terms are placed in the final expression. Looping may also be wrapped between top, bottom, and sides. 112 2
Examples of looping pairs of adjacent two 1s (pairs). Looping: combining the squares that contain 1s to simplify the circuit. Looping Groups of Two: Figure (a) two terms has A in both normal and complement form while B & C remain unchanged, X = BC. Same principle applies to figure (b), ( c), and (d). Looping a pair of adjacent 1s in a K map eliminates the variable that appears in complemented and un-complemented form. 113 Examples of looping groups of fours 1s (quads). Looping Groups of Four: a group of four squares adjacent containing 1s. Figure (a) four terms has 1 adjacent vertically, when grouped, the resultant contains only the variable that do not change, in this case x=c. Same principle applies to figure (b), ( c), (d), and (e). Looping a quad of adjacent 1s in a K map eliminates the two variables that appear in both complemented and un-complemented form. 114 3
Examples of looping groups of eight 1s (octets). Looping Groups of eight: a group of eight squares adjacent containing 1s. Figure (a) eight terms has 1, when grouped, the resultant contains only the variable that do not change, in this case x=b. Same principle applies to figure (b), ( c), (d), and (e). Looping an octet of adjacent 1s in a K map eliminates the three variables that appear in both complemented and un-complemented form. 115 4-5 Karnaugh Map Method Complete K map simplification process When a variable appears in both complemented and un- complemented form within a loop, that variable is eliminated from the expression. Variables that are the same for all squares of the loop must appear in the final expression. A larger loop of 1s eliminates more variables, loop of two eliminates 1, loop of 4 eliminates 2, loop of 8 eliminates 3 variables. K-Map process to simplify a Boolean expression: Construct the K map, place 1s as indicated in the truth table. Loop 1s that are not adjacent to any other 1s. Loop 1s that are in pairs, only adjacent to only one other 1. Loop 1s in octets even if they have already been looped. Loop quads that have one or more 1s not already looped. Loop any pairs necessary to include 1 st not already looped. Form the OR sum of terms generated by each loop. 116 4
Examples 4-10 to 4-12 Assuming K map was obtained from problem truth table Figure (a) Square 4, group of 11, 15, group of 6,7,10,11. Figure (b): (3,7), (5,6,9,10), (5,6,7,8) Figure (c): (9,10), (2,6), (7,8), (11,15) 117 The same K map with two equally good solutions. Both expressions are of the same complexity, so neither is better than the other 118 5