Lesson 13: Finite State Machines (FSM)

TL;DR
  • FSM = state + transitions + outputs. It is the standard way to model control logic in digital systems (protocols, controllers, UI flows, sequencing).
  • Moore: output depends only on state → stable outputs, usually 1 clock later.
  • Mealy: output depends on state + input → faster response, sometimes fewer states, but more sensitive to input glitches.
  • Typical Verilog structures: 3-tier (clearest), 2-tier (compact), 1-tier (shortest but harder to maintain).
  • Quartus: You must do Pin Assignments; you should add a minimal SDC create_clock for meaningful timing analysis.

Conclusion


Conclusion

Finite State Machines are a cornerstone of digital system design. Mastering FSM theory and implementation in Verilog HDL enables you to build reliable, well-structured digital controllers on FPGAs and ASICs.

In this lecture article, we have covered:

  • The theoretical foundation of FSMs: states, transitions, inputs, and outputs.
  • The two primary FSM types: Moore (output from state) and Mealy (output from state and input).
  • How to construct state diagrams and state transition tables as design tools.
  • Three different Verilog coding styles (3-tier, 2-tier, 1-tier) for both Moore and Mealy FSMs.
  • Practical implementation considerations, including timing, glitch-free outputs, and latch avoidance.
  • Step-by-step guidance for synthesizing, pin-assigning, and programming FSMs on Altera MAX-10 FPGAs using Quartus Prime v25.

As a general rule of thumb for FPGA-based FSM design:

ScenarioRecommendation
Default FSM style Moore FSM with 3-tier always blocks
Need fewer states / fast output Mealy FSM with 3-tier always blocks
Glitch-free output critical Moore FSM (all tiers) or 1-tier Mealy
Quick prototyping 2-tier style (compact, readable)
Complex multi-output FSM Always use 3-tier style
Quartus encoding One-Hot for performance, User-Encoded for clarity

With this knowledge, you are well-equipped to design FSM-based controllers for a wide range of embedded and digital systems projects on the Intel MAX-10 platform.

© 2026 Air Supply Information Center (Air Supply BBS)