Chapter4 Prof Lee

Chapter4 Prof Lee - ELEC 2220 Computer Systems Chapter 4....

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

View Full Document Right Arrow Icon
ELEC2220 Auburn University ELEC 2220 Computer Systems Chapter 4. Modular Programming Soo-Young Lee Department of Electrical and Computer Engineering Auburn University
Background image of page 1

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

View Full DocumentRight Arrow Icon
ELEC2220 Auburn University 4. Modular Programming: Chapter Objectives Subroutine Subroutine-related instructions Parameter Passing
Background image of page 2
ELEC2220 Auburn University 4-1. Subroutines A large task may be partitioned into blocks, and some of the blocks can be implemented as subroutines (modules), especially those executed repeatedly. Example Finding the sum of all elements in array[N] Issues: task partitioning, parameter passing Main Sum up elements in array[N] EA of array, N Sum Subroutine Why modular programming? • easily understand easy debugging • localized changes • share modules
Background image of page 3

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

View Full DocumentRight Arrow Icon
Auburn University 4-1. Subroutines Task Partitioning Define the computation to be carried out by each subroutine. Parameter Passing Define the input parameters (constants, variables, etc.) to be passed to the subroutine. Define the results from the subroutine.
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.

Page1 / 12

Chapter4 Prof Lee - ELEC 2220 Computer Systems Chapter 4....

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