Sunteți pe pagina 1din 103

CMPUT329 - Fall 2003

Topic 5: Quine-McCluskey Method

José Nelson Amaral

CMPUT 329 - Computer


Organization and Architecture II 1
Reading Assignment

Section 4.4

CMPUT 329 - Computer


Organization and Architecture II 2
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 3
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.

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
CMPUT 329 - Computer
Organization and Architecture II 4
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.

CMPUT 329 - Computer


Organization and Architecture II 5
Determination of Prime
Implicants

AB’CD’ + AB’CD = AB’C


(The dash indicates a missing variable)
1010 +1011=101-

We can combine the minterms above because they


differ by a single bit.
The minterms below won’t combine

A’BC’D + A’BCD’

0101 +0110

CMPUT 329 - Computer


Organization and Architecture II 6
Quine-McCluskey Method
An Example
1. Find all the prime implicants
f (a, b, c, d )   m(0,1,2,5,6,7,8,9,10,14)

group 0 0 0000 Group the minterms


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

Column I Column II

group 0 0 0000
1 0001
group 1 2 0010
Combining 8 1000
group 0 and 5 0101
group 1: 6 0110
group 2 9 1001
10 1010
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 8
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


1 0001 
group 1 2 0010
Combining 8 1000
group 0 and 5 0101
group 1: 6 0110
group 2 9 1001
10 1010
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 9
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
group 1 2 0010 
Combining 8 1000
group 0 and 5 0101
group 1: 6 0110
group 2 9 1001
10 1010
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 10
Quine-McCluskey Method
An Example

Column I Column II
Does it make group 0 0 0000  0,1 000-
sense to no 0,2 00-0
1 0001 
combine group 0 0,8 -000
group 1 2 0010 
with group 2 or 3? 8 1000 
No, there are at 5 0101
least two bits that 6 0110
are different. group 2 9 1001
10 1010
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 11
Quine-McCluskey Method
An Example

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

CMPUT 329 - Computer


Organization and Architecture II 12
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 1 8 1000 
and group 2. 5 0101 
6 0110
group 2 9 1001
10 1010
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 13
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 1 8 1000 
and group 2. 5 0101 
6 0110
group 2 9 1001
10 1010
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 14
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 1 8 1000 
1,9 -001
and group 2. 5 0101 
6 0110
group 2 9 1001 
10 1010
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 15
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 1 8 1000 
1,9 -001
and group 2. 5 0101 
6 0110
group 2 9 1001 
10 1010
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 16
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 1 8 1000 
1,9 -001
and group 2. 5 0101 
6 0110
group 2 9 1001 
10 1010
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 17
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 1 8 1000 
1,9 -001
and group 2. 5 0101 
6 0110
group 2 9 1001 
10 1010
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 18
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 1 8 1000 
1,9 -001
and group 2. 5 0101  2,6 0-10
6 0110 
group 2 9 1001 
10 1010
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 19
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 1 8 1000 
1,9 -001
and group 2. 5 0101  2,6 0-10
6 0110 
group 2 9 1001 
10 1010
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 20
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 1 8 1000 
1,9 -001
and group 2. 5 0101  2,6 0-10
6 0110  2,10 -010
group 2 9 1001 
10 1010 
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 21
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 1 8 1000 
1,9 -001
and group 2. 5 0101  2,6 0-10
6 0110  2,10 -010
group 2 9 1001 
10 1010 
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 22
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 1 8 1000 
1,9 -001
and group 2. 5 0101  2,6 0-10
6 0110  2,10 -010
group 2 9 1001 
10 1010 
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 23
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 1 8 1000 
1,9 -001
and group 2. 5 0101  2,6 0-10
6 0110  2,10 -010
group 2 9 1001  8,9 100-
10 1010 
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 24
Quine-McCluskey Method
An Example

Column I Column II

Again, there is group 0 0 0000  0,1 000-


