Question: ( 4 ) 3 M decides to make Post - its by printing yellow squares on white pieces of paper. As part of the printing
M 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 point color
int c;
int m;
int y;
int k;
;
struct point color square;
int i j;
Assume the two functions are executed under the following conditions:
sizeofint
square begins at memory address
The cache is initially empty.
The only memory accesses are to the entries of the array square. Vari
ables i and j are stored in registers.
A
for i ; i ; i
for j ; j ; j
squareijc ;
squareijm ;
squareijy ;
squareijk ;
a What is the total number of writes? Explain.
b What is the total number of writes that miss in the cache? Explain.
c What is the miss rate? Explain.
B
for i ; i ; i
for j ; j ; j
squareijy ;
for i ; i ; i
for j ; j ; j
squareijc ;
squareijm ;
squareijk ;
a What is the total number of writes? Explain.
b What is the total number of writes that miss in the cache? Explain.
c What is the miss rate? Explain
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
