Download - Transformation between Mealy and Moore Machines

Transcript
Page 1: Transformation between Mealy and Moore Machines

CS 140L Lecture 7Transformation between Mealy

and Moore MachinesProfessor CK Cheng

CSE Dept.

UC San Diego

Page 2: Transformation between Mealy and Moore Machines

Outlines

• Framework

• Procedure

• Example: Transform

• Example: State Diagram

• Example: Output Sequence

Page 3: Transformation between Mealy and Moore Machines

Transform from Mealy to Moore Machine

Mealy Machine: y(t) = f(x(t), s(t))Moore Machine: y(t) = f(s(t))

s(t+1) = g(x(t), s(t))

C1 C2

CLK

x(t)

y(t)

Mealy Machine

C1 C2

CLK

x(t) y(t)

Moore Machine

s(t) s(t)

3

Page 4: Transformation between Mealy and Moore Machines

Transform from Mealy to Moore Machine

1) For each NS, z = Si,yj create a state Si(j)

2) For each new state Si(j), repeat the row PS = Si

3) Replace NS, z = Si,yj with state Si(j).

Set output z = yj for row PS = Si(j)

AlgorithmInput: State Table of Mealy machine

Page 5: Transformation between Mealy and Moore Machines

Mealy Machine:

Example

PS A B

00 A,0A,1

01A,1B,0

10B,0B,0

(x,y)

(NS, z)

PS A0A1B

00 A0A0A1

01A1A1B

Moore Machine:10BBB

(x,y) z 0 1 0

Page 6: Transformation between Mealy and Moore Machines

Mealy Machine

A0/0

A1/1

B/010

10

00

1001

01

00

0001

A10/0 B

00/1

00/0, 01/1 10/0, 01/0

Moore Machine

State Diagram

Page 7: Transformation between Mealy and Moore Machines

Timing Diagrams

Time step x y S z

S z

0

00

A0

A00

1

01

A1

A00

2

10

A0

A11

3

00

B1

B0

4

01

A1

A11

5

01

A1

A11

Mealy

Moore

The output shifts by one clock from Mealy to Moore machine

A

A11