Question: 3 M decides to make Post - its by printing yellow squares on white piec es yeJlolV , As part of the printing process, they

3M decides to make Post-its by printing yellow squares on white piec
es
yeJlolV
,As part of the printing process, they need to set the CMYK (cyan, magen
tafficiencr
black) value for every point in the square. 3M hires you to determine.
th ee d
data
of the following algorithms on a machine with a 2,048-byte direct-m
aPP
e
cache with 32-byte blocks. You are given the following definitions:
.......__
struct
point_color
{
Homework
Probl em s
657
int
c;
2
int
m;
3
int
y;
4
int
k
5'
6
};
7
8
struct
point_color
square
[16]
[l
6] ;
9
int
i'
j;
Assume
the
following:
sizeof(int)
=4.
square
begins
at
memory
address
O.
Toe
cache
is initially empty.
Toe only
memory
accesses
are to th
.
and j
are stored in
registers. e
entnes of
the array
square.
Variables i
Determine
the cache performance of the
f ll o owmg code:
2
3
4
5
6
7
8
A.B.
C.
for
(i
= O; i <
16; i++){
for (j
= O; j <
16; j++)
{
square[i][j]
.c
= O;
square[i][j]
.m O;
square[i][j]
.y
1 ;
square[i][j]
.k
O;
}
}
What
is
the total number of
writes?
What
is
the total number of
writes that miss in the cache?
What
is
the
miss
rate?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!