Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AutoCAD Database Connectivity

Authors: Scott McFarlane

1st Edition

0766816400, 978-0766816404

More Books

Students also viewed these Databases questions

Question

=+C&B (especially taxation) laws, regulations, and practices?

Answered: 1 week ago

Question

=+designing international assignment C&B packages.

Answered: 1 week ago