Download presentation
Presentation is loading. Please wait.
Published byLiani Yuliana Kurniawan Modified over 6 years ago
1
CSCI1600: Embedded and Real Time Software
Lecture 11: Modeling IV: Compositions of State Machines Steven Reiss, Fall 2017 Hand out digital watch statechart Without the introductory discussion of the circuit, this lecture would have run short. Might want to look at some of the material in the text and see if it can augment the lecture.
2
Modeling Tasks We can model individual tasks using FSMs
Extended FSMs, Timed automata, Peroidic automata … Hybrid automata to reflect state of outside world This is sufficient for coding We need to model the overall application In order to prove properties of the system In order to understand overall system behavior What was in chapter 5? Lecture 12: Modeling Compositions 12/2/2018
3
Digital Watch Lots of features Four buttons for input
How does it work? How would you model it? Lecture 12: Modeling Compositions 12/2/2018
4
Statecharts Here is one model Lets look at it in detail
Understand what it means Map to a single FSM How many think they could explain/understand this? Lecture 12: Modeling Compositions 12/2/2018
5
Example : Concurrent Machines
This diagram is not readable. Replace Lecture 12: Modeling Compositions 12/2/2018
6
Example: Concurrency Lecture 12: Modeling Compositions 12/2/2018
7
Example: Concurrency Lecture 12: Modeling Compositions 12/2/2018
8
Example : Communicating Tasks
Lecture 12: Modeling Compositions 12/2/2018
9
Example: Hierarchical
Lecture 12: Modeling Compositions 12/2/2018
10
Example: Hierarchical
Lecture 12: Modeling Compositions 12/2/2018
11
Example: Hierarchical
Lecture 12: Modeling Compositions 12/2/2018
12
Microwave Oven Lecture 12: Modeling Compositions 12/2/2018
13
Digital Watch Can you understand this now?
Lecture 12: Modeling Compositions 12/2/2018
14
Example Tic-Tac-Toe NIM Lecture 12: Modeling Compositions 12/2/2018
15
Implementing a Statechart
Handling concurrency The FSM is in multiple states What does this mean formally (single FSA) What does this mean in a statechart What do you do with an input How is this implemented What if the results are contradictory (set x = 1, set x = 0) What does this mean for your implementation Lecture 12: Modeling Compositions 12/2/2018
16
Mapping to Code Direct sequential coding Explicit state variables
Determine state from various conditions Act accordingly Allows common operations for multiple states Explicit state variables switch (state) { … } Table-driven Approximate the state machine Lecture 12: Modeling Compositions 12/2/2018
17
Homework Read and Prepare for IO Lab Read 6.1, 6.2, 6.4 Exercise 6.7
Lecture 12: Modeling Compositions 12/2/2018
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.