(K-Map) KARNAUGH MAP.pdf

13
NOTES008 KARNAUGH MAP page 1 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo KARNAUGH MAP (K-MAP) It originated from the “map method” proposed by Veitch also called the “Veitch Diagram” and then modified by Karnaugh. Developed by Karnaugh in 1953 that he presented in his paper entitled “The map method for synthesis of combinational logic circuit”. It is a pictorial form of a truth table and could handle up to 6 variables. It is used to reduce or simplify a Boolean function. It is an array of cells/squares in which each cell represents a binary value of the input variables. GENERALIZATION: 1) MAP SET-UP The number of cell/square in a K-map is equal to 2 n where n is the number of input variables. The map is drawn to show the relationship between squares and input variables. Variables are assigned to row and column. Binary marking are placed in each row and column using reflected code sequence. Each cell in the map represents a combination of input variables in a given truth table.

Transcript of (K-Map) KARNAUGH MAP.pdf

Page 1: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 1 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

KARNAUGH MAP (K-MAP)

• It originated from the “map method” proposed by Veitch also called the “Veitch Diagram” and then modified by Karnaugh.

• Developed by Karnaugh in 1953 that he presented in his paper entitled “The map method for synthesis of combinational logic circuit”.

• It is a pictorial form of a truth table and could handle up to 6 variables.

• It is used to reduce or simplify a Boolean function. • It is an array of cells/squares in which each cell represents a binary

value of the input variables. GENERALIZATION:

1) MAP SET-UP

• The number of cell/square in a K-map is equal to 2n where n is the number of input variables.

• The map is drawn to show the relationship between squares

and input variables. Variables are assigned to row and column. Binary marking are placed in each row and column using reflected code sequence.

• Each cell in the map represents a combination of input

variables in a given truth table.

Page 2: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 2 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

# of Cells/group # of inputs to represent the group

1 3 2 2 4 1 8 Grouping of 1’s – F = 1

Grouping of 0’s – F = 0

# of Cells/group # of inputs to represent the group

1 4 2 3 4 2 8 1 16 Grouping of 1’s – F = 1

Grouping of 0’s – F = 0

Page 3: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 3 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

# of Cells/group # of inputs to represent the group

1 5 2 4 4 3 8 2 16 1 32 Grouping of 1’s – F = 1; Grouping of 0’s – F = 0

2) ADJACENCY RULE

• Each cell in the K-map is positioned such that its neighboring cells

are adjacent to it. The cells in a Karnaugh map are arranged so that there is only a single –variable change between adjacent cells.

• Adjacency is defined by a single-variable change. Cells that differ by

only one variable are adjacent. Cells with values that differ by more than one variable are not adjacent.

Page 4: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 4 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

3) MAPPING OF 0’s AND 1’s IN THE KARNAUGH MAP.

• 1’s are placed in the squares of a K-map to represents minterms of a Boolean function in canonical SOP (Sum-of-Minterm) form. The number of 1’s in the K-map is equal to the number of product terms in the Boolean function. The cells that do not have a 1 are the cells for which the expression is 0.

• The 0’s placed in the squares of a K-map represents the

maxterms of a Boolean function in canonical POS (Product of Maxterm) form. The number of 0’s in the K-map is equal to the number of sum terms in the Boolean function. The cells that do not have a 0 are the cells for which the expression is 1.

Example: F(A,B,C) = (A+B+C)(A+B’+C)(A’+B’+C)(A’+B+C’)

Page 5: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 5 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

• A Boolean expression in standard (SOP or POS) form should be converted first into its canonical (Sum of Minterm or Product of Maxterm) expression before mapping the 1’s (or 0’s).

• All 1’s and 0’s in the output column of the truth table can be mapped directly onto a Karnaugh map into the cells corresponding to the values of the associated input variable combinations.

Example:

Page 6: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 6 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

4) GROUPING OF 0’s AND 1’s

