Computer Systems: Program... -Access
Computer Systems: Program... -Access
3rd Edition
ISBN: 9780134071923
Author: Bryant
Publisher: PEARSON
Question
Book Icon
Chapter 6.5, Problem 6.19PP

A.

Program Plan Intro

Given Information:

The definition for the code is mentioned below:

//Traverse through the grid

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

{

for (j = 0; j < 16; j++)

{

//add values of x into grid

total_x += grid[j][i].x;

//add values of y into grid

total_y += grid[j][i].y;

}

}

B.

Program Plan Intro

Given Information:

The definition for the code is mentioned below:

//Traverse through the grid

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

{

for (j = 0; j < 16; j++)

{

//add values of x into grid

total_x += grid[j][i].x;

//add values of y into grid

total_y += grid[j][i].y;

}

}

C.

Explanation of Solution

Miss rate:

  • The cache can only hold half of the elements in the array, so that means that a read to grid[8][0] will evict the block that was loaded when we read grid[0][0].  Since this block also contained grid[0][1], the first read of grid[0][1] will be a miss.
  • Hence, each iteration will have one hit and one miss. 
  • This means one will have 256 hits and 256 misses...

D.

Explanation of Solution

 New Miss Rate:

If the cache were twice as big the n it could hold the entire grid array and the only misses would be the initial cold miss...

Blurred answer
Students have asked these similar questions
4.1.1 Complete solution and answer only no need explanation Given three data points (1,6), (3,28), and (10, 231), What is the value of y at x = 2 if the function y = 2x2 + 3x + 1 passes through the three data points.
7.  a. Explain the concept and the cause of a memory leak.       b. Explain the idea of garbage collection and how it is related to current heap links
li   $t2, 2 L1: add   $t1, $t1, $t2   sub   $t1, $t1, $t3   bne   $t1, $t4, L1   sub   $t4, $s0, $t3 Given the modified single-cycle processor shown below, what are the values (in binary) of instruction[31-26], instruction[25-21], instruction[20-16], instruction[15-11], instruction[5-0], Read data 1, Read data 2, ALU zero, PCSrc, and all the main control decoded output signals when the time is at 1950 ns. The below single-cycle processor diagram can be used for your reference. Note: A new decoded signal output “Tzero” is added for executing “bne” instruction. The signal definition is described below: Instruction Opcode New Main Control Output Signal beq 00100b (4d) Tzero = 0 bne 00101b (5d) Tzero = 1   At the moment of 1950 ns, the below values (0, 1 or X) are:instruction[31-26] = instruction[25-21] = instruction[20-16] =instruction[15-0] =  Read data 1 output =  Read data 2 output =  RegDst =  ALUSrc =  MemtoReg =  RegWrite =…
Knowledge Booster
Background pattern image
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