Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mealy and Moore Machines

Similar presentations


Presentation on theme: "Mealy and Moore Machines"— Presentation transcript:

1 Mealy and Moore Machines
Lecture 8 Mealy and Moore Machines

2 Overview Moore Machines Mealy Machines Sequential Circuits

3 A Moore Machine q0/1 q1/0 q2/0 q3/1 a b a,b

4 Definition of a Moore Machine
A finite set of states q0, q1, q2, etc. q0 is the start state Alphabet of input letters Alphabet of output letters Transitions A unique one for each letter and each state Output Table A letter for each state

5 Moore Machine for aba a b a q0/0 q1/0 q2/0 q3/1 b a b q4/0 a,b

6 Defining a Language To change a FA into a Moore machine which accepts the same language Name each state Name the Start state q0 Output 0 in all non-final states Output 1 in all Final states. A string is accepted if after it has been completed read in the last letter printed is 1.

7 A Mealy Machine q0 q1 q2 b/0 a/0 a/1 a/1, b/1

8 Definition of a Mealy Machine
A finite set of states q0, q1, q2, etc. q0 is the start state Alphabet of input letters Alphabet of output letters Transitions A unique one for each letter and each state Each transition also has one output letter

9 Equivalence of Machines
Every Moore machine can be turned into a Mealy machine. Every Mealy machine can be turned into a Moore machine. Every regular language can be defined by Moore machine or a Mealy machine. All languages defined by a Moore machine or a Mealy machine are regular.

10 Equivalent Machines: Two machine are said to equivalent if they print the same output string when the same input string is run on them Moore = Mealy A Moore machine can’t be equivalent to any Mealy machine. However, ignoring the extra character printed by Moore machine, automatically at the start state, there exist a Mealy machine which is equivalent to the Moore machine.

11 Theorem 8: For every Moore machine Mo, there is a Mealy machine Me that is equivalent to it (ignoring the initial extra character printed by the Moore machine). Proof: The proof will be the constructive algorithm. Consider the following situation in Moore machine

12 It will be converted into its equivalent Mealy machine by shifting the output character corresponding to state qx to the labels of corresponding incoming arrows. Thus the above machine will become. Note: If any state does not have incoming arrow then remove its output character for nothing. Ex:

13 Theorem 9: For every Mealy machine Me, there is a Moore machine Mo that is equivalent to it. Proof: The proof will be the constructive algorithm. At each state of a Mealy machine there are two possibilities for incoming transitions; The incoming transitions have same output character. Shift the output character of all the incoming transition to corresponding state.

14 ii) The incoming transitions have different output characters.
Under this scenario there are two possibility. There is no self loop on the state. Split the corresponding state into as many new states as the number of different output characters on the incoming transitions, i.e. can be split into etc. Shift the output characters of the transitions to the corresponding new states. These new states should behave like the old state. i.e.

15 b) There is self loop on the state.
Split the corresponding state into as many new states as the number of different output characters on the incoming transitions, i.e. can be split into etc. Shift the output characters of the transitions to the corresponding new states. These new states should behave like the old state. i.e Connect the new states with each other with the arrow in appropriate direction and with appropriate output character. Examples: Ch # 8: Exercise Questions 8, 9

16 Transducers Transducers as Models of Sequential Circuits:
Automata with input and output are sometimes called transducers. Thus Moore and Mealy machines are also called transducers. Example: Exercise Q. No. 10 Solve Exercise questions: 1, 3, 4, 5, 6, 7, 8, 9, 10


Download ppt "Mealy and Moore Machines"

Similar presentations


Ads by Google