324_Book

# C figure 74 elf symbol table entry type and binding

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: only memory accesses are to the entries of the array buffer. Variables i, j, cptr, and iptr are stored in registers. What percentage of writes in the following code will miss in the cache? 1 2 3 4 5 6 7 8 for (j = 0; j < 640; j++) { for (i = 0; i < 480; i++){ buffer[i][j].r = 0; buffer[i][j].g = 0; buffer[i][j].b = 0; buffer[i][j].a = 0; } } Homework Problem 6.29 [Category 2]: Given the assumptions in Problem 6.28, what percentage of writes in the following code will miss in the cache? 1 2 3 char *cptr = (char *) buffer; for (; cptr < (((char *) buffer) + 640 * 480 * 4); cptr++) *cptr = 0; Homework Problem 6.30 [Category 2]: Given the assumptions in Problem 6.28, what percentage of writes in the following code will miss in the cache? 344 1 2 3 CHAPTER 6. THE MEMORY HIERARCHY int *iptr = (int *)buffer; for (; iptr < ((int *)buffer + 640*480); iptr++) *iptr = 0; Homework Problem 6.31 [Category 3]: Download the mountain program from the CS:APP Web site and run it on your favorite PC/Linux system. Use the results to estimate the sizes of the L1 and L2 caches on your system. Homework Problem 6.32 [Category 4]: In this assignment you will apply the concepts you learned in Ch...
View Full Document

## This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online