Course contentsShow
← Embedded Systems & Computer Architecture
Lesson 19 of 9361. Foundations of Digital Logic and Computer ArchitectureFree lesson

Moore versus Mealy Machine Architectures

You will compare Moore and Mealy machine models to determine the most efficient output generation strategy for specific hardware control tasks.

In this lesson, you will learn how to choose between Moore and Mealy architectures to optimize your hardware’s response time and complexity.

The Output Dilemma

When designing a Finite State Machine (FSM), you must decide where to generate your output signals. The two standard approaches—Moore and Mealy—differ based on whether the output depends solely on the current state or also on the current input.

Moore Machine: Stability First

In a Moore machine, the output is determined exclusively by the current state. Imagine a digital lock: the "Unlatch" signal is only high if the machine is in the "Unlocked" state, regardless of which button you just pressed.

  • Pros: Outputs are glitch-free because they change only on the clock edge when the state transition occurs.
  • Cons: The system is inherently slower. Because the output logic waits for the next clock edge, it often takes an extra cycle to react to an input change.

Mealy Machine: Reaction Speed

In a Mealy machine, the output is a function of both the current state and the current input. If your system needs to react instantly to an input—like an emergency "Stop" button that must halt a motor before the next clock tick—the Mealy model is superior.

  • Pros: Extremely responsive; the output changes as soon as the input changes.
  • Cons: Because the output depends on the input, it is susceptible to "glitches." If your input signal bounces or ripples, your output signal will do the same, which can cause erratic behavior in downstream hardware.

Comparison at a Glance

Think of the difference in how they calculate the output logic:

// Moore: Output logic depends only on state
assign output = (current_state == STATE_READY);

// Mealy: Output logic depends on state AND input
assign output = (current_state == STATE_READY) && (input_button == 1);

If your control task requires high stability and synchronous timing, use Moore. If your task requires minimal latency and immediate input-to-output mapping, use Mealy. Most complex embedded systems actually use a hybrid approach, choosing the model that best fits the specific control signal requirements of each output port.

Key Takeaway: Moore machines offer stable, glitch-free outputs tied to the clock, while Mealy machines provide rapid, input-dependent responses at the cost of potential signal instability.