Finite State Machine
A model of computation with a finite set of states and rules for transitioning between them on inputs.
Definition
A finite state machine (FSM) is a system that occupies one of a finite number of states and moves between them according to inputs. Its behavior is defined by states, transitions, and outputs.
State explosion is the main practical limit: as a system's memory grows, the number of states can multiply beyond what is manageable to design or verify by hand. Hierarchical and extended state machines, which add variables alongside states, keep large controllers tractable.
In software, state machines tame complex event-driven logic, protocol handlers, user-interface flows, parsers, by making every state and transition explicit and therefore testable. In hardware they are the standard way to build controllers. Their great virtue is that a well-drawn machine can be reasoned about exhaustively for small state counts, and formally verified for large ones, turning tangled conditional code into a structure whose behavior is transparent.
Two forms
- Moore machine: output depends only on the current state.
- Mealy machine: output depends on state and input.
- Deterministic vs nondeterministic transition rules.
Why it matters
FSMs model and implement controllers, protocol handlers, parsers, and sequencers. They are simple enough to verify exhaustively yet powerful enough to describe most control logic, which is why they are ubiquitous in hardware and embedded software.
Fusion connection
The operating sequence of a fusion machine, from standby through startup to shutdown, is naturally described as a finite state machine, making the plant's control logic explicit and checkable.