Docsity

FSM Practice Problems: Implementing and Converting Finite State Machines, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
PRACTICE PROBLEMS 2
Lecture 3 - Lecture 4
1. Which of the following FSMs implement a button synchronizer, converting each unique button press into a single cycle
“1”, regardless of the time the button is actually pressed.
2. Create a state table for the following FSM. You can assume the state register is implemented with D flip-flops. You DO
NOT need to implement the combinational logic.
3. Convert the following Moore FSM to a Mealy FSM.
4. Convert the following Mealy FSM to a Moore FSM
Inputs: y; Outputs: e
A B
y’ / e = 1
y
’ / e = 0
y
/ e = 0
y / e = 1
A
B
D
Inputs: ab; Outputs: w
C
w
=
1
w
=
1
w
=
1
w
=
0
a’
a’b’
ab’
ab b’ ab
b
b’ + ab’
Inputs: a; Outputs: x, y
A B D C
y = 0
a’ / x = 1
y = 0 y = 1 y = 0
a / x = 1 a / x = 0a / x = 1
a’ / x = 0 a’ / x = 1 a’ / x = 1
a / x = 0
(a) (b) (c) (d)
Inputs: b (bit)
Outputs: x (bit)
A B
b
b’
b’
b
x = 0 x = 1
Inputs: b (bit)
Outputs: x (bit)
A B
b
b’
x = 0 x = 1
Inputs: b (bit)
Outputs: x (bit)
A B
b
b’
b
b’
x = 0 x = 1
Inputs: b (bit)
Outputs: x (bit)
A B
b
b’ b’
x = 0 x = 1
Cb
x = 0
b
b’
pf2

Partial preview of the text

Download FSM Practice Problems: Implementing and Converting Finite State Machines and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

PLecture 3 - Lecture 4RACTICE P ROBLEMS 2

1. Which of the following FSMs implement a button synchronizer, converting each unique button press into a single cycle“1”, regardless of the time the button is actually pressed.

2. Create a state table for the following FSM. You can assume the state register is implemented with D flip-flops. You NOT need to implement the combinational logic. DO

3. Convert the following Moore FSM to a Mealy FSM.

4. Convert the following Mealy FSM to a Moore FSM

Inputs: y; Outputs: e A y’ / e = 1 B

y / e = 0 y’ / e = 0 y / e = 1

A B

D

Inputs: ab; Outputs: w

C

w = 1 w = 1

w = 0 w = 1

a’ a’b’

ab’

ab (^) b’ ab b b’ + ab’

Inputs: a; Outputs: x, y A (^) y = 0 B C D

a’ / x = 1 y = 0 y = 1 y = 0

a / x = 1 a / x = 1 a / x = 0 a’ / x = 0 a’ / x = 1 a’ / x = 1

a / x = 0

(a) (b) (c) (d)

Inputs: b (bit)Outputs: x (bit) A b B

b’ b’

b x = 0 x = 1

Inputs: b (bit)Outputs: x (bit) A b B

b’ x = 0 x = 1

Inputs: b (bit)Outputs: x (bit) A b B

b’ b

b’ x = 0 x = 1

Inputs: b (bit)Outputs: x (bit) A b B

b’ b’ x = 0 x = 1 x = 0C^ b

b’ b

5. Implement a Mealy FSM that detects the input sequence patternimmediately output f = 1 (do not wait until the next clock cycle). You only need to show the FSM, you do not need to implement z = 1, 0, 1, 0. Whenever the input pattern is detected

the architecture. Hint: What happens when you detect input z = 1, 0, 1, 0, 1, 0?

  1. Describe the FSM provided using the formal specification M = (X, Y, S, δ, λ, s (^) o).
  2. You want to design a laser surgery system where a surgeon activates the laser by pressing a button. The laser should thenstay on for exactly 3 cycles, then turn off. The FSM below describes the three-cycles high laser timer controller. (Same system from lecture 3, slide 4)

To model this FSM in Verilog we can use either a 2-process model or a 1-process model. Download the three-cycleshigh laser time code provided on the course page and simulate both FSMs using the Testbench provided. a)b) Do both the 1-process model and 2-process model accurately describe the functionality of the desired system?Is there any difference in output between the 1-process model and 2-process model? If so, why?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------ECE 574A Questions

------------------------------------------------------------------------------------------------------------------------------------------------------------------------8. Derive a state table for the FSM provided. Assume the state register is implemented with T flip-flops and the state encodings for states A, B, C, and D are 00 , 01 , 10 , and 11 respectively. A truth table for T flip-flops is provided. T flip-flop and corresponding truth table A yz = 00

D C

a’ B

Inputs: a (bit)Outputs: y, z (bit) a’

a’ a’

a

a a

a yz = 01

yz = 10 yz = 11

T Q C

T 0 Q 0 Q 0 next

Inputs: a, b; Outputs: y A (^) y = 0 B^ C

a’ a’b’ b’/ y= y = 0

a ab’ b b / y = 1

Off x = 0 On

b’

On

Inputs: b (bit)Outputs: x (bit)

b On x = 1 x = 1 x = 1