DIGITAL · TOOL

Finite State Machine Simulator

Step through a state machine: current state highlighted, output trace, transition table.

Advanced No backend · 100% client-side

What it does: Interactively run a finite state machine (FSM): feed input and watch how the state jumps and the output changes.

When to use it: When learning sequential control, sequence detection, or the Mealy/Moore difference.

Current state
Last tick output?
Feed input:
→ two hits
Next

You might also need

How to

How to use the state machine simulator

Choose a machine → feed input → watch state transitions and output.

  1. 01

    Choose a state machine

    A 101 sequence detector (Mealy) or a parity machine (Moore). Its states and transition table are shown below.

  2. 02

    Feed input bit by bit

    Click the input buttons (0 / 1) to step one bit at a time; the current state is highlighted and the output for that tick is shown.

  3. 03

    Or run a whole string at once

    Type a string of 0/1 in the input box and click "Run sequence" to see the full state trace and output string.

Reference

Mealy vs Moore

The two kinds of state machine differ in "what the output depends on".

MealyMoore
Output depends onPresent state + inputPresent state only
Output labeled onTransition edgesStates
Response to inputChanges same tickChanges next state
Example here101 detectorParity check

Mealy (1955) / Moore (1956) automaton models.

FAQ

Common questions, answered in 3 minutes

Which is better, Mealy or Moore?

Each has trade-offs: Mealy outputs faster (responds to the input in the same tick) and usually needs fewer states; Moore outputs depend only on the state, so they are more stable and glitch-free and the timing is easier to analyze. They are inter-convertible.

Why does the "101 detector" allow overlap?

After detecting 101, the trailing 1 can serve as the start of the next 101. So the input 10101 is detected twice — this is the overlapping-detection design.

What is the initial state?

The state the machine is in after power-on/reset. In this tool, click "Reset" to return to the initial state, then start feeding input.

How are state machines related to counters?

A counter is a special kind of state machine (state = count value). An FSM is more general: states and transitions can be defined arbitrarily, used to recognize sequences, control flow, and so on.

Can I define my own state machine?

This tool ships with two classic machines for demonstration; the underlying engine is generic (supports any state/transition table), and a custom visual editor could be a future enhancement.

Data Provenance

Standards and sources referenced by this tool

Item Value / Formula Source
State machine model Mealy / Moore Automata theory
Example machines 101 detect / parity built-in, tested

Ideal synchronous state machine model, no external API.

⚡ Powered by Circflow