Question
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
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 1,024-byte direct-mapped data cache with 16-byte blocks. You are given the following definitions struct point_color { 2 int c; 3 int m; 4 int y; 5 int k; 6 }; 7 8 struct point_color square[16][16]; 9 int i, j; Assume the following: . 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. Determine the cache performance of the following code: 1 for (i = 15; i >= 0; i--){ 2 for (j = 15; j >= 0; j--) { 3 square[i][j].c = 0; 4 square[i][j].m = 0; 5 square[i][j].y = 1; 6 square[i][j].k = 0; 7 } 8 } A. What is the total number of writes? B. What is the total number of writes that hit in the cache? C. What is the hit rate? NUMBERS BEFORE CODE IS THE LINE NUMBER, PLEASE ANSWER A,B,C. I WANT TO KNOW THE HIT'S NOT MISSES, I'VE SEEN PLENTY OF RESPONSES THAT ARE FOR MISSES.
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