Moore and Mealy Machines
Two FSM models - Moore outputs depend on state only, Mealy outputs depend on state and inputs.
There are two fundamental models of finite state machines. In a Moore machine, outputs depend only on the current state. In a Mealy machine, outputs depend on both the current state and the current inputs. Moore machines are simpler and glitch-free on outputs, while Mealy machines can respond faster (within the same clock cycle) and often require fewer states.
Objectives
- Define Moore machine: outputs = f(state)
- Define Mealy machine: outputs = f(state, inputs)
- Design the same function using both models and compare
- Choose between Moore and Mealy based on design requirements
Key Takeaways
- Moore: outputs depend only on state → synchronous, glitch-free, may need more states
- Mealy: outputs depend on state AND inputs → faster response, fewer states, possible glitches
- Moore outputs labeled inside state circles; Mealy outputs labeled on transition arrows
- Moore outputs delayed one cycle relative to Mealy
- Registered Mealy outputs = Moore timing (best of both worlds)
- Both models can implement the same functionality
Practice Problems
Problem 1: A sequence detector outputs 1 when it sees "11" in the input. Design as Moore and count the states for each.
Problem 2: In a Moore machine, when can outputs change?
Problem 3: Why might a Mealy machine output have glitches?
Problem 4: Convert a Mealy machine to Moore by adding output registers. What happens to timing?