Skip to main content Accessibility help
×
Hostname: page-component-586b7cd67f-rcrh6 Total loading time: 0 Render date: 2024-11-26T23:24:53.366Z Has data issue: false hasContentIssue false

7 - State Machines for Real-Time Embedded Systems

from Part II - Real-Time Software Design Method

Published online by Cambridge University Press:  05 March 2016

Hassan Gomaa
Affiliation:
George Mason University, Virginia
Get access

Summary

State machines (also referred to as finite state machines) are used for modeling control and sequencing in a system. This is particularly important for real-time embedded systems, which are usually highly state dependent. In particular, the actions of a state dependent system depend not only on the inputs to the system but also on what happened previously in the system, which is captured as a state. A state machine can be used to depict the states of a system, subsystem, component, or object. Notations used to define state machines are the state transition diagram, state machine diagram, statechart, and state transition table. In highly state dependent systems, these notations help substantially to understand the complexity of these systems.

A state machine specification is typically more precise and understandable than a textual or use case description. State machines can enhance or even replace use case descriptions of requirements by providing more precise specifications. In particular, state machines are essential for specifying systems with significant state dependent behavior.

In the UML notation, a state transition diagram is referred to as a state machine diagram. The UML state machine diagram notation is based on Harel's statechart notation (Harel and Gery 1996; Harel and Politi 1998). In this book the terms state machine and state machine diagram are used interchangeably. This chapter refers to a traditional state transition diagram, which is not hierarchical, as a flat state machine and uses the term hierarchical state machine to refer to the concept of hierarchical state decomposition, a concept introduced by Harel. A brief overview of the state machine notation is given in Chapter 2 (Section 2.6).

This chapter starts by considering the characteristics of flat state machines and then describes hierarchical state machines. To show the benefits of hierarchical state machines, this chapter starts with the simplest form of flat state machine and gradually shows how it can be improved upon to achieve the full modeling power of hierarchical state machines. The process of developing state machines from use cases is then described. Several examples are given throughout the chapter from two case studies, the Microwave Oven and Train Control state machines.

Section 7.1 describes events and states in state machines. Section 7.2 introduces the Microwave Oven Control state machine example.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2016

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×