Professional Documents
Culture Documents
Machines
FSM (Finite State Machine) Optimization
State tables
net-list
FSM Optimization
01 00
-0
S2 S3
11 01 0- 10
1-
-0 -1
S1 S4
11
PI PO
Combinational
Logic
v1 u1
PS NS
v2 u2
State Minimization
Ex :
0A B0
1A C0
0B D0 (A,B,C,D,E,F,H)(G)
1B E0
0C F0 (A,B,C,E,F,H)(G)(D)
1C A0
0D H0 (A,C,E,H)(G)(D)(B,F)
1D G0
0E B0 (A,C,E)(G)(D)(B,F)(H)
1E C0
0F D0
1F E0
0G F1
1G A0
0H H0
1H A0
State Assignment
state groups :
a b
{2,5,12,17}
{2,6,17}
12 17
6
5 2
2 17
wrong!
6
5 12
Hyper-cube Embedding
state groups :
a b
{2, 6, 17}
6 17 {2, 4, 5}
2
5 4
6 17
2 4
wrong!
5
How to Check if a State Assignment
Satisfies the Constraint Matrix?
1 * *
Step1: Group face F = A˙S = 0 * 0
* 0 0
Step2: Check encoding of state-6 = [011]
Since it does not belong to group 1, 2 and 3,
check [0 1 1] ∩ [1 * *] =
[0 1 1] ∩ [0 * 0] =
[0 1 1] ∩ [* 0 0] =
check [1 1 1] ∩ [1 * *] = 111
[1 1 1] ∩ [0 * 0] =
[1 1 1] ∩ [* 0 0] =
Ex: 00
0101 10
A= 1010 S = 01
1100 11
To encode a new state (state-5), we have a new
constraint matrix,
01011
A’ = 10100
11000
For the states already assigned, we have a new
encoding,
000
100
S’ =
010
110
For the new state (state-5), we have encodings
ns = [1 0 1] or [1 1 1]
Hyper-cube Embedding Method
• Advantage :
– use two-level logic minimizer to
identify good state group
– almost all of the advantage of one-hot
encoding, but fewer state-bit
Adjacency-Based State Assignment
Basic algorithm:
(1) Assign weight w(s,t) to each pair of states
– weight reflects desire of placing states
adjacent on the hypercube
(2) Define cost function for assignment of codes
to the states
– penalize weights for the distance between
the state codes
eg. w(s,t) * distance(enc(s),enc(t))
(3) Find assignment of codes which minimize
this cost function summed over all pairs of
states.
– heuristic to find an initial solution
– pair-wise interchange (simulated annealing)
to improve solution
Adjacency-Based State Assignment
S1 S3
S2
$$$ S1 S2 $$$$
$$$ S3 S2 $$$$
S1 S3
$/j $/j
S2 S4
$$$ S1 S2 $$$1$
$$$ S3 S4 $$$1$
S1
S2 S4
$$$ S1 S2 $$$$
$$$ S1 S4 $$$$
S1 S3
i i
S2 S4
$0$ S1 S2 $$$$
$0$ S3 S4 $$$$
• Which is better?
FSMs have no useful two-level
face constraints => adjacency-embedding
FSMs have many two-level
face constraints => face-embedding