Question: ( 4 ) 3 M decides to make Post - its by printing yellow squares on white pieces of paper. As part of the printing

(4)3 M 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 2,048-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];
int i, j;
```
Assume the two functions are executed under the following conditions:
- 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.[1+4+1]
for (i =0; i 16; i++){
for (j =0; j 16; j++){
square[i][j].c =0;
square[i][j].m =0;
square[i][j].y =1;
square[i][j].k =0;
}
8}
```
(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.
( 4 ) 3 M decides to make Post - its by printing

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!