Presentation is loading. Please wait.

Presentation is loading. Please wait.

CMPUT 329 - Computer Organization and Architecture II1 CMPUT329 - Fall 2003 Topic 5: Quine-McCluskey Method José Nelson Amaral.

Similar presentations


Presentation on theme: "CMPUT 329 - Computer Organization and Architecture II1 CMPUT329 - Fall 2003 Topic 5: Quine-McCluskey Method José Nelson Amaral."— Presentation transcript:

1 CMPUT 329 - Computer Organization and Architecture II1 CMPUT329 - Fall 2003 Topic 5: Quine-McCluskey Method José Nelson Amaral

2 CMPUT 329 - Computer Organization and Architecture II2 Reading Assignment Section 4.4

3 CMPUT 329 - Computer Organization and Architecture II3 Motivation Karnaugh maps are very effective for the minimization of expressions with up to 5 or 6 inputs. However they are difficult to use and error prone for circuits with many inputs. Karnaugh maps depend on our ability to visually identify prime implicants and select a set of prime implicants that cover all minterms. They do not provide a direct algorithm to be implemented in a computer. For larger systems, we need a programmable method!!

4 CMPUT 329 - Computer Organization and Architecture II4 Quine-McCluskey Quine, Willard, “A way to simplify truth functions.” American Mathematical Monthly, vol. 62, 1955. Quine, Willard, “The problem of simplifying truth functions.” American Mathematical Monthly, vol. 59, 1952. Willard van Orman Quine 1908-2000, Edgar Pierce Chair of Philosophy at Harvard University. http://members.aol.com/drquine/wv-quine.html McCluskey Jr., Edward J. “Minimization of Boolean Functions.” Bell Systems Technical Journal, vol. 35, pp. 1417-1444, 1956 Edward J. McCluskey, Professor of Electrical Engineering and Computer Science at Stanford http://www-crc.stanford.edu/users/ejm/McCluskey_Edward.html

5 CMPUT 329 - Computer Organization and Architecture II5 Outline of the Quine- McCluskey Method 1. Produce a minterm expansion (standard sum-of-products form) for a function F 2. Eliminate as many literals as possible by systematically applying XY + XY’ = X. 3. Use a prime implicant chart to select a minimum set of prime implicants that when ORed together produce F, and that contains a minimum number of literals.

6 CMPUT 329 - Computer Organization and Architecture II6 Determination of Prime Implicants AB’CD’ + AB’CD = AB’C 1 0 1 0 + 1 0 1 1 = 1 0 1 - (The dash indicates a missing variable) A’BC’D + A’BCD’ 0 1 0 1 + 0 1 1 0 We can combine the minterms above because they differ by a single bit. The minterms below won’t combine

7 CMPUT 329 - Computer Organization and Architecture II7 Quine-McCluskey Method An Example 1. Find all the prime implicants group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Group the minterms according to the number of 1s in the minterm. This way we only have to compare minterms from adjacent groups.

8 CMPUT 329 - Computer Organization and Architecture II8 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II Combining group 0 and group 1:

9 CMPUT 329 - Computer Organization and Architecture II9 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000-  Combining group 0 and group 1:

10 CMPUT 329 - Computer Organization and Architecture II10 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0   Combining group 0 and group 1:

11 CMPUT 329 - Computer Organization and Architecture II11 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000    Does it make sense to no combine group 0 with group 2 or 3? No, there are at least two bits that are different.

12 CMPUT 329 - Computer Organization and Architecture II12 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000    Does it make sense to no combine group 0 with group 2 or 3? No, there are at least two bits that are different. Thus, next we combine group 1 and group 2.

13 CMPUT 329 - Computer Organization and Architecture II13 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01     Combine group 1 and group 2.

14 CMPUT 329 - Computer Organization and Architecture II14 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01     Combine group 1 and group 2.

