Translate

Conversion from Mealy Machine to Moore machine

1 min read

 

Conversion from Mealy Machine to Moore machine

Conversion from Mealy to Moore Machine

Let us take the transition table of mealy machine shown in Figure 2.

 Input=0Input=1
Present StateNext StateOutputNext StateOutput
q0q10q20
q1q10q21
q2q11q20

Table 1

Step 1. First find out those states which have more than 1 outputs associated with them. q1 and q2 are the states which have both output 0 and 1 associated with them.

Step 2. Create two states for these states. For q1, two states will be q10 (state with output 0) and q11 (state with output 1). Similarly for q2, two states will be q20 and q21.

Step 3. Create an empty moore machine with new generated state. For moore machine, Output will be associated to  each state irrespective of inputs.

 Input=0Input=1 
Present StateNext StateNext StateOutput
q0   
q10   
q11   
q20   
q21   

Table 2

Step 4. Fill the entries of next state using mealy machine transition table shown in Table 1. For q0 on input 0,  next state is q10 (q1 with output 0). Similarly, for q0 on input 1, next state is q20 (q2 with output 0). For q1 (both q10 and q11) on input 0, next state is q10. Similarly, for q1(both q10 and q11), next state is q21.  For q10, output will be 0 and  for q11, output will be 1. Similarly, other entries can be filled.

 Input=0Input=1 
Present StateNext StateNext StateOutput
q0q10q200
q10q10q210
q11q10q211
q20q11q200
q21q11q201

Table 3

This is the transition table of moore machine shown in Figure 1.



Method for conversion of Moore machine to Mealy machine

Let M = (Q, ∑, δ, λ, q0) be a Moore machine. The equivalent Mealy machine can be represented by M' = (Q, ∑, δ, λ', q0). The output function λ' can be obtained as:

  1. λ' (q, a) = λ(δ(q, a))  

Example 1:

Convert the following Moore machine into its equivalent Mealy machine.

Conversion from Moore machine to Mealy Machine

Solution:

The transition table of given Moore machine is as follows:

QabOutput(λ)
q0q0q10
q1q0q11

The equivalent Mealy machine can be obtained as follows:

  1. λ' (q0, a) = λ(δ(q0, a))  
  2.                 = λ(q0)  
  3.                 = 0  
  4.   
  5. λ' (q0, b) = λ(δ(q0, b))  
  6.                 = λ(q1)  
  7.                 = 1  

The λ for state q1 is as follows:

  1. λ' (q1, a) = λ(δ(q1, a))  
  2.                 = λ(q0)  
  3.                 = 0  
  4.   
  5. λ' (q1, b) = λ(δ(q1, b))  
  6.                 = λ(q1)  
  7.                 = 1  

Hence the transition table for the Mealy machine can be drawn as follows:

Conversion from Moore machine to Mealy Machine

The equivalent Mealy machine will be,

Conversion from Moore machine to Mealy Machine

Note: The length of output sequence is 'n+1' in Moore machine and is 'n' in the Mealy machine.

Example 2:

Convert the given Moore machine into its equivalent Mealy machine.

Conversion from Moore machine to Mealy Machine

Solution:

The transition table of given Moore machine is as follows:

QabOutput(λ)
q0q1q00
q1q1q20
q2q1q01

The equivalent Mealy machine can be obtained as follows:

  1. λ' (q0, a) = λ(δ(q0, a))  
  2.                 = λ(q1)  
  3.                 = 0  
  4.   
  5. λ' (q0, b) = λ(δ(q0, b))  
  6.                 = λ(q0)  
  7.                 = 0  

The λ for state q1 is as follows:

  1. λ' (q1, a) = λ(δ(q1, a))  
  2.                 = λ(q1)  
  3.                 = 0  
  4.   
  5. λ' (q1, b) = λ(δ(q1, b))  
  6.                 = λ(q2)  
  7.                 = 1  

The λ for state q2 is as follows:

  1. λ' (q2, a) = λ(δ(q2, a))  
  2.                 = λ(q1)  
  3.                 = 0  
  4.   
  5. λ' (q2, b) = λ(δ(q2, b))  
  6.                 = λ(q0)  
  7.                 = 0  

Hence the transition table for the Mealy machine can be drawn as follows:

Conversion from Moore machine to Mealy Machine

The equivalent Mealy machine will be,

Conversion from Moore machine to Mealy Machine

Example 3:

Convert the given Moore machine into its equivalent Mealy machine.

QabOutput(λ)
q0q0q10
q1q2q01
q2q1q22

Solution:

The transaction diagram for the given problem can be drawn as:

Conversion from Moore machine to Mealy Machine

The equivalent Mealy machine can be obtained as follows:

  1. λ' (q0, a) = λ(δ(q0, a))  
  2.                 = λ(q0)  
  3.                 = 0  
  4.   
  5. λ' (q0, b) = λ(δ(q0, b))  
  6.                 = λ(q1)  
  7.                 = 1  

The λ for state q1 is as follows:

  1. λ' (q1, a) = λ(δ(q1, a))  
  2.                 = λ(q2)  
  3.                 = 2  
  4.   
  5. λ' (q1, b) = λ(δ(q1, b))  
  6.                 = λ(q0)  
  7.                 = 0  

The λ for state q2 is as follows:

  1. λ' (q2, a) = λ(δ(q2, a))  
  2.                 = λ(q1)  
  3.                 = 1  
  4.   
  5. λ' (q2, b) = λ(δ(q2, b))  
  6.                 = λ(q2)  
  7.                 = 2  

Hence the transition table for the Mealy machine can be drawn as follows:

Conversion from Moore machine to Mealy Machine

The equivalent Mealy machine will be,

Conversion from Moore machine to Mealy Machine

You may like these posts

Post a Comment

© 2025TOC. The Best Codder All rights reserved. Distributed by