Finite Automata with Output (Set 5)

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 β€˜1’ as the substring or the input string starts with β€˜1’ or ends with β€˜1’.
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 β€˜X’ 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 β€˜Y’ and prints β€˜A’ as the output. The state β€˜Y’ on getting β€˜1’ as the input it remains in the state of itself and prints β€˜A’ as the output and on getting β€˜0’ as the input it comes back to the state β€˜X’ and prints β€˜B’ as the output.
Thus finally above Moore machine can easily give β€˜A’ as the output on getting β€˜1’ as input substring.

The required Mealy machine is constructed below:-

Explanation:
In the above diagram, the initial state β€˜X’ 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 β€˜Y’ and prints β€˜A’ as the output. The state β€˜Y’ on getting β€˜1’ as the input it remains in the state of itself and prints β€˜A’ as the output and on getting β€˜0’ as the input it comes back to the state β€˜X’ and prints β€˜B’ as the output.
Thus finally above Mealy machine can easily give β€˜A’ as the output on getting β€˜1’ as input substring.


Contact Us