15 CMPUT 329 - Computer Organization and Architecture II15 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001      Combine group 1 and group 2.

16 CMPUT 329 - Computer Organization and Architecture II16 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001      Combine group 1 and group 2.

17 CMPUT 329 - Computer Organization and Architecture II17 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001      Combine group 1 and group 2.

18 CMPUT 329 - Computer Organization and Architecture II18 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001      Combine group 1 and group 2.

19 CMPUT 329 - Computer Organization and Architecture II19 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10       Combine group 1 and group 2.

20 CMPUT 329 - Computer Organization and Architecture II20 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10       Combine group 1 and group 2.

21 CMPUT 329 - Computer Organization and Architecture II21 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010        Combine group 1 and group 2.

22 CMPUT 329 - Computer Organization and Architecture II22 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010        Combine group 1 and group 2.

23 CMPUT 329 - Computer Organization and Architecture II23 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010        Combine group 1 and group 2.

24 CMPUT 329 - Computer Organization and Architecture II24 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100-        Combine group 1 and group 2.

25 CMPUT 329 - Computer Organization and Architecture II25 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0        Again, there is no need to try to combine group 1 with group 2.

26 CMPUT 329 - Computer Organization and Architecture II26 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0        Again, there is no need to try to combine group 1 with group 3. Lets try to combine group 2 with group 23.

27 CMPUT 329 - Computer Organization and Architecture II27 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1         Combine group 2 and group 3.

28 CMPUT 329 - Computer Organization and Architecture II28 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1         Combine group 2 and group 3.

29 CMPUT 329 - Computer Organization and Architecture II29 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011-         Combine group 2 and group 3.

30 CMPUT 329 - Computer Organization and Architecture II30 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110          Combine group 2 and group 3.

31 CMPUT 329 - Computer Organization and Architecture II31 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110          Combine group 2 and group 3.

32 CMPUT 329 - Computer Organization and Architecture II32 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110          Combine group 2 and group 3.

33 CMPUT 329 - Computer Organization and Architecture II33 Quine-McCluskey Method An Example group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110 Column I Column II  0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110          Combine group 2 and group 3.

34 CMPUT 329 - Computer Organization and Architecture II34 Quine-McCluskey Method An Example Column I Column II 0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           We have now completed the first step. All minterms in column I were included. We can divide column II into groups.

35 CMPUT 329 - Computer Organization and Architecture II35 Quine-McCluskey Method An Example Column I Column II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10

36 CMPUT 329 - Computer Organization and Architecture II36 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III

37 CMPUT 329 - Computer Organization and Architecture II37 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III

38 CMPUT 329 - Computer Organization and Architecture II38 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III

39 CMPUT 329 - Computer Organization and Architecture II39 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III

40 CMPUT 329 - Computer Organization and Architecture II40 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III

41 CMPUT 329 - Computer Organization and Architecture II41 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00-  

42 CMPUT 329 - Computer Organization and Architecture II42 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00-  

43 CMPUT 329 - Computer Organization and Architecture II43 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00-  

44 CMPUT 329 - Computer Organization and Architecture II44 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00-  

45 CMPUT 329 - Computer Organization and Architecture II45 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00-  

46 CMPUT 329 - Computer Organization and Architecture II46 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00-  

47 CMPUT 329 - Computer Organization and Architecture II47 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00-  

48 CMPUT 329 - Computer Organization and Architecture II48 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0    

49 CMPUT 329 - Computer Organization and Architecture II49 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0    

50 CMPUT 329 - Computer Organization and Architecture II50 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00-      

51 CMPUT 329 - Computer Organization and Architecture II51 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00-      

52 CMPUT 329 - Computer Organization and Architecture II52 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00- 0,8,2,10 -0-0       

53 CMPUT 329 - Computer Organization and Architecture II53 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00- 0,8,2,10 -0-0       

54 CMPUT 329 - Computer Organization and Architecture II54 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00- 0,8,2,10 -0-0       