Group the 1’s (or 0’s) on the Karnaugh map according to the rules given below. The objective is to maximize the number of elements in a group and to minimize the number of groups. (a) Always group adjacent cell containing 1’s (or 0’s) in powers of 2 {1, 2, 4, 8, 16, 32 or 64 1s (or 0s) in a group}. Start by combining the maximum number of adjacent cell containing 1’s (or 0’s). (b) Always include the largest possible number of 1’s (or 0’s) in a group in accordance with rule (a) to reduce the number of literals in a term. (c) Ensure that each 1’s (or 0’s) are covered when combining the squares. The 1’s (or 0’s) already in a group can be included in another group as long as the overlapping groups include noncommon 1’s (or 0’s). (d)Minimize the number of groups to reduce the number of terms in the simplified function. Avoid redundant grouping! Example 1:

Example 2:

Page 7: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 7 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

5) DETERMINATION OF SIMPLIFIED BOOLEAN FUNCTION IN SOP AND POS FORM

In determining the simplified Boolean function in SOP form, the

following steps are done: (a) Obtain a simplified product term for each group of cell

containing 1’s by considering only variables that occur in only one form (either uncomplemented or complemented) within the group. Variables that occur both uncomplemented and complemented within each group are eliminated.

(b) When the entire simplified product terms are derived from the Karnaugh map, they are summed to form the simplified Boolean function in SOP form.

Example 1:

Example 2:

Page 8: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 8 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

In determining the simplified Boolean function in POS form, the following steps are done:

(a) Obtain a simplified sum term for each group of cell containing 0’s by considering only variables that occur in only one form (either uncomplemented or complemented) within the group. Variables that occur both uncomplemented and complemented within each group are eliminated.

(b) When all the simplified sum terms are derived from the Karnaugh map, AND all the simplified sum terms to form the simplified Boolean function in POS form.

F(A,B,C,D) = (A + B + C')(A' + B' + C +D)(A' + C' + D')

Page 9: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 9 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