0,2 00-0
no need to try 1 0001 
0,8 -000
to combine group group 1 2 0010 
1,5 0-01
1 with group 2. 8 1000 
1,9 -001
5 0101  2,6 0-10
6 0110  2,10 -010
group 2 9 1001  8,9 100-
10 1010  8,10 10-0
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 25
Quine-McCluskey Method
An Example

Column I Column II

Again, there is group 0 0 0000  0,1 000-


0,2 00-0
no need to try 1 0001 
0,8 -000
to combine group group 1 2 0010 
1,5 0-01
1 with group 3. 8 1000 
1,9 -001
5 0101  2,6 0-10
6 0110  2,10 -010
Lets try to combine group 2 9 1001  8,9 100-
group 2 with 10 1010  8,10 10-0
group 23.
7 0111
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 26
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 2 8 1000 
1,9 -001
and group 3. 5 0101  2,6 0-10
6 0110  2,10 -010
group 2 9 1001  8,9 100-
10 1010  8,10 10-0
5,7 01-1
7 0111 
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 27
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 2 8 1000 
1,9 -001
and group 3. 5 0101  2,6 0-10
6 0110  2,10 -010
group 2 9 1001  8,9 100-
10 1010  8,10 10-0
5,7 01-1
7 0111 
group 3
14 1110

CMPUT 329 - Computer


Organization and Architecture II 28
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 2 8 1000 
1,9 -001
and group 3. 5 0101  2,6 0-10
6 0110  2,10 -010
group 2 9 1001  8,9 100-
10 1010  8,10 10-0
5,7 01-1
7 0111 
group 3 6,7 011-
14 1110

CMPUT 329 - Computer


Organization and Architecture II 29
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 2 8 1000 
1,9 -001
and group 3. 5 0101  2,6 0-10
6 0110  2,10 -010
group 2 9 1001  8,9 100-
10 1010  8,10 10-0
5,7 01-1
7 0111 
group 3 6,7 011-
14 1110 
6,14 -110

CMPUT 329 - Computer


Organization and Architecture II 30
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 2 8 1000 
1,9 -001
and group 3. 5 0101  2,6 0-10
6 0110  2,10 -010
group 2 9 1001  8,9 100-
10 1010  8,10 10-0
5,7 01-1
7 0111 
group 3 6,7 011-
14 1110 
6,14 -110

CMPUT 329 - Computer


Organization and Architecture II 31
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 2 8 1000 
1,9 -001
and group 3. 5 0101  2,6 0-10
6 0110  2,10 -010
group 2 9 1001  8,9 100-
10 1010  8,10 10-0
5,7 01-1
7 0111 
group 3 6,7 011-
14 1110 
6,14 -110

CMPUT 329 - Computer


Organization and Architecture II 32
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


0,2 00-0
1 0001 
0,8 -000
group 1 2 0010 
1,5 0-01
Combine group 2 8 1000 
1,9 -001
and group 3. 5 0101  2,6 0-10
6 0110  2,10 -010
group 2 9 1001  8,9 100-
10 1010  8,10 10-0
5,7 01-1
7 0111 
group 3 6,7 011-
14 1110 
6,14 -110

CMPUT 329 - Computer


Organization and Architecture II 33
Quine-McCluskey Method
An Example

Column I Column II

group 0 0 0000  0,1 000-


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

Column I Column II

group 0 0 0000  0,1 000-


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

Column I Column II Column III

group 0 0 0000  0,1 000-


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

Column I Column II Column III

group 0 0 0000  0,1 000-


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

Column I Column II Column III

group 0 0 0000  0,1 000-


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

Column I Column II Column III

group 0 0 0000  0,1 000-


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

Column I Column II Column III

group 0 0 0000  0,1 000-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


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

Column I Column II Column III

group 0 0 0000  0,1 000-  0,1,8,9 -00-