55 CMPUT 329 - Computer Organization and Architecture II55 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00- 0,8,2,10 -0-0       

56 CMPUT 329 - Computer Organization and Architecture II56 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00- 0,8,2,10 -0-0       

57 CMPUT 329 - Computer Organization and Architecture II57 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00- 0,8,2,10 -0-0 2,6,10,14 --10         

58 CMPUT 329 - Computer Organization and Architecture II58 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00- 0,8,2,10 -0-0 2,6,10,14 --10 2,10,6,14 --10          

59 CMPUT 329 - Computer Organization and Architecture II59 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00- 0,8,2,10 -0-0 2,6,10,14 --10 2,10,6,14 --10          

60 CMPUT 329 - Computer Organization and Architecture II60 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00- 0,8,2,10 -0-0 2,6,10,14 --10 2,10,6,14 --10          

61 CMPUT 329 - Computer Organization and Architecture II61 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00- 0,8,2,10 -0-0 2,6,10,14 --10 2,10,6,14 --10           No more combinations are possible, thus we stop here.

62 CMPUT 329 - Computer Organization and Architecture II62 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00- 0,8,2,10 -0-0 2,6,10,14 --10 2,10,6,14 --10           We can eliminate repeated combinations

63 CMPUT 329 - Computer Organization and Architecture II63 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 2,6,10,14 --10           f = a’c’d Now we form f with the terms not checked

64 CMPUT 329 - Computer Organization and Architecture II64 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 2,6,10,14 --10           f = a’c’d + a’bd

65 CMPUT 329 - Computer Organization and Architecture II65 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 2,6,10,14 --10           f = a’c’d + a’bd + a’bc

66 CMPUT 329 - Computer Organization and Architecture II66 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 2,6,10,14 --10           f = a’c’d + a’bd + a’bc + b’c’

67 CMPUT 329 - Computer Organization and Architecture II67 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 2,6,10,14 --10           f = a’c’d + a’bd + a’bc + b’c’ + b’d’

68 CMPUT 329 - Computer Organization and Architecture II68 Quine-McCluskey Method An Example Column IColumn II group 0 group 1 group 2 group 3 0 0000 1 0001 2 0010 8 1000 5 0101 6 0110 9 1001 10 1010 7 0111 14 1110           0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 100- 8,10 10-0 5,7 01-1 6,7 011- 6,14 -110 10,14 1-10 Column III 0,1,8,9 -00- 0,2,8,10 -0-0 2,6,10,14 --10           f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’

69 CMPUT 329 - Computer Organization and Architecture II69 Quine-McCluskey Method An Example f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’ But, the form below is not minimized, using a Karnaugh map we can obtain: a 1 b c d 1

70 CMPUT 329 - Computer Organization and Architecture II70 Quine-McCluskey Method An Example f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’ But, the form below is not minimized, using a Karnaugh map we can obtain: a 1 1 b c d 1

71 CMPUT 329 - Computer Organization and Architecture II71 Quine-McCluskey Method An Example f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’ But, the form below is not minimized, using a Karnaugh map we can obtain: a 1 1 1 b c d 1

72 CMPUT 329 - Computer Organization and Architecture II72 Quine-McCluskey Method An Example f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’ But, the form below is not minimized, using a Karnaugh map we can obtain: a 1 1 1 1 1 1 b c d 1

73 CMPUT 329 - Computer Organization and Architecture II73 Quine-McCluskey Method An Example f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’ But, the form below is not minimized, using a Karnaugh map we can obtain: a 1 1 1 1 1 1 11 b c d 1

74 CMPUT 329 - Computer Organization and Architecture II74 Quine-McCluskey Method An Example f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’ But, the form below is not minimized. Using a Karnaugh map we can obtain: a 1 1 1 1 1 1 111 b c d 1

