Moore machine
In this machine, the output is determined only by the present active state of the state machine and not by any input events.
- There are no Output during state transition.
- Output is represented inside the state
- Output is also called "Action".
- In the Moore model the Output is also called "Entry action" or Input.
Light switch state machine
In this example, a light switch is controlled with two buttons (ON/OFF) and each state is reached through them. The state name is on the blue part of each rectangle and the process being executed is on the bottom white part.
The blue ON and OFF represent actions from the user and the bridge between each state.
State transition table - Light control Moore machine
In this representation, we start from a state and an output and wait for an input event to transition to a different state. From there, we shall go back to the left of the table and start again.
- When the state machine enters the "OFF" state, it executes the Light OFF entry action and waits until an input event is received.
- If the input event received is ON, the state machine moves to the state "Dim".
- If the input event received is OFF, event is ignored.