aLec10_subroutinesStack - Introduction to Embedded...

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

View Full Document Right Arrow Icon
Introduction to Embedded Microcomputer Systems Lecture 10.1 Jonathan W. Valvano Recap Switch, LED interface Real board debugging if-then statements Overview Successive refinement Modular programming Subroutines, parameter passing Debugging dump When we solve problems on the computer, we need to answer these questions: What does being in a state mean? List state parameters What is the starting state of the system? Define the initial state What information do we need to collect? List the input data What information do we need to generate? List the output data How do we move from one state to another? Actions we could do What is the desired ending state? Define the ultimate goal Successive refinement , stepwise refinement , and systematic decomposition Start with a task and decompose the task into a set of simpler subtasks Subtasks are decomposed into even simpler sub-subtasks. Each subtask is simpler than the task itself. Make design decisions Subtask is so simple, it can be converted to software code. Subtask 1 Sequential Conditional Iterative Subtask 2 Subtask 1 Subtask 2 Subtask Task Subtask Interrupt Condition True False Condition True False We need to recognize these phrases that translate to four basic building blocks: “do A then do B” sequential “do A and B in either order” sequential (parallel) “if A, then do B” conditional “for each A, do B” iterative “do A until B” iterative “repeat A over & over forever” iterative (condition always true) “on external event do B” interrupt “every t msec do B” interrupt
Background image of page 1

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

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

Page1 / 6

aLec10_subroutinesStack - Introduction to Embedded...

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

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