Open In App

Moore and Mealy machines to produce ‘A’, ‘B’, ‘C’ depends on inputs that end with ’10’ or with ’11’ else other

Prerequisite: Mealy and Moore Machines, Difference between Mealy machine and Moore machine 
Problem: Construction of the machines that take set of all string over {0, 1} as input and produce ‘A’ as output if the input ends with ’10’ or produce ‘B’ as output if the input ends with ’11’ otherwise produce ‘C’ as the output. 
Assume, 
 

Ε = {0, 1} and 
Δ = {A, B, C}  

where Ε and Δ are the input and output alphabet respectively. 



Explanation: 
The required Moore machine is constructed below: 

 



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

Thus finally above Moore machine can easily produce ‘A’ as output if the input ends with ’10’ or produce ‘B’ as output if the input ends with ’11’ otherwise produce ‘C’ 

Conversion of Moore machine to Mealy machine: 
Above Moore machine takes set of all string over {0, 1} as input and produce ‘A’ as output if the input ends with ’10’ or produce ‘B’ as output if the input ends with ’11’ otherwise produce ‘C’ as the output. 
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 :