0,2 00-0  0,2,8,10 -0-0
1 0001 
2 0010  0,8 -000  2,6,10,14 --10
group 1
8 1000  1,5 0-01
1,9 -001 
5 0101  2,6 0-10 
6 0110  2,10 -010 
group 2 9 1001  
8,9 100-
10 1010  
8,10 10-0 f = a’c’d + a’bd + a’bc + b’c’
5,7 01-1
7 0111  + b’d’ + cd’
group 3 6,7 011-
14 1110 
6,14 -110 
10,14 1-10 
CMPUT 329 - Computer
Organization and Architecture II 68
Quine-McCluskey Method
An Example
But, the form below is not minimized, using a
Karnaugh map we can obtain:
f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’

1 1
d
c

CMPUT 329 - Computer


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

1 1
d
1
c

CMPUT 329 - Computer


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

1 1
d
1
c
1

CMPUT 329 - Computer


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

1 1
1 1 1
d
1
c
1

CMPUT 329 - Computer


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

1 1
1 1 1
d
1
c
1 1 1

CMPUT 329 - Computer


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

1 1
1 1 1
d
1
c
1 1 1 1

CMPUT 329 - Computer


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

1 1
F = a’bd
1 1 1
d
1
c
1 1 1 1

CMPUT 329 - Computer


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

1 1
F = a’bd + cd’
1 1 1
d
1
c
1 1 1 1

CMPUT 329 - Computer


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

1 1
F = a’bd + cd’ + b’c’
1 1 1
d
1
c
1 1 1 1

CMPUT 329 - Computer


Organization and Architecture II 77
Quine-McCluskey Method
An Example
What are the extra terms in the solution obtained
with the Quine-McCluskey method?
f = a’c’d + a’bd + a’bc + b’c’ + b’d’ + cd’

1 1
F = a’bd + cd’ + b’c’
1 1 1
d
Thus, we need a method to 1
eliminate this redundant terms c
1 1 1 1
from the Quine-McCluskey solution.
b

CMPUT 329 - Computer


Organization and Architecture II 78
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.

CMPUT 329 - Computer


Organization and Architecture II 79
Prime Implicant Chart
(Example)
minterms
Prime Implicants 0 1 2 5 6 7 8 9 10 14
(0,1,8,9) b’c’ X X X X
(0,2,8,10) b’d’ X X X X
(2,6,10,14) cd’ X X X X
(1,5) a’c’d X X
(5,7) a’bd X X
(6,7) a’bc X X

Question: Given the prime implicant chart above,


how can we identify the essential prime
implicants of the function?

CMPUT 329 - Computer


Organization and Architecture II 80
Prime Implicant Chart
(Example)
minterms
Prime Implicants 0 1 2 5 6 7 8 9 10 14
(0,1,8,9) b’c’ X X X X
(0,2,8,10) b’d’ X X X X
(2,6,10,14) cd’ X X X X
(1,5) a’c’d X X
(5,7) a’bd X X
(6,7) a’bc X X

Similar to the Karnaugh map, all we have to do is


to look for minterms that are covered by a single
term.

CMPUT 329 - Computer


Organization and Architecture II 81
Prime Implicant Chart
(Example)
minterms
Prime Implicants 0 1 2 5 6 7 8 9 10 14
(0,1,8,9) b’c’ X X X X
(0,2,8,10) b’d’ X X X X
(2,6,10,14) cd’ X X X X
(1,5) a’c’d X X
(5,7) a’bd X X
(6,7) a’bc X X

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.
CMPUT 329 - Computer
Organization and Architecture II 82
Prime Implicant Chart
(Example)
minterms
Prime Implicants 0 1 2 5 6 7 8 9 10 14
(0,1,8,9) b’c’ X X X X
(0,2,8,10) b’d’ X X X X
(2,6,10,14) cd’ X X X X
(1,5) a’c’d X X
(5,7) a’bd X X
(6,7) a’bc X X

CMPUT 329 - Computer


