ECE 3561 - Lecture 1 1 L8:Flowcharting a program Department of Electrical and Computer Engineering...
-
Upload
lora-mcgee -
Category
Documents
-
view
214 -
download
0
Transcript of ECE 3561 - Lecture 1 1 L8:Flowcharting a program Department of Electrical and Computer Engineering...
![Page 1: ECE 3561 - Lecture 1 1 L8:Flowcharting a program Department of Electrical and Computer Engineering The Ohio State University ECE 2560.](https://reader036.fdocuments.net/reader036/viewer/2022082816/56649f495503460f94c6b9ac/html5/thumbnails/1.jpg)
ECE 3561 - Lecture 1 1
L8:Flowcharting a program
Department of Electrical and Computer EngineeringThe Ohio State University
ECE 2560
![Page 2: ECE 3561 - Lecture 1 1 L8:Flowcharting a program Department of Electrical and Computer Engineering The Ohio State University ECE 2560.](https://reader036.fdocuments.net/reader036/viewer/2022082816/56649f495503460f94c6b9ac/html5/thumbnails/2.jpg)
Flowcharting
Where does flowcharting come in?Flowcharting symbols and examplesFlowcharting a program
ECE 3561 - Lecture 1 2
![Page 3: ECE 3561 - Lecture 1 1 L8:Flowcharting a program Department of Electrical and Computer Engineering The Ohio State University ECE 2560.](https://reader036.fdocuments.net/reader036/viewer/2022082816/56649f495503460f94c6b9ac/html5/thumbnails/3.jpg)
What is flowcharting
Flowcharting is a method of documenting an algorithm or method for performing a sequence of actions.
Could be something that is not intended for a computer program.
Provides a graphical view of the process or method.
For assembler language can even indicate register and memory usage
ECE 3561 - Lecture 1 3
![Page 4: ECE 3561 - Lecture 1 1 L8:Flowcharting a program Department of Electrical and Computer Engineering The Ohio State University ECE 2560.](https://reader036.fdocuments.net/reader036/viewer/2022082816/56649f495503460f94c6b9ac/html5/thumbnails/4.jpg)
Flowcharting symbols
Straight action (or code sequence)
Enclosed in a box – sequence of code goes in the box.
Example – exchange 2 items A - -> Temp B - -> A Temp - -> B
ECE 3561 - Lecture 1 4
![Page 5: ECE 3561 - Lecture 1 1 L8:Flowcharting a program Department of Electrical and Computer Engineering The Ohio State University ECE 2560.](https://reader036.fdocuments.net/reader036/viewer/2022082816/56649f495503460f94c6b9ac/html5/thumbnails/5.jpg)
Flowcharting symbols
Decision structure
Example dec I jge yes Code for false branch jmp after yes Code for true branch after code that follows structure
ECE 3561 - Lecture 1 5
![Page 6: ECE 3561 - Lecture 1 1 L8:Flowcharting a program Department of Electrical and Computer Engineering The Ohio State University ECE 2560.](https://reader036.fdocuments.net/reader036/viewer/2022082816/56649f495503460f94c6b9ac/html5/thumbnails/6.jpg)
Flowcharting loops
A for loopFor I = 1 to 10 Loop code in loopEnd loop;
ECE 3561 - Lecture 1 6
![Page 7: ECE 3561 - Lecture 1 1 L8:Flowcharting a program Department of Electrical and Computer Engineering The Ohio State University ECE 2560.](https://reader036.fdocuments.net/reader036/viewer/2022082816/56649f495503460f94c6b9ac/html5/thumbnails/7.jpg)
Flowchart for a problem
We considered multiply routine (note: different register numbers used here)
Note symbol for subroutine and enter/return
ECE 3561 - Lecture 1 7
![Page 8: ECE 3561 - Lecture 1 1 L8:Flowcharting a program Department of Electrical and Computer Engineering The Ohio State University ECE 2560.](https://reader036.fdocuments.net/reader036/viewer/2022082816/56649f495503460f94c6b9ac/html5/thumbnails/8.jpg)
Other flowchart symbols
Have seem actions, decision, subprocess, enter/return
A couple of others that are often used
ECE 3561 - Lecture 1 8
![Page 9: ECE 3561 - Lecture 1 1 L8:Flowcharting a program Department of Electrical and Computer Engineering The Ohio State University ECE 2560.](https://reader036.fdocuments.net/reader036/viewer/2022082816/56649f495503460f94c6b9ac/html5/thumbnails/9.jpg)
Flowchart hierarcy
Flowchart can be written such that what is in the action (process) box is a high level statement.
The high level statement can be a program in and of itself
ORA flowchart can be done indicating
assembler instructions and which registers are used.
ECE 3561 - Lecture 1 9