Answered step by step
Verified Expert Solution
Link Copied!

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 5.(12 points):
3M decides to make Post-Its 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. 3M hires you to
determine the efficiency of the following algorithms on a machine with a 2048-byte direct-mapped data cache with
32 byte blocks.
You are given the following definitions:
struct point_color {
int c;
int m;
int y;
int k;
;
struct point_color square [16][16] :
register int i,j :
Assume:
sizeof(int)=4
square begins at memory address 0
The cache is initially empty.
The only memory accesses are to the entries of the array square. Variables i and j are stored in registers.
A. What percentage of the writes in the following code will miss in the cache?
for
for (j=0;j16;j++)(
square [i][j].c =0 :
square [i][j]*m=0;
square [i][j]y=1
square [i][j].k=0;
}
Miss rate for writes to square:
%
B. What percentage of the writes in the following code will miss in the cache?
for
for
square [j][i].c=0;
square [j][i].m=0;
square [j][i]*y=1;
square [j][i].k=0 :
}
Miss rate for writes to square:
C. What percentage of the writes in the following code will miss in the cache?
for
for (j=0;j16;j++)(
square [i][j]y=1;
]
for
for (j=0;j16;j++)(
square [i][j].c =0;
square [i][j]*m=0;
square [i][j].k=0 :
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

Have you laid out a timeframe for refreshing the data regularly?

Answered: 1 week ago

Question

Have you laid out the information as clearly as possible?

Answered: 1 week ago

Question

Have you tested your findings with those closest to the market?

Answered: 1 week ago