Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.

Similar presentations


Presentation on theme: "Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row."— Presentation transcript:

1 Digital Logic (Karnaugh Map)

2 Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row in the truth table. Also, one map cell corresponds to a minterm or a maxterm in the boolean expression Multiple-cell areas of the map correspond to standard terms. 2016/2/16Boolean Algebra PJF - 2

3 Two-Variable Map 2016/2/16Boolean Algebra PJF - 3 m3m3m3m3 m2m2m2m2 1 m1m1m1m1 m0m0m0m0 0 10 x1x1x1x1 x2x2 01 2 3 NOTE: ordering of variables is IMPORTANT for f(x 1,x 2 ), x 1 is the row, x 2 is the column. Cell 0 represents x 1 ’x 2 ’; Cell 1 represents x 1 ’x 2 ; etc. If a minterm is present in the function, then a 1 is placed in the corresponding cell. m3m3m3m3 m1m1m1m11 m2m2m2m2 m0m0m0m00 10 x2x2x2x2 x1x1 02 1 3 OR

4 Two-Variable Map (cont.) Any two adjacent cells in the map differ by ONLY one variable, which appears complemented in one cell and uncomplemented in the other. Example: m 0 (=x 1 ’x 2 ’) is adjacent to m 1 (=x 1 ’x 2 ) and m 2 (=x 1 x 2 ’) but NOT m 3 (=x 1 x 2 ) 2016/2/16Boolean Algebra PJF - 4

5 2-Variable Map -- Example f(x 1,x 2 ) = x 1 ’x 2 ’+ x 1 ’x 2 + x 1 x 2 ’ = m 0 + m 1 + m 2 = x 1 ’ + x 2 ’ 1s placed in K-map for specified minterms m 0, m 1, m 2 Grouping (ORing) of 1s allows simplification What (simpler) function is represented by each dashed rectangle? – x 1 ’ = m 0 + m 1 – x 2 ’ = m 0 + m 2 Note m 0 covered twice 2016/2/16Boolean Algebra PJF - 5 x1x1x1x101 011 110 x2x2 01 23

6 Minimization as SOP using K-map Enter 1s in the K-map for each product term in the function Group adjacent K-map cells containing 1s to obtain a product with fewer variables. Group size must be in power of 2 (2, 4, 8, …) Handle “boundary wrap” for K-maps of 3 or more variables. Realize that answer may not be unique 2016/2/16Boolean Algebra PJF - 6

7 Three-Variable Map 2016/2/16Boolean Algebra PJF - 7 m6m6m6m6 m7m7m7m7 m5m5m5m5 m4m4m4m41 m2m2m2m2 m3m3m3m3 m1m1m1m1 m0m0m0m0010110100yz x 0132 4576 -Note: variable ordering is (x,y,z); yz specifies column, x specifies row. -Each cell is adjacent to three other cells (left or right or top or bottom or edge wrap)

8 Three-Variable Map (cont.) 2016/2/16Boolean Algebra PJF - 8 The types of structures that are either minterms or are generated by repeated application of the minimization theorem on a three variable map are shown at right. Groups of 1, 2, 4, 8 are possible. minterm group of 2 terms group of 4 terms

9 Simplification Enter minterms of the Boolean function into the map, then group terms Example: f(a,b,c) = a’c + abc + bc’ Result: f(a,b,c) = a’c+ b 2016/2/16Boolean Algebra PJF - 9 111 11 a bc11111

10 More Examples f 1 (x, y, z) = ∑ m(2,3,5,7) f 2 (x, y, z) = ∑ m (0,1,2,3,6) 2016/2/16Boolean Algebra PJF - 10 f 1 (x, y, z) = x’y + xz f 1 (x, y, z) = x’y + xz f 2 (x, y, z) = x’+yz’ f 2 (x, y, z) = x’+yz’ yz yzX00011110 011 111 11111

