A finite state machine has a set of states and two functions called the next-state and output function.
The diagram given below explains the functioning of a finite state machine in TOC.
The output function generates a set of outputs from the current state and the inputs.
The two types of finite state machines are −
We mostly deal with the Moore machine. These two types are equivalent in capabilities.
A Finite State Machine consists of the following −
The components which exists in a finite state machine are explained below −
State − The states are usually drawn with circles and only one state can be active at a time.
It is represented as follows −
Initial State − It is the starting point of our system. Initial states are usually drawn with an arrow pointed to state, as shown below −
Final state − It is a subset of known states that indicates whether the input we processed is valid or not. Accepting states are usually drawn as a double circle as shown below −
Transitions − The machine moves from one state to another and is indicated as transition. These are drawn as two states connected with a line, as shown below −