Finite State Machine Simulator
Step through a state machine: current state highlighted, output trace, transition table.
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.
—
MEANS —
No history yet. Each calculation is automatically saved to this device.
How to use the state machine simulator
Choose a machine → feed input → watch state transitions and output.
- 01
Choose a state machine
A 101 sequence detector (Mealy) or a parity machine (Moore). Its states and transition table are shown below.
- 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.
- 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.
Mealy vs Moore
The two kinds of state machine differ in "what the output depends on".
| Mealy | Moore | |
|---|---|---|
| Output depends on | Present state + input | Present state only |
| Output labeled on | Transition edges | States |
| Response to input | Changes same tick | Changes next state |
| Example here | 101 detector | Parity check |
Mealy (1955) / Moore (1956) automaton models.
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.
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.