Computer Systems: A Programmer's Perspective (3rd Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
Question
Book Icon
Chapter 5, Problem 5.19HW
Program Plan Intro

Given C Code:

void psum1a(float a[], float p[], long n)

{

long i;

float last_val, val;

last_val = p[0] = a[0];

for(i=1; i<n; i++)

{

val = last_val + a[i];

p[i] = val;

last_val = val;

}

}

Cycles per element (CPE):

  • The CPE denotes performance of program that helps in improving code.
  • It helps to understand detailed level loop performance for an iterative program.
  • It is appropriate for programs that use a repetitive computation.
  • The processor’s activity sequencing is controlled by a clock that provides regular signal of some frequency.

Loop unrolling:

  • It denotes a program transformation that would reduce count of iterations for a loop.
  • It increases count of elements computed in each iteration.
  • It reduces number of operations that is not dependent to program directly.
  • It reduces count of operations in critical paths of overall computations.

Blurred answer
Students have asked these similar questions
For the two statements about the running time of ALGO, I need an explanation if it is True and F if it is false  1) The increment operation in Line 6 is executed a total of n/2 times in the worst case 2) The decrement operation in Line 10 is executed O(n) times. For Reference the Answer for 1 is False and 2 is True
There are many algorithms presented in this text that would lend themselves to beincluded as subprograms in the utils.asm file. Implement some or all of the followinginto the utils.asm file, properly documenting them, and include programs to test them.a. NOR subprogram - take two input parameters, and return the NOR operation onthose two parameter.b. NAND- take two input parameters, and return the NAND operation on those twoparameter.c. NOT- take one input parameters, and return the NOT operation on that parameter.d. Mult4 - take an input parameter, and return that parameter multiplied by 4using only shift and add operations.e. Mult10 - take an input parameter, and return that parameter multiplied by 10using only shift and add operations.f. Swap- take two input parameters, swap them using only the XOR operation.g. RightCircularShift - take an input parameter, and return two values. The firstis the value that has been shifted 1 bit using a right circular shift, and the second isthe…
I am working on a block of code and cannot figure out how to count the number of times a loop is proccessed within the stated parameters, but when the output is 0 that value is not counted in the iteration. Here is the problem and my code
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education