


















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



















1
2
**- FSMs are different from counters in the sense that they have external I/Ps, and state transitions are dependent on these I/Ps and the current state.
CLK
CLK
Tlog +Tff +Tsu Tlog = comb. logic delay Tff = FF delay Tsu = FF setup time
Docsity.com
4
Determining a Reset State:
Solution 1: (Mealy) 0/ Even
Odd
0/
Reset
Even
Reset [0]
Odd [1]
Output
Output^ Input
Input
Transition Arc
Output is dependent only on current state
O/P is dependent on current state and input in Mealy
Solution 2: (Moore)
Mealy Machine: Output is associated with the state transition, and appears before the state transition is completed (by the next clock pulse).
Moore Machine: Output is associated with the state and hence appears after the state transition take place. Docsity.com
5
FFs
External I/Ps (^) External O/Ps
m 1 m 2
n n
Comb. Logic
CLK
FFs n
CLK
n Output Logic m 2
Next State Comb. Logic
m 1
External I/Ps
External Outputs
even ↓ odd
Time t : Even I/P ∆ = propagation delay of logic of Mealy M/C
t t+∆^ t+T^ CLK t+T^ CLK+∆^2
Even x= O/P=
O/P= (Mealy)
Odd (^) O/P= (Moore)
∆ 2 = propagation delay of O/P logic unit of Moore M/C
7
State= Even
State= Odd
Reset 0 State= Even
Reset [0]
State= Odd [1]
x
FF
N.S. Logic
CLK
Q Q D
D-
Assume single bit state information stored in a D-FF
CLK
x
D Q (state) y 2 (Mealy O/P) y (^1) Moore O/P)
State Transition is occurring
State Transition is occurring
S.T. is complete.
S.T. is complete.
even odd even^ even odd odd
0/
Docsity.com
8
D Q CLK R^ Q
y (^1) x=
A
0
a) D-FF
T Q R Q
x A y 2
CLK
b) T-FF
Moore O/P is synchronized with clock.
D Q CLK R^ Q
y (^2)
x=
A
(^0 1) T Q
R Q
x
CLK
y 1
a) D-FF
b) T-FF
Mealy O/P is not synchronized with clock.
Reset
Reset
Reset
Reset
D (^) A= A⊕x ; TA= x y 1 = A for Moore; y 2 = A⊕x for Mealy
10
Here is how the control is supposed to work. The vending machine delivers a package of gum after it has received 15 cents in coins. The machine has a single coin slot that accepts nickels and dimes, one coin at a time. A mechanical sensor indicates to the control whether a dime or a nickel has been inserted into the coin slot. The controller’s output causes a single package of gum to be released down a chute to the customer. One further specification: We will design our machine so it does not give change. A customer who pays with two dimes is out 5 cents!
Vending Machine FSM CLK
Reset
Coin Sensor
Gum Release Mechanism
Open
Vending Machine block diagram
States:
11
— The figure below show the Moore and Mealy machine state transition diagrams.
0 cent [0]
5 cent [0]
10 cent [0]
=15 cent [1]
Moore machine
=15 cent
10 cent
5 cent
0 cent
Mealy machine Moore and Mealy machine state diagrams for the vending machine FSM
Reset / 0 ( N Reset ( ND +
Reset
Reset / 0 N / 0 D / 0
N / 0
N+D N+D/
N
D
N
D
D/
N (^) D
N (^) D / 0
N (^) D N (^) D / 0
Reset)/^
D +Reset)/
Reset Reset / 1
13
00 01 11 10 00 01 11 10
Q 1 Q 0 DN 00 01 11 10 00 01 11 10
Q 1 Q 0 DN 00 01 11 10 00 01 11 10
Q 1 Q 0 DN 0 0 1 1 0 1 1 1 x x x x 1 1 1 1
0 1 1 0 1 0 1 1 x x x x 0 1 1 1
0 0 1 0 0 0 1 0 x x x x 0 0 1 0 K-map for D 1 K-map for D 0 K-map for Open (Moore)
D 1 = Q 1 + D + Q 0 ·N D (^) 0 = N ⋅ Q 0 + Q 0 ⋅ N + Q 1 ⋅ N + Q 1 ⋅ D OPEN = Q 1 ·Q 0 Moore OPEN = Q1·Q 0 + D·Q 0 + D·Q 1 + N·Q 1 Mealy
00 01 11 10 00 01 11 10
Q 1 Q 0 DN 0 0 1 0 0 0 1 1 x x x x 0 1 1 1 K-map for Open (Mealy)
14
D Q R Q
D Q R Q
Q 0
N N
Q 0
Q 1 N
Q 1 D
D 0
D 1 Q 1
OPEN
D
Q 0
CLK
CLK
Vending machine FSM implementation based on D flip-flops(Moore).
Q 0
Q 1
Q 1
Q 0
Reset
Reset
16
00 01 11 10 00 01 11 10
Q 1 Q 0 DN
00 01 11 10 00 01 11 10
Q 1 Q 0 DN 00 01 11 10 00 01 11 10
Q 1 Q 0 DN
00 01 11 10 00 01 11 10
Q 1 Q 0 DN 0 0 x x 0 1 x x x x x x 1 1 x x
x x 0 0 x x 0 0 x x x x x x 0 0
0 x x 0 1 x x 1 x x x x 0 x x 1
x 0 0 x x 1 0 x x x x x x 0 0 x
K-map for J (^1) K-map for K (^1)
K-map for J 0 K-map for K (^0)
K-maps for J-K flip-flop implementation of vending machine.
17
J Q
R Q
Q 1 CLK
K
J Q
R Q
Q 0 CLK K
N^ OPEN
Q 0 D
N
D
Q 1
N
Q 0
Q 1
(^1) Q 0 Q
J-K flip-flop implementation for the vending machine example (Moore).
Similarly, a Mealy implementation; only the OPEN function changes.
Reset
19
20
1 received 1 received 1 received
i=
i=
i=2 i= [0]
i= [0]
i= [1]
Reset Reset 0/
0/
0/
1/
1/
00
10
(^01 )
1
1
0
0
0
Mealy Machine Moore Machine
Input
Output
1/
Docsity.com