EECS 20 Lecture 11 (February 9, 2001) Tom Henzinger Feedback
Parity LastThree Nats 0 Bools path without delay
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 {
Parity System truefalse true / true true / false false / true false / false States = Bools Inputs = Bools Outputs = Bools
LastThree System States = { 0, 1, 2 } Inputs = Bools Outputs = Bools 0 21 true / false false / false true / true true / false
A Run of the LastThree System Time Input t t t t f Output State
A Run of the LastThree System Time Input t t t t f Output State 0
A Run of the LastThree System Time Input t t t t f Output f State 0 1
A Run of the LastThree System Time Input t t t t f Output f f State 0 1 2
A Run of the LastThree System Time Input t t t t f Output f f t State
A Run of the LastThree System Time Input t t t t f Output f f t t State
A Run of the LastThree System Time Input t t t t f Output f f t t f State
Parity LastThree FeedbackLoop Nats 0 Bools This block diagram is ok, because every cycle contains a delay.
Parity LastThree FeedbackLoop Nats 0 Bools x y z u q1 q2
Parity LastThree FeedbackLoop Nats 0 Bools x y z u q1 q2
A Run of the FeedbackLoop System Time Input x t t f t f Output y Aux z Aux u State q1 State q
A Run of the FeedbackLoop System Time Input x t t f t f Output y Aux z Aux u State q1 t State q
A Run of the FeedbackLoop System Time Input x t t f t f Output y t Aux z Aux u State q1 t State q
A Run of the FeedbackLoop System Time Input x t t f t f Output y t Aux z f Aux u State q1 t State q
A Run of the FeedbackLoop System Time Input x t t f t f Output y t Aux z f Aux u f State q1 t State q
A Run of the FeedbackLoop System Time Input x t t f t f Output y t Aux z f Aux u f State q1 t t State q
A Run of the FeedbackLoop System Time Input x t t f t f Output y t t Aux z f Aux u f State q1 t t State q
A Run of the FeedbackLoop System Time Input x t t f t f Output y t t Aux z f f Aux u f State q1 t t State q
A Run of the FeedbackLoop System Time Input x t t f t f Output y t t Aux z f f Aux u f f State q1 t t State q
A Run of the FeedbackLoop System Time 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 q
A Run of the FeedbackLoop System Time 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 q
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 )
The FeedbackLoop System, continued output [ FeedbackLoop ] ( ( q1, q2 ), x ) = output [ Parity] ( q1, any ) The value of this does not matter !
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 )
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 ).
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 )
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.
An Ill-Defined System Nats 0 Bools
An Ill-Defined System Nats 0 Bools f f X
An Ill-Defined System Nats 0 Bools f t X No legal output !
Another Ill-Defined System id Nats 0 Bools
Another Ill-Defined System id Nats 0 Bools f t
Another Ill-Defined System id Nats 0 Bools f f Multiple legal outputs !
Example: Vending Machine
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
Coin Collector (D,f)/(15, ) ( ,f)/(15, ) (N,f)/ (15, ) ( ,t)/(15, ) (Q,f)/(15,Q) (Q,t)/(15, ) (N,t)/(15, ) (D,t)/ (15, )
Coin Collector Collect Nats 0 {0, … 30 } Nats 0 Coins 1 2 Nats 0 Bools 1 2 reset fundscin cthru
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 }.
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, )
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)
Soda Dispenser Disp Nats 0 Dispense Nats 0 Select Nats 0 Bools 1 2 Nats 0 { 0, … 30 } Nats 0 Coins funds reset change select soda
Vending Machine Disp Nats 0 Dispense Nats 0 Select Nats 0 Bools 1 3 Nats 0 { 0, … 30 } Nats 0 Coins Collect Nats 0 Coins resetfunds select soda change cin cthru
Vending Machine DispC Nats 0 Dispense Nats 0 Select Nats 0 Bools 1 3 Nats 0 { 0, … 30 } Nats 0 Coins Collect Nats 0 Coins resetfunds select soda change cin cthru
Time cin N Q Q D select C D C funds soda change reset cthru State Coll 0 State Disp n
Time cin N Q Q D select C D C funds soda C D change N N reset f f t t f cthru State Coll State Disp n n C n n C
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