Chapter 2 - Part 6 - PPT - Mano & Kime
Download
Report
Transcript Chapter 2 - Part 6 - PPT - Mano & Kime
SYEN 3330
Digital Systems
Chapter 2 – Part 6
SYEN 3330 Digital Systems
Jung H. Kim Chapter 2-6 1
Table Methods for PI Generation
This method of simplifying a Boolean equation was improved by
Quine and McCluskey and is sometimes known as the Q-M
Method.
The Tabular Method:
1. Starts with a table of minterms.
2. Compares each minterm with every other minterm in the
list to find minterms which differ in exactly one variable.
3. Constructs a new list with terms of one fewer variables,
keeping track of which minterms were covered.
4. Compares every element in the new list with each other
to find terms that differ in one more variable.
5. Repeats Steps 3 and 4 until done.
SYEN 3330 Digital Systems
Chapter 2-6
2
An Example: F(x,y,z)= m(2,3,6,7)
Initial work: Step 1 creates a table of minterms.
Column (a)
Column (b)
Column(c)
xyz
xyz
xyz
010 m2
011 m3
110 m6
111 m7
Step 2: Compare each minterm with all others.
010: (011 01-), (110 -10), (111Ø)
011:
(110 Ø), (111-11)
110:
(111 11-)
SYEN 3330 Digital Systems
Chapter 2-6
3
Results - Step 2
Column (a)
xyz
010 m2
011 m3
110 m6
111 m7
Column (b) Column(c)
xyz m2,m3 xyz
(01-)
(-10) m2,m6
(-11) m3,m7
(11-) m6,m7
Note that there can be terms which are duplicated -- that
is, they appear more than once. The terms are duplicates
if they have the same pattern of bits (including the -) and
they came from the same minterms. Only one of each
duplicate term should remain.
SYEN 3330 Digital Systems
Chapter 2-6
4
Step 3
Column (a)
xyz
010 m2
011 m3
110 m6
111 m7
Column (b) Column(c)
xyz m2,m3 xyz
(01-)
(-10) m2,m6
(-11) m3,m7
(11-) m6,m7
Step 3: Make a new list by comparing items in Column (b).
01-: (-10 Ø), (-11 Ø ), (11- -1-)
-10: (01- Ø), (-11 -1-), (11- Ø )
-11: (01- -1-), (-10 -1-), (11- Ø )
11-: (01- -1-), (-10 Ø ), (-11 Ø )
SYEN 3330 Digital Systems
Chapter 2-6
5
The Results of Step 3
Column (a)
xyz
010 m2
011 m3
110 m6
111 m7
Column (b)
xyz
(01-) m2,m3
(-10) m2,m6
(-11) m3,m7
(11-) m6,m7
Column(c)
xyz
(-1-) m2,m3,m6,m7
(-1-) m2,m6,m3,m7
(-1-) m3,m7,m6,m7
(-1-) m6,m7,m2,m3
Obviously, the Column (c) can be simplified by
eliminating duplicates -- this leads to only one entry:
(-1-) from m2,m3,m6,m7
This corresponds to the Prime Implicant "y". The
algorithm terminates at this point. Since this is the only PI
and it covers all minterms, the result is: F(x,y,z) = y
SYEN 3330 Digital Systems
Chapter 2-6
6
Computational Complexity Issues
The table method generates a lot of work. For "n"
minterms, there are on the order of n2 comparisons
required.
The Q-M Method simplifies the work by sorting the
minterms into terms that can compare favorably. Terms
that have no chance of combining are not even tried. It
also adds some bookkeeping to simplify PI identification.
Grouping: Use the number of "1"s in the minterm to group
the minterms. Preserve groups derived from this grouping
in adjacent columns.
Bookkeeping: Use a "check mark" () next to terms
that have been combined. Carry along lists of
minterms used.
SYEN 3330 Digital Systems
Chapter 2-6
7
Q-M on F(x,y,z)= m(2,3,6,7)
Initial
Group
One 1
Column (a) Column (b) Column(c)
xyz
xyz
xyz
010 m2
---------------Two 1's 011 m3
110 m6
---------------Three 1's 111 m7
Step 2: Compare terms from adjacent groups.
Group 1 => Group 2
010: (011 01-), (110 -10)
Group 2 => Group 3
011: (111-11)
NOTICE: Fewer steps!
110: (111 11-)
SYEN 3330 Digital Systems
Chapter 2-6
8
The Result of Step 3
Initial
Group
One 1
Column (a)
xyz
010 m2
---------------Two 1's 011 m3
110 m6
---------------Three 1's 111 m7
Column (b)
Column(c)
xyz
xyz
(01-) m2,m3
(-10) m2,m6
-----------------(-11) m3,m7
(11-) m6,m7
Step 4: Repeat on Column (b)
Group (1-2) => Group (2-3)
(01-): (-11 Ø), (11- -1-)
(-10): (-11 -1-), (11-Ø)
SYEN 3330 Digital Systems
Chapter 2-6
9
Result of Step 4
Initial
Group
One 1
Two 1's
Column (a)
xyz
010 m2
---------------011 m3
110 m6
---------------111 m7
Column (b)
xyz
(01-) m2,m3
(-10) m2,m6
-----------------(-11) m3,m7
(11-) m6,m7
Column(c)
xyz
(-1-)m2,m3,m6,m7
(-1-)m2m6,m7
,m3,m6,m7
m3,m7
Three
1's that the resulting terms are duplicates and are unchecked at
Note
termination.
Final Result: F(x,y,z) = y
In general, when no new terms can be generated, the set of all
unchecked terms give the result.
SYEN 3330 Digital Systems
Chapter 2-6
10
Review of Boolean Logic
Given a Boolean Function F, We have learned to express F
as: 1. Canonical Sum-of-Minterms
2. Canonical Product-of-Maxterms
3. Standard Sum-of-Products (SOP) Form
4. Standard Product-of-Sums (POS) Form
We have also learned how to minimize the number of
literals in F by using:
1. Algebraic Simplification.
2. Selection of Prime Implicants (Karnaugh Map
and Quine-McCloskey Method)
3. Systematic K-Map to minimum literal SOP.
SYEN 3330 Digital Systems
Chapter 2-6
11
Canonical Forms
F ( w, x, y, z ) 0,2,4,5,8,10,11,13,15
F( w, x, y, z)
1,3,6,7,9,12,14
y
1
1
0
4
0
w
12
1
8
0
1
1
5
1
13
0
9
0
0
3
7
1
0
1
0
1
1
15
11
2
6
14
10
z
NOTE: there is one and only one way to write the
equations in Canonical Sum-of-minterm and
Canonical Product-of-Maxterm form.
SYEN 3330 Digital Systems
Chapter 2-6
12
x
Minimum Literal SOP Form
Example: Find a minimum literal Standard SOP form for
F(w,x,y,z)
F(w,x,y,z) =
F(w,x,y,z) =
x'z' + w'y'z' + xy'z + wyz
x'z' + w'xy' + wxz + wx'y
y
1
1
0
w
1
0
4
12
8
0
1
1
0
0
1
0
5
1
13
1
9
3
7
15
11
y
1
0
0
1
z
2
1
6
1
x
0
14
w
10
1
0
4
12
8
0
1
1
0
0
1
0
5
1
13
1
9
3
7
15
11
1
0
0
1
2
6
x
14
10
z
NOTE: Both are minimum literal SOP!
SYEN 3330 Digital Systems
Chapter 2-6
13
Tabular Method to Find a Cover
1). Construct a table with:
a). Columns for each minterm and
b). Rows for each Prime Implicant
2). Select Essential Prime Implicants and check off each
covered minterm.
3). Delete Less Than Prime Implicants
4). Select Secondary Essential Prime Implicants and check off
each covered minterm.
5). Repeat 3 and 4 until a cover is generated.
If cycles exist, pick a PI and generate a cover and then delete
that same PI and generate an alternate cover. Select the
minimum literal cover.
SYEN 3330 Digital Systems
Chapter 2-6
14
Table Method Example
Function g(w,x,y,z)
y
1
0
4
w
12
1
8
1
1
1
1
5
1
13
9
z
3
1
7
1
15
11
Step 1, Enter table:
2
6
1
14
x
PI
1 x' z'
10
w' x'
w' y' z
x y' z
wxz
wx y
w y z'
SYEN 3330 Digital Systems
0
x
x
1
x
x
2
x
x
3
5
8 10 13 14 15
x x
Type
x
x
x
x
x
x
x
x
x
x
Chapter 2-6
15
Select Essential Prime Implicants
Step 2: Select Essential Prime Implicants and check them
off along with minterms covered.
PI
x'z'
w'x'
w'y'z
xy'z
wxz
wxy
wyz'
0
x
x
1
x
x
2
x
x
3
5
8 10 13 14 15
x x
x
x
x
x
x
x
x
x
Type
Essential
Essential
x
x
Note: w'y'z is less than xy'z since xy'z covers two as yet uncovered
minterms (m5 and m13) while w'y'z covers one (m5) uncovered
minterm.
Similarly wyz' is less than wxy. Why?
SYEN 3330 Digital Systems
Chapter 2-6
16
Select Essential Prime Implicants
Reduced Covered Table
PI
w'y'z
xy'z
wxz
wxy
wyz'
5 13 14 15
x
x x
x
x
x x
x
SYEN 3330 Digital Systems
Chapter 2-6
17
Less Than Prime Implicants
Step 3: Delete Less Than Prime Implicants
PI
0
x'z'
x
w'x'
x
w'y'z
1
2
3
5
x
x
x
8 10 13 14 15
x
x
Essential
x
x
Essential
x
xy'z
Less Than
x
x
wxz
x
wxy
x
x
wyz'
x
Type
x
x
Less Than
Note that after deleting the Less Than PIs, the following occurs:
Minterm 5 is only covered by xy'z and Minterm 14 by wxy.
Thus wxy and xy'z are Secondary Essential PIs.
SYEN 3330 Digital Systems
Chapter 2-6
18
Secondary Essential PIs
PI
x'z'
w'x'
w'y'z
xy'z
wxz
wxy
wyz'
0
x
x
1
x
x
2
x
x
3
5
8 10 13 14 15
x x
x
x
x
x
x
x
x
x
x
x
Type
Essential
Essential
Less Than
Secondary
Essential
(Redundant)
Secondary
Essential
Less
Than
Note that at this point, minterms 13 and 15 are already
covered, so the PI wxz is redundant. The algorithm
terminates at this point with the minimum literal, Standard
Sum-of-Products form:
F(w,x,y,z) = x'z' + w'x' + xy'z + wxy
SYEN 3330 Digital Systems
Chapter 2-6
19
Cyclic Structures
y
Let F(x,y,z) = m(0,1,2,5,6,7)
1
We build the following PI Table:
0
x
4
1
1
1
3
1
5
7
1
1
2
6
z
PI 0 1 2 5 6 7
x' y' x x
y' z
x
x
xz
x
x
xy
x x
y z'
x
x
x' z' x
x
SYEN 3330 Digital Systems
Type
Chapter 2-6
20
Cyclic Structure: Pick One
NOTE: All minterms are covered twice. No PIs are
essential. A cyclic structure exists.
Step 1: Pick a PI and mark off the covered minterms.
PI 0 1 2 5 6 7
x' y' x x
y' z
x
x
xz
x
x
xy
x x
y z'
x' z'
x
x
Type
(Picked)
x
x
SYEN 3330 Digital Systems
Chapter 2-6
21
Less Thans
Step 2: Eliminate Less Thans.
PI 0 1 2 5 6 7
x' y' x x
y' z
x
x
xz
x
x
xy
x x
y z'
x
x
x' z' x
x
Type
(Picked)
Less Than
Less Than
Once the less thans are deleted, there are two
secondary essential PIs.
SYEN 3330 Digital Systems
Chapter 2-6
22
Secondary Essential PIs
Step 3: Pick Secondary Essential PIs.
PI 0 1 2 5 6 7
Type
(Picked)
x' y' x x
y' z
x
x
Less Than
x
x Secondary
xz
xy
x x (Redundant)
EPI
x
x
Secondary
y z'
x' z' x
x
Less
Than
EPI
Picking the two secondary essential PIs generates a
complete cover and we can state that the Standard Sum of
Products form for F(x,y,z) is:
F(x,y,z) = x'y' + xz + yz'
SYEN 3330 Digital Systems
Chapter 2-6
23
Now Go Back and Try Again
Step 1': GO BACK and eliminate the PI you picked and
generate a new cover.
PI 0 1 2
x' y' x x
x
y' z
xz
xy
y z'
x
x
x' z' x
5 6 7
x
x
Type
(Eliminated)
Essential
x
x x
x
Essential
Note that y'z and x'z' become essential PIs.
Select y'z and x'z' and then notice that xz and yz'
become less thans.
SYEN 3330 Digital Systems
Chapter 2-6
24
Finish Up
Step 2': Eliminate the less thans.
Step 3': Select Secondary Essential PIs.
PI 0 1 2 5 6 7
Type
(Eliminated)
x' y' x x
Essential PI
x
x
y' z
x
x
Less Than
xz
x x Secondary EPI
xy
x
x
Less Than
y z'
Essential PI
x
x' z' x
Notice that after Step 2', xy is a secondary essential PI and
that picking it completes the cover. Thus the Standard
Product of Sums form for this selection is: F(x,y,z) = y'z + xy + x'z'
Both Implementations are Minimum Literal.
SYEN 3330 Digital Systems
Chapter 2-6
25
Quine-McCluskey (tabular) method
1. Arrange all minterms in group such that all terms in the
same group have the same # of 1’s in their binary
representation.
2. Compare every term of the lowest-index group with each
term in the successive group. Whenever possible, combine
two terms being compared by means of
gxi+gxi´=g(xi+xi´)=g.
Two terms from adjacent groups are combinable if their
binary representation differ by just a single digit in the
same position.
3. The process continues until no further combinations are
possible. The remaining unchecked terms constitute the set
of PI.
SYEN 3330 Digital Systems
Chapter 2-6
26
Ex) f(x1,x2,x3,x4) = (0,1,2,5,6,7,8,9,10,13,15)
#
x1,x2,x3,x4
x1,x2,x3,x4
0
0
0
0
0
1
2
8
0
0
1
0
0
0
0
1
0
1
0
0
5
6
9
10
0
0
1
1
1
1
0
0
0
1
0
1
1
0
1
0
7
13
0
1
1
1
1
0
1
1
15
1
1
1
1
x1,x2,x3,x4
0
0
-
0
0
0
0
0
0
0
(0,1)
(0,2)
(0,8)
0
0
1
1
0
0
0
0
0
0
1
1
0
-
1
1
0
0
0
(1,5)
(1,9)
(2,6)
(2,10)
(8,9)
(8,10)
0
0
1
1
1
1
-
0
1
0
1
1
1
1
1
1
SYEN 3330 Digital Systems
1
-
1
1
(5,7)
(5,13)
(6,7)
(9,13)
(7,15)
(13,15)
-
0
0
1
0
0
-
0
1
1
x1,x2,x3,x4
(0,1,8,9)
(0,2,8,10)
(1,5,9,13)
(5,7,13,15)
Using prime implicant chart, we can find
essential PI
0
(2,6)
(6,7)
(0,1,8,9)
(0,2,8,10)
(1,5,9,13)
(5,7,13,15)
1
2
5
6
7
9
10
13
15
8
Chapter 2-6
27
The reduced PI chart
1
(2,6)
(6,7)
(0,1,8,9)
(1,5,9,13)
6
The essential PI’s are (0,2,8,10) and (5,7,13,15) . So,
f(x1,x2,x3,x4) = (0,2,7,8) + (5,7,13,15) + PI’s
9
Here are 4 different choices (2,6) + (0,1,8,9), (2,6) + (1,5,9,13)
(6,7) + (0,1,8,9), or (6,7) + (1,5,9,13)
A PI pj dominates PI pk iff every minterm covered by pk is also covered by pj.
m1 m2 m3 m4
pj
pk
(can remove)
Branching method
m1 m2 m3 m4 m5
p1
p2
p3
p4
p5
If we choose p1 first, then p3, p5 are next.
p1
p3
p5
p4
p2
p3
Quine – McCluskey method (no limitation of the # of variables)
SYEN 3330 Digital Systems
Chapter 2-6
28
Quine-McCluskey example
• F(A,B,C,D) = (3,9,11,12,13,14,15) +
d (1,4,6)
SYEN 3330 Digital Systems
Chapter 2-6
29
Ex) f(A,B,C,D) = (3,9,11,12,13,14,15) + d (1,4,6)
PI chart:
3
9
11
12
(1,3, 9, 11)
(4, 6,12,14)
(9,13,11,15)
(12,13,14,15)
13
14
15
Reduced PI chart:
12
(4, 6,12,14)
(9,13,11,15)
(12,13,14,15)
13
14
15
Result: (1,3,9,11) + (12,13,14,15)
SYEN 3330 Digital Systems
Chapter 2-6
30
Minimum SOP to Minimum POS
We can use the minimization techniques learned so far
to implement a minimum literal, Standard POS form.
We take the following steps:
1. Implement the COMPLEMENT of a function in
Standard Sum of Product form.
2. Use DeMorgan's Law to complement the function
and convert it to Standard Product of Sum form.
NOTE: Implementing the complement of a function
means using the ZEROS on the K-Map.
SYEN 3330 Digital Systems
Chapter 2-6
31
Minimum POS Example
Given g(w,x,y,z):
Form the Complement (Circle Zeros):
y
1
0
0
w
1
0
4
12
8
1
1
1
0
1
1
0
5
1
13
0
9
3
7
15
11
z
y
1
0
1
1
2
6
14
10
0
0
x
0
w
1
4
5
12
13
8
0
3
0
0
9
7
2
0
6
15
14
11
10
x
z
Next we minimize the function using a table method (or
from the K-Map).
SYEN 3330 Digital Systems
Chapter 2-6
32
Table Method Minimum SOP
PI 4
wx'z
xy'z' x
w'xy
w'xz' x
6 7 9 11 12
Type
x x
Essential PI
x Essential PI
x x
x
Essential PI
Redundant
Thus: g'(w,x,y,z) =
wx'z + xy'z' + w'xy
This implements a Standard Sum of Products form for
the complement of the desired function.
Applying DeMorgan's Law we get: g =
(w'+x+z')(x'+y+z)(w+x'+y')
A minimum literal Standard POS form.
SYEN 3330 Digital Systems
Chapter 2-6
33