Lecture 8 Mealy and Moore Machines Overview Moore

  • Slides: 16
Download presentation
Lecture 8 Mealy and Moore Machines

Lecture 8 Mealy and Moore Machines

Overview • Moore Machines • Mealy Machines • Sequential Circuits

Overview • Moore Machines • Mealy Machines • Sequential Circuits

A Moore Machine a, b q 1/0 a q 0/1 b q 3/1 a

A Moore Machine a, b q 1/0 a q 0/1 b q 3/1 a b b q 2/0 a

Definition of a Moore Machine • A finite set of states – q 0,

Definition of a Moore Machine • A finite set of states – q 0, q 1, q 2, etc. – q 0 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

Moore Machine for aba q 0/0 a b b q 1/0 a q 2/0

Moore Machine for aba q 0/0 a b b q 1/0 a q 2/0 b q 4/0 a, b a q 3/1

Defining a Language • To change a FA into a Moore machine which accepts

Defining a Language • To change a FA into a Moore machine which accepts the same language – Name each state – Name the Start state q 0 – 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.

A Mealy Machine q 1 a/1, b/1 a/1 q 0 a/0 b/0 q 2

A Mealy Machine q 1 a/1, b/1 a/1 q 0 a/0 b/0 q 2 b/0

Definition of a Mealy Machine • A finite set of states – q 0,

Definition of a Mealy Machine • A finite set of states – q 0, q 1, q 2, etc. – q 0 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

Equivalence of Machines • Every Moore machine can be turned into a Mealy machine.

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.

Equivalent Machines: • Two machine are said to equivalent if they print the same

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. 10

Theorem 8: • For every Moore machine Mo, there is a Mealy machine Me

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 11

 • It will be converted into its equivalent Mealy machine by shifting the

• 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: 12

Theorem 9: • For every Mealy machine Me, there is a Moore machine Mo

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; i) The incoming transitions have same output character. • Shift the output character of all the incoming transition to corresponding state. 13

ii) The incoming transitions have different output characters. Under this scenario there are two

ii) The incoming transitions have different output characters. Under this scenario there are two possibility. a) 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. 14

 • b) There is self loop on the state. • Split the corresponding

• 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 15

Transducers • Transducers as Models of Sequential Circuits: • Automata with input and output

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 16