Question: Problem 3 . ( 2 0 points ) : On a machine with a 1 0 2 4 - byte direct - mapped data cache
Problem points:
On a machine with a byte directmapped data cache with byte blocks, you are given the following
definitions:
struct point
int x;
int y;
;
struct point array;
register int i j;
Assume:
sizeofint
array begins at memory address
The cache is initially empty.
The only memory accesses are to the elements of array. Variables i and j are stored in registers.
Given the following code:
for i; i; i
for j; j; j
arrayijx ;
arrayijy ;
for j; j; j
for i; i; i
arrayijx ;
arrayijy ;
A points When executing line for the first time ie arrayx which array elements
will be loaded into the cache? points Explain your reasoning.
B points When executing line for the first time ie arrayx is it a hit or miss?
points Explain your reasoning.
C points What is the miss rate for the first loop? points Explain your reasoning.
D points What is the miss rate for the second loop? points Explain your reasoning.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
