Download presentation
Presentation is loading. Please wait.
Published byHenry Owen Modified over 8 years ago
1
CSCI1600: Embedded and Real Time Software Lecture 10: Modeling IV: Compositions of State Machines Steven Reiss, Fall 2015
2
Modeling Tasks We can model individual tasks using FSMs Extended FSMs, Timed automata, … Hybrid automata to reflect state of outside world This is sufficient for coding We need to model the overall application We need this to prove properties of the system We need this to understand overall system behavior What was in chapter 5
3
Statecharts We saw this last week Lets look at it in more detail Lets be able to understand it formally Map to a single FSM
4
Example : Concurrent Machines
5
Example: concurrency
6
Example: Concurrency
7
Example : communicating tasks
8
Example: hierarchical
10
Example: Hierarchical
11
Example
12
Tic-Tac-Toe
13
Issues 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
14
Mapping to Code Direct sequential coding Determine state from various conditions Act accordingly Allows common operations for multiple states Explicit state variable switch (state) { … } Table-driven Approximate the state machine
15
Homework Read 6.1, 6.2, 6.4
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.