Академический Документы
Профессиональный Документы
Культура Документы
Inputs: x; Outputs: y
x
x
x
S1
y=0
y=0
S1
x
S2
y=1
S0
state
x
x
x
S0
S1
x
S3
S0
y=1
S2
S1
y=0
S2
S0
state
x
y=1
S1
S1
S0
S0
if x = 1,1,0,0
then y = 0,1,1,0,0
Inputs: x; Outputs: y
x
x
x
S1
S2
S3
y=0
y=1
y=0
y=1
x
x
S0
x
S0,
S2
y=0
x
x
S1,
S3
y=1
Another example
x
S1
y=0
y=1
x
S2
S3
y=1
y=1
x
x
S0
y=0
x
x
S1
y=1
S0
x
x
S2
S3
y=1
y=1
y=0
S0
Output Assignment
x
x
S1
y=1
x
x
S2
S3
y=1
y=1
State reduction through visual inspection (what we did in the last few slides)
isnt reliable and cannot be automated a more methodical approach is
needed: implication tables
Inputs: x; Outputs: y
x
x
x
S0
y=0
x
x
S1
y=0
y=1
S0
x
S2
S1
Redundant
S3
y=1
To compare every
pair of states,
construct a table of
state pairs
S2
Diagonal
S3
S0 S1 S2 S3
S1
S2
S3
S0 S1 S2
Inputs: x; Outputs: y
x
x
x
x
x
S0
S1
S2
S3
y=0
y=1
y=0
y=1
S1
S2
S3
S0
S1
S2
Inputs: x; Outputs: y
x
x
x
x
x
S0
S1
S2
S3
y=0
y=1
y=0
y=1
(S2, S0)
S1
(S3, S1)
(S2, S0)
S2
(S3, S1)
(S0, S2)
S3
(S3, S1)
S0
S1
S2
Inputs: x; Outputs: y
x
x
x
x
x
S0
S1
S2
S3
y=0
y=1
y=0
y=1
(S2, S0)
(S3, S1)
(S2, S0)
S2
(S3, S1)
S1
(S3, S1)
(S0, S2)
S3
S0
S1
S2
Inputs: x; Outputs: y
x
x
x
S1,S3
y=0
y=1
S1
S2
S3
y=0
y=1
y=0
y=1
S1
S2
(S3, S1)
(S2, S0)
(S3, S1)
(S0, S2)
S3
x
S0,S2
x
x
S0
S0
S1
S2
Step
Description
10
Inputs: x; Outputs: y
x
x
x
x
S0
S1
S2
S3
y=0
y=1
y=1
y=1
S1
S2
S3
S0
S1
S2
11
Inputs: x; Outputs: y
x
x
x
x
x
S0
S1
S2
S3
y=0
y=1
y=1
y=1
S1
S2
(S2, S2)
(S3, S1)
S3
X=0
S2 goes to S2
S1 goes to S2
X=0
S3 goes to S0
S1 goes to S2
X=0
S3 goes to S0
S2 goes to S2
X=1
S2 goes to S3
S1 goes to S1
X=1
S3 goes to S3
S1 goes to S1
X=1
S3 goes to S3
S2 goes to S3
S0
S1
S2
12
x
S2
S3
y=0
y=1
y=1
y=1
S2
(S2, S2)
(S3, S1)
S3
x
x
S1
S1
x
x
S0
S0
S1
S2
Repeat
S3 = S1? Unsure
S2 = S2? Yes
S0 = S2? NO!
S3 = S1? NO!
S0 = S2? NO!
13
x
x
x
x
S0
S1
S2
S3
y=0
y=1
y=1
y=1
S1
S2
(S2, S2)
(S3, S1)
S3
S0
S1
S2
Inputs: x; Outputs: y
x
S3
y=0
S0
S4
y=0
y=0
x x
(S1,S0)? No
S2
S1
y=1
y=1
(S2,S0)? No
(S2,S1)? OK
S1
(S3,S0)? OK
(S3,S1)? No
(S3,S2)? No
S2
S3
(S4,S0)? OK
(S4,S1)? No
(S4,S2)? No
S4
S0
S1
S2
S3
(S4,S3)? OK
15
Inputs: x; Outputs: y
y=0
x
S3
S0
S4
y=0
y=0
x x
S2
S1
y=1
y=1
S1
X=0
S3 goes to S3
S0 goes to S2
X=1
S2 goes to S2
S1 goes to S1
X=1
S3 goes to S0
S0 goes to S1
Repeat for
(S4, S0) pair
(S4, S3) pair
(S3,S4)
(S2,S1)
S2
S3 (S3,S2)
(S0,S1)
S4
(S4,S3)
(S0,S0)
(S4,S2)
(S0,S1)
S0
S1
S2
S3
16
Inputs: x; Outputs: y
x
y=0
x
S3
S0
S4
y=0
y=0
x x
x
x
S2
S1
y=1
y=1
S1
(S3,S4) - OK
(S2,S1) - OK
(S3,S4)
(S2,S1)
S2
(S3,S2) - NO
(S4,S2) - NO
(S4,S3) - OK
S3 (S3,S2)
(S0,S1)
(S0,S0) - OK
(S4,S3)
(S0,S0)
(S4,S2)
S4
(S0,S1)
S0
S1
S2
S3
17
Inputs: x; Outputs: y
x
x
S3
y=0
S0
S4
y=0
y=0
x x
S2
S1
y=1
y=1
S1
(S3,S4)
(S2,S1)
S2
S3 (S3,S2)
(S0,S1)
S4
(S4,S3)
(S0,S0)
(S4,S2)
(S0,S1)
S0
S1
S2
S3
18
Inputs: x; Outputs: y
x
x
x
S3
y=0
y=0
S0
S4
x
y=0
x x
S2
y=1
y=1
Combine (S2, S1)
and (S4, S3)
Inputs: x; Outputs: y
x
S3,S4
y=0
S1
S0
S1,S2
y=0
y=1
19
State Minimization
Inputs
Outputs
Current
State
Next
State
A
A
B
0
1
0
B
C
D
1
1
1
B
C
C
D
1
0
1
0
F
F
E
B
1
0
0
1
E
E
F
0
1
0
F
G
G
1
0
1
F
C
E
D
F
G
0
0
0
0
0
0
20
P1 = (ABDCEFG)
P2 = (ABD)(CEFG)
Inputs
Outputs
Current
State
Next
State
A
A
B
B
C
C
D
0
1
0
1
0
1
0
B
C
D
F
F
E
B
1
1
1
1
0
0
1
E
E
F
F
G
G
0
1
0
1
0
1
F
C
E
D
F
G
0
0
0
0
0
0
21
Inputs
Second test
P2 = (ABD)(CEFG)
When w = 0
A goes to B
B goes to D
D goes to B
When w = 1
A goes to C
B goes to F
D goes to G
B, D, and B are in
same partition so
maybe same state
C, F, and G are in
same partition so
maybe same state
Outputs
Current
State
Next
State
A
B
1
0
C
D
1
1
C
C
D
0
1
0
F
E
B
0
0
1
E
F
1
0
F
G
1
0
F
C
E
D
F
G
0
0
0
0
0
0
22
Inputs
Second test
P2 = (ABD)(CEFG)
When w = 0
C goes to F
E goes to F
F goes to E
G goes to F
When w = 1
C goes to E
E goes to C
F goes to D
G goes to G
F, F, E, and F are in
same partition
D is in different
partition then E, C, G!
Outputs
Current
State
Next
State
A
A
B
0
1
0
B
C
D
1
1
1
B
C
C
D
1
0
1
0
F
F
E
B
1
0
0
1
E
E
F
0
1
0
F
G
G
1
0
1
F
C
E
D
F
G
0
0
0
0
0
0
23
Inputs
Second test
P3 = (ABD)(CEG)(F)
When w = 0
A goes to B
B goes to D
D goes to B
When w = 1
A goes to C
B goes to F
D goes to G
B, D, and B are in
same partition
F is in different
partition than C and G!
Move B to its own
partition.
Outputs
Current
State
Next
State
A
A
B
B
C
C
D
0
1
0
1
0
1
0
B
C
D
F
F
E
B
1
1
1
1
0
0
1
E
E
F
F
G
G
0
1
0
1
0
1
F
C
E
D
F
G
0
0
0
0
0
0
24
Inputs
Second test
P4 = (AD)(B)(CEG)(F)
When w = 0
A goes to B
D goes to B
When w = 1
A goes to C
D goes to G
B and B in same
partition
C and G in same
partition
Outputs
Current
State
Next
State
A
B
1
0
C
D
1
1
C
C
D
0
1
0
F
E
B
0
0
1
E
F
1
0
F
G
1
0
F
C
E
D
F
G
0
0
0
0
0
0
25
Inputs
Second test
P4 = (AD)(B)(CEG)(F)
B should be
equivalent to itself,
move to next group
Outputs
Current
State
Next
State
A
A
B
0
1
0
B
C
D
1
1
1
B
C
C
D
1
0
1
0
F
F
E
B
1
0
0
1
E
E
F
0
1
0
F
G
G
1
0
1
F
C
E
D
F
G
0
0
0
0
0
0
26
Inputs
Second test
P4 = (AD)(B)(CEG)(F)
When w = 0
C goes to F
E goes to F
G goes to F
When w = 1
C goes to E
E goes to C
G goes to G
F, F, F in same
partition
E, C, G in same
partition
Outputs
Current
State
Next
State
A
A
B
B
C
C
D
0
1
0
1
0
1
0
B
C
D
F
F
E
B
1
1
1
1
0
0
1
E
E
F
F
G
G
0
1
0
1
0
1
F
C
E
D
F
G
0
0
0
0
0
0
27
Inputs
Second test
Next
State
A
B
1
0
C
D
1
1
P4 = (AD)(B)(CEG)(F)
F should be
equivalent to itself,
move to next group
Outputs
Current
State
C
C
D
0
1
0
F
E
B
0
0
1
E
F
1
0
F
G
1
0
F
C
E
D
F
G
0
0
0
0
0
0
28
Table for large FSM too big for humans to work with
100 states would have table with 100*100=100,000 state pairs cells
Automation needed
SB
SI
SO
SH
SA
x
z=1
z=0
z=1
SC
z=0
z=0
x
x
SD
x
x
SG
z=0
z=1
x
SK
SF
SE
z=0
z=0
z=0
x'
SM
SJ
x
z=1
z=1
SL
x
z=0
SN
x
z=1
z=1
29