Skip to content
BetterDL

Moore machine

Also called: Moore, Moore FSM, Moore output, Moore model

A finite state machine whose outputs depend only on the present state, so they are written inside the state circles and change only at clock edges.

In a Moore machine each state has a fixed output. The output gates read only the state flip-flops, never the inputs.

Because the state only changes at clock edges, a Moore output only changes at clock edges too. It stays steady for the whole clock period, even if the input wiggles. That makes Moore outputs clean and safe to use elsewhere in a synchronous design.

The cost is time and states. A Moore machine reacts one clock cycle later than a mealy machine, because it has to move into a state before the output can show the result. And it often needs an extra state just to hold the output: a sequence detector for an n-bit pattern needs n + 1 Moore states, against n for Mealy.

When tracing a Moore machine, read the output of the state you arrive in.

start01010101S00S10S20S31

Worked examples

Example

Tracing a Moore 110 detector

The diagram detects 110, overlapping: S0 = nothing, S1 = seen 1, S2 = seen 11, S3 = seen 110 (output 1). Apply 1, 1, 0, 1, 1, 0 from S0.

  1. 1.

    1: S0 → S1, output 0.

  2. 2.

    1: S1 → S2, output 0.

  3. 3.

    0: S2 → S3, output 1 (110 complete).

  4. 4.

    1: S3 → S1, output 0 (the new 1 starts a fresh match).

  5. 5.

    1: S1 → S2, output 0.

  6. 6.

    0: S2 → S3, output 1.

  7. 7.

    Outputs: 0, 0, 1, 0, 0, 1.

Example

Spotting Moore from the equations

A machine has state bits Q1, Q0 and input X. Its output is Z = . Is it Moore or Mealy?

  1. 1.

    List what Z uses: Q1 and Q0, both state bits.

  2. 2.

    No input appears, so the output depends on the state alone.

  3. 3.

    It's a Moore machine.

Common mistakes

  • Reading the output of the state you leave. For Moore, the output for an input is the one in the state you arrive in.

  • Expecting a Moore output to respond to an input change mid-cycle. It waits for the next clock edge.

  • Drawing a Moore detector with the same number of states as the Mealy one. It needs a separate state to show the match.

Practice Moore machine

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Moore machine is taught in Finite State Machines.