11 Four-Variable Maps Top cells are adjacent to bottom cells. Left-edge cells are adjacent to right-edge cells. Note variable ordering (WXYZ). 2016/2/16 PJF - 11Boolean Algebra m 10 m 11 m9m9m9m9 m8m8m8m8 10 m 14 m 15 m 13 m 12 11 m6m6m6m6 m7m7m7m7 m5m5m5m5 m4m4m4m4 01 m2m2m2m2 m3m3m3m3 m1m1m1m1 m0m0m0m0 00 10 10 11 11 01 01 00 00 WX YZ

12 Four-variable Map Simplification One square represents a minterm of 4 literals. A rectangle of 2 adjacent squares represents a product term of 3 literals. A rectangle of 4 squares represents a product term of 2 literals. A rectangle of 8 squares represents a product term of 1 literal. A rectangle of 16 squares produces a function that is equal to logic 1. 2016/2/16Boolean Algebra PJF - 12

13 Example Simplify the following Boolean function (A,B,C,D) = ∑m(0,1,2,4,5,7,8,9,10,12,13). First put the function g( ) into the map, and then group as many 1s as possible. 2016/2/16Boolean Algebra PJF - 13 cd ab 1 11 11 1 11 1 11 g(A,B,C,D) = c’+b’d’+a’bd 111 11 111 111

14 Don't Care Conditions There may be a combination of input values which – will never occur – if they do occur, the output is of no concern. The function value for such combinations is called a don't care. They are denoted with x or –. Each x may be arbitrarily assigned the value 0 or 1 in an implementation. Don’t cares can be used to further simplify a function 2016/2/16Boolean Algebra PJF - 14

15 Minimization using Don’t Cares Treat don't cares as if they are 1s to generate PIs. Delete PI's that cover only don't care minterms. Treat the covering of remaining don't care minterms as optional in the selection process (i.e. they may be, but need not be, covered). 2016/2/16Boolean Algebra PJF - 15

16 Example Simplify the function f(a,b,c,d) whose K-map is shown at the right. f = a’c’d+ab’+cd’+a’bc’ or f = a’c’d+ab’+cd’+a’bd’ 2016/2/16Boolean Algebra PJF - 16 xx11 xx00 10111010 xx11 xx00 10111010 0101 1101 00xx 11xx ab cd 00 01 11 10 00 01 11 10

17 Another Example Simplify the function g(a,b,c,d) whose K-map is shown at right. g = a’c’+ ab or g = a’c’+b’d 2016/2/16Boolean Algebra PJF - 17 x100 1x0x 1xx1 0xx0 x1001x0x 1xx1 0xx0 x1001x0x 1xx1 0xx0 ab cd

18 Karnaugh Maps for Four Input Functions Represent functions of 4 inputs with 16 minterms Use same rules developed for 3-input functions Note bracketed sections shown in example.

19 C+ B’D’ Solution set can be considered as a coordinate System! Karnaugh map: 4-variable example F(A,B,C,D) =  m(0,2,3,5,6,7,8,10,11,14,15) F = D A B A B C D 0000 1111 1000 0111 10011001 010001000 11 11 C + A’BD

20 A' B' D + A' C + B' C D B C' D' + A C' + A B D' LT= EQ= GT= K-map for LTK-map for GT Design examples 0 00100010 00 D A11 010001000 B C K-map for EQ 10011001 00 D A00 10011001 B C 010001000 11 D A00 0 00100010 B C Can you draw the truth table for these examples? A'B'C'D' + A'BC'D + ABCD + AB'CD’

21 ABCDABCD EQ Physical Implementation °Step 1: Truth table °Step 2: K-map °Step 3: Minimized sum-of- products °Step 4: Physical implementation with gates K-map for EQ 10011001 00 D A00 10011001 B C

22 Karnaugh Maps Four variable maps. F=BC +CD + AC+ AD 0 AB 11 0 0001 00 01 CD 0 01 1 1110 F=ABC + ACD + ABC + AB CD + ABC + AB C 1 10 1 11 10 1 11 1 °Need to make sure all 1’s are covered °Try to minimize total product terms. °Design could be implemented using NANDs and NORs

