Finite Automata with Output (Set 6)
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 {0, 1} as input and produce βAβ as output if the input contains β101β as the substring or the input string starts with β101β or ends with β101β.
That is here we have,
Ξ = {0, 1} and
Ξ = {A, B}
where Ξ and Ξ are the input and output alphabet respectively.
The required Moore machine is constructed below:-
Explanation:
In the above diagram, the initial state βwβ on getting β0β as the input it remains in the state of itself and prints βBβ as the output and on getting β1β as the input it transits to a state βXβ and prints βBβ as the output. The state βXβ on getting β1β as the input it remains in the state of itself and prints βBβ as the output and on getting β0β as the input it transmits to the state βYβ and prints βBβ as the output and so on for the remaining states.
Thus finally above Moore machine can easily give βAβ as the output on getting β101β as input substring.
The required Mealy machine is constructed below:-
Explanation:
In the above diagram, the initial state βwβ on getting β0β as the input it remains in the state of itself and prints βBβ as the output and on getting β1β as the input it transits to a state βXβ and prints βBβ as the output. The state βXβ on getting β1β as the input it remains in the state of itself and prints βBβ as the output and on getting β0β as the input it transmits to the state βYβ and prints βBβ as the output and so on for the remaining states.
Thus finally above Moore machine can easily give βAβ as the output on getting β101β as input substring.
Contact Us