State Machines

[a definition]

The more complete Wikipedia entry.

A state machine remembers a "state" (a memory of where it is in its internal process) and depending on whar state it is in, it calculates outputs that are determined by the current inputs and then transitions to a different (or the same) state. We could specify a state machine by a connected graph. States are represented by circles. Directed arrows specify the transitions between states. Each transition is determined by the "current state" (that is, the circle it originates in) and by the input conditions. As a side effect of the state transition the state machine defines new output values.

[Mealy: transition -> output; Moore: state -> output]

See statemachine.sc for some simple examples

See the Pdsfm (with its examples) and Pfsm finite state machine (FSM) classes.