75 CMPUT 329 - Computer Organization and Architecture II75 Quine-McCluskey Method An Example f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’ But, the form below is not minimized, using a Karnaugh map we can obtain: a 1 1 1 1 1 1 111 b c d 1 F = a’bd

76 CMPUT 329 - Computer Organization and Architecture II76 Quine-McCluskey Method An Example f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’ But, the form below is not minimized, using a Karnaugh map we can obtain: a 1 1 1 1 1 1 111 b c d 1 F = a’bd + cd’

77 CMPUT 329 - Computer Organization and Architecture II77 Quine-McCluskey Method An Example f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’ But, the form below is not minimized, using a Karnaugh map we can obtain: a 1 1 1 1 1 1 111 b c d 1 F = a’bd + cd’ + b’c’

78 CMPUT 329 - Computer Organization and Architecture II78 Quine-McCluskey Method An Example f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’ What are the extra terms in the solution obtained with the Quine-McCluskey method? a 1 1 1 1 1 1 111 b c d 1 F = a’bd + cd’ + b’c’ Thus, we need a method to eliminate this redundant terms from the Quine-McCluskey solution.

79 CMPUT 329 - Computer Organization and Architecture II79 The Prime Implicant Chart The prime implicant chart is the second part of the Quine-McCluskey procedure. It is used to select a minimum set of prime implicants. Similar to the Karnaugh map, we first select the essential prime implicants, and then we select enough prime implicants to cover all the minterms of the function.

80 CMPUT 329 - Computer Organization and Architecture II80 Prime Implicant Chart (Example) Question: Given the prime implicant chart above, how can we identify the essential prime implicants of the function? minterms Prime Implicants

81 CMPUT 329 - Computer Organization and Architecture II81 Prime Implicant Chart (Example) Similar to the Karnaugh map, all we have to do is to look for minterms that are covered by a single term. minterms Prime Implicants

82 CMPUT 329 - Computer Organization and Architecture II82 Prime Implicant Chart (Example) Once a term is included in the solution, all the minterms covered by that term are covered. Therefore we may now mark the covered minterms and find terms that are no longer useful. minterms Prime Implicants

83 CMPUT 329 - Computer Organization and Architecture II83 Prime Implicant Chart (Example) minterms Prime Implicants

84 CMPUT 329 - Computer Organization and Architecture II84 Prime Implicant Chart (Example) As we have not covered all the minterms with essential prime implicants, we must choose enough non-essential prime implicants to cover the remaining minterms. minterms Prime Implicants

85 CMPUT 329 - Computer Organization and Architecture II85 Prime Implicant Chart (Example) What strategy should we use to find a minimum cover for the remaining minterms? minterms Prime Implicants

86 CMPUT 329 - Computer Organization and Architecture II86 Prime Implicant Chart (Example) We choose first prime implicants that cover the most minterms. Should this strategy always work?? minterms Prime Implicants

87 CMPUT 329 - Computer Organization and Architecture II87 Prime Implicant Chart (Example) Therefore our minimum solution is: f(a,b,c,d) = b’c’ + cd’ + a’bd minterms Prime Implicants

88 CMPUT 329 - Computer Organization and Architecture II88 Cyclic Prime Implicant Chart F(a,b,c) =  m(0, 1, 2, 5, 6, 7) 0 000  1 001  2 010  5 101  6 110  7 111  0,1 00- 0,2 0-0 1,5 -01 2,6 -10 5,7 1-1 6,7 11- Which ones are the essential prime implicants in this chart? There is no essential prime implicants, how we proceed? minterms Prime Implicants

89 CMPUT 329 - Computer Organization and Architecture II89 Cyclic Prime Implicant Chart F(a,b,c) =  m(0, 1, 2, 5, 6, 7) 0 000  1 001  2 010  5 101  6 110  7 111  0,1 00- 0,2 0-0 1,5 -01 2,6 -10 5,7 1-1 6,7 11- Also, all implicants cover the same number of minterms. We will have to proceed by trial and error. minterms Prime Implicants F(a,b,c) = a’b’