Organization and Architecture II 83
Prime Implicant Chart
(Example)
minterms
Prime Implicants 0 1 2 5 6 7 8 9 10 14
(0,1,8,9) b’c’ X X X X
(0,2,8,10) b’d’ X X X X
(2,6,10,14) cd’ X X X X
(1,5) a’c’d X X
(5,7) a’bd X X
(6,7) a’bc X X

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.

CMPUT 329 - Computer


Organization and Architecture II 84
Prime Implicant Chart
(Example)
minterms
Prime Implicants 0 1 2 5 6 7 8 9 10 14
(0,1,8,9) b’c’ X X X X
(0,2,8,10) b’d’ X X X X
(2,6,10,14) cd’ X X X X
(1,5) a’c’d X X
(5,7) a’bd X X
(6,7) a’bc X X

What strategy should we use to find a minimum


cover for the remaining minterms?

CMPUT 329 - Computer


Organization and Architecture II 85
Prime Implicant Chart
(Example)
minterms
Prime Implicants 0 1 2 5 6 7 8 9 10 14
(0,1,8,9) b’c’ X X X X
(0,2,8,10) b’d’ X X X X
(2,6,10,14) cd’ X X X X
(1,5) a’c’d X X
(5,7) a’bd X X
(6,7) a’bc X X

We choose first prime implicants that cover the


most minterms.
Should this strategy always work??

CMPUT 329 - Computer


Organization and Architecture II 86
Prime Implicant Chart
(Example)
minterms
Prime Implicants 0 1 2 5 6 7 8 9 10 14
(0,1,8,9) b’c’ X X X X
(0,2,8,10) b’d’ X X X X
(2,6,10,14) cd’ X X X X
(1,5) a’c’d X X
(5,7) a’bd X X
(6,7) a’bc X X

Therefore our minimum solution is:

f(a,b,c,d) = b’c’ + cd’ + a’bd

CMPUT 329 - Computer


Organization and Architecture II 87
Cyclic Prime Implicant
Chart
F(a,b,c) =  m(0, 1, 2, 5, 6, 7)
minterms
0 1 2 5 6 7
0 000 

Prime Implicants
0,1 00- (0,1) a’b’ X X
1 001  0,2 0-0 (0,2) a’c X X
2 010  1,5 -01 (1,5) b’c X X
5 101  2,6 -10 (2,6) bc’ X X
6 110  5,7 1-1 (5,7) ac X X
7 111  6,7 11- (6,7) ab X X

Which ones are the essential prime implicants


in this chart?
There is no essential prime implicants, how we proceed?
CMPUT 329 - Computer
Organization and Architecture II 88
Cyclic Prime Implicant
Chart
F(a,b,c) =  m(0, 1, 2, 5, 6, 7)
minterms
0 1 2 5 6 7
0 000 

Prime Implicants
0,1 00- (0,1) a’b’ X X
1 001  0,2 0-0 (0,2) a’c X X
2 010  1,5 -01 (1,5) b’c X X
5 101  2,6 -10 (2,6) bc’ X X
6 110  5,7 1-1 (5,7) ac X X
7 111  6,7 11- (6,7) ab X X

Also, all implicants cover the same number of


minterms. We will have to proceed by trial and error.
F(a,b,c) = a’b’

CMPUT 329 - Computer


Organization and Architecture II 89
Cyclic Prime Implicant
Chart
F(a,b,c) =  m(0, 1, 2, 5, 6, 7)
minterms
0 1 2 5 6 7
0 000 

Prime Implicants
0,1 00- (0,1) a’b’ X X
1 001  0,2 0-0 (0,2) a’c X X
2 010  1,5 -01 (1,5) b’c X X
5 101  2,6 -10 (2,6) bc’ X X
6 110  5,7 1-1 (5,7) ac X X
7 111  6,7 11- (6,7) ab X X

Also, all implicants cover the same number of


minterms. We will have to proceed by trial and error.
F(a,b,c) = a’b’ + bc’

CMPUT 329 - Computer


