Computer Systems: A Programmer's Perspective Plus Mastering Engineering With Pearson Etext -- Access Card Package (3rd Edition)
Computer Systems: A Programmer's Perspective Plus Mastering Engineering With Pearson Etext -- Access Card Package (3rd Edition)
3rd Edition
ISBN: 9780134123837
Author: Randal E. Bryant, David R. O'Hallaron
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 5, Problem 5.13HW

A.

Program Plan Intro

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 suitable for programs that use a repetitive calculation.
  • The processor’s activity sequencing is measured by a clock that provides signal of some frequency.

A.

Expert Solution
Check Mark

Explanation of Solution

Diagram for instruction sequence:

Computer Systems: A Programmer's Perspective Plus Mastering Engineering With Pearson Etext -- Access Card Package (3rd Edition), Chapter 5, Problem 5.13HW , additional homework tip  1

Computer Systems: A Programmer's Perspective Plus Mastering Engineering With Pearson Etext -- Access Card Package (3rd Edition), Chapter 5, Problem 5.13HW , additional homework tip  2

Explanation:

  • The data dependencies between instructions are been depicted in diagram.
  • The given instruction sequence is been decoded into operations.
  • It creates a critical path of operations.
  • The data flow between instructions is been shown in diagram.

B.

Program Plan Intro

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 suitable for programs that use a repetitive calculation.
  • The processor’s activity sequencing is measured by a clock that provides signal of some frequency.

B.

Expert Solution
Check Mark

Explanation of Solution

Lower bound on CPE:

  • The lower bound on CPE is been determined by critical path.
  • For data type “double”, it denotes the float add cell.
  • The lower bound on CPE is 3.0 based on the architecture.

C.

Program Plan Intro

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 suitable for programs that use a repetitive calculation.
  • The processor’s activity sequencing is measured by a clock that provides signal of some frequency.

C.

Expert Solution
Check Mark

Explanation of Solution

Lower bound on CPE:

  • The lower bound on CPE is been determined by critical path.
  • For data type “integer”, it denotes the long add cell.
  • The lower bound on CPE is 1.0 based on the architecture.

D.

Program Plan Intro

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 suitable for programs that use a repetitive calculation.
  • The processor’s activity sequencing is measured by a clock that provides signal of some frequency.

D.

Expert Solution
Check Mark

Explanation of Solution

Given C Code:

// Define method inner4

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

{

// Declare variable

long i;

//Compute length of vector

long length = vec_length(u);

//Get first vector

data_t *udata = get_vec_start(u);

//Get second vector

data_t *vdata = get_vec_start(v);

//Initialize variable

data_t sum = (data_t) 0;

//Loop

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

{

//Compute product and add

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

}

//Store result

*dest = sum;

}

CPE value for floating-point versions:

  • The inner product computed is been accumulated in temporary.
  • The float add operation is only on key path.
  • The multiplication operation takes 5 clock cycles.
  • The overall operation takes 3 cycles to complete on average.
  • Hence, CPE value for floating-point versions is 3.0.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Write pseudocode for a function Det-Quicksort(A, p, r) that receives array A[1..n], and indices p and r. The function should sort the subarray A[p..r] recursively (meaning you should call itself). You can also use a function LinearSearch(A, p, r, v) that searches subarray A[p..r] for an element of value v and return its index (in case it exists) in O(r − p) time. (Just to give you something to compare to, the solution has 8 lines.)
Implement the following function, without using any data structure. /* Given two vectors of chars, check if the two vectors are permutations of each other, i.e., they contains same values, in same or different order.e.g., V1=[‘a’,’b’,’a’] and V2=[‘b’,’a’,’a’] stores same multi-set of data points: i.e., both contains two ‘a’, and one ‘b’. e.g., V3=[‘a’,’c’,’t’,’a’] and V4=[‘a’,’c’,’t’] are not same multi-set. V3 contains two ‘a’s, while V4 has only one ‘a’. Note: when considering multiset, the number of occurrences matters. @param list1, list2: two vectors of chars @pre: list1, list2 have been initialized @post: return true if list1 and list2 stores same values (in same or different order); return false, if not. */
 bool SameMultiSet (vector<char> list1, vector<char> list2)
Consider an input string TAM of letters ‘A’, ‘M’, and ‘T’. This string, which is given by the user, ends with ‘#’. It should be stored in a table (or array), called TAMUK. The number of each of these letters is unknown. We have a function, called SWAP(TAM,i,j), which places the ith letter in the jth entry of string TAM and the jth letter in the ith entry of TAM. Note that SWAP(TAM,i,j) is defined for all integers i and j between 0 and length(TAM)–1, where length(TAM) is the number of letters of TAM. 1. Using our algorithmic language, write an algorithm, called Sort_TAM, which sorts the letters in the array TAMUK in a way that all T’s appear first, followed by all A’s, and followed by all M’s. The algorithm Sort_TAM should have one parameter: The array TAMUK. Also, your solution is correct only if the following four constraints are satisfied: - Constraint 1: Each letter (‘A’, ‘M’, or ‘T’) is evaluated only once. - Constraint 2: The function SWAP(TAM,i,j) is used only when it is…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning