Finite Automata with Output (Set 3)
Prerequisite: Mealy and Moore Machines, Difference between Mealy machine and Moore machine
In this article, we will see some designing of Finite Automata with Output i.e, Moore and Mealy machines.
Problem: Construction of the machines that take set of all string over {a, b} as input and count number of substring βaβ.
That is here we have,
Ξ = {a, b} and
Ξ = {0, 1}
where Ξ and Ξ are the input and output alphabet respectively.
The required Moore machine is constructed below:-
Explanation:
In the above diagram, the initial state βXβ on getting βbβ as the input it remains in the state of itself and print β0β as the output and on getting βaβ as the input it transits to a state βYβ and prints β1β as the output. The state βYβ on getting βaβ as the input it remains in the state of itself and prints β1β as the output and on getting βbβ as the input it comes back to the state βXβ and prints β0β as the output.
Thus finally above Moore machine can easily count substring βaβ i.e, on getting βaβ as the substring it gives β1β as the output thus on counting number of β1β we can count the number of substrings βaβ.
The required Mealy machine is constructed below:-
Explanation:
In the above diagram, the initial state βXβ on getting βbβ as the input it remains in the state of itself and print β0β as the output and on getting βaβ as the input it transits to a state βYβ and prints β1β as the output. The state βYβ on getting βaβ as the input it remains in the state of itself and prints β1β as the output and on getting βbβ as the input it comes back to the state βXβ and prints β0β as the output.
Thus finally above Moore machine can easily count substring βaβ i.e, on getting βaβ as the substring it gives β1β as the output thus on counting number of β1β we can count the number of substrings βaβ.
Contact Us