Some Training

21
1 Some Training State Assignment of synchronous FSM based on partitions

description

Some Training. State Assignment of synchronous FSM based on partitions. To encode machine M we need 3 two-block partitions such that:. Example 1. We generate closed partitions. G,H. C,D. G,E. A,C. A,B. F,H. E,F. B,D. Example continued . Gra ph of successor pairs :. - PowerPoint PPT Presentation

Transcript of Some Training

Page 1: Some Training

1

Some Training

State Assignment of synchronous FSM based on partitions

Page 2: Some Training

2

ExampleExample 1 1x

s 0 1 Z

A H B 0B F A 0C G D 0D E C 1E A C 0F C D 0G B A 0H D B 0

We generate closed partitions

To encode machine M we need 3 two-block partitions such that:

(0) cba

Page 3: Some Training

3

Example continued.

xs 0 1 Z

A H B 0B F A 0C G D 0D E C 1E A C 0F C D 0G B A 0H D B 0

Graph of successor pairs:

HG,F,E,;DC,B,A,1

A,B F,H

C,D

E,F A,CG,E

G,HB,D

Page 4: Some Training

4

Example 1 continued

xs 0 1 Z

A H B 0B F A 0C G D 0D E C 1E A C 0F C D 0G B A 0H D B 0

GF,C,B,;HE,D,A,

GF,;HE,CB,;DA, ;

GF,CB,;HE,D,A, ;

HE,DA,;GF,C,B, ;

A,D

D,H

B,F+ =2

Page 5: Some Training

5

Example 1 continued

HG,F,E,;DC,B,A,1

GF,C,B,;HE,D,A,2

Unfortunately:

Thus we need one more partition :

)0( GF,;HE,;CB,;DA,21

)(0τ 21

FE,D,C,;HG,B,A,τ

Page 6: Some Training

6

Example 1 continued

HG,F,E,;DC,B,A,1

GF,C,B,;HE,D,A,2 00001111

01100110

Encoding wrt 1 2

ABCDEFGH

FE,D,C,;HG,B,A,τ

00111100

Page 7: Some Training

7

Example 1 continued

With such encoding two excitation functions Q1’ i Q2’ of this machine will depend on one internal variable, and the third one Q3’ (in the worst case) on three variables, i.e.:

Q1’ = f(x,Q1)

Q2’ = f(x,Q2)

Q3’ = f(x,Q1,Q2,Q3)

If you do not trust, please encode, calculate cost functions Q1’, Q2’, Q3’ and check.

Page 8: Some Training

8

For everybody

If I am wrong

I will buy beer

Page 9: Some Training

9

Comment

Q1’ = f(x,Q1)

Q2’ = f(x,Q1,Q2,Q3)

Q3’ = f(x,Q1,Q2,Q3)

0 0 0 0 0 10 1 0

0 1 11 0 01 0 11 1 01 1 1

ABCDEFGH

Every other encoding will lead to more complex excitation functions.

In particular for binary encoding:

Page 10: Some Training

10

ExampleExample 2 2x

s 0 1 0 1

A D C 0 1B C D 0 0C E F 0 1D F E 0 0E B A 0 1F A B 0 0 FD,B,;EC,A,O

FE,;DC,;BA,I

Partition compatible with inputs:

Π(0)ΠΠOI

I is closed

Page 11: Some Training

11

Example 2 continued

FE,;DC,;BA,Π I FD,B,;EC,A,ΠO

0 00 00 10 11 01 0

010101

Encoding wrt I wrt O

ABCDEF

Q1’ = f(Q1,Q2)

Q2’ = f(Q1,Q2)

Q3’ = ???

y = f(x,Q3)

Page 12: Some Training

12

ES

0 1

S0 S0 S1

S1 S1 S2

S2 S2 S3

S3 S3 S4

S7 S7 S0

Intuitive Encoding

counterE

clock

Q

Example of a counter with input Enable

Page 13: Some Training

13

E

S0 1 E

Q2Q1Q0 0 1

S0 S0 S1 000 000 001

S1 S1 S2 001 001 010

S2 S2 S3 010 010 011

S3 S3 S4 011 011 100

S4 S4 S5 100 100 101

S5 S5 S6 101 101 110

S6 S6 S7 110 110 111

S7 S7 s0 111 111 000

S’ Q2Q1Q0 Q2’Q1’Q0’

Modulo 8 counter

Transition TableTransition table encoded with binary natural code

Page 14: Some Training

14

EQ2Q1Q0 0 1 E

Q2Q1Q0 0 1

000 000 001 000 000 001

001 001 010 001 001 010

010 010 011 011 011 100

011 011 100 010 010 011

100 100 101 110 110 111

101 101 110 111 111 000

110 110 111 101 101 110

111 111 000 100 100 101

Q2Q1Q0 Q2’Q1’Q0’ Q2Q1Q0 Q2’Q1’Q0’

Encoded table

Page 15: Some Training

15

EQ2Q1Q0 0 1 E

Q2Q1Q0 0 1 0 1 0 1

000 000 001 000 0 0 0 0 0 1

001 001 010 001 0 0 0 1 1 0

011 011 100 011 0 1 1 0 1 0

010 010 011 010 0 0 1 1 0 1

110 110 111 110 1 1 1 1 0 1

111 111 000 111 1 0 1 0 1 0

101 101 110 101 1 1 0 1 1 0

100 100 101 100 1 1 0 0 0 1

Q2Q1Q0 Q2’Q1’Q0’ Q2Q1Q0 D2 D1 D0

Excitation function table for D flip-flops

D2 = 1QQ20QQ2

D1 = EQ1 D0 = EQ0EQ22Q1Q0EQ 1Q0EQ

0QQ1 0EQ

Page 16: Some Training

16

EQ2Q1Q0 0 1 E

Q2Q1Q0 0 1 0 1 0 1

000 000 001 000 0 0 0 0 0 1

001 001 010 001 0 0 0 1 0 1

011 011 100 011 0 1 0 1 0 1

010 010 011 010 0 0 0 0 0 1

110 110 111 110 0 0 0 0 0 1

111 111 000 111 0 1 0 1 0 1

101 101 110 101 0 0 0 1 0 1

100 100 101 100 0 0 0 0 0 1

Q2Q1Q0 Q2’Q1’Q0’ Q2Q1Q0 T2 T1 T0

Encoded excitation table for T flip-flops

T2 = EQ1Q0 T1 = T0 = EQ0 E

Page 17: Some Training

17

Diagram of the counter

T Q

Q Clock

T Q

Q

Enable T Q

Q

11102

01

0

QTQEQTEQTET

Discuss this design, how flip flops are selected, how to generalize to any number of bits

Page 18: Some Training

18

Example 3Example 3x

s 0 1 0 1

A A F 0 0B E C 0 1C C E 0 1D F A 1 0E B F 1 1F D E 0 0

FDCEBA ,,;,,1

0 0 0 10 10 01 01 0

Encoding wrt 1

ABCDEF

001101

FECBDAτ ,;,;,

Is not sufficient for encoding

Page 19: Some Training

19

Example 3 continued

xs 0 1 0 1

A A F 0 0B E C 0 1C C E 0 1D F A 1 0E B F 1 1F D E 0 0

A 0 0 0 B 0 0 1C 1 0 1D 1 0 0E 0 1 0F 1 1 0

Let us then use closed partition:

Q1’ = D1 = f(x,Q1)

We do not have to calculate excitation functions to know that the first one, D1

will…

Unfortunately only one variable we were able to encode according to the closed partition, therefore:

And what with remaining?

Q2’ = D2 = f(x,Q1,Q2,Q3)

Q3’ = D3 = f(x,Q1,Q2,Q3)

Page 20: Some Training

20

Example 3…

xs 0 1 0 1

A A F 0 0B E C 0 1C C E 0 1D F A 1 0E B F 1 1F D E 0 0

FEDBCA ,;,;,2 π

FDCEBA ,,;,,1 π

Encoding wrt 1

0 0 0 10 00 11 01 0

ABCDEF

001101

2

)(0 21

This is unique encoding

May be there are more closed partitions:

We will show that besides 1

is 2

Page 21: Some Training

21

Example 3 cont

With this encoding the first excitation function Q1’ of this machine will depend on one internal variable, and the second and third together (Q2’, Q3’) on two internal variables, like this:

Q1’ = f(x,Q1)

Q2’ = f(x,Q2,Q3)

Q3’ = f(x,Q2,Q3)

If you do not trust, encode and calculate excitation functionsQ1’, Q2’, Q3’ and check.

Do this!