Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started