Download as pdf
Download as pdf
You are on page 1of 35
CHAPTER 6 KARNAUGH MAP In Chapter 4, we have seen that logical or Boolean expressions can be written preferably in Sum of Product form (SOP) or Product of Sum form (POS). The expressions are simplified (reduced) and then implemented using a logic circuit. For simplifying Boolean expressions, understanding of Boolean algebra is necessary. The laws and rules of Boolean algebra and simplification of Boolean expressions were introduced in Chapter-5. An alternative and more elegant way of simplifying Boolean expressions is called Karnaugh map (K map) method. In this chapter, 2 to 5 variable maps are discussed with a number of examples. We will be studying this chapter under the following headings. 6.4 Minterms and Maxterms 6.2 Relationship between K map and truth table 63 2-variable K map using minterms 6.4 3-variable K map using minterms 65 4-variable K map using minterms 6.6 Don't care conditions 67 5-variable K map using minterms 6.8 K map using maxterms MINTERMS AND MAXTERMS A logical expression can be given in Sum of Product (SOP) form or Product of Sum (POS) form. SOP and POS were introduced in Chapter- 4, Sec 4.5 and 4.6. For the sake of continuity, we will review them once again and introduce the idea of minterms and maxterms. In the s.udy of K map, we will be repeatedly using these two. Minterms are associated with SOP and maxterms are associated with POS. Let us consider them one by ‘one, MINTERM: Lot us take an expression of threo variables, F(A, B,C) = AB + ABC In this expression, the first form contains two variables A and B in the complement form, The first term 16 @ product. The second term contains all the three variables, A ang 8 in the normal form and C in its complement form. This type of product where all the three variables are present is called standard product or fundamental product. The standarg product or fundamental product is also called as minterm and is represented by ‘m’. The second term ABG is a minterm or standard product, where as AB is just a product. For any minterm, the standard product should produce a logical 1. The minterm ABC gives a 1 when A= 1,B = 1 and C =1 i e, C = 0). Since ABC = (110), = 6, this minterm is designated as Mm, if each term in the above SOP expression is made up of three variebles (in the normal or complemented form), then such an expression will be called standard SOP. In the expression we have taken, only the second term has three literals where as the first term has only two. Therefore, this expression is said to be in SOP form but not in standard SOP form. ‘ For three variables there will be eight standard products or eight minterms. As usual let us take the input variables as A, B and C. py iienA = 0,B=OandC id represented as mo. 0, the fundamental product or minterm is written as 1, the fundamental product or minterm is written as for 000 = 0 for 001 = 1 for 010 = 2 for 011 =3 for 100 = 4 for 101 = 5 for 110 =6 for111=7 Table 6.1 If only two variables A and B are used, then there will be four minterms as shown in Table 6.2. for 00 =0 for01=1 for 10=2 for11=3 Table 6.2 : In a similar way, for four variables A, B, C and D there will be sixteen minterms, m, to ™m,,.A BC D represents minterm m, and ABCD represents minterm m,,. "When a SOP Boolean expression has to be simplified using K map, then we must "Convert the equation to standard SOP or a collection of minterms. et Consider the expression once again. F(A,B,C) = AB+ABC. The given expression can be converted into standard SOP by modifying the equation in such a way that each term in the modified expression contains three variables. The required steps are given below. The variable C is missing in the first term. Since © +C) = 1, logical multiplication of the first term with (C+ C) does not affect the value of the expression. Therefore the modifieg expression is, F(A, B, C) B(C+C) + ABC " pl Fl BC+ABC+ABC Now, each term in this expression contains all the three variables and hence the SOP is called standard SOP. The expression can also be written as, F(A, B,C) = m,+m,+m, = ‘Sum of the minterms (m, , m, . m,) OR F(A, B,C) = © (0, 1,6) where the symbol sigma, © is used to indicate ‘sum of Here the minterms are given by their decimal numbers. Example 6.1 Convert the logical function of three variables, F(A, B, C) = A + BC to standard SOP expression (i.e., sum of minterms). Solution: The first term is multiplied by (B + B)(C + C) and the second term is multiplied bf (A+A). , F(A, B, C) " A(B + B)(C +C) + BC(A +A) (AB + AB)(C + C) + ABC + ABC AB C + ABC +ABC + ABC + ABC +ABC ty The term ABC appears twice and one of them can be removed. Therefore the standard SOP is, F(A,B,C) = ABC+ ABC +ABC + ABC + ABC » This expression is to be presented as it is without simplification. This expression can also be given as, F(A, B,C) = m, +m, +m, +m, +m, = m,+m,+m,+m,+m, Sum of the minterms (m,,m,, m,, m, , m,) z (3,4,5,6,7) MAXTERM: Justas a minterm represents a standard product, a maxterm represents a standard sum. Let us take an expression of three variables. F(A, B,C) = (A+B)(A+B+C) Here the second term contains all the three variables, A and B in the normal form and C in its complement form. This type of sum is called standard sum or fundamental sum. The standard sum or fundamental sum is also called as maxterm and designated as M. In the expression given above (A + B + C) is a maxterm or standard sum where as (A+B)is just a sum. For any maxterm, the standard sum should produce a logical 0. The maxterm (A+B+C) gives a 0 whenA=0,B=0andC=0/(ie.,,C=1). Since (A + B + C) means A = 0, B = 0 and C = 1, this maxterm is designated as M, If each term in the POS expression is made up of three variables (in the normal or omplemented form), then such an expression will be called standard POS. Sas For three variables there will be eight standard sums or eight maxterms. They As listed in the Table 6.3. AB e | Term [ Designation for 000 = 0 for 001 = 1 for 010 =2 for 014 =3 for 100 = 4 for 101 =5 for 110 =6 for 111=7 Table 6.3 Similarly for two variables there will be four maxterms and for four variables there will be sixteen maxterms. When a POS Boolean expression has to be simplified using K map then we must convert the equation to standard POS or a collection “of maxterms. Let us convert the expression we have taken to standard POS form. In the expression, © > F(A, B,C) = (A+B)\(A+B+C) the second term is already a maxterm. The first term which contains only two variables _ has to be converted into a maxterm. \ a The variable C is missing in the first term. Since EC = 0, logical summing of the first term with GC does not affect the value of the expression. Therefore the modified expression is, F(A,B,C) = (A+B+CcyA+B+C) 5 (A+B +C)(A+B+C)(A+B+C) Now, each term in this expression contains all the three variables and hence the POS js called standard POS. The expression can also be written as, F(A,B,C) = MMM, Product of the maxterms(M,, M,, M,) OR F(A, B,C) = 1 (1, 6,7) where the symbol pi, 7C is used'to indicate ‘product of Here the maxterms are given by their decimal numbers. Example 6.2 Convert the logical function of three variables, F(A, B, C) = A + BC to standard POS expression ( i.e., product of maxterms). Solution: F(A, B,C) = A+B8C (A+ B)(A+C) ; Rule 8a, Chapter-5 " Both the terms have only two variables each. The first term does not have the variable C and the second term does not have the variable B. Since GC = 0 and BB = 0, we can add CC to the first term and BB to the second term. Therefore, - F(A, B,C) = (A+B+CC)(A+BB+C) = (A+B +C)(A+B+C)(A+B+C)(A+B+C) There are two (A + B + C) terms and one is enough since A. A = 4, F(A, B,C) = (A+B +C)(A+B+C)(A+B+C) = MMM, Product of maxterms (M,.M,.M,) " 1 (0, 1, 2) Note: As already mentioned in Chapter 4, Sec 4.6, Boolean functions expressed as a sum of minterms or product of maxterms are said to be in canonical form. Conversion between canonical forms: Examples 6.1 and 6.2 shows how a given expression can be converted into SOP or POS canonical form. For Examples 6.1 and 6.2, we have taken the same function namely, F(A, B,C) = A+BC Example 6.1 gives the sum of minterms as 5 (3, 4, 5, 6, 7) and Example 6.2 gives the product of maxterms as 7 (0, 1, 2). It is a simple example to show that a given expression can be converted to sum of minterms or product of maxterms. From truth table to canonical forms: Let us consider a truth table of three variables, as given in Table 6.4. A sum of minterms expression can be formed by selecting the minterms for each combination of variables which produces a 1 in the function. From the Table 6.4, we find that F = 1, when A,B,C combination is 000, 010, 011,101 and 110. In terms of minterms, >I F = ABC+ABC+ABC + ABC +ABC F = ¥(0,2.3,5, 6) There are five 1's and three 0's in the truth table. Collecting the minterms for which F = 0 orF=1 F = ABC+ABC+ABC Bc\|F | ar i) 0 1]0 40 | a4 4 0 ojo o1|4 1 0|14 Poteet leo Table 6.4 Taking complement on both sides and using DeMorgan's theorems en Coan CEA ABC+ABC+ABC F = ABC.ABC.ABC = (A+B+C)\A+B8+C\A+B+0) = (A+B+C\A+B+C)A+B+C) = 7 (1,4, 7) We can see that a function expressed as a sum of minterms can be converted into function expressed as a product of maxterms simply by i) changing the symbols © and TT, ii) listing those numbers missing from the original form. Let us consider two more examples. If, F (A,B, C) > (1,3,4,7) F (A, B, C) 1 (0,2,5,6) then S_- © similarly If FIA,B)G, 0): = 210, 1,9, 6,7, 8, 8/10, 121.15) then F(A, B, ©, D) = 11 (2,4,5, 11, 13, 14) Now that we know how to convert a given expression or truth table as a sum of minterms or a product of maxterms, we can proceed with simplification of Boolean functions using a method called Karnaugh mapping. The K map can be used to give the simplified result in SOP form or POS form. To start with let us use the minterms in the K map and simplify. Later towards the end, we will learn to use the maxterms and simplify. 6.2 RELATIONSHIP BETWEEN K- MAP AND TRUTH TABLE The Karnaugh map is a two dimensional representation of a truth table. It can be rectangular or square in shape and is divided into number of square cells. The number of Cells in a map depends on the number of variables. For ‘n’ variables, the map will have 2” cells. That is, a 2-variable K map has 4 cells, 3 variable K map has 8 cells, a 4 variable map has 16 cells etc. For each minterm there is a specific cell in the K map. Let us take 2 variables as A and B. These variables take four possible values, 00, 01, 10 and 11. They correspond to the minterms A B, A B, AB and AB or m,, m,,m, and m, respectively. It is useful (as we proceed further) to note the number of the minterm in ‘one corner of the cell. This 2 variable K map with cell numbers and minterms are shown in Fig 6.1a and 6.1b. w Diet xe ‘On. 4 0 0| AB | AB a : o 1 1 4| AB | AB ‘ 2 2 3 Fig 6.1a Fig 6.1b The cell numbered '0' represents minterm m, and A = 0 and B = 0. The cell numbered '1' represents minterm m, and A = 0 and B = 1. The cell numbered '2' represents minterm m, and A = 1 and B = 0, The cell numbered ‘3’ represents minterm m, and A = 1 and B = 1. Now let us take a 2 variable truth table and fill the corresponding K map as shown in Fig 6.2a and 6.2b. reo Orr Om 0) Ep me 411 1 +e Fig 6.2a Fig 6.26 | With reference to the truth table, j Y= when A= 1 and B = 0 and this corresponds to the minterm AB or m, Therefore i in the K map, the cell representing m, ( numbered 2) is filled with a 1. Y= 1 when A = 1 and B = 1 and this corresponds to the minterm AB or m, Therefore in the K map, the cell representing m, ( numbered 3) is filled with a 1. The remaining two cells are filled with ‘0's. We have to use the 1's for simplification, fan expression is given as Y = © (2, 3), then also the K map is the same as Fig: 6.2b. Let us take one more truth table, Fig. 6.3a and fill one more K map, Fig. 6.3b. peo Oo; 1 0 ° 1 ‘ Th 0 2 3 Fig. 6.3b A ‘1’ is filled for cells corresponding to minterms mo and mz and the remaining og are filled with 0's. ‘ We get the same map for the expression , Y = © (0, 2). A three variable K map has eight cells representing minterms m, fo m,. Let us take the three variables as A, B and C. The binary combination for A is taken as 0 and 1. Fo BC there are four possible binary combinations, 00, 01, 10 and 11. But instead of Using normal binary progression, Gray code format is used. That is the BC combination is take, as 00, 01, 11 and 10. This is done so that when we go from one cell to the next cell (along the horizontal or vertical direction) there is only one change in the binary combination For example: From 01 to 11 in Gray code — one change From 01 to 10 in binary — two changes This arrangement is purposely done so that grouping of cells is possible during K map simplification. A 3 variable K map is shown in Fig. 6.4a. We can also draw the map as shown in 6.4b where AB takes values as 00, 01, 11 and 10 and C takes the values as 0 and 1. Aon Ose el BC ABC| AB pedoulo1 11°" 10 00; /ABGH ARG! 9 | ABC| ABc | ABc ABC 01 |ABG| Asc of * 4} a} _2 als 4 | ABG| ABC | ABC ABC 44 |ABG | ABC ol alae 40 |ABC ABC aj Fig. 64a Fig. 6.4b We will be following the K map given in Fig. 6.4a for 3 variables, KARNAUGH MAP. rae IE Let us take 3 variable truth table (Table 6.5). We have come across the same truth table in Example 4.5 and in the discussion about SOP in Section 4.5. Table 6.5 To fill the K map, we have to collect the minterms for which the output Y equals 1. ~ Y= 1 when A= 0, B= 0 and C = 1 and the minterm is AB C = m, Y= 1 when A = 1, B = 0 and C = 1 and the minterm is ABC = m, Y= 1 when A = 1, B= 1 and C = 0 and the minterm is ABC = m, Y =1 when A=1,B=1andC=1 andthe mintermisABC = m, The above truth table can also be represented by the expression in terms of sum of minterms as, Vie F(A, B, C)= ABC +ABC + ABC + ABC Or Y = F(A,B,C)=2 (1,5, 6, 7) Therefore a ‘1’ is entered in the cells with minterm numbers 1, 5, 6, and 7. The remaining cells are filled with O's. S Camm nncc ren, The 3 variable K map for the above truth table is shown in Fig. 6.5. BC AX 0004 11 10 Fig. 6.5. In Example 5.2, we have taken the same equation as given above and shown that the equation can be reduced to AB + BC. A similar simplification can also be obtained using K map. The method of simplification with K map will be discussed in the sections that follow, A four variable K map has sixteen cells representing minterms m, to m,,. Let us take the three variables as A, B, C and D. The binary combination for AB and CD are taken as 00, 01, 11 and 10. As mentioned already it is a Gray code format and is done so that when we go from one cell to the next cell (along the horizontal or vertical direction) there is only one change in the binary combination: A 4 variable map is-shown in Fig. 6.6. CD AB OD Ose 131.0) 00 | ABéD| ABE} ABCD] ABcd| fn | 2| 01 | ABCD] ABéD} ABco} ABcd} | =. s x | 41 | A8CO} ABCD} ABcD} aBcol ii 43) 4 4] | 40 | Alc] Ao] Aco] aacal ‘ eC aon When a problem or expression is given as , F(A. B,C, D) = Z (0, 1,4, 6, 7, 8,9, 10; 11, 15), then the required K map will be as shown in Fig. 6.7. cD AB\ “00 01 1110 ye 00; 1 il 0 0 yl 01; 1 0 i} f Aik arate 11.| 70 0 1 0 a asl gl 40| 1 1 1 1 dd | id Fig..6.7 ‘As before, a 1 is entered:in cells with minterm-numbers 0, 1, 4, 6, 7, 8, 9, 10, 11, 15 and the remaining cells are filled with 0's. A five variable K map is discussed in a later section. 6.3 2-VARIABLE K MAP USING MINTERMS To start with, let us take 2 variable K map examples and learn how to get simplified expressions. Let us take the truth table given in Fig. 6.2a and the corresponding K map shown in Fig..6.2b. peo 4 0| 0 | 0 ora. ACs lead |e Fig. 6.2a Fig. 6.2b From the truth table, we can write the SOP expression as, F(AB) = AB+AB Using basic Boolean rules, F(A,B) = A(B+B) = At =A Let us see how we get this simplification using K map. When a K map contains two 1's that are horizontally adjacent or vertically adjacent then these two 1's form a pair. The two 1's correspond to the minterms AB and AB. This Pair is encircled to indicate that they can give a reduced expression. The K map with €ncircled pair is shown in Fig. 6.8. The pair of 1's cover the minterms m, and Bo 1 ™, or AB and AB. This gets reduced to A as ol o lo shown above. But in K map we get the 0 4 reduced expression by simply examining the 1; TD) map (not using Boolean rules for each step). To Go that we can follow a simple procedure. Move from cell 2 to cell 3. For both the cells the variable A is common with a value A = 1. Fig.6.8 But we find that when we move from cell 2 to cell 3 the variable B is changing from B to B. The variable that changes is eliminated. Therefore the simplified result from K map is, F(A.B) = A Let us take one more expression in 2 variables. F(AB) = AB+AB This corresponds to the minterms m, and m,. Using Boolean laws the expression reduces toB(A+A)=B - daz he K map fe i tr ip for the expression is the Same as shown in Fig. 6.3b, There is a pair formed by minterms m, and m,. This is shown in Fig. 6.9, In this case the pair of 1's cover the minterms m, and m, or AB and AB. This gets reduced to B because A B + AB = B by Boolean rules. By using K map, when we move from cell 0 to cell 2 the variable A is changing from A to A. The variable that changes is ano eliminated. The variable B remains unchanged for both the cells with a value B=0. Therefore the simplified result from K map is, F(AB) = B As a third example, let us take the truth table shown in Fig. 6.10. A glance at the truth table tells us that it is the truth table for an OR gate which gives the expression , Y = A+B We can also arrive at the same ‘expression treating this table just as any other table. The SOP expression is, y = AB+AB+AB We can simplify this expression and show that Y = A + B. We have, Y = AB+AB+AB = AB+A(B +B) = AB+A jforB+B=1 = A+AB SSA +B iforA+AB=A+B, Rule 7a, Let us try this simplification using K map. For the given truth table a 2 variable K map is constructed as shown in Fig. 6.11.-A ‘1’ is entered for the cells 1,2 and 3. A ‘0’ is entered for the cell-0. Going by the previous examples, a pair can be formed encircling the 1’s in cells 2. and 3 or celis 1 and 3. Let us take the pair from cells 2 and 3. This leaves a single 1 in cell 1. Fig. 6.11 The minterm for the cell 1 = AB For the pair, when we move from cell 2 to cell 3, we find that the variable A remains unchanged with-A-= 1. The variable B changes from B to B and hence eliminated. The reduced expression for the pair is A. The final expression will be a SOP of two:terms, the first term due to minterm, m, and the second one due to the pair. ie, Y = AB+A A+AB 0 Using Rule 7a, Y can be reduced to A + B. KARNAUGH MAP 151 But the final simplified expression must be obtained directly from the K map with out resorting to Boolean algebra. Therefore, there must be some improvement, we can make to the procedure we have adopted. The modification is shown in the new K map given in Fig. 6.12. In this map the ‘1’ in cell 1 is paired with the 1 in cell 3. The 1’s in cell 2 and cell 3 are already paired. It means that the 1 in cell 3 helps to form a pair with cell 1 and cell 2. This type of grouping is known as overlapping of groups. Overlapping of groups is allowed in Fig. 6.12 K map simplification. With two pairs, we can get the final simplified expression. For the pair of cell 2 and cell 3, A is constant with 1 where as B changes from 0 to 1 and B is eliminated. For the pair of cell 1 and cell 3, B remains constant with 1 where as A changes from 0 to 1 and A is eliminated. The final expression is the SOP of the resultant terms from the two. pairs. Therefore, Y = A+B 64 3-VARIABLE K MAP USING MINTERMS We have seen how to construct a 3 variable K map and its relationship with the 3 variable truth table. We will take some simple examples to understand the groupings and simplifications of a 3 variable K map. Let us a draw a map for the expression, Fe Beceem (0; 1..6, 7) As explained above a ‘1’ is entered in minterm cells numbered 0, 1, 6 and 7. eee ers eo The remaining cells are filled with 0's. The map is given in Fig. 6.13. ni ely ty By examining the map, We can see that BC the 1's in cell 0 and cell 1 can be grouped as R 00550) wallet a pair, Let us represent the pair as P,(0, 1) 0 indicating that this pair is formed using minterms m, and m,. Similarly, the 1's in cell 4 6 and cell 7 form a pair: Let us call this pair ae Fig. 6.13 For the pair P, (0, 1), the variable A = 0 for both the cells and taken as A the variable B = 0 for buth the cells and taken as B the variable C changes from 0 to 1 when we move from cell 0 to cell 1 and is eliminated. Therefore, the reduced product term for P, (0, 1) is AB: For the pair P, (6, 7), the variable A = 1 for both the cells and taken as A fs he variable B = 1 for both the cells and taken as B ean 5 the variable C changes from 1 to 0 when we move from cell 7 to cell 6 andis inated. ; e, the reduced product term for P, (6, 7) is AB. final reduced expression for the K map is the SOP of the two reduced terms. FAB) = AB+AB OO Le Let us take one more éxample to introduce a new point in grouping. F(A.B.C) = ¥ (0, 2, 5,7) The corresponding K map will be as shown in Fig. 6.14. The 1's in cell S and cell 7 form a pair. For this pair, the variables with A=1 and C=1 remain unchanged whereas B changes from 0 to 1 and gets eliminated. Therefore, the product obtained for the pair BC pair is AC. There is a 1 in cell 0 Corresponding to 074) 0 0 ae the minterm ABC and a 1 in cell 2 ; Gam ; corresponding to the minterm ABC. Therefore dea 4 ! 3 4 7 9 | when cell 0 and cell 2 are paired only the variable B changes from 0 to 1 and can be Fig. 6.14 eliminated. Hence though these two cells are not adjacent , they form a pair by a process is called folding or rolling the map. That is, when the map is folded, the cells 0 and 2 become adjacent. The first pair P,(5,7) gives the product as AC. The second pair P,(0,2) gives the product AC. The final reduced expression is F(A, B,C) = AC+AC In grouping the 1's, our aim must be to form minimum number of groups for the 1's and not forming as many groups as possible. The following example wil illustrate this point. J a let us draw a K map for the given truth table and then simplify the K map. Let us once again take the tr As discussed earlier, the above (ruth table can also be represented by the expression in terms of sum of minterms 5, F(A, B,C) = ABC +ABC+ABC + ABC Or ‘ SONG): F(A, B, C) The 3 variable K map for the above truth table is given in Fig. 6.5 which is reproduced here with grouping in Fig. 6.13. Here the first pair is formed using cells 1 and 5, say P,(1, 5) which gives the reduced product as BC. The second pair is formed using cells 6 and 7, say P,(6, 7) which gives the reduced product as AB. Therefore the final simplified expression for the truth table is F(A, B,C) = AB+BC and it is the same result we have obtained in Example 5.2 in Chapter 5 using Boolean rules. But while grouping the 1’s, we may get three pairs as shown in Fig. 6.14. . uth table used in Chap! ter 4, Example 4.5 and Seq es Fig. 6.14 gy “ IGH MAP, 155 Here, besides the two pairs, P,(1, 5) and P,(6, 7), there is a third pair P,(5, 7) . For the third pair, the reduced product is AC as B is eliminated, For the three pairs, the final expression is F(A, B,C) = AB+BC+AC But we can prove that, AB+BC+AC = AB+BC (Hint: We have AB + AC + BC = AB + AC ; Rule 9a, Chapter 5) Therefore the third pair formed is not required. Inclusion of this pair provides only a redundant term and should be avoided. Ina three variable K map, while forming groups we have so far formed only pairs. If we are able to group four 1’s together, then the arrangement is called a quad. A quad gives a further reduced expression. Actually, a quad eliminates two variables and their complements. A few quads and their reduced expressions are discussed below. Let F(A,B, C) = © (0, 1, 2, 3) The 3 variable K map for the function is given in Fig. 6.15a. BC PN005 01a We can form two pairs, the first pair G 7 D being m, and m, and the second pair being 0 4 1) | ea | m, and ms, The first pair P,(0.1) gives @ sos lae tones reduced product as AB. The second pair J eae Pp. a reduced product as AB. The gages © Fig. 6.15a final SOP can be written as, _-FIA,B,C) = AB +B x kn this expression can be further simplified as shown. we have, F(A,B,C) = A+B) ek for (B+ B)=4 It means that the two pairs can be combined to form a single group called a quad. Let us represent the quad as Q (0, 1, 2, 3). The K map with this quad is shown in Fig. 6.15b. For all the four cells only the vartable A ‘remains unchanged with A = 0. When we from cell 0 to cell 2 from left to right, the variables B and C change at least hence both B and C are eliminated. fore the quad gives the reduced ion as A. Therefore, F(A,B,C)= A - 6.16 shows a K map with a quad of minterms m,, m,, m, and m,. 4, Q (4, 5, 6, 7) gives the a \GH MAP. 157 ~y. ~ 8 shows a K map with a quad BC comprising of minterms m,,m,,m, and m,. Av 00 01 11 10 The quad is formed by folding the pair 0 1 No 4 a : (mm, ) with the pair (m,, m,). The quad, 1 4) On| eOneyt Q (0, 1, 4, §) gives the reduced expression "Lau. 4 aa Fig. 6.18 We can simplify Boolean expressions using a 3-variable K map, by forming pairs and quads as explained in this section. Let us solve some problems based on the above discussions. The steps are straightforward. i) Draw the K map and number the minterm cells. ii) _Fill the map with 1’s and 0's. if) Group the 1's as quads and pairs, starting from bigger group. iv) _ Allow the groups to overlap, if necessary. | v) _ Avoid redundant groups. vi) Fold or roll the map if necessary to get bigger group. Example 6.3 Simplify using K map. Y = F(A, B, C)= (1,6, 7) Example 6.4 ; ay 3, 5,7, Sima uenaeneR RFID Berea, Solution: The 3-Variable K map for the problem 's BC shown in Fig. 6.20. N 00. 01. 11) ig Minterms m,, m,, m, and m, form a quad. ol o | | @i> . 9 4 3] For the quad Q (1, 3, 5, 7), the reduced A ‘| Fi 4 expression is C. | 4 [see Q i tl Minterms m, and m, form a pair. For the Fig. 6.20 pair P(2, 3), the reduced expression is AB. The pair and the quad overlap and it is allowed. Therefore the final expression is Y =F(A,B,C) = C +AB Example 6.5 Y = F(A,B,C)= (1,3, 4,5, 6, 7) Simplify using K map: Solution: The 3-variable K map for the problem is shown in Fig. 6.21. Minterms m,,m,,m, and m, form a quad. 7), the variables A For the quad Q,(1, 3, 5: and B change and are eliminated. The variable C remains unchanged and gives the reduced expression as Cc, Fig. 6.21 - KARNAUGH MAP 159 wanna $a Minterms m,, m,, m,, and m, form a second quad. For this quad Q, (4, 5, 6, 7), he variables B and C change and are eliminated, The variable A remains unchanged and gives the reduced expression as A, The two quads overlap and overlapping is allowed. Therefore the final expression is Y = F(A,B,C) = A+C Example 6.6 Simplify using K map: Y = F(A, B,C) = © (0,2,4,6,7) ‘Solution: The 3-variable K map for the problem is shown in Fig. 6.22. Minterms m,, m,, m, and m, form a quad by folding. For the quad Q (0, 2, 4, 6), the reduced expression is C. Minterms m, and m, form a pair. For the pair P(6, 7), the reduced expression is AB. The pair and quad overlap and is allowed. Therefore the final expression is Y =F(A,B,C) = C +AB 6.5 4-VARIABLE K MAP USING MINTERMS Fig. 6.22 The construction of a 4-variable K map has already been discussed in Sec.4.2 of this chapter. There will be sixteen cells corresponding to the minterms m, to m,,. Let us take the four variables as A, B, C and D. In 3-variable K map, the 1's in the K map can be ‘grouped in pairs or quads, With sixteen cells in the 4-variable K map besides the pairs and quads a bigger group called octet can be formed. An octet is group with eight 1's. An octet eliminates three variables and their complements. Let us represent an octet ae 0 (cell numbers). 160 1u| Three K maps with different octet grouP 1 low. and the simplified expression Is shown bé i t Fig, 6.23 shows a K map with an octet comprising of minterms m,, ™,, MMs Myr ms, m, and m,. The octet, O (0, 1, 2, 3, 4, 5, 6, 7) gives the reduced expression as A. Fig. 6.24 shows a K map with a octet ‘comprising of minterms m,, m,,m,,m,, M,,M,, m,, and m,,. The octet, O (0, 1, 4, 5, 8, 9, 12, 13) gives the reduced expression as C. Fig. 6.25 shows a K map with an octet ‘and f Mo Mas Me My My My, a KARNAUGH MAP, 164 in Fig. 6.26, we have a new arrangement We a1’ is placed in each corner of the map. AB O05.01) [eid tough they appear as single 1's, by folding gg 0 Gy the map along the Y-Y axis, minterms m, and 1 an, form a pair and minterms m, and m,, form ayy Desh Qui nei re 2g x a pair. By folding the map once again along 4 4 oto 0 the XX axis, the four minterms m,, m,, m, and Ss m, form a quad. This quad Q (0, 2,8, 10) 10 Cy 0 1h of gives the reduced expression BD. Fig. 6.26 As we have done for the 3-variable K map, we can take some 4-variable K map problems and simplify. In 4-variable K map the grouping can be pairs, quads or octets. Also there is a possibility of a quad by double folding. Example 6.7 Simplify using K map: Y = F(A, B, C, D) = © (2, 3, 12, 13, 14, 15). Solution: The K map with the groupings is shown in Fig. 6.27. Mya» The minterms m,,, 2 quad. It eliminates the variables C and D and their complements. The reduced ©xpression for this quad is AB. m,, and m,, form The minterms m, and m, form a pair which eliminates the variable D and its ‘Somplement, The reduced expression for the Pair is ABC, The final simplification is Y =F(A,B,C,D) = AB+ABC ai 10 Ee | Te tala 0 0 oj} 0 dl ad Fig. 6.27 Example 6.8 =F (0, 1,24, 5, 10, 11, 14, 15), Simplify using K map: Y = F(A, B, C, D) = 200, Solution: The K map with the groupings is shown cD in Fig. 6.28a and Fig. 6.28b. AB We have two quads and a pair. 00 The first quad Q, (0, 1, 4, 5) gives the 01 reduced expression AC. The second quad Q,(10, 11, 14, 15) 11 gives the reduced expression AC. 10 The minterm m, can form a pair with m, or m,. Our aim is to group the 1 of m,. It can be grouped either with m, or m,, . But we have to take only one of them, for we want only lesser number of groups. The second group will be redundant. CD The pair P (2, 10) gives the reduced AB 00014 11 10 expression BCD. Fig. 6.28a. The pair P (2, 0) gives the reduced expression ABD. Fig. 6.28b. We have to take only any one of the expression of the pairs. Therefore the final expression is, Y = F(A, B,C,D) = AC+ac+Bcp ae Fig, 6.28b Y = F(A,B,C,D) = AC+ac+An5 ee KARNAUGH MAP example 6.9 163 Simplify using K map: Y = F(A, B, C, D) = ¥ (0, 1, 3, 5, 7, 9, 11, 12, 13, 14, 15). solution: The K map with the groupings is shown in Fig. 6.29. We have an octet, quad and a pair. The octet O (1, 3, 5, 7, 9, 11, 13,15) gives the reduced expression D. The quad Q (12, 13, 14, 15) gives the reduced expression AB. The pair P (0, 1) gives the reduced expression as ABC. Therefore the final expression is, Y = F(A,B,C,D)= D+AB+ABC Example 6.10 Simplify using K map: Y = F(A, B, C, D) = ¥ (0, 2, 5, 7, 8, 10, 13, 15). Solution: The K map with the groupings is shown in Fig. 6.30. We have two quads. The first quad is direct, Q, (5, 7, 13,15) Gives the reduced expression BD. The second quad is by double folding, 2,0, 2, 8, 10) gives the reduced expression 8D. Therefore the final expression is, Y = F(A,B,C,D) = BD+BD apt? 00. 01 11 10 » |eOT A °, or | o}ft} aif 0 44-1 LL 10) -\i22 B : d Fig. 6.29 aps?o0 01 11 10 00 0} 0 Aman 1 0 [ola | 11) 0} | vl o yl vel a 0} 0 o Pelole Fig, 6.30 — le 6. xample 6.11 0, 1, 2,3, 4,6, 8, 9, 10, 14, 12, tay ‘ c,p)= = ( Simplify using K map: ¥ = F(A, B, Solution. eee i The K map with the groupings !S show! cD 00 01. 17m in Fig, 6.31. AB We have two octets. 00 G 11 1 The first octet is formed by two quads ot 1 0 0 Q (0, 4, 2, 3) and Q(8, 9, 10, 11) by rolling 4 q4—4 the map. The reduced expression for this 11 1 (0) 0 octet is B. Es = s Ay): 41) tales The second octet is formed by two quads 10 | Q (0, 4, 8, 12) and Q (2, 6, 10, 14) again by "4 rolling the map. The reduced expression for Fig. 6.31 this octet is B. The final expression is = B+D Example 6.11 Simplify using K map: Y = F(A, B, C, D) = 5 (1,5, 6, 7, 11, 12, 13, 15). Solution: CD The K map with the groupings is shown aa a Oo in two different ways in Fig. 6.32a and 6.32b. 0 According to the K map shown in z Fig. 6.32a, there is a quad and four Pairs, 4 ; F The quad Q (5,7, 13, 15) gives a 1 reduced expression as BD. i 1 a Fig. 6.32a -_ KARNAUGH MAP. 165 The pair P (1, 5) gives ACD, the pair P(6, 7) gives ABC, the pair P (12, 13) gives ABC and the pair P (11, 15) gives ACD. Therefore the final simplified expression is y = BD+ACD +ABC+ABC+ACD But in the K map shown in Fig. 6.32b there are only four pairs and the central quad has been removed. Our aim must be to group 00 | 0 al Oe A 3 all the 1's. Once all the 1's are covered, then 3 01 0 4 4 there is no need to form any extra group. In | J 7 this example, even if it is a quad it is a 11 GE (") 0 redundant group and can be omitted 2 aes ae eee Therefore, taking Fig. 6.32b as the correct 10 | 0 | O UJ 0 map, the final-expression is Y = ACD + ABC + ABC + ACD Fig. 6.32b This expression contains only four terms where as the other expression contains five terms. Note: In all the examples (from 6.3 to 6.11), we have taken the function as a sum of minterms. fa function is not expressed in minterms, then we have to convert the given expression in SOP to standard SOP.or sum of minterms. For example, if an expression is given as F(A,B,C) = A+BC then it can be converted to standard SOP or sum of minterms as F(A, B,C) = ABC + ABC +ABC + ABC + ABC. F(A,B,C) = m,+m,+m,+m,+m, (Refer Example 6.1) z (3, 4, 5, 6, 7) = 168: DIGITAL FUNDAMENTA g Now the problem can be solved by the usual method. Also a problem can be represented by a truth table. The truth table can be converteg into sum of minterms (Refer Sec 6.2) and solved by K map method 6.6 DON'T CARE CONDITIONS So far we have drawn maps filling the minterm cells with either O's or 1's. Then the t's (or 0's) are grouped together in pairs, quads or octets and simplified. But in some digital systems certain input combinations never occur during normal operation. For example, the output of a BCD counter has only ten combinations, 0000 to 1001. The other six combinations, 1010, 1011, 1100, 1101, 1110 and 1111 are invalid BCD combinations and will not appear at the output of a BCD counter. When the output of the BCD counter is given as input to any other digital circuit, the second circuit receives only any one of the ten BCD combinations. The second circuit does not care about the six invalid combinations that never appear at the output. Therefore it is enough if we know the output states (0 or 4) for the first ten combinations and the other six combinations can be taken as don't care condition. The don't care condition can be used in the K map to our convenience to provide bigger groups and hence more simplified expressions. The don’t care condition is denoted with ‘X’ to differentiate from 0 and 1. When choosing adjacent cells to simplify, the X's may be assumed as 0 or 1. In K map using minterms X can be taken as 1 and in K maps using maxterms X can be taken as 0. Also X can altogether be omitted. Example 6.12 ‘Simplify using K map: Y = FAB,C,D) =D (2,3,4,5)+5, (10, 14, 12, 13, 14, 15) Solution: The K map is shown in Fig. 6.33. In the K map a ‘1’ is entered in minterm cells 2, 3, 4 and 5, A °x’ is entered in c2® 40, 11, 12, 13, 14 and 15. we KARNAUGH MAP 167 The minterms m, and m, can form a pair and give an expression ABC, But the two don't care X's at cells 12 and 13 can be treated as 1's. Then minterms m,, m,, m,, and m,, form a quad to give BC thus eliminating one variable, A. Similarly the 1's in cells 2 and 3 and X's jn cells form a quad to give BC. ‘Therefore the final expression is Y =F(A,B,C,D) = BC+BC Example 6.13 5 Simplify using K map: Y=F(A, B, C, D) = = (1, 3, 7, 11,15) +2, (0, 2, 5, 8) Solution: The K map is shown in Fig. 6.34. We can form two quads. The first quad Q, (3, 7, 11, 15) gives CD The second quad Q, (1, 3, 5,7) gives AD The second quad can alternately be med as Q, (0, 1, 2, 3) which gives AB Therefore the final reduced expression is Y =F(a,B,c,p) = cD+AD = FA,B,C,D) = CD+AB AB 00 01 11 10 OO OTe Tele oo eee} ° L-) x x x ia] asad 0 x d | \ Fig. 6.33

You might also like