AS Computing - Unit 1
State Transtion Tables

A state transition table is a means of recording all of the possible states and transitions for a Finite State Machine. Some software modelling tools will generate code or state transition diagrams from such a table.

Let's return to the model we made for the vending machine. The state diagram looked like this,

FSM Vending Machine

We can record the states and transitions using the following table,

InputCurrent StateOutputNext State
5pGot 0No canGot 5p
10pGot 0No canGot 10p
5pGot 5pNo canGot 10p
10pGot 5pCanGot 0
5pGot 10pCanGot 0
10pGot 10pCanGot 5p

This model could be extended to accept other coinage and to return change to the customer. Currently, the model only shows what happens when the correct coins are entered.