90 CMPUT 329 - Computer Organization and Architecture II90 Cyclic Prime Implicant Chart F(a,b,c) =  m(0, 1, 2, 5, 6, 7) 0 000  1 001  2 010  5 101  6 110  7 111  0,1 00- 0,2 0-0 1,5 -01 2,6 -10 5,7 1-1 6,7 11- Also, all implicants cover the same number of minterms. We will have to proceed by trial and error. minterms Prime Implicants F(a,b,c) = a’b’ + bc’

91 CMPUT 329 - Computer Organization and Architecture II91 Cyclic Prime Implicant Chart F(a,b,c) =  m(0, 1, 2, 5, 6, 7) 0 000  1 001  2 010  5 101  6 110  7 111  0,1 00- 0,2 0-0 1,5 -01 2,6 -10 5,7 1-1 6,7 11- Thus, we get the minimization: F(a,b,c) = a’b’ + bc’ + ac minterms Prime Implicants

92 CMPUT 329 - Computer Organization and Architecture II92 Cyclic Prime Implicant Chart F(a,b,c) =  m(0, 1, 2, 5, 6, 7) 0 000  1 001  2 010  5 101  6 110  7 111  0,1 00- 0,2 0-0 1,5 -01 2,6 -10 5,7 1-1 6,7 11- Lets try another set of prime implicants. minterms Prime Implicants

93 CMPUT 329 - Computer Organization and Architecture II93 Cyclic Prime Implicant Chart F(a,b,c) =  m(0, 1, 2, 5, 6, 7) 0 000  1 001  2 010  5 101  6 110  7 111  0,1 00- 0,2 0-0 1,5 -01 2,6 -10 5,7 1-1 6,7 11- Lets try another set of prime implicants. minterms Prime Implicants F(a,b,c) = a’c

94 CMPUT 329 - Computer Organization and Architecture II94 Cyclic Prime Implicant Chart F(a,b,c) =  m(0, 1, 2, 5, 6, 7) 0 000  1 001  2 010  5 101  6 110  7 111  0,1 00- 0,2 0-0 1,5 -01 2,6 -10 5,7 1-1 6,7 11- Lets try another set of prime implicants. minterms Prime Implicants F(a,b,c) = a’c + b’c’

95 CMPUT 329 - Computer Organization and Architecture II95 Cyclic Prime Implicant Chart F(a,b,c) =  m(0, 1, 2, 5, 6, 7) 0 000  1 001  2 010  5 101  6 110  7 111  0,1 00- 0,2 0-0 1,5 -01 2,6 -10 5,7 1-1 6,7 11- Lets try another set of prime implicants. minterms Prime Implicants F(a,b,c) = a’c + b’c’+ ab

96 CMPUT 329 - Computer Organization and Architecture II96 Cyclic Prime Implicant Chart F(a,b,c) =  m(0, 1, 2, 5, 6, 7) 0 000  1 001  2 010  5 101  6 110  7 111  0,1 00- 0,2 0-0 1,5 -01 2,6 -10 5,7 1-1 6,7 11- This time we obtain: F(a,b,c) = a’c + b’c’+ ab minterms Prime Implicants

97 CMPUT 329 - Computer Organization and Architecture II97 Cyclic Prime Implicant Chart Which minimal form is better? F(a,b,c) = a’b’ + bc’ + ac F(a,b,c) = a’c + b’c’+ ab Depends on what terms we must form for other functions that we must also implement. Often we are interested in examining all minimal forms for a given function. Thus we need an algorithm to do so.

98 CMPUT 329 - Computer Organization and Architecture II98 Petrick’s Method S. R. Petrick. A direct determination of the irredundant forms of a boolean function from the set of prime implicants. Technical Report AFCRC-TR-56-110, Air Force Cambridge Research Center, Cambridge, MA, April, 1956. Goal: Given a prime implicant chart, determine all minimum sum-of-products solutions.

