Moore Machine

A Moore machine makes an output String depending only on the state you are in, not on the input you just gave it. Essentially, the Function which produces the next string is executed on the “nodes”, not the “edges”. Unlike Mealy Machines which produce characters on the edges.

Definition 1

A Moore machine is a Finite State Transducer whose output depends only on the current state.

Formally a 6-Tuple ():

  • : finite Set of states
  • : input Alphabet
  • : output Alphabet
  • : state transition function
  • : output Function (defined only on states)
  • : start state

Can always be converted to a Mealy Machine.

Example 1 — Parity Checker

A Moore machine that outputs 1 whenever the number of 1s seen so far is odd, otherwise 0.

Components

State + Output Table

Each state has a fixed output:

StateOutput
0
1

Transitions:

  • on 0
  • on 1
  • on 0
  • on 1

Example Run

Input: 1011

  • Start → output 0
  • Read 1: go to → output 1
  • Read 0: stay in → output 1
  • Read 1: go to → output 0
  • Read 1: go to → output 1

Output string: 01101