1 moore machine and mealy machine (p.274) mealy machine: created by g. h. mealy, 1955 moore machine:...

24
1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

Upload: doreen-mcgee

Post on 02-Jan-2016

254 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

1

Moore machine and Mealy machine (P.274)

Mealy machine: created by G. H. Mealy, 1955Moore machine: created by E.F. Moore, 1956

Page 2: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

2

Moore machine and Mealy machine (P.274)

Mealy machine: created by G. H. Mealy, 1955Moore machine: created by E.F. Moore, 1956

Purpose: to design a mathematical model for sequential circuits.

Page 3: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

3

Moore machine and Mealy machine (P.274)

Mealy machine: created by G. H. Mealy, 1955Moore machine: created by E.F. Moore, 1956

Purpose: to design a mathematical model for sequential circuits.

Definition: A Moore machine is a collection of five things

Page 4: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

4

Moore machine and Mealy machine (P.274)

Mealy machine: created by G. H. Mealy, 1955Moore machine: created by E.F. Moore, 1956

Purpose: to design a mathematical model for sequential circuits.

Definition: A Moore machine is a collection of five things1.A finite set of states qo q1 q2 … qo is the start state.

Page 5: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

5

Moore machine and Mealy machine (P.274)

Mealy machine: created by G. H. Mealy, 1955Moore machine: created by E.F. Moore, 1956

Purpose: to design a mathematical model for sequential circuits.

Definition: A Moore machine is a collection of five things1.A finite set of states qo q1 q2 … qo is the start state.2.An alphabet of letters for forming the input string Σ = {a, b, c, … }

Page 6: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

6

Moore machine and Mealy machine (P.274)

Mealy machine: created by G. H. Mealy, 1955Moore machine: created by E.F. Moore, 1956

Purpose: to design a mathematical model for sequential circuits.

Definition: A Moore machine is a collection of five things1.A finite set of states qo q1 q2 … qo is the start state.2.An alphabet of letters for forming the input string Σ = {a, b, c, … }3.An alphabet of possible output characters Γ = {x, y, z, … }

Page 7: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

7

Moore machine and Mealy machine (P.274)

Mealy machine: created by G. H. Mealy, 1955Moore machine: created by E.F. Moore, 1956

Purpose: to design a mathematical model for sequential circuits.

Definition: A Moore machine is a collection of five things1.A finite set of states qo q1 q2 … qo is the start state.2.An alphabet of letters for forming the input string Σ = {a, b, c, … }3.An alphabet of possible output characters Γ = {x, y, z, … }4.A transition table that shows for each state and each input letter what state is reached next.

Page 8: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

8

Moore machine and Mealy machine (P.274)

Mealy machine: created by G. H. Mealy, 1955Moore machine: created by E.F. Moore, 1956

Purpose: to design a mathematical model for sequential circuits.

Definition: A Moore machine is a collection of five things1.A finite set of states qo q1 q2 … qo is the start state.2.An alphabet of letters for forming the input string Σ = {a, b, c, … }3.An alphabet of possible output characters Γ = {x, y, z, … }4.A transition table that shows for each state and each input letter what state is reached next.5.An output table that shows what character from Γ is printed by each state as it is entered

Page 9: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

9

Moore machine Transition and output table

Old State

qo

q1

q2

q3

Old State

1

0

0

1

Input a

q1

q3

q0

q3

Input b

q3

q1

q3

q2

Output by the New State

Page 10: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

10

Moore machine – the pictorial representation

qo /1

q2 /0 q3 /1

a

aa b

b

b

q1 /0

b

a

Page 11: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

11

Moore machine – example Input: a b b a Output:

qo /1

q2 /0 q3 /1

a

aa b

b

b

q1 /0

b

a

Page 12: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

12

Moore machine – example Input: a b b a Output: 1

qo /1

q2 /0 q3 /1

a

aa b

b

b

q1 /0

b

a

Page 13: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

13

qo /1

q2 /0 q3 /1

a

aa b

b

b

q1 /0

b

a

Page 14: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

14

qo /1

q2 /0 q3 /1

a

aa b

b

b

q1 /0

b

a

Page 15: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

15

qo /1

q2 /0 q3 /1

a

aa b

b

b

q1 /0

b

a

Page 16: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

16

qo /1

q2 /0 q3 /1

a

aa b

b

b

q1 /0

b

a

Page 17: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

17

qo /1

q2 /0 q3 /1

a

aa b

b

b

q1 /0

b

a

Page 18: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

18

qo /1

q2 /0 q3 /1

a

aa b

b

b

q1 /0

b

a

Page 19: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

19

qo /1

q2 /0 q3 /1

a

aa b

b

b

q1 /0

b

a

Page 20: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

20

qo /1

q2 /0 q3 /1

a

aa b

b

b

q1 /0

b

a

Page 21: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

21

qo /1

q2 /0 q3 /1

a

aa b

b

b

q1 /0

b

a

1. No final state2. Output is always

one letter more than the input

Page 22: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

22

Mealy machine

Definition: A Mealy machine is a collection of four things1.A finite set of states qo q1 q2 … qo is the start state.2.An alphabet of letters for forming the input string Σ = {a, b, c, … }3.An alphabet of possible output characters Γ = {x, y, z, … }4.A pictorial representation with states represented by small circles and directed edges indicting transitions between states. Each edge is labeled with a compound symbol of the form i/o.

Page 23: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

23

Example: input abba output 0111

q0 q2

q3

q1

a/0

b/1

b/1

a/1

a/1

a/0b/0

b/1

Page 24: 1 Moore machine and Mealy machine (P.274) Mealy machine: created by G. H. Mealy, 1955 Moore machine: created by E.F. Moore, 1956

24

FSA NFSA Moore Mealy

Start State 1 1 1 1

Final State some or 1 some or 1 none none

Edge Labels letters letters letters i/o

# of edges 1 for @ letter arbitrary 1 for @ letter 1 for @ letter

Deterministic yes no yes yes

Output no no yes yes