Conversion From Mealy to Moore Machine
Let us take the transition table of the mealy machine shown in Figure 2.
Input=0 | Input=1 | |||
---|---|---|---|---|
Present State | Next State | Output | Next State | Output |
q0 | q1 | 0 | q2 | 0 |
q1 | q1 | 0 | q2 | 1 |
q2 | q1 | 1 | q2 | 0 |
Table 1
Step 1. First, find out those states which have more than 1 output 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 (a state with output 0) and q11 (a state with output 1). Similarly, for q2, two states will be q20 and q21.
Step 3: Create an empty Moore machine with a newly generated state. For more machines, Output will be associated with each state irrespective of inputs.
Input=0 | Input=1 | ||
Present State | Next State | Next State | Output |
q0 | |||
q10 | |||
q11 | |||
q20 | |||
q21 |
Table 2
Step 4: Fill in the entries of the next state using the mealy machine transition table shown in Table 1. For q0 on input 0, the next state is q10 (q1 with output 0). Similarly, for q0 on input 1, the next state is q20 (q2 with output 0). For q1 (both q10 and q11) on input 0, the next state is q10. Similarly, for q1(both q10 and q11), next state is q21. For q10, the output will be 0 and for q11, the output will be 1. Similarly, other entries can be filled.
Input=0 | Input=1 | ||
---|---|---|---|
Present State | Next State | Next State | Output |
q0 | q10 | q20 | 0 |
q10 | q10 | q21 | 0 |
q11 | q10 | q21 | 1 |
q20 | q11 | q20 | 0 |
q21 | q11 | q20 | 1 |
Table 3
This is the transition table of the Moore machine shown in Figure 1.
Mealy and Moore Machines in TOC
Moore and Mealy Machines are Transducers that help in producing outputs based on the input of the current state or previous state. In this article we are going to discuss Moore Machines and Mealy Machines, the difference between these two machines as well as Conversion from Moore to Mealy and Conversion from Mealy to Moore Machines.