Docsity

Moore and Mealy machine conversion, Exercises of Theory of Automata

Toggle sidebar
bg1
Mealy and Moore machine and their conversions
Mealy and Moore machine
Mealy machine:
In Mealy machine. the value of output function is depend on the present state and
present input.
Mealy machine is described by 6-tuples - (Q, Σ, ∆, δ, λ, q0)
where
Q = Finite non-empty set of states;
Σ = Set of input alphabets.
∆ = Set of output alphabets.
δ = Transitional function mapping Q X Σ → Q
λ = Output function mapping Q X Σ → ∆
q0 = Initial state.
Sample Transition table:
Present State
Next State
a = 0 a = 1
State Output State Output
-> q0 q3 0 q1 1
q1 q0 1 q3 0
q2 q2 1 q2 0
q3 q1 0 q0 1
Moore machine:
In Moore machine. the value of output function is depend on the present state only.
Moore machine is described by 6-tuples - (Q, Σ, ∆, δ, λ, q0)
where
Q = Finite non-empty set of states;
Σ = Set of input alphabets.
∆ = Set of output alphabets.
δ = Transition function mapping Q X Σ → Q
λ = Output function mapping Q → ∆
q0 = Initial state..
pf3
pf4
pf5
Discount

On special offer

Partial preview of the text

Download Moore and Mealy machine conversion and more Exercises Theory of Automata in PDF only on Docsity!

Mealy and Moore machine and their conversionsMealy and Moore machine

Mealy machine:

 In Mealy machine. the value of output function is depend on the present state andpresent input.

 Mealy machine is described by 6-tuples - ( Q , Σ, ∆, δ , λ , q 0 )

where

Q = Finite non-empty set of states;

Σ = Set of input alphabets.

∆ = Set of output alphabets.

δ = Transitional function mapping Q X Σ → Q

λ = Output function mapping Q X Σ → ∆

q 0 = Initial state.

Sample Transition table:

Present State

Next State a = 0 a = 1 State Output State Output -> q0 q3 0 q1 1 q1 q0 1 q3 0 q2 q2 1 q2 0 q3 q1 0 q0 1

Moore machine:

  In Moore machine. the value of output function is depend on the present state only.Moore machine is described by 6-tuples - ( Q , Σ, ∆, δ , λ , q

where

Q = Finite non-empty set of states;

Σ = Set of input alphabets.

∆ = Set of output alphabets.

δ = Transition function mapping Q X Σ → Q

λ = Output function mapping Q → ∆

q 0 = Initial state..

Sample Transition Table:

Present State a = 0 Next Statea = 1 Output -> q0 q3 q1 1 q1 q0 q3 0 q2 q2 q2 0 q3 q1 q0 1

Conversion from Mealy machine to Moore machine: Steps:

1.> 2.> we split qi into different states according to different output associated with it. for ex. Determine the number of different output associated with qi in the next state column.

suppose in the next state column of the above sample transition table of mealy machine,the output associated with q1 is "0" in the first next state column and "1" in the second next

state column. so we split q1 into q10 and q11 states. similarly check others and split them.

Example 1:convert it into corresponding Moore machine. consider the above sample transition table of the mealy machine.

Solution: associated with different outputs (0 and 1). so we split both states into q10 , q11 and q20, q21. After applying the conversion steps, we get two states ( q1 and q2) that are

Now the transition table becomes

Present State

Next State a = 0 a = 1 State Output State Output -> q0 q3 0 q11 1 q10 q0 1 q3 0 q11 q0 1 q3 0 q20 q21 1 q20 0 q21 q21 1 q20 0 q3 q10 0 q0 1

Here  whole row of q1 is copied to q10 , q11 and whole row of q2 is copied to q20 and q

 of the sample transition table of mealy machine.The outputs of the next state columns of q1 and q2 are depend on the previous

output. For ex. in the first row, q1 becomes q11 because the out of q1 is 1. in thefourth row, q2 becomes q21 because the output of the q2 is 1. and in the

subsequent column q2 becomes q20 because the output of q2 in that column was 0.and so on

Solution: First of all take the mealy machine transition table format, i.e.,

resent State

Next State a = 0 a = 1 State Output State Output

next step is to copy all thetransition table format moore machine transition table states into mealy machine

Present State

Next State a = 0 a = 1 State Output State Output -> q0 q3 q q1 q0 q q2 q2 q q3 q1 q

Now in the moore machine, the output of the q0 is 1. so make the output of q0 in the mealymachine next state column of the above table is 1. same process is repeated for q1, q2 and

q3.

Present State

Next State a = 0 a = 1 State Output State Output -> q0 q3 q q1 q0 1 q q2 q2 q q3 q1 q0 1

After repeating the above process for q1,q2 and q3 states, the final mealy machinetransition table is:

Present State

Next State a = 0 a = 1 State Output State Output -> q0 q3 1 q1 0 q1 q0 1 q3 1 q2 q2 0 q2 0 q3 q1 0 q0 1

Exercise : convert the following Moore machine into mealy machine:

Present State a = 0 Next Statea = 1 Output -> q0 q1 q0 0 q1 q2 q3 1 q2 q3 q2 0 q3 q0 q1 1