p14m

State machine designer

Enter a Moore or Mealy state table and get the state diagram, state assignment, transition table and minimized flip-flop equations, checked by simulation.

How it works

The page follows the sequential circuit design procedure: state table, state diagram, state assignment, transition table, flip-flop input and output equations, then a check.

  • Moore or Mealy. A Moore output depends only on the present state, so it is written once per state and shown inside the circle. A Mealy output also depends on the input, so it is written per transition as input/output.
  • State table. For each present state and input value, pick the next state. Click an output to cycle it through 0, 1 and x. An x is a don't-care, and so is a next state of x.
  • State assignment. Binary and Gray codes use ⌈log2 n⌉ flip-flops, and any unused code becomes a don't-care. Custom lets you type each state's code and pick from ⌈log2 n⌉ up to n flip-flops; its unused codes are don't-cares too. One-hot uses one flip-flop per state, and each next-state equation ORs the transitions into that state: Qi times the input condition for each incoming edge.
  • Excitation. Each row of the transition table turns a change from Q to Q+ into flip-flop inputs: D = Q+, T = Q ⊕ Q+, and for JK one of the two inputs is a don't-care on every row.
  • Equations are exact minimum sums of products. Open in K-map shows the same function, with its don't-cares, on a Karnaugh map.
  • Check. The simulation runs your input sequence through the equations and compares every step with the state table. A wrong equation shows up as a mismatch.
  • Share. The address bar always holds a link to the machine on screen, with its settings and input sequence. Copy link copies it.
Examples
Machine type
Input bits
Output bits
State table (click an output to cycle 0, 1, x)
State assignment
Flip-flop type

State diagram

Drag a state to move it. Drag from its edge to another state to add a transition. Double-click empty space to add a state.

State assignment

Transition table

Equations

Check by simulation

Each step is computed from the equations above and compared with the state table.