Verilog RTL II – FSM Intensive
Parameterization, FSM, memories, FIFO, arbiter, interrupts
What you will learn and practise
Complete the stages in order and retain the requested evidence.
FSM partitioning
Moore/Mealy
State encoding
Illegal-state recovery
Control-path verification
1. 2-state/3-state FSM
2. Moore detector
3. Mealy detector
4. Overlap/non-overlap
5. Traffic controller
6. Pedestrian control
7. Vending machine
8. Door controller
9. Elevator controller
10. Washing controller
11. Command processor
12. Handshake/timeout/retry
13. One-hot vs binary FSM
Debug dead state, missing transition, lockup and reset-state bugs
Compare Moore vs Mealy waveforms
FSM portfolio + debug report
Design, simulate and debug robust Moore and Mealy finite-state machines with explicit recovery behavior.
- Create project_workspace/week3_verilog_rtl2/day12_fsm with rtl, tb, sim and logs directories.
- Keep state diagrams/tables with the RTL evidence.
- Exercise reset and illegal/unexpected transition conditions.
- Implement 2-state and 3-state FSMs.
- Implement Moore and Mealy sequence detectors.
- Exercise overlap and non-overlap behavior.
- Implement traffic and pedestrian controllers.
- Implement selected vending/door/elevator/washing/command-control FSM exercises.
- Implement handshake/timeout/retry control.
- Compare one-hot and binary encoding on a selected FSM.
- Compare Moore and Mealy output behavior.
- Explain FSM partitioning into state register, next-state and output logic.
- Explain illegal-state recovery.
- Compare one-hot and binary state encoding.
- Describe how reset choice affects FSM startup behavior.
Find and repair dead-state, missing-transition, lockup and reset-state bugs; compare Moore and Mealy waveforms.
- FSM RTL
- state diagram/table
- testbench
- waveforms
- debug report
- FSMs reset to defined states
- Expected transitions are demonstrated
- Illegal/unexpected conditions recover as designed
Build, run and retain evidence
project_workspace/week3_verilog_rtl2/day12_fsm/
RunWaveformReview before completing Day 12
- Concept
What distinguishes Moore and Mealy FSM outputs?
Review answer
Moore outputs depend on the current state, while Mealy outputs can depend on both the current state and current inputs.
- RTL reasoning
Why is a default next-state assignment useful at the beginning of combinational next-state logic?
Review answer
It gives defined behavior for paths not explicitly changing state and helps prevent unintended latches from incomplete assignment.
- Debugging
An FSM reaches a state for which the case statement has no recovery path and remains stuck. What design feature is missing?
Review answer
A defined illegal/unexpected-state recovery path, normally returning the machine to a documented safe state.
- Short answer
What evidence should be shown to prove overlap behavior in a sequence detector?
Review answer
Stimulus containing overlapping sequences together with state/output waveform or simulation results demonstrating that the detector recognizes the required overlapping occurrences.
Assessment: