Presentation is loading. Please wait.

Presentation is loading. Please wait.

EECS 20 Lecture 11 (February 9, 2001) Tom Henzinger Feedback.

Similar presentations


Presentation on theme: "EECS 20 Lecture 11 (February 9, 2001) Tom Henzinger Feedback."— Presentation transcript:

1 EECS 20 Lecture 11 (February 9, 2001) Tom Henzinger Feedback

2 Parity LastThree Nats 0  Bools path without delay

3 The Parity System : States [ Parity] = { true, false } initialState [ Parity ] = true nextState [ Parity ] (q,x) = (q  x) output [ Parity ] (q,x) = q The LastThree System : States [ LastThree] = { 0, 1, 2 } initialState [ LastThree ] = 0 nextState [ LastThree ] (q,x) = output [ LastThree ] (q,x) = ( ( q = 2 )  x ) 0 if  x min (q+1, 2) if x {

4 Parity System truefalse true / true true / false false / true false / false States = Bools Inputs = Bools Outputs = Bools

5 LastThree System States = { 0, 1, 2 } Inputs = Bools Outputs = Bools 0 21 true / false false / false true / true true / false

6 A Run of the LastThree System Time 0 1 2 3 4 Input t t t t f Output State

7 A Run of the LastThree System Time 0 1 2 3 4 Input t t t t f Output State 0

8 A Run of the LastThree System Time 0 1 2 3 4 Input t t t t f Output f State 0 1

9 A Run of the LastThree System Time 0 1 2 3 4 Input t t t t f Output f f State 0 1 2

10 A Run of the LastThree System Time 0 1 2 3 4 Input t t t t f Output f f t State 0 1 2 2

11 A Run of the LastThree System Time 0 1 2 3 4 Input t t t t f Output f f t t State 0 1 2 2 2

12 A Run of the LastThree System Time 0 1 2 3 4 Input t t t t f Output f f t t f State 0 1 2 2 2 0

13 Parity LastThree FeedbackLoop Nats 0  Bools  This block diagram is ok, because every cycle contains a delay.

14 Parity LastThree FeedbackLoop Nats 0  Bools  x y z u q1 q2

15 Parity LastThree FeedbackLoop Nats 0  Bools  1 2 3 1 x y z u q1 q2

16 A Run of the FeedbackLoop System Time 0 1 2 3 4 Input x t t f t f Output y Aux z Aux u State q1 State q2 123123

17 A Run of the FeedbackLoop System Time 0 1 2 3 4 Input x t t f t f Output y Aux z Aux u State q1 t State q2 0 123123

18 A Run of the FeedbackLoop System Time 0 1 2 3 4 Input x t t f t f Output y t Aux z Aux u State q1 t State q2 0 123123

19 A Run of the FeedbackLoop System Time 0 1 2 3 4 Input x t t f t f Output y t Aux z f Aux u State q1 t State q2 0 123123

20 A Run of the FeedbackLoop System Time 0 1 2 3 4 Input x t t f t f Output y t Aux z f Aux u f State q1 t State q2 0 123123

21 A Run of the FeedbackLoop System Time 0 1 2 3 4 Input x t t f t f Output y t Aux z f Aux u f State q1 t t State q2 0 1 123123

22 A Run of the FeedbackLoop System Time 0 1 2 3 4 Input x t t f t f Output y t t Aux z f Aux u f State q1 t t State q2 0 1 123123

23 A Run of the FeedbackLoop System Time 0 1 2 3 4 Input x t t f t f Output y t t Aux z f f Aux u f State q1 t t State q2 0 1 123123

24 A Run of the FeedbackLoop System Time 0 1 2 3 4 Input x t t f t f Output y t t Aux z f f Aux u f f State q1 t t State q2 0 1 123123

25 A Run of the FeedbackLoop System Time 0 1 2 3 4 Input x t t f t f Output y t t Aux z f f Aux u f f State q1 t t t State q2 0 1 2 123123

26 A Run of the FeedbackLoop System Time 0 1 2 3 4 Input x t t f t f Output y t t t t f Aux z f f t t f Aux u f f f t f State q1 t t t t f f State q2 0 1 2 2 2 0

27 The FeedbackLoop System Inputs [ FeedbackLoop ] = Bools Outputs [ FeedbackLoop ] = Bools States [ FeedbackLoop ] = States [ Parity ]  States [ LastThree ] = { true, false }  { 0, 1, 2 } initialState [ FeedbackLoop ] = ( initialState [ Parity ], initialState [ LastThree ] ) = ( true, 0 )

28 The FeedbackLoop System, continued output [ FeedbackLoop ] ( ( q1, q2 ), x ) = output [ Parity] ( q1, any ) The value of this does not matter !

29 The FeedbackLoop System, continued output [ FeedbackLoop ] ( ( q1, q2 ), x ) = output [ Parity] ( q1, any ) Let this be y. nextState [ FeedbackLoop ] ( ( q1, q2 ), x ) 2 = nextState [ LastThree ] ( q2, y )

30 The FeedbackLoop System, continued output [ FeedbackLoop ] ( ( q1, q2 ), x ) = output [ Parity] ( q1, any ) Let this be y. nextState [ FeedbackLoop ] ( ( q1, q2 ), x ) 2 = nextState [ LastThree ] ( q2, y ) Let z = output [ LastThree ] ( q2, y ).

31 The FeedbackLoop System, continued output [ FeedbackLoop ] ( ( q1, q2 ), x ) = output [ Parity] ( q1, any ) Let this be y. nextState [ FeedbackLoop ] ( ( q1, q2 ), x ) 2 = nextState [ LastThree ] ( q2, y ) Let z = output [ LastThree ] ( q2, y ). nextState [ FeedbackLoop ] ( ( q1, q2 ), x ) 1 = nextState [ Parity ] ( q1, x  z )

32 If every cycle contains a delay, then all values can be computed. If there is a cycle without delay, then some values may not be well-defined.

33 An Ill-Defined System   Nats 0  Bools

34 An Ill-Defined System   Nats 0  Bools f f X

35 An Ill-Defined System   Nats 0  Bools f t X No legal output !

36 Another Ill-Defined System  id Nats 0  Bools

37 Another Ill-Defined System  id Nats 0  Bools f t

38 Another Ill-Defined System  id Nats 0  Bools f f Multiple legal outputs !

39 Example: Vending Machine

40 Coin Collector Collect Nats 0  {0, … 30 } Nats 0  Coins  1 2 Nats 0  Bools 1 2 reset funds Let Coins = { Nickel, Dime, Quarter }. cin cthru

41 Coin Collector 010525201530 (D,f)/(15,  ) ( ,f)/(15,  ) (N,f)/ (15,  ) ( ,t)/(15,  ) (Q,f)/(15,Q) (Q,t)/(15,  ) (N,t)/(15,  ) (D,t)/ (15,  )

42 Coin Collector Collect Nats 0  {0, … 30 } Nats 0  Coins  1 2 Nats 0  Bools 1 2 reset fundscin cthru

43 Soda Dispenser Disp Nats 0  Dispense  Nats 0  Select  Nats 0  Bools 1 2 Nats 0  { 0, … 30 } 1 2 funds reset 3 Nats 0  Coins  change select soda Let Select = { selectCoke, selectDiet }. Let Dispense = { dispenseCoke, dispenseDiet }.

44 Soda Dispenser none Diet Coke {(C,x)|x<25} / ( ,f,  ) (C,25) / (C,t,  ) (C,30) / (C,t,N) (D,20) / (D,t,  ) (D,25) / (D,t,N) (D,30) / (D,t,D) {(C,x)|x<20} / ( ,f,  ) {( ,x)|x  0} / ( ,f,  )

45 Soda Dispenser none Diet Coke {(C,x)|x<25} / ( ,f,  ) {( ,x)|x<25} / ( ,f,  ) {(D,x)|x<20} / ( ,f,  ) ( ,25) / (C,t,  ) ( ,30) / (C,t,N) (C,25) / (C,t,  ) (C,30) / (C,t,N) (D,20) / (D,t,  ) (D,25) / (D,t,N) (D,30) / (D,t,D)

46 Soda Dispenser Disp Nats 0  Dispense  Nats 0  Select  Nats 0  Bools 1 2 Nats 0  { 0, … 30 } 1 2 3 Nats 0  Coins  funds reset change select soda

47 Vending Machine Disp Nats 0  Dispense  Nats 0  Select  Nats 0  Bools 1 3 Nats 0  { 0, … 30 } 1 2 2 Nats 0  Coins  Collect Nats 0  Coins  2 1 1 2 resetfunds select soda change cin cthru

48 Vending Machine DispC Nats 0  Dispense  Nats 0  Select  Nats 0  Bools 1 3 Nats 0  { 0, … 30 } 1 2 2 Nats 0  Coins  Collect Nats 0  Coins  2 1 1 2 resetfunds 1 2 1 1 2 2 3 select soda change cin cthru

49 Time 0 1 2 3 4 cin N  Q Q D select  C  D C funds soda change reset cthru State Coll 0 State Disp n 1222312223

50 Time 0 1 2 3 4 cin N  Q Q D select  C  D C funds 0 5 5 0 0 soda   C D  change   N N  reset f f t t f cthru      State Coll 0 5 5 0 0 10 State Disp n n C n n C

51 Quiz 1. Draw the transition diagram of the system Delay 0 : [ Nats 0  Bins ]  [ Nats 0  Bins ]  x  [ Nats 0  Bins ],  y  Nats 0, ( Delay 0 (x)) (y) = 2. Draw the transition diagram of the system 0 if y = 0 x (y-1) if y > 0 { Delay 0


Download ppt "EECS 20 Lecture 11 (February 9, 2001) Tom Henzinger Feedback."

Similar presentations


Ads by Google