Organization and Architecture II 90
Cyclic Prime Implicant
Chart
F(a,b,c) =  m(0, 1, 2, 5, 6, 7)
minterms
0 1 2 5 6 7
0 000 

Prime Implicants
0,1 00- (0,1) a’b’ X X
1 001  0,2 0-0 (0,2) a’c X X
2 010  1,5 -01 (1,5) b’c X X
5 101  2,6 -10 (2,6) bc’ X X
6 110  5,7 1-1 (5,7) ac X X
7 111  6,7 11- (6,7) ab X X

Thus, we get the minimization:

F(a,b,c) = a’b’ + bc’ + ac

CMPUT 329 - Computer


Organization and Architecture II 91
Cyclic Prime Implicant
Chart
F(a,b,c) =  m(0, 1, 2, 5, 6, 7)
minterms
0 1 2 5 6 7
0 000 

Prime Implicants
0,1 00- (0,1) a’b’ X X
1 001  0,2 0-0 (0,2) a’c X X
2 010  1,5 -01 (1,5) b’c X X
5 101  2,6 -10 (2,6) bc’ X X
6 110  5,7 1-1 (5,7) ac X X
7 111  6,7 11- (6,7) ab X X

Lets try another set of prime implicants.

CMPUT 329 - Computer


Organization and Architecture II 92
Cyclic Prime Implicant
Chart
F(a,b,c) =  m(0, 1, 2, 5, 6, 7)
minterms
0 1 2 5 6 7
0 000 

Prime Implicants
0,1 00- (0,1) a’b’ X X
1 001  0,2 0-0 (0,2) a’c X X
2 010  1,5 -01 (1,5) b’c X X
5 101  2,6 -10 (2,6) bc’ X X
6 110  5,7 1-1 (5,7) ac X X
7 111  6,7 11- (6,7) ab X X

Lets try another set of prime implicants.

F(a,b,c) = a’c

CMPUT 329 - Computer


Organization and Architecture II 93
Cyclic Prime Implicant
Chart
F(a,b,c) =  m(0, 1, 2, 5, 6, 7)
minterms
0 1 2 5 6 7
0 000 

Prime Implicants
0,1 00- (0,1) a’b’ X X
1 001  0,2 0-0 (0,2) a’c X X
2 010  1,5 -01 (1,5) b’c X X
5 101  2,6 -10 (2,6) bc’ X X
6 110  5,7 1-1 (5,7) ac X X
7 111  6,7 11- (6,7) ab X X

Lets try another set of prime implicants.

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

CMPUT 329 - Computer


Organization and Architecture II 94
Cyclic Prime Implicant
Chart
F(a,b,c) =  m(0, 1, 2, 5, 6, 7)
minterms
0 1 2 5 6 7
0 000 

Prime Implicants
0,1 00- (0,1) a’b’ X X
1 001  0,2 0-0 (0,2) a’c X X
2 010  1,5 -01 (1,5) b’c X X
5 101  2,6 -10 (2,6) bc’ X X
6 110  5,7 1-1 (5,7) ac X X
7 111  6,7 11- (6,7) ab X X

Lets try another set of prime implicants.

F(a,b,c) = a’c + b’c’+ ab

CMPUT 329 - Computer


Organization and Architecture II 95
Cyclic Prime Implicant
Chart
F(a,b,c) =  m(0, 1, 2, 5, 6, 7)
minterms
0 1 2 5 6 7
0 000 

Prime Implicants
0,1 00- (0,1) a’b’ X X
1 001  0,2 0-0 (0,2) a’c X X
2 010  1,5 -01 (1,5) b’c X X
5 101  2,6 -10 (2,6) bc’ X X
6 110  5,7 1-1 (5,7) ac X X
7 111  6,7 11- (6,7) ab X X

This time we obtain:

F(a,b,c) = a’c + b’c’+ ab

CMPUT 329 - Computer


Organization and Architecture II 96
Cyclic Prime Implicant
Chart
F(a,b,c) = a’b’ + bc’ + ac
F(a,b,c) = a’c + b’c’+ ab

