Advanced FSM minization and assignment.

advertisement
Finite State
Machine
Minimization
Advanced
Methods based on triangular
table and binate covering
Example 1. Minimize the following Mealy Finite State Machine
Input state or
combination of
x
A X1 X2 X3 X4 input signals
3
1
2
4
3
6
Fig 5.17bcd
5
6
1
2
1
0
0
6
6
4
Internal
state or
combination
of memory
signals
1
4
3
0
1
1
0 05
1
2
1
2 3
0 1
Output states or
signal
combinations
b)
x
2
X1 X2 X3 X4
A
3
1
2
4
3
6
1
2
3
1
0
0
6
6
4
5
6
1
4
3
0
Triangular Table
3, 6
4, 6
4
1
0
1 5
0 1
2
1
2 3
0 1
5
2, 4
6
1, 2
3, 5
3, 4
2
1
3
2
1
3
66
44
5
Fig 3.16
Max cliques are:1235,36,24,46
5
Group {1,2,3,5}
c)
Compatibility Graph
obtained from the
Triangular Table
4
4 Maximum
cliques
b)
x
2
X1 X2 X3 X4
A
3
1
2
4
3
6
4
1
2
3
1
0
6
6
3
0
3, 6
4, 6
No, because {1,2,3,5} implies states
{3,6} to be in one group.
4
0
4
5
6
1
Can I take {1,2,3,5} and {4,6}??
1
0
5
1 5
0 1
2
1
2 3
0 1
2, 4
6
1, 2
3, 5
3, 4
2
1
3
4
5
c)
2
I can take all
max cliques but
solution will be
not minimal
1
3
6
6
44
Solution is to split {1,2,3,5} to {1,2}
and {3,5}
5
{1,2} implies nothing, {3,5}
implies nothing, {4,6} implies {1,2}
and {3,5}
Solution : {1,2}, {3,5}, {4,6}
There are other
solutions
But how I know to split this way? Heuristics!
In any case creating Maximum Compatible Groups is useful!
Systematic Method of Creating Maximum Compatible Groups
a)
Column
Non-cancelled rows
4
{6}
3
{5,6}
2
{3,4,5}
1
{2,3,5}
Groups of compatible states
{4,6}
{3,5} {3,6}
{2,3,5} {2,4}
{1,2,3,5}
= { {4,6} , {1,2,3,5} , {3,6} , {2,4} }
Fig5.17a
This method is systematic and creates
all maximum compatible groups
(cliques)
For small FSMs
you can find
them by visual
inspection
Complete and Closed Subgraph
• Complete = all state numbers
have been used at least once
inside it
• Closed = there is no arrow going
out of this graph
Closure graph for compatibility pairs
This method selects subsets of maximum cliques in order to
satisfy the completeness and closure conditions for state
numbers
This way we
found other
solutions.
Please draw
machines
{1,3}
{1,5}
{2,4}
{3,6}
{1,2}
{4,6}
{3,5}
{2,3}
{2,5}
Combining groups of compatibles from the cover to single state
This is a final stage of state table minimization
It can be done with:
1) ALL groups of compatible states or
2) with the set of complete and closed groups of compatible states
Method to combine State
Minimization and State
Assignment
• The method shown now is a small modification to state
minimization discussed before.
• However, the differences may be large since we combine state
assignment procedure into state minimization loop.
• We make such choices of compatibles that allow to find a better
state assignment.
• Any state assignment method can be used in this loop.
Now let us go back to fast method, remember that it is not optimal
Combining ALL groups of compatibles from the cover to single state
b) x
A X1 X2 X3 X4
3 4 2
1
1 1 1
2
4
3
6
0
0
6
1
2
5
This is nondeterministic
FSM, you can
make a choice to
simplify state
assignment
3
6
6
3
2
4
4
4
6
0
6
1
1
2
0
0
3
1
0
6
0
1
0
5
1
6 1 5
0 0 1
3
2 3
0
0 1
c)
x
A X1 X2 X3 X4
{4,6}
{3,6}
{2,4}
2
A = {1,2,3,5} 0
1
1
1
B = {3,6}
{3,6}
C = {2,4}
4
6
0
2
1
6
0
3
0
1
1
5
1
0
0
3
6
{1,2}
{3,5}
B
B
B,D
A,C
A,B
C
C,D
D
A,B
D = {4,6} 0
0
1
0
x
X1 X2 X3 X4
A
d)
A D 0 B 1 C 1 A,C 1
0
1
A
B,D
0
A
A
0
1
1
0
0
B,D
0
0
A
0
1
Combining ALL groups of compatibles from the cover to single state
Select B
in whole
column
Select states
from groups to
create large
groups of the
same state
Select A
in whole
column
Select C
x
X1
x
X1 X2 X3 X4
A
D
B
B
C
C,D
D
A,B
B
C
B,D
0
1
0
0
B
B
C
C,D
1
A
1
0
0
A
0
1
A,B
A
B,D
0
1
A,C
B,D
D
A
0
1
D
B
C
B,D
0
0
1
A
1
0
0
A
0
1
A,B
A
B,D
0
1
1
0
X4
A,C
A,C
B,D
A,B
X3
1
0
A,C
1
0
A
X2
A
0
1
As you see, it is a good idea to combine FSM minimization
and state assignment. Many methods are based on this idea.
Creating new table by combining
states from groups of compatible
states
• The same method of combining states can be
applied to any set of compatible and closed
Problem for possible homework: Find an FSM table for
which the following triangular table exists:
2
3
4
5
6
1,2
3,4
2,6
3,4
2,5
3,4
2,6
3,4
2,5
1 2 3 4 5
Fig.5.18
Example 3 of FSM Minimization
b
)
2
3,4
6,8
3
6,8
4
3,4
1,6
5
v
6
4,5
7
3,4
1
2
3
4
5
6
7
8
1,8
6,8
6,8
1,6
4,5
1,8
3,5
v
1,6
4/- 6/0
3/1 8/0
4/0 8/0
3/0 1/0
-/- 6/0
5/0 1/0
3/1 -/2/1 1/1
{1,6} 1
{2,7} 2
{3} 3
{4,5} 4
{8} 8
4/0 1/0
3/1 8/0
4/0 8/0
3/0 1/0
2/1 1/1
v
8
2,3
1
c
)
2
3
8
4
5
6
7
d
)
{5,6}
1
7
2
{1,6}
{5,7}
{4,5}
3
6
{2,7}
Fig.5.21.bcd
{1,5}
5
4
{3}
{8}
Homework Problems
• Use a method of combined state
minimization and state assignment to
realize machines from this and previous
lectures and compare the cost of logic
circuit realized as a PLA.
• Write a program for state minimization
reducing the problem to binate covering
and using existing software for binate
covering.
Download