Skip to content
BetterDL

State table

Also called: next-state table, state transition table, transition table

A table form of a state machine: one row per present state, giving the next state, and the output, for every input value.

A state table holds exactly the same information as a state diagram, laid out in rows and columns.

Why bother when you have the diagram? A table makes it impossible to forget an arrow, because every row has a cell for every input. And it's the bridge to hardware: once the states are given codes (state encoding), the table becomes a truth table whose inputs are the present-state bits and the machine inputs, and whose outputs are the next-state bits. From there you write next-state equations with K-maps.

Counters use a simpler version, the next-state table: with no inputs except the clock, each present state has just one next state.

Tables also make it easy to spot equivalent states: rows with the same outputs and the same next states can be merged.

start0/01/00/01/00/11/0ABC

Worked examples

Example

The Mealy 110 detector as a table

Write the diagram above as a state table. Each cell is next state / output.

  1. 1.

    Row A: X = 0 → A / 0. X = 1 → B / 0.

  2. 2.

    Row B: X = 0 → A / 0. X = 1 → C / 0.

  3. 3.

    Row C: X = 0 → A / 1. X = 1 → C / 0.

  4. 4.

    Three rows, two cells each: six cells, matching the six arrows in the diagram.

Example

A Moore table

The Moore 110 detector has states S0 to S3, with output 1 only in S3.

  1. 1.

    S0: X = 0 → S0, X = 1 → S1. Output 0.

  2. 2.

    S1: X = 0 → S0, X = 1 → S2. Output 0.

  3. 3.

    S2: X = 0 → S3, X = 1 → S2. Output 0.

  4. 4.

    S3: X = 0 → S0, X = 1 → S1. Output 1.

  5. 5.

    One output per row, because the output depends on the state alone.

Common mistakes

  • Mixing up the present-state column and the next-state columns.

  • Writing one output per row for a Mealy machine. Its output can differ between inputs in the same row.

  • Leaving cells empty. Every present state needs a next state for every input (or an explicit don't-care for unused codes).

Practice State table

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

Learn it step by step

State table is taught in Finite State Machines and Counters.