lecture_08 - ECE 190 Lecture 08 Programming in LC-3 machine...

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

View Full Document Right Arrow Icon
ECE 190 Lecture 08 September 15, 2011 1 V. Kindratenko Programming in LC-3 machine language Lecture Topics Programming using systematic decomposition Debugging Lecture materials Textbook Ch. 6 Homework/Projects MP1 is due next Wednesday Lab 4 is due next Monday Announcements Exam 1 is on Mon, Sept. 26 , 7-9:30pm It is designed to be a <90 minutes exam for a well-prepared student We give you up to 2.5 hours to complete it Let us know if you have a conflict by next Wednesday via a quiz on Compass Check https://wiki.engr.illinois.edu/display/ece190/Exams for updates Exams from prior years are posted here as well Exam topics include everything covered in lectures 1-9
Background image of page 1

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

View Full DocumentRight Arrow Icon
ECE 190 Lecture 08 September 15, 2011 2 V. Kindratenko Programming using systematic decomposition Systematic decomposition In order for electrons to solve a problem for us, we need to go through several levels of transformation to get o from the natural language in which the problem statement is initially expressed o to the level at which electrons can be manipulated to do the work for us Problem statement Algorithm Program Problem statement can be imprecise, thus, we first translate it into a precise algorithm which should have the following 3 properties: o finiteness (it terminates) o definiteness (each step is precisely stated) o effective computability (each step can be carried out by the computer) to start with the problem statement and end up with a working program, we will apply a process referred to as systematic decomposition or stepwise refinement o complex tasks are systematically broken down into simpler, smaller tasks such that the collection of these simpler tasks, or units of work, will accomplish the same as the original task o the decomposition continues until each simpler task can be implemented as just a few instructions in the programming language we use Three constructs We want to replace a large unit of work with a set of a few smaller units of work. task to be decomposed This can be done using one of the 3 basic constructs: sequential, conditional, and iterative Sequential construct o Is used when we can decompose a given task into two smaller sub-tasks, such that one
Background image of page 2
ECE 190 Lecture 08 September 15, 2011 3 V. Kindratenko of them has to be fully executed before we can execute the other: task to be decomposed Subtask 1 Subtask 2 Once subtask 1 is executed, we never go back to it, we continue with subtask 2 conditional construct o Is used when the task consists of some subtasks such that only one of them needs to be executed, but not all, depending on some condition: Subtask 1 Subtask 2 Test condition task to be decomposed o If the test condition is true, we need to carry out one subtask, otherwise we carry out the other task; but we newer carry out both tasks o Once one of these subtasks is executed, we never go back Iterative construct o Is used if one of subtasks needs to be re-done several times, but only as long as some condition is met Test condition Subtask true fals task to be decomposed
Background image of page 3

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

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

This note was uploaded on 01/24/2012 for the course ECE 190 taught by Professor Hutchinson during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 9

lecture_08 - ECE 190 Lecture 08 Programming in LC-3 machine...

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

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