Which minimal form is better?

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.


CMPUT 329 - Computer
Organization and Architecture II 97
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.

CMPUT 329 - Computer


Organization and Architecture II 98
Petrick’s Method
An Example
minterms
0 1 2 5 6 7

Prime Implicants
P1 (0,1) a’b’ X X
P2 (0,2) a’c X X
P3 (1,5) b’c X X
P4 (2,6) bc’ X X
P5 (5,7) ac X X
P6 (6,7) ab X X

Step 1: Label all the rows in the chart.

Step 2: Form a logic function P with the logic


variables P1, P2, P3 that is true when
all the minterms in the chart are covered.
CMPUT 329 - Computer
Organization and Architecture II 99
Petrick’s Method
An Example
minterms
0 1 2 5 6 7

Prime Implicants
P1 (0,1) a’b’ X X
P2 (0,2) a’c X X
P3 (1,5) b’c X X
P4 (2,6) bc’ X X
P5 (5,7) ac X X
P6 (6,7) ab X X

The first column has an X in rows P1 and P2.


Therefore we must include one of these rows
in order to cover minterm 0. Thus the following
term must be in P:

(P1 + P2)
CMPUT 329 - Computer
Organization and Architecture II 100
Petrick’s Method
An Example
minterms
0 1 2 5 6 7

Prime Implicants
P1 (0,1) a’b’ X X
P2 (0,2) a’c X X
P3 (1,5) b’c X X
P4 (2,6) bc’ X X
P5 (5,7) ac X X
P6 (6,7) ab X X

Following this technique, we obtain:


P = (P1 + P2) (P1 + P3) (P2 + P4) (P3 + P5) (P4 + P6) (P5 + P6)

P = (P1 + P2) (P1 + P3) (P4 + P2) (P5 + P3) (P4 + P6) (P5 + P6)

P = (P1 + P2) (P1 + P3) (P4 + P2) (P4 + P6) (P5 + P3) (P5 + P6)

P = (P1 + P2 P3) (P4 + P2 P6) (P5 + P3 P6)


CMPUT 329 - Computer
Organization and Architecture II 101
Petrick’s Method
An Example
P = (P1 + P2) (P1 + P3) (P2 + P4) (P3 + P5) (P4 + P6) (P5 + P6)

P = (P1 + P2) (P1 + P3) (P4 + P2) (P5 + P3) (P4 + P6) (P5 + P6)

P = (P1 + P2) (P1 + P3) (P4 + P2) (P4 + P6) (P5 + P3) (P5 + P6)

P = (P1 + P2 P3) (P4 + P2 P6) (P5 + P3 P6)

P = (P1 P4 + P1 P2 P6 + P2 P3 P4 + P2 P3 P6) (P5 + P3 P6)

P = P1 P4 P5 + P1 P2 P5 P6 + P2 P3 P4 P5 + P2 P3 P5 P6
+ P1 P3 P4 P6 + P1 P2 P3 P6 + P2 P3 P4 P6 + P2 P3 P6

P = P1 P4 P5 + P1 P2 P5 P6 + P2 P3 P4 P5 + P1 P4 P3 P6 + P2 P3 P6
CMPUT 329 - Computer
Organization and Architecture II 102
Petrick’s Method
An Example
P = P1 P4 P5 + P1 P2 P5 P6 + P2 P3 P4 P5 + P1 P4 P3 P6 + P2 P3 P6

This expression says that to cover all the minterms


we must include the terms in line P1 and line P4 and
line P5, or we must include line P1, and line P2, and
line P5, and line P6, or …
Considering that all the terms P1, P2, … have the same
cost, how many minimal forms the function has?
The two minimal forms are P1 P4 P5 and P2 P3 P6:

F = a’b’ + bc’ + ac F = a’c’ + b’c + ab

CMPUT 329 - Computer


Organization and Architecture II 103

S-ar putea să vă placă și