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.16HW
Program Plan Intro

Given C Code:

void inner4(vec_ptr u, vec_ptr v, data_t *dest)

{

long i;

long length = vec_length(u);

data_t *udata = get_vec_start(u);

data_t *vdata = get_vec_start(v);

data_t sum = (data_t) 0;

for (i = 0; i < length; i++)

{

sum = sum + udata[i] * vdata[i];

}

*dest = sum;

}

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
Q3: Consider the Boolean function f(x1, x2, x3) Σ(1,2, 5) a. Implement using PLA. b. Implement using 3 input Look Up Table (LUT).
Implement the following error detection and error correction algorithms using C programming for Hamming code. For Hamming codes, flip a bit in the data and implement the algorithm to correct the same on the receiver side.
As we learned in the lecture, computer software uses decimal degrees (DD), as they are much easier to handle in complex algorithms for various mapping applications.  Your task is to convert Lat-Long from DMS to DD and vice versa.  Remember: when using DD, the cardinal direction are replaced by positive and negative numbers .  The "+" sign is omitted (it is implied) and only the minus sign "--" is mandatory . (See lecture)   Washington Monument in DC has the following coordinates, in DMS:  LAT: 38 deg 53 min 22 sec North ; LONG: 77 deg 02 min 19 sec West.  Use an online converter (such as https://www.latlong.net/degrees-minutes-seconds-to-decimal-degreesLinks to an external site.) and find the coordinates in decimal degrees.  Choose the correct coordinates in DD for the Washington Monument: 38.88944444 , 77.03861111 38.88944444 , --77.03861111 --38.88944444 , 77.03861111 --38.88944444 , --77.03861111
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