Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3M decides to make Post-its by printing yellow squares on white pieces of paper.

ID: 3862854 • Letter: 3

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 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, 0.48-byte direct-mapped data cach with 32-byte blocks. You are given the following definitions: sturct point_color {int c; int m; int y; int k;}; struct point_color square [16][16]; 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: for (i - 0; i

Explanation / Answer

(A).For total number of writes in the above,,each line in inner loop write two structure points separatly.As there are four lines and eight writes for inner loop.

--> for complete code number of writes = 16*16*8

= 2048 writes.

(B)The total number of writes that miss in cache = 16*16*1

= 16*16

= 256 writes.

(C) Miss rate = (256/2048)%

= (1/8)%

= 12.5%

Miss rate is 12.5%

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote