Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are writing a new 3D game that you hope will earn you fame and fortune. You are currently working on a function to blank
You are writing a new 3D game that you hope will earn you fame and fortune. You are currently working on a function to blank the screen buffer before drawing the next frame. The screen you are working with is a 640 x 480 array of pixels. The machine you are working on has a 64 KB direct- mapped cache with 4-byte lines. The C structures you are using are as follows: struct pixel char r char g; char b char a 35 struct pixel buffer [48011640]; int i,j; char *cptr; int *iptr; And assuming the following: sizeof(int) 4 and size ar) buffer begins at memory address 0 The cache is initially empty The only memory accesses are to the entries of the array buffer, with the variables i, j, cptr and i ptr being stored in registers . Determine the cache performance of the following code: for (j ; j 640; j++) f buffer[ij 0; buffer[i]1j].g 0 buffer[i]lj].b 0 buffer[i][j.a-0; The miss rate is 25 % (accurate to +/-0.5%) You are writing a new 3D game that you hope will earn you fame and fortune. You are currently working on a function to blank the screen buffer before drawing the next frame. The screen you are working with is a 640 x 480 array of pixels. The machine you are working on has a 64 KB direct- mapped cache with 4-byte lines. The C structures you are using are as follows: struct pixel char r char g; char b char a 35 struct pixel buffer [48011640]; int i,j; char *cptr; int *iptr; And assuming the following: sizeof(int) 4 and size ar) buffer begins at memory address 0 The cache is initially empty The only memory accesses are to the entries of the array buffer, with the variables i, j, cptr and i ptr being stored in registers . Determine the cache performance of the following code: for (j ; j 640; j++) f buffer[ij 0; buffer[i]1j].g 0 buffer[i]lj].b 0 buffer[i][j.a-0; The miss rate is 25 % (accurate to +/-0.5%)
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