Download - DISCRETE DYNAMICS
![Page 1: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/1.jpg)
DISCRETE DYNAMICS
EEN 417Fall 2013
![Page 2: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/2.jpg)
Midterm I
• In class on 10/4• Covered Material will be:• Chapter 1 (Introduction)• Chapters 2 & 3 (Continuous and Discrete
Dynamics)• Chapters 7 (Processors)• Chapter 12 (Linear Temporal Logic)
![Page 3: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/3.jpg)
Processor Pipelining
![Page 4: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/4.jpg)
Processor Pipelining
Stage 1 2 3 4 5 6 7 8
Fetch A B C
Decode A B C
Execute A B C
Memory A B C
Writeback A B C
![Page 5: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/5.jpg)
If B relies on ALU results of A
Stage 1 2 3 4 5 6 7 8
Fetch A B C
Decode A B C
Execute A B C
Memory A B
Writeback A
![Page 6: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/6.jpg)
What if A can forward the result of writeback to the ALU?
Stage 1 2 3 4 5 6 7 8
Fetch A
Decode A
Execute A
Memory A
Writeback A
![Page 7: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/7.jpg)
What if A can forward the result of ALU to the ALU?
Stage 1 2 3 4 5 6 7 8
Fetch A
Decode A
Execute A
Memory A
Writeback A
![Page 8: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/8.jpg)
•Example: integrator:
•Continuous-time signal:
•Continuous-time actor:
Recall Actor Model of a Continuous-Time System
![Page 9: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/9.jpg)
Discrete Systems
•Example: count the number of cars that enter and leave a parking garage:
•Pure signal:•Discrete actor:
![Page 10: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/10.jpg)
Reaction
![Page 11: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/11.jpg)
Input and Output Valuations at a Reaction
![Page 12: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/12.jpg)
State Space
![Page 13: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/13.jpg)
Garage Counter Finite State Machine (FSM)
in Pictures
![Page 14: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/14.jpg)
Garage Counter Finite State Machine (FSM)
in Pictures
![Page 15: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/15.jpg)
Garage Counter Finite State Machine (FSM)
in Pictures
Initial state
![Page 16: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/16.jpg)
Garage Counter Finite State Machine (FSM)
in Pictures
Output valuation
![Page 17: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/17.jpg)
Garage Counter Mathematical Model
The picture above defines the update function.
![Page 18: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/18.jpg)
FSM Notation
transition
self loop
state
initial state
![Page 19: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/19.jpg)
Examples of Guards for Pure Signals
![Page 20: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/20.jpg)
Examples of Guards for Signals with Numerical Values
![Page 21: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/21.jpg)
Example: Thermostat
•Exercise: From this picture, construct the formal mathematical model.
![Page 22: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/22.jpg)
More Notation: Default Transitions
•A default transition is enabled if no non-default transition is enabled and it either has no guard or the guard evaluates to true. When is the above default transition enabled?
![Page 23: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/23.jpg)
Extended State Machines
![Page 24: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/24.jpg)
Traffic Light Controller
![Page 25: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/25.jpg)
Definitions
• Stuttering transition: Implicit default transition that is enabled when inputs are absent and that produces absent outputs.
• Receptiveness: For any input values, some transition is enabled. Our structure together with the implicit default transition ensures that our FSMs are receptive.
• Determinism: In every state, for all input values, exactly one (possibly implicit) transition is enabled.
![Page 26: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/26.jpg)
Example: Nondeterminate FSM•Nondeterminate model of pedestrians arriving at a crosswalk:
•Formally, the update function is replaced by a function
![Page 27: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/27.jpg)
Behaviors and Traces• FSM behavior is a sequence of (non-stuttering) steps.• A trace is the record of inputs, states,
and outputs in a behavior.• A computation tree is a graphical
representation of all possible traces.
• FSMs are suitable for formalanalysis. For example, safetyanalysis might show that some unsafestate is not reachable.
![Page 28: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/28.jpg)
Uses of nondeterminism
1. Modeling unknown aspects of the environment or system Such as: how the environment changes the iRobot’s
orientation2. Hiding detail in a specification of the system
We will see an example of this later (see notes)
Any other reasons why nondeterministic FSMs might be preferred over deterministic FSMs?
![Page 29: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/29.jpg)
Size Matters
•Non-deterministic FSMs are more compact than deterministic FSMs
– ND FSM D FSM: Exponential blow-up in #states in worst case
![Page 30: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/30.jpg)
Non-deterministic Behavior: Tree of Computations
•For a fixed input sequence: A deterministic system exhibits a single behavior A non-deterministic system exhibits a set of behaviors
. . .
. . .
. . .
. . .
. . .
Deterministic FSM behavior for a particular input sequence:
Non-deterministic FSM behavior for an input sequence:
![Page 31: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/31.jpg)
Related points•What does receptiveness mean for non-deterministic state machines?
•Non-deterministic Probabilistic
![Page 32: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/32.jpg)
Example from Industry: Engine Control
Source: Delphi Automotive Systems (2001)
![Page 33: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/33.jpg)
Elements of a Modal Model (FSM)
Source: Delphi Automotive Systems (2001)
state
initial state
transition
input
output
![Page 34: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/34.jpg)
Actor Model of an FSM
This model enables composition of state machines.
![Page 35: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/35.jpg)
What we will be able to do with FSMs
•FSMs provide: 1.A way to represent the system for:
– Mathematical analysis – So that a computer program can manipulate it
2.A way to model the environment of a system.3.A way to represent what the system must do and must not do – its specification.4.A way to check whether the system satisfies its specification in its operating environment.
![Page 36: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/36.jpg)
WRAP UP
![Page 37: DISCRETE DYNAMICS](https://reader035.vdocuments.us/reader035/viewer/2022062315/56816388550346895dd47770/html5/thumbnails/37.jpg)
For next time
Read Chapter 3 – Discrete DynamicsAssignment 3 – Chapter 3, problems 2, 3, 4, and 5.
Due 10/4You can turn them in early so yours is graded by the exam. Any turned in by class on Friday 9/27 will be ready for pickup in my office by Monday 9/30.