Skip to content
BetterDL

Output equation

Also called: output logic, output equations, output function

A Boolean equation giving a state machine's output from its state bits (Moore) or from its state bits and its inputs (Mealy).

Besides the next-state equations, every FSM with outputs needs an output equation for each output. It's the logic between the state register (and maybe the inputs) and the output pins.

  • Moore: the output depends only on the state, so the equation uses only state bits. If the output is 1 in state 11 alone, Z = .
  • Mealy: the output also depends on the inputs, so the equation includes input variables, for example Z = .

That gives the fastest way to tell the two apart: if an input appears in the output equation, the machine is Mealy.

To derive one, take the output column of the encoded state table, mark unused codes as don't-cares, and simplify. For a one-hot Moore machine it's even simpler: the output is just the OR of the flip-flops for the states where it's 1.

000
010
100
111

Worked examples

Example

A Moore output

A 4-state Moore machine is encoded S0 = 00, S1 = 01, S2 = 10, S3 = 11. Its output is 1 in S2 and S3.

  1. 1.

    Z = 1 for codes 10 and 11.

  2. 2.

    Both have Q1 = 1, whatever Q0 is.

  3. 3.

    Z = . Only state bits appear: Moore ✓.

Example

A Mealy output

In the Mealy 110 detector (A = 00, B = 01, C = 10), the output is 1 only on the arrow from C on input 0.

  1. 1.

    Z = 1 only for Q1Q0 = 10 with X = 0.

  2. 2.

    Using the unused code 11 as a don't-care: Z = .

  3. 3.

    X appears in the equation, which confirms the machine is Mealy.

Common mistakes

  • Putting an input into a Moore output equation. A Moore output can use only state bits.

  • Calling a machine Moore because its diagram has few output-1 arrows. Check what the output equation actually reads.

Practice Output equation

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

Learn it step by step

Output equation is taught in Finite State Machines.