samek0311

samek0311 - Miro Samek, Ph.D. Miro Samek, Ph.D. q uantum p...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Miro Samek, Ph.D. Miro Samek, Ph.D. q uantum p rogramming Copyright 2003 by Miro Samek. All Rights Reserved. ierarchical State Machines ierarchical State Machines a Fundamentally Important a Fundamentally Important Way of Design Way of Design Association Association of C & C++ Users, of C & C++ Users, March 11, 2003 March 11, 2003 2 q uantum p rogramming Copyright 2003 by Miro Samek. All Rights Reserved. About the Speaker About the Speaker Miro Samek is the author of Practical Statecharts in C/C++: Quantum Programming for Embedded Systems (CMP Books, 2002) and a contributing editor to C/C++ Users Journal . He is the lead software architect at IntegriNautics Corporation (Menlo Park, CA) and a consultant to industry. He previously worked at GE Medical Systems, where he has developed safety-critical, real- time software for diagnostic imaging X-ray machines. Miro earned his Ph.D. in nuclear physics at GSI (Darmstadt, Germany) where he conducted heavy-ion experiments. Miro welcomes contact and can be reached at miro@quantum-leaps.com . 3 q uantum p rogramming Copyright 2003 by Miro Samek. All Rights Reserved. Objectives Objectives Introduce Hierarchical State Machines (HSMs) Describe a particularly small and highly maintainable implementation of HSMs in C Show how a good HSM implementation can lead to a paradigm shift in programming reactive systems Demonstrate that HSMs are a fundamentally important way of design not the use of a particular CASE tool. 90 minutes maximum. Discussion . 4 q uantum p rogramming Copyright 2003 by Miro Samek. All Rights Reserved. The Challenge of Event The Challenge of Event-- Driven Systems Driven Systems Almost all computers today are event-driven systems The main programming challenge is to quickly pick and execute the right code in reaction to an event The reaction depends both on the nature of the event and on the current context , that is, the sequence of past events in which the system was involved Traditional bottom up approaches represent the context ambiguously by a multitude of variables and flags, which results in code riddled with a disproportionate number of convoluted conditional branches ( if-else or switch- case statements in C/C++) 5 q uantum p rogramming Copyright 2003 by Miro Samek. All Rights Reserved. The Significance of State The Significance of State State machines make the response to an event explicitly dependent on both the nature of the event and the context of the system ( state ) State captures the relevant aspects of the systems history very efficiently 'A' 'a' EXAMPLE: a character code generated by a keyboard depends if the Shift has been depressed, but not on how many and which specific characters have been typed previously....
View Full Document

Page1 / 34

samek0311 - Miro Samek, Ph.D. Miro Samek, Ph.D. q uantum p...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online