behavioral equivalence sequential machine theory prof. k. j. hintz department of electrical and...

21
Behavioral Equivalence Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 7 Modifications and updates by Marek Perkowski

Post on 22-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Behavioral EquivalenceBehavioral Equivalence

Sequential Machine Theory

Prof. K. J. HintzDepartment of Electrical and Computer

Engineering

Lecture 7

Modifications and updates by Marek Perkowski

Behavioral EquivalenceBehavioral EquivalenceBehavioral EquivalenceBehavioral Equivalence

“Black Box” View of Machines

M1I1 O1

1

M2I2 O2

2

Behavioral EquivalenceBehavioral Equivalence

Two machines, M1 and M2, are behaviorally equivalent iff– The sets of inputs are the same, I1 = I2,

– The sets of outputs are the same, O1 = O2

and, there exists a behavioral equivalence relation (which is not necessarily injective) between the states...

Behavioral EquivalenceBehavioral Equivalence

xsxs

x

,,

* then, if

,and

=)( Range

=)( Domain

: thatsuch

:

2

*

21

*

1

21

2

1

21

ISS

S

S

SS

R

R

R

R

Behavioral EquivalenceBehavioral Equivalence

To show that R is a behavioral Equivalence, it is necessary to show that:

kj ss

asasas

asasas

R

RR

R

IS

and

OO

IS

,,,

,,,

11211

21

11211

Behavioral EquivalenceBehavioral Equivalence

a

s1

sj R(s1)

sk

RR

a

M1 M2

kj ss

asasas

asasas

R

RR

R

IS

and

OO

IS

,,,

,,,

11211

21

11211

Behavioral Equivalence ExampleBehavioral Equivalence Example

M1

A/0

C/0

B/1a

a

a

b

b

b

PS a b o/p

A B A 0

B B C 1

C B A 0

Behavioral Equivalence ExampleBehavioral Equivalence Example

M2

1/0

2/1aa

b

PS a b o/p

1 2 1 0

2 2 1 1

b

Behavioral Equivalence ExampleBehavioral Equivalence Example

122*21

*1

2

1

21

21

where,,

2,1 Range

Domain

1,,2,,1,

1,01,0

,,

ssxsxs

CB,A,

CBA

baba

R

R

R

=R

S

S

OO

II

M1

A/0

C/0

B/1

a

a

a

b

b

b

PS a b o/p

A B A 0

B B C 1

C B A 0

M2

1/0

2/1a a

b

bPS a b o/p

1 2 1 0

2 2 1 1

Behavioral Equivalence ExampleBehavioral Equivalence Example

• Since This Is a Moore Machine, It Is Only Necessary to Check Each State, i.e.,

• For Mealy Machine, Also Need to Check For Each Input.

ii ss R21

Equivalence of OutputsEquivalence of Outputs

checks state so ,01 0

1

checks state so ,12 1

2

checks state so ,01 0

1

21

21

21

21

CC

C

BB

B

AA

A

R

R

R

MM

M1

A/0

C/0

B/1

a

a

a

b

b

b

PS a b o/p

A B A 0

B B C 1

C B A 0

M2

1/0

2/1a a

b

bPS a b o/p

1 2 1 0

2 2 1 1

Verifying MorphismVerifying Morphism

Need also to verify relation

inputs all and states allfor .

binput for checks state so, ,11

,1

,,

ainput for checks state so, ,22

,1

,,

,,,

2

21

2

21

121

etc

A

bA

bAbA

A

aB

aAaA

asasas iii

R

RR

R

RR

RR IS

M1

A/0

C/0

B/1

a

a

a

b

b

bPS a b o/p

A B A 0

B B C 1

C B A 0

M2

1/0

2/1a a

b

bPS a b o/p

1 2 1 0

2 2 1 1

inputs all and states allfor .

binput for checks state so, ,11

,1

,,

ainput for checks state so, ,22

,1

,,

,,,

2

21

2

21

121

etc

A

bA

bAbA

A

aB

aAaA

asasas iii

R

RR

R

RR

RR IS

Verifying MorphismVerifying Morphism

How to check Behavioral How to check Behavioral Equivalence of Moore/MealyEquivalence of Moore/Mealy

How to check Behavioral How to check Behavioral Equivalence of Moore/MealyEquivalence of Moore/Mealy

• Constructive Approach– Moore to Mealy (easy)

21

21

2

1

Let

, , , , =Mealy

, , , , = Moore

OO

II

OIS

OIS

M

M

Moore StateMoore State

Sk/0k

a

b

c

c

b

a

a b c

sk ok

sl sk

sm sk

sn sk

Mealy StateMealy State

a b c

sk (so,oo) (sp,op) (sq,oq)

sl (sk,ok)

sm (sk,ok)

sn (sk,ok)

Sk

a/oob/ok

c/ok

a/ok

b/op

c/oq

Mealy to Moore ConversionMealy to Moore Conversion

• Construct a New Set of States Consisting of Each Present State Combined With Each of the Possible Outputs. Some of the States With Outputs May Not Be Reachable.

• A More Sophisticated Method Would Generate a New Set of States Consisting Only of Those State/Output Combinations Reached by the Head of an Arrow.

Mealy to Moore ConversionMealy to Moore Conversion

Mealy to Moore ConversionMealy to Moore Conversion

Mealy State TableMealy State Table

a b c d

R ( R, x ) ( R, 0 )

P ( R, 0 )

Q ( R, 1 )

Equivalent Moore State TableEquivalent Moore State Table

a b c d o/p

R1 R3 R1 0

R2 R3 R1 1

R3 R3 R1 x

P R1

Q R2