Presentation is loading. Please wait.

Presentation is loading. Please wait.

State Machines EECS 20 Lecture 8 (February 2, 2001) Tom Henzinger.

Similar presentations


Presentation on theme: "State Machines EECS 20 Lecture 8 (February 2, 2001) Tom Henzinger."— Presentation transcript:

1 State Machines EECS 20 Lecture 8 (February 2, 2001) Tom Henzinger

2 Finite-Memory Systems
Discrete-Time Delay: remember last input value Discrete-Time Moving Average: remember last 2 input values Parity: remember if number of past inputs “true” is even Infinite-Memory Systems Count: remember if number of past inputs “true” is greater than number of past inputs “false”

3 t, t, t, f, f, t, t, … Parity t, f, t, f, f, f, t, …

4 { The Parity System Parity : [ Nats0  Bools ]  [ Nats0  Bools ]
such that  x  [ Nats0  Bools ] ,  y  Nats0 , ( Parity (x) ) (y) = true if | trueValues (x,y) | is even false if | trueValues (x,y) | is odd { where trueValues (x,y) = { z  Nats0 | z < y  x (z) = true }

5 t, t, f, f, f, t, t, … Count t, t, t, t, t, f, t, …

6 { The Count System Count : [ Nats0  Bools ]  [ Nats0  Bools ]
such that  x  [ Nats0  Bools ] ,  y  Nats0 , ( Count (x) ) (y) = true if | trueValues (x,y) |  | falseValues (x,y) | false if | trueValues (x,y) | < | falseValues (x,y) | { where falseValues (x,y) = { z  Nats0 | z < y  x (z) = false }

7 An Implementation of the Parity System
Bools Dt Bools

8 An Implementation of the Parity System
t, f, t, … Dt t

9 An Implementation of the Parity System
t, f, t, … Dt t, f

10 An Implementation of the Parity System
t, f, t, … Dt t, f, f

11 An Implementation of the Parity System
t, f, t, … Dt t, f, f, t

12 An Implementation of the Parity System
t, f, t, … Dt t, f, f, t Memory = “state” of the system

13 Systems with finite memory are naturally implemented as
finite state machines ( or finite transition systems ) .

14 An Implementation of the Count System
Ints Ints Bools pos D0 Bools

15 { { ± : Bools  Ints  Ints such that  x  Bools,  y  Ints,
± (x,y) = y if x = true y if x = false { pos : Ints  Bools such that  x  Ints, pos (x) = true if x  0 false if x < 0 {

16 An Implementation of the Count System
3 t, t, t, … pos D0 t, t, t, t

17 An Implementation of the Count System
3 t, t, t, … pos D0 t, t, t, t infinite state

18 Systems with countable ( integer ) memory are naturally implemented as
infinite state machines ( or infinite transition systems ) .

19 ( Systems with uncountable ( real ) memory,
such as continuous-time delay, are not naturally viewed naturally as transition systems. )

20 A Discrete-Time Reactive System
F Nats0  Inputs Nats0  Outputs F : [ Nats0  Inputs ]  [ Nats0  Outputs ]

21 State-Based Implementation
F 2 2 Update Nats0  Inputs Nats0  Outputs 1 1 Dc Nats0  States Nats0  States Update: memory-free Memory = States

22 update : States  Inputs  States  Outputs
State Implementation F 2 2 Update Nats0  Inputs Nats0  Outputs 1 1 Dc Nats0  States Nats0  States update : States  Inputs  States  Outputs c  States ( “initial state” )

23 State Implementation of the Parity System
Inputs = Bools Outputs = Bools States = Bools initialState = true update : States  Inputs  States  Outputs such that  q  States,  x  Inputs, update (q,x) 1 = ( q  x ) update (q,x) 2 = q

24 State Implementation of the Count System
Inputs = Bools Outputs = Bools States = Ints initialState = 0 update : States  Inputs  States  Outputs such that  q  States,  x  Inputs, update (q,x) 1 = ± (x,q) update (q,x) 2 = pos (q)

25 A State Machine Inputs ( set of possible input values ) Outputs ( set of possible output values ) States ( set of states ) initialState  States update : States  Inputs  States  Outputs

26 A state machine is finite iff States is a finite set. Parity : can be implemented by a two-state machine. Count : cannot be implemented by finite-state machine.

27 Discrete-Time Reactive Systems
Every memory-free system can be implemented by a one-state machine. Every causal system can be implemented by a state machine ( take as state the entire history of inputs ), and every system that can be implemented by a state machine is causal.

28 The Block Diagram of a State Machine
2 2 Update Nats0  Inputs Nats0  Outputs 1 1 DinitialState Nats0 States Nats0 States

29 The Transition Table of a Finite-State Machine ( Parity )
Current state Input Next state Output true true false true true false true true false true true false false false false false

30 The Transition Diagram of a State Machine ( Parity )
true / true true false true / false false / false false / true States = Bools Inputs = Bools Outputs = Bools


Download ppt "State Machines EECS 20 Lecture 8 (February 2, 2001) Tom Henzinger."

Similar presentations


Ads by Google