Title: Minimization of automata
1Minimization of automata
Minimization of number of states
Automata are equivalent Often initial
specification is not minimal
We reduce the number of flip-flops
2Minimization of FSM
Compatibility relation on set of states
S (pairs of compatible states)
Maximal compatibles (Maximal sets of compatible
pairs)
- Selection of sets satisfying the following
- Cover condition
- Closure condition
3Basic Concepts
Two internal states Si, Sj are Compatible, if for
each input v they have consistent output states,
and their successors are the same or compatible.
Two internal states Si, Sj are conditionally
compatible, if their output states are consistent
and for some v ? V pairs of successors of Si, Sj
(denote Sk, Sl) (Si, Sj) ? (Sk, Sl)
States Si, Sj are incompatible, if for some v ? V
the states of their outputs are inconsistent.
4Compatibility relation
Because of conditional compatibility we use
triangular table in all calculations
Triangular table has as many cells as there are
possible pairs of states.
5Triangular table
We fill the cells of triangular table as follows
6Triangular table example
v
36
46
v
v
v
24
1,2 3,5
v
34
7Triangular table - example
After filling the table we check if the pairs of
incompatible states (denoted by ?) do exist as
pairs of successor states.
If there are such pairs, they should be
crossed out (i.e. denote by ?). This process
should be repeated until all crosses are checked
out.
All non-crossed cells correspond to compatible
pairs
(1,2) (1,3) (1,5) (2,3) (2,4) (2,5) (3,5)
(3,6) (4,6).
8Calculating MCC
After calculating the set of pairs of compatible
states, we Calculate the following
Maximal sets of compatible states.
Maximal classes of compatibility (MCC)
...we know how to do it!
9...we return to the example
Compatible pairs (1,2) (1,3) (1,5) (2,3)
(2,4) (2,5) (3,5) (3,6) (4,6)
MCC 1,2,3,5
v v v v v v
1,2 1,3 1,5 2,3 2,4 2,5 3,5 3,6 4,6
1,2,3
1,2,5 1,3,5 2,3,5
2,4 3,6 4,6
MCC 1,2,3,5, 2,4, 3,6, 4,6
10Minimization Algorithm
1) Find all pairs of compatible states,
2) Calculate maximal sets of compatible states
(MCC),
3) Select sets that satisfy the so-called
Covering condition (a) and closure condition (b)
a) Each state must be in at least one class
b) For each input symbol all succesors (next
states) of each class must be included into one
class.
11Covering Condition - example
MCC 1,2,3,5, 3,6, 2,4, 4,6
To satisfy covering condition we should select
1,2,3,5, 4,6
12Closure condition - example
For selected classes 1,2,3,5,4,6 we
calculate their successors
4,6
3,6
2,4
2
3,6!
2,4!
3
6
1,2
3,5
Closure condition is not satisfied!
13Condition of covering and closure second try
MCC 1,2,3,5, 3,6, 2,4, 4,6
Selection
1,2, 3,5, 4,6
14One more example
46
56
45
v
v
v
37
v
v
37
68
v
v
48
58
v
v
v
15One more example continued
1,3 1,7 2,5 2,8 3,4 3,5 3,6 4,5 4,6 4,7 5,7 5,8 6,
7 6,8
Compatibles
MCC
2,5,8
3,4,5
3,4,6 4,5,7 4,6,7 1,3 1,7 6,8
16One more example continued
2,5,8 3,4,5 3,4,6 4,5,7 4,6,7 1,3 1,7 6,8
MCC
Table of successors
3
7
7
2
3
7
2
33
45
1
45
58
58
64
68
17One more example continued
A
B
C
18How to improve calculating MCCs?
In order to improve calculating of MCCs we will
introduce two new methods
- Method based on compatible pairs
- b) Method based on incompatible pairs
19Algorithm based on compatible pairs
E compatibility relation (ei,ej) ? E
Rj ei i lt j and (ei,ej) ? E
If CCFk is a family of compatible classes
obtained at the k-th iteration of the algorithm,
then CCFk1 is described by the intersection of
each CC ? CCFk with the set Rk1. There can be
encountered three possible cases
a) Rk1 ?, then CCFk1 is increased by a class
CC k1
b) CC ? Rk1 ?, then the class CC remains
unchanged
c) CC ? Rk1 ? ?, then a new class CC is
created, CC CC ? Rk1? k1
20Example
Rj ei i lt j oraz (ei,ej) ? E
E
1,2 1,3 1,5 2,3 2,4 2,5 3,5 3,6 4,6
?
R1
R2
1
1,2
R3
R4
2
R5
1,2,3
R6
3,4
21Example
1
1,2
1,2,3
1,2,3
2,4,
Family of MCCs
1,2,3,5,
2,4
2,5,
3,6,
4,6,
1,2,3,5,
2,4
22Algorithm based on incompatible pairs
Write pairs as the product of two-element sums
Transform the product of two-element sums to the
form of sum of logical products
Then the maximal compatibles are obtained by
subtracting from the whole set those sets of
elements (states) that are written in separate
products.
23The same example
Compatible pairs
Incompatible pairs
E
1,2 1,3 1,5 2,3 2,4 2,5 3,5 3,6 4,6
1,4 1,6 2,6 3,4 4,5 5,6
24Example...
Incompatible pairs (k1, k4), (k1, k6), (k2,
k6), (k3, k4), (k4, k5), (k5, k6)
Boolean expression as product of 2-element
sums (k1 k4) (k1 k6 ) (k2 k6) (k3 k4)
(k4 k5) (k5 k6)
After rearranging (k4 k1) (k4 k3 ) (k4
k5) (k6 k1) (k6 k2) (k6 k5)
we transform this expression to the sum of
products form
k1k3k5)
(k4
(k6
k1k2k5)
k4k6 k1k2k4k5 k1k3k5k6 k1k2k3k5
25Example...
The maximal compatible classes are obtained by
subtracting from the whole set those sets of
elements (states) that are written in separate
products.
k1,..., k6
k4k6 k1k2k4k5 k1k3k5k6 k1k2k3k5
k1,..., k6 ? k4, k6 k1, k2, k3, k5
k1,...,k6 ? k1, k2 , k4 , k5 k3,
k6 k1,...,k6 ? k1, k3, k5 , k6 k2 ,
k4 k1,...,k6 ? k1, k2, k3, k5 k4, k6
26Synthesis of sequential circuits
- Synthesis steps
- ? From a word description of the problem, form a
state table - ? Simplify the state table (minimization of
states) - ? Assign the codes to the states (input and
output symbols) - ? Derive the excitation and output functions
minimization
state assignment
27Sequence detector
Design a Mealy machine with one input and one
output (binary). The machine should analyze the
successive triplets of input symbols.
The input symbol that arises in the third pulse
should be 1, when triplet has the form 001, and
0, when triplet is of a differnt form. The
signal that occurs during the first and second
pulse may be unspecified.
0/0
0/-
1/1
1/-
0/0
0/-
1/0
0/0
01100100110101001
0/-
1/0
1/-
- - 0
- - 1
- - 1
- - 0
- - 0
0/0
1/-
1/0
28Sequence detector
1/-
0/-
29Minimization of sequence detector
Many compatibles
We use incompatible pairs to find MCC, since
there is few of them, only two.
30Minimization of sequence detector
Incompatible pairs we write as a Boolean
expression being a product of logic sums
In sequence detector the incompatibles are (2,
3) (4, 5).
Based on this we write the expression (2 ? 3) (4
? 5), which after multiplication obtains the
form (2 ? 3) (4 ? 5) 2 4 ? 2 5 ? 3 4 ? 3 5
Subtracting from set S 1, 2, 3, 4, 5 of all
states those sets of states that are written in
separate products we obtain the family of all MCC
1, 2, 3, 4, 5 2, 4 1, 3, 5 1, 2, 3, 4,
5 2, 5 1, 3, 4 1, 2, 3, 4, 5 3,
4 1, 2, 5 1, 2, 3, 4, 5 3, 5 1, 2,
4
31Minimization of sequence detector
MCC 1, 3, 5, 1, 3, 4, 1, 2, 5, 1, 2, 4
Classes 1, 3, 5, 1, 2, 4 satisfy covering
condition,
Transition function for all MCC
But do not satisfy the closure condition the
next states 1,2,5 !
We add the class 1,2,5
Classes 1,3,5, 1, 2, 4, 1, 2, 5 satisfy
closure and covering conditions
Minimal automaton
32...this is next realized
DGL6 Slides No. 17 to 23!
Whole synthesis process !
Formulation of sequence detector problem