23 Karnaugh maps:Don’t cares In some cases, outputs are undefined We “don’t care” if the logic produces a 0 or a 1 This knowledge can be used to simplify functions. 01 X0X1X0X1 D A 1 110X110X 00 B C CD AB 00 01 11 10 00 01 11 10 - Treat X’s like either 1’s or 0’s - Very useful - OK to leave some X’s uncovered

24 + C’D Karnaugh maps: Don’t cares f(A,B,C,D) =  m(1,3,5,7,9) + d(6,12,13) – without don't cares f = 01 X0X1X0X1 D A 1 110X110X 00 B C A’D CD AB 00 01 11 10 00 01 11 10 Cf 00 01 10 11 00 01 1X 100110011100110011 D 0 1 0 1 0 1 0 101010101101010101 10100XX0010100XX00 A 0 0 0 0 0 0 0 011111111011111111 + B 0 0 0 0 1 1 1 100001111100001111 +

25 Don’t Care Conditions In some situations, we don’t care about the value of a function for certain combinations of the variables. – these combinations may be impossible in certain contexts – or the value of the function may not matter in when the combinations occur In such situations we say the function is incompletely specified and there are multiple (completely specified) logic functions that can be used in the design. – so we can select a function that gives the simplest circuit When constructing the terms in the simplification procedure, we can choose to either cover or not cover the don’t care conditions.

26 Map Simplification with Don’t Cares F=ACD+B+AC 0 AB xx 1 0001 00 01 CD 0 x1 0 1110 1 x0 1 11 10 1 11 x 0 AB xx 1 0001 00 01 CD 0 x1 0 1110 1 x0 1 11 10 1 11 x F=ABCD+ABC+BC+AC °Alternative covering.

27 Karnaugh maps: don’t cares (cont’d) f(A,B,C,D) =  m(1,3,5,7,9) + d(6,12,13) – f = A'D + B'C'Dwithout don't cares – f = with don't cares don't cares can be treated as 1s or 0s depending on which is more advantageous 01 X0X1X0X1 D A1 110X110X 00 B C A'D by using don't care as a "1" a 2-cube can be formed rather than a 1-cube to cover this node + C'D

28 Definition of terms for two-level simplification Implicant – Single product term of the ON-set (terms that create a logic 1) Prime implicant – Implicant that can't be combined with another to form an implicant with fewer literals. Essential prime implicant – Prime implicant is essential if it alone covers a minterm in the K-map – Remember that all squares marked with 1 must be covered Objective: – Grow implicant into prime implicants (minimize literals per term) – Cover the K-map with as few prime implicants as possible (minimize number of product terms)

29 0X110X111 10101010 D A 100010000 11 B C 5 prime implicants: BD, ABC', ACD, A'BC, A'C'D Examples to illustrate terms 01 10101010 D A 01010101 10 B C 6 prime implicants: A'B'D, BC', AC, A'C'D, AB, B'CD minimum cover: AC + BC' + A'B'D essential minimum cover: 4 essential implicants essential

30 Prime Implicants Any single 1 or group of 1s in the Karnaugh map of a function F is an implicant of F. A product term is called a prime implicant of F if it cannot be combined with another term to eliminate a variable. B C A 1 1 1 11 11 1 D Example: If a function F is represented by this Karnaugh Map. Which of the following terms are implicants of F, and which ones are prime implicants of F? (a) AC’D’ (b) BD (c) A’B’C’D’ (d) AC’ (e) B’C’D’ Implicants: (a),(c),(d),(e) Prime Implicants: (d),(e)

31 Essential Prime Implicants A product term is an essential prime implicant if there is a minterm that is only covered by that prime implicant. - The minimal sum-of-products form of F must include all the essential prime implicants of F.


Download ppt "Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row."

Similar presentations


Ads by Google