99 CMPUT 329 - Computer Organization and Architecture II99 Petrick’s Method An Example Step 1: Label all the rows in the chart. Step 2: Form a logic function P with the logic variables P 1, P 2, P 3 that is true when all the minterms in the chart are covered. minterms Prime Implicants

100 CMPUT 329 - Computer Organization and Architecture II100 Petrick’s Method An Example The first column has an X in rows P 1 and P 2. Therefore we must include one of these rows in order to cover minterm 0. Thus the following term must be in P: (P 1 + P 2 ) minterms Prime Implicants

101 CMPUT 329 - Computer Organization and Architecture II101 Petrick’s Method An Example Following this technique, we obtain: P = (P 1 + P 2 ) (P 1 + P 3 ) (P 2 + P 4 ) (P 3 + P 5 ) (P 4 + P 6 ) (P 5 + P 6 ) P = (P 1 + P 2 ) (P 1 + P 3 ) (P 4 + P 2 ) (P 5 + P 3 ) (P 4 + P 6 ) (P 5 + P 6 ) P = (P 1 + P 2 ) (P 1 + P 3 ) (P 4 + P 2 ) (P 4 + P 6 ) (P 5 + P 3 ) (P 5 + P 6 ) P = (P 1 + P 2 P 3 ) (P 4 + P 2 P 6 ) (P 5 + P 3 P 6 ) minterms Prime Implicants

102 CMPUT 329 - Computer Organization and Architecture II102 Petrick’s Method An Example P = (P 1 + P 2 ) (P 1 + P 3 ) (P 2 + P 4 ) (P 3 + P 5 ) (P 4 + P 6 ) (P 5 + P 6 ) P = (P 1 + P 2 ) (P 1 + P 3 ) (P 4 + P 2 ) (P 5 + P 3 ) (P 4 + P 6 ) (P 5 + P 6 ) P = (P 1 + P 2 ) (P 1 + P 3 ) (P 4 + P 2 ) (P 4 + P 6 ) (P 5 + P 3 ) (P 5 + P 6 ) P = (P 1 + P 2 P 3 ) (P 4 + P 2 P 6 ) (P 5 + P 3 P 6 ) P = (P 1 P 4 + P 1 P 2 P 6 + P 2 P 3 P 4 + P 2 P 3 P 6 ) (P 5 + P 3 P 6 ) P = P 1 P 4 P 5 + P 1 P 2 P 5 P 6 + P 2 P 3 P 4 P 5 + P 2 P 3 P 5 P 6 + P 1 P 3 P 4 P 6 + P 1 P 2 P 3 P 6 + P 2 P 3 P 4 P 6 + P 2 P 3 P 6 P = P 1 P 4 P 5 + P 1 P 2 P 5 P 6 + P 2 P 3 P 4 P 5 + P 1 P 4 P 3 P 6 + P 2 P 3 P 6

103 CMPUT 329 - Computer Organization and Architecture II103 Petrick’s Method An Example P = P 1 P 4 P 5 + P 1 P 2 P 5 P 6 + P 2 P 3 P 4 P 5 + P 1 P 4 P 3 P 6 + P 2 P 3 P 6 This expression says that to cover all the minterms we must include the terms in line P 1 and line P 4 and line P 5, or we must include line P 1, and line P 2, and line P 5, and line P 6, or … Considering that all the terms P 1, P 2, … have the same cost, how many minimal forms the function has? The two minimal forms are P 1 P 4 P 5 and P 2 P 3 P 6: F = a’b’ + bc’ + ac F = a’c’ + b’c + ab


Download ppt "CMPUT 329 - Computer Organization and Architecture II1 CMPUT329 - Fall 2003 Topic 5: Quine-McCluskey Method José Nelson Amaral."

Similar presentations


Ads by Google