lecture_11 - ECE 190 Lecture 11 Programming in LC-3 machine...

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

View Full Document Right Arrow Icon
ECE 190 Lecture 11 February 22, 2011 1 V. Kindratenko Programming in LC-3 machine language Lecture Topics Programming using systematic decomposition Debugging LC-3 data path review Lecture materials Textbook Ch. 6 Homework HW3 due Wednesday February 23 at 5pm in the ECE 190 drop-off box Machine problem MP2 due March 2, 2011 at 5pm submitted electronically. Announcements Stats for the exam Monday Tuesday Wednesday # of students that took the exam 97 96 90 Average 37.7 38.9 35.2 Standard deviation 14.0 16.9 14.8 # of zeros on programming part 23 26 30 Highest score 60 60 59 Lowest score 6 7 2
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 11 February 22, 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 11 February 22, 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
ECE 190 Lecture 11
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

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

Page1 / 11

lecture_11 - ECE 190 Lecture 11 Programming in LC-3 machine...

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

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