Open In App

Finite Automata with Output (Set 11)

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 the binary number {0, 1} as input and produce 1’s complement of that number as output. 
Here the assumption is that the input string is read from LSB (Least Significant Bit) and end carry is discarded. 
That is here we have, 
Ε = {0, 1} 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 ‘1’ as the input it remains in the state of itself and prints ‘0’ as the output and on getting ‘0’ as the input it transmits to a state ‘Y’ and prints ‘1’ as the output so on for the remaining states. 

For example, when the input string is ‘101’ then above Moore machine produce output as ‘010’ which is nothing but 1’s complement of the given input i.e, 1 gets converted into 0 and vice versa. 
Thus finally above Moore machine can easily produce 1’s complement of the given input binary string. 

The required Mealy machine is constructed below:- 
 

Explanation: 
In the above diagram, the initial state ‘X’ on getting ‘1’ as the input it remains in the state of itself and prints ‘0’ as the output and on getting ‘0’ as the input it transmits to a state ‘Y’ and prints ‘1’ as the output so on for the remaining states. 

For example, when the input string is ‘101’ then above Moore machine produce output as ‘010’ which is nothing but 1’s complement of the given input i.e, 1 gets converted into 0 and vice versa. 
Thus finally above Mealy machine can easily produce 1’s complement of the given input binary string. 

Conversion from Moore machine to Mealy machine: 
State Transition Diagram of a Moore machine: 
 

Above Moore machine takes the binary number {0, 1} as input and produce 1’s complement of that number as output. 
Here the assumption is that the input string is read from LSB (Least Significant Bit) and end carry is discarded. 

Now we need to transform the above transition diagram of Moore machine to equivalent Mealy machine transition diagram. Steps for the required conversion are given below: 

 

Note: While converting from Moore to Mealy machine the number of states remains same for both Moore and Mealy machine but in case of Mealy to Moore conversion it does not give the same number of states.
 

Article Tags :