Mealy machine


In this machine, the output produced by the state machine depends on the input events fed to the state machine AND present active state of the same machine.

The Output is not produced inside the state.

Mealy model.png


Light switch state machine

In this example, the light switch has two buttons (ON/OFF) and 4 states (OFF, DIM, Medium bright, Bright) and depending on which button is pressed and the previous state the next state will change.

Only one button (ON) is necessary to transition from the initial state to the final state (Bright).
The OFF button can turn off the lamp from any state.

Pasted image 20241112101637.png

State transition table - Light control Mealy machine

The Mealy machine can also be represented in table form. Here, the present state can be used as a starting point to analyze what will happen when an input is introduced, both the next state and the output can be known from there.

Pasted image 20241112103750.png