Академический Документы
Профессиональный Документы
Культура Документы
State minimization
VIII - Working
same output
for all input combinations, states transition to same or equivalent states
Algorithm sketch
VIII - Working
0/0
0/0
S3
S1
S0
Input
Sequence
Next State
Present StateX=0
X=1
Output
X=0
X=1
Reset
0
1
00
01
10
11
S0
S1
S2
S3
S4
S5
S6
0
0
0
0
1
0
1
S1
S3
S5
S0
S0
S0
S0
S2
S4
S6
S0
S0
S0
S0
0
0
0
0
0
0
0
1/0
1/0
0/0
S4
S5
S2
1/0
S6
VIII - Working
Next State
Present StateX=0
X=1
Output
X=0
X=1
Reset
0
1
00
01
10
11
S0
S1
S2
S3
S4
S5
S6
0
0
0
0
1
0
1
S1
S3
S5
S0
S0
S0
S0
S2
S4
S6
S0
S0
S0
S0
0
0
0
0
0
0
0
( S0 S1 S2 S3 S4 S5 S6 )
S1 is equivalent to S2
( S0 S1 S2 S3 S5 ) ( S4 S6 )
S3 is equivalent to S5
( S0 S3 S5 ) ( S1 S2 ) ( S4 S6 )
S4 is equivalent to S6
( S0 ) ( S3 S5 ) ( S1 S2 ) ( S4 S6 )
VIII - Working
Minimized FSM
Present State
Reset
0+1
X0
X1
S0
S1'
S3'
S4'
S1'
S3'
S0
S0
Next State
X=0
S1'
S4'
S0
S0
Output
X=1
X=0
0
0
0
1
X=
0
0
0
0
S0
X/0
0/0
S1
1/0
S4
S3
X/0
VIII - Working
0/1
1/0
S0
[1]
10
10
01
11
00
S2
[1]
10
S4
[1]
S3
[0]
10
01
11
10
10
00
11
00 01
01
01
11
S1
[0]
11
S5
01 [0]
00
11
VIII - Working
present
state
S0
S1
S2
S3
S4
S5
00
S0
S0
S1
S1
S0
S1
next state
01 10 11
S1 S2 S3
S3 S1 S4
S3 S2 S4
S0 S4 S5
S1 S2 S5
S4 S0 S5
output
1
0
1
0
1
0
symbolic state
transition table
Minimized FSM
S1
S0-S1
S2 S1-S3
S2-S2
S3-S4
S3
S0-S0
S4 S1-S1
S2-S2
S3-S5
S5
S0
S0-S1
S3-S0
S1-S4
S4-S5
S0-S1
S3-S4
S1-S0
S4-S5
S1
VIII - Working
present
state
S0'
S1
S2
S3'
S1-S0
S3-S1
S2-S2
S4-S5
S2
00
S0'
S0'
S1
S1
next state
01 10 11
S1 S2 S3'
S3' S1 S3'
S3' S2 S0'
S0' S0' S3'
output
1
0
1
0
S4
state
0
1
1
output
S1 is compatible with both S0 and S2
but S0 and S2 are incompatible
VIII - Working
X
01
[1]
X
11
[0]
X
X
0
0
0
1
1
1
Q1
0
0
1
0
0
1
1
Q0
0
1
1
0
1
1
0
Q1+
0
0
0
0
1
1
0
Q0+
0
0
0
1
1
1
0
X
Q1+ = X (Q1 xor Q0)
Q0+ = X Q1 Q0
VIII - Working
00
[0]
X
10
[0]
X
11
[0]
X
01
[1]
VIII - Working
10
State assignment
with n state bits for m states there are 2n! / (2n m)!
[log n <= m <= 2n]
2n codes possible for 1st state, 2n1 for 2nd, 2n2 for 3rd,
huge number even for small values of n and m
VIII - Working
11
Possible strategies
VIII - Working
12
Simple
easy to encode
easy to debug
one-hot + all-0
VIII - Working
13
Q
c
c
O
j
k
a
c=i*a+ i*b
i/j
i/k
c
Q
a
b
Q
a
a
Q+ O
b
j
c
l
i/j
b=i *a
c=k*a
k/l
c
Q
a
c
VIII - Working
Q+ O
b
j
d
j
j=i *a+ i *c
b=i*a
d=i*c
c
i/j
i/j
14
VIII - Working
15
Output-based encoding
why create new functions for state bits when output can serve as well
fits in nicely with synchronous Mealy implementations
Inputs
C
TL
0
0
1
1
1
0
0
Present State
TS
0
1
0
1
Next State
HG
HG
HG
HY
HY
FG
FG
FG
FY
FY
HG = ST H1 H0 F1 F0 + ST H1 H0 F1 F0
HY = ST H1 H0 F1 F0 + ST H1 H0 F1 F0
FG = ST H1 H0 F1 F0 + ST H1 H0 F1 F0
HY = ST H1 H0 F1 F0 + ST H1 H0 F1 F0
VIII - Working
HG
HG
HY
HY
FG
FG
FY
FY
FY
HG
ST
0
0
1
0
1
0
1
1
0
1
Outputs
H
00
00
00
01
01
10
10
10
10
10
F
10
10
10
10
10
00
00
00
01
01
16
For tight encodings using close to the minimum number of state bits
One-hot encoding
Output-based encoding
ad hoc - no tools
most common approach taken by human designers
yields very small circuits for most FSMs
VIII - Working
17
State minimization
State assignment
many heuristics
best-of-10-random just as good or better for most machines
output encoding can be attractive (especially for PAL implementations)
VIII - Working
18