Download presentation
Presentation is loading. Please wait.
1
EECS 20 Lecture 8 (February 2, 2001) Tom Henzinger State Machines
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
Parityt, t, t, f, f, t, t, …t, f, t, f, f, f, t, …
4
The Parity System Parity : [ Nats 0 Bools ] [ Nats 0 Bools ] such that x [ Nats 0 Bools ], y Nats 0, ( Parity (x) ) (y) = true if | trueValues (x,y) | is even false if | trueValues (x,y) | is odd { where trueValues (x,y) = { z Nats 0 | z < y x (z) = true }
5
Countt, t, f, f, f, t, t, …t, t, t, t, t, f, t, …
6
The Count System Count : [ Nats 0 Bools ] [ Nats 0 Bools ] such that x [ Nats 0 Bools ], y Nats 0, ( Count (x) ) (y) = true if | trueValues (x,y) | | falseValues (x,y) | false if | trueValues (x,y) | < | falseValues (x,y) | { where falseValues (x,y) = { z Nats 0 | z < y x (z) = false }
7
An Implementation of the Parity System DtDt Bools
8
DtDt t, f, t, … f t An Implementation of the Parity System t
9
t, f, t, … An Implementation of the Parity System f t, f f DtDt
10
t, f, t, … An Implementation of the Parity System f t, f, f t DtDt
11
t, f, t, … An Implementation of the Parity System t t, f, f, tDtDt
12
t, f, t, … An Implementation of the Parity System t t, f, f, t Memory = “state” of the system DtDt
13
Systems with finite memory are naturally implemented as finite state machines ( or finite transition systems ).
14
An Implementation of the Count System ±D0D0 Bools Ints pos Ints
15
± : Bools Ints Ints such that x Bools, y Ints, ± (x,y) = y+1 if x = true y-1 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 ± pos t, t, t, … t, t, t, t 3 D0D0
17
An Implementation of the Count System ± pos t, t, t, … t, t, t, t 3 infinite state D0D0
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 Nats 0 InputsNats 0 Outputs F : [ Nats 0 Inputs ] [ Nats 0 Outputs ] F
21
State-Based Implementation Nats 0 InputsNats 0 Outputs F DcDc Update 11 22 Nats 0 States Update: memory-free Memory = States
22
State Implementation Nats 0 InputsNats 0 Outputs F DcDc Update 11 22 Nats 0 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 Nats 0 InputsNats 0 Outputs D initialState Update 11 22 Nats 0 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 ) truefalse true / true true / false false / true false / false States = Bools Inputs = Bools Outputs = Bools
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.