Question: Problem 5 . ( 1 2 points ) : 3 M decides to make Post - Its by printing yellow squares on white pieces of
Problem points:
decides to make PostIts by printing yellow squares on white pieces of paper. As part of the printing process,
they need to set the CMYK cyan magenta, yellow, black value for every point in the square. M hires you to
determine the efficiency of the following algorithms on a machine with a byte directmapped data cache with
byte blocks.
You are given the following definitions:
struct pointcolor
int ;
int ;
int ;
int ;
;
struct pointcolor square :
register int :
Assume:
sizeofint
square begins at memory address
The cache is initially empty.
The only memory accesses are to the entries of the array square. Variables i and are stored in registers.
A What percentage of the writes in the following code will miss in the cache?
for
for ;;
square ijc :
square ;
square ij
square ;
Miss rate for writes to square:
B What percentage of the writes in the following code will miss in the cache?
for
for
square ;
square ;
square ;
square :
Miss rate for writes to square:
C What percentage of the writes in the following code will miss in the cache?
for
for ;;
square ij;
for
for ;;
square ijc ;
square ;
square :
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
