Steps for this Lab:
Consider the following cache line reference sequence:
Assume cache contains room for 4 cache lines. This could be organized by
Determine the number of cache hits and misses in each of these cases.
Now consider a virtual paging system, where four pages may be stored in main memory and where the sequence of the previous problem reflects the sequence of page requests needed in a program.
Determine the number of hits to main memory for each of the above replacement algorithms:
Solve problems 26 and 27 in Chapter 4 (page 301) in the text.
Adapted from Computer Organization, A Top-Down Approach by Greg Scragg, McGraw-Hill, 1992.
Recall the 90% rule: 90% of execution time typically involves 10% of the code.
Assume that you have a cache capable of holding 50% of your code, and assume a cache line holds 8 instructions.
If an instruction of a running program is selected at random from a code listing, what is the probability that it will be in cache.
If execution was stopped after a random number of steps, what would the probability be that the next instruction would be in cache?
Consider the overall running of the program. What is a likely cache hit ratio?
In each case, give a brief justification of your answer.
Extra Credit: Repeat problem 5, assuming that only 5% of the program fits in cache.
Only one write-up of each problem should be turned in for each group, and the writing of solutions should be shared by group members. Each member of a group must write up at least one problem, and each solution should be reviewed by all members of the group. After solutions are written (and revised as necessary) to the satisfaction of all group members, the solutions should be collected together and turned in as a single packet from the group.
This document is available on the World Wide Web as
http://www.math.grin.edu/~walker/courses/211.fa99/labs/lab-cache.html