Example 3. Simplify the following Boolean functions using Karnaugh map: (a) F (x,y,z) = )7,5,1,0(Π

Answer: F (x,y,z) = (x+y)(x’+z’) (b) F (A,B,C) = ∑ )6,4,3,2,0(

Answer: F (A,B,C) = A’B + C’ (c) F (w,x,y,z) = ∑ )15,14,12,6,5,4,1(

Answer: F (w,x,y,z) = (xz’+w’y’z+wxy) (d) F (A,B,C,D) = )15,13,7,5,3,1(Π

Answer: F (A,B,C,D) = (A+D’)(B’+D’) (e) F (w,x,y,z) = wxy + yz + xy’z + x’y

Answer: F (w,x,y,z) = xz+x’y+wy (f) F(a,b,c) = (a’ + b’) (a + b + c’) (a’ + b)

Answer: F (a,b,c) = a’(b+c’)

Example 4. Given the truth table below, determine the following: (a) Simplified Boolean function F in SOP and POS form using K-map. (b) Simplified F’ in SOP form. (c) Simplified F’ in POS form. (d) Implement the Boolean function F using minimum number of logic

gates. (e) Implement the Boolean function F’ using minimum number of logic

gates. X y z F 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 0

Answer: (a) F in POS form = y’(x + z’) {group 0’s then obtain the simplified sum term for each grouping and AND all sum terms}

F in SOP form = y’z’+ xy’ {group 1’s then obtain the simplified product term for each grouping and OR all product terms} (b) F’ in SOP form = y + x’z (c) F’ in POS form = (x’+y)(y+z) (d) Implement F in POS form using an OR gate and an AND gate (e) Implement F’ in SOP form using an AND gate and an OR gate

Page 10: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 10 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

KARNAUGH MAP WITH “DON’T CARE” CONDITIONS

Sometimes a situation arises in which some input variable combinations are not allowed. For example, recall that in the BCD code, there are six invalid combinations. For NBCD: 1010, 1011, 1100, 1101, 1110 and 1111. Since these unallowed states will never occur in an application involving the BCD code, they can be treated as “don’t care” terms with respect to their effect on the output. That is, for these “don’t care” terms either a 1 or a 0 may be assigned to the output; it really does not matter since they will never occur.

For each “don’t care” term, an X is placed in the cell. The “don’t care” terms can be used as an advantage when simplifying because when grouping the 1s (or 0’s), the Xs can be treated as 1s (or 0’s) to maximize the number of elements in a group. Note that maximizing the number of element per group would result to simpler product term (or sum term).

Example 5. Create a function that would give a 1 output only when NBCD code for 7, 8 or 9 is present on the inputs.

Page 11: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 11 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

Example 6. Determine the simplified Boolean functions using Karnaugh map:

(a) F (A,B,C) = ∑ )5,4,2,1,0( ; d (A,B,C) = ∑ )7,6,3( Answer: F (A,B,C) = 1 (b)

Answer: F (A,B,C,D,E) = D + B’E’ (c)

Answer: F (A,B,C,D,E) = B’ E’

Example 7. Design a BCD to Excess-3 code converter circuit using minimum number of logic gates. Use K-map in obtaining the simplified Boolean function. Solution: Let: A,B,C,D = input variables representing 4-bit NBCD w,x,y,z = output variables representing 4-bit Excess-3 code

Page 12: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 12 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

Truth table: Input

NBCD Output

Excess-3 code A B C D w x Y z 0 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 0 1 0 0 1 0 1 1 1 1 0 1 0 1 0 0 0 1 0 1 1 1 0 0 1 1 1 0 0 1 0 1 0 X X X X 1 0 1 1 X X X X 1 1 0 0 X X X X 1 1 0 1 X X X X 1 1 1 0 X X X X 1 1 1 1 X X X X

Using K-map, w = A + BC +BD x = B’C + B’D + BC’D’ y = CD + C’D’ z = D’

Page 13: (K-Map) KARNAUGH MAP.pdf

NOTES008 KARNAUGH MAP page 13 DIGITAL SYSTEM I LECTURE NOTES by Engr. Analene Montesines-Nagayo

DRILL PROBLEMS 1. A digital clock is to display the month of the year. Because the length of the calendar varies, it is necessary to reset the day display at different points, depending on the month. The calendar month is to be internally present as a 4-bit binary number, that is January = 0001, February = 0010, March = 0011 and so on. As part of the resetting circuit, it is necessary to detect all months having 31 days. Another reset circuit is designed for months with less than 31 days. Design a minimal OR-NAND circuit to implement the 31-days reset function. Design a minimal NAND-AND circuit to implement the less than 31-days reset function. 2. Simplify the Boolean function together with the don’t-care conditions.

(a) F(w,x,y,z) = )15,10,7,5()11,8,6,3,2,1,0( d+Σ (b) F(A,B,C,D) = )15,13,10,8,6,5,2,1()14,12,4,3( d+Π

3. Simplify the following Boolean functions using K-map and implement using minimum number of logic gates:

(a) F = w’z + xz + x’y + wx’z (b) F(v,w,x,y,z) = )31,27,23,19,18,16,15,11,7,6,5,4,3,2,0(Σ (c) F (a,b,c,d) = (a’+b’+d’)(a+b’+c’)(a’+b+d’)(b+c’+d’)

REFERENCES [1] Thomas, Floyd L., Digital Fundamentals, 4th Edition, Macmillan Publishing Company, New York, 1990 [2] Mano, M., Digital Design, 2nd Edition, Prentice Hall, N.J, 1991 [3] Swidlec Lecture Notes by Edzel Lapira, DLSU [4] Tocci, R. and Widmer, N., Digital Systems: Principles and Applications, 8th Edition, Prentice Hall Inc., N.J., 2001