1.04k likes | 1.2k Vues
CMPUT329 - Fall 2003. Topic 5: Quine-McCluskey Method José Nelson Amaral. Reading Assignment. Section 4.4. 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
E N D
CMPUT329 - Fall 2003 Topic 5: Quine-McCluskey Method José Nelson Amaral CMPUT 329 - Computer Organization and Architecture II
Reading Assignment Section 4.4 CMPUT 329 - Computer Organization and Architecture II
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!! CMPUT 329 - Computer Organization and Architecture II
Edward J. McCluskey, Professor of Electrical Engineering and Computer Science at Stanford http://www-crc.stanford.edu/users/ejm/McCluskey_Edward.html McCluskey Jr., Edward J. “Minimization of Boolean Functions.” Bell Systems Technical Journal, vol. 35, pp. 1417-1444, 1956 Quine-McCluskey Willard van Orman Quine 1908-2000, Edgar Pierce Chair of Philosophy at Harvard University. http://members.aol.com/drquine/wv-quine.html Quine, Willard, “The problem of simplifying truth functions.” American Mathematical Monthly, vol. 59, 1952. Quine, Willard, “A way to simplify truth functions.” American Mathematical Monthly, vol. 62, 1955. CMPUT 329 - Computer Organization and Architecture II
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 implicantsthat when ORed together produce F, and that contains a minimum number of literals. CMPUT 329 - Computer Organization and Architecture II
Determination of Prime Implicants by Combining Method AB’CD’ + AB’CD = AB’C 1 0 1 0 + 1 0 1 1 = 1 0 1 - (The dash indicates a missing variable) We can combine the minterms above because they differ by a single bit. The minterms below won’t combine A’BC’D + A’BCD’ 0 1 0 1 + 0 1 1 0 CMPUT 329 - Computer Organization and Architecture II
Quine-McCluskey MethodAn Example 1. Find all the prime implicants Group the minterms according to the number of 1s in the minterm. This way we only have to compare minterms from adjacent groups. group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Combining group 0 and group 1: CMPUT 329 - Computer Organization and Architecture II
0,1 000- group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Combining group 0 and group 1: CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II 0,1 000- 0,2 00-0 Combining group 0 and group 1: CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Does it make sense to no combine group 0 with group 2 or 3? 0,1 000- 0,2 00-0 0,8 -000 No, there are at least two bits that are different. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Does it make sense to no combine group 0 with group 2 or 3? 0,1 000- 0,2 00-0 0,8 -000 No, there are at least two bits that are different. Thus, next we combine group 1 and group 2. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II 0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 Combine group 1 and group 2. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II 0,1 000- 0,2 00-0 0,8 -000 1,5 0-01 Combine group 1 and group 2. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example 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. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example 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. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example 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. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example 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. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Combine group 1 and group 2. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Combine group 1 and group 2. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Combine group 1 and group 2. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Combine group 1 and group 2. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Combine group 1 and group 2. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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- Combine group 1 and group 2. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Again, there is no need to try to combine group 1 with group 2. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Again, there is no need to try to combine group 1 with group 3. Lets try to combine group 2 with group 3. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Combine group 2 and group 3. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Combine group 2 and group 3. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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- Combine group 2 and group 3. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Combine group 2 and group 3. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Combine group 2 and group 3. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Combine group 2 and group 3. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 Combine group 2 and group 3. CMPUT 329 - Computer Organization and Architecture II
group 0 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn 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 We have now completed the first step. All minterms in column I were included. We can divide column II into groups. CMPUT 329 - Computer Organization and Architecture II
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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III 0,1,8,9 -00- CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III 0,1,8,9 -00- CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III 0,1,8,9 -00- CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III 0,1,8,9 -00- CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III 0,1,8,9 -00- CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III 0,1,8,9 -00- CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III 0,1,8,9 -00- CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III 0,1,8,9 -00- 0,2,8,10 -0-0 CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III 0,1,8,9 -00- 0,2,8,10 -0-0 CMPUT 329 - Computer Organization and Architecture 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 0 0000 1 0001 2 0010 8 1000 group 1 5 0101 6 0110 9 1001 10 1010 group 2 7 0111 14 1110 group 3 Quine-McCluskey MethodAn Example Column I Column II Column III 0,1,8,9 -00- 0,2,8,10 -0-0 0,8,1,9 -00- CMPUT 329 - Computer Organization and Architecture II