Homework 8: Caches and VM

TA In Charge: Alex Kronrod

Submitting Your Solution

Submit your solution online by 11:59pm on Wednesday 2007-04-18. Do this by creating a directory named hw8 that contains a text file named README. From within that directory, type submit hw8.

Problems

P&H Exercises 7.17, 7.18, 7.29, 7.39, 7.40 (pp. 556-558)

7.17: Find the AMAT (Average Memory Access Time = Time for a hit + Miss rate * Miss penalty) for a processor with a 2 ns clock, a miss penalty of 20 clock cycles, a miss rate of 0.05 misses per instruction, and a cache access time (including hit detection) of 1 clock cycle. Assume that the read and write miss penalties are the same and ignore other write stalls.

7.18: Suppose we can improve the miss rate to 0.03 misses per reference by doubling the cache size. This causes the cache access time to increase to 1.2 clock cycles. Using the AMAT as a metric, determine if this is a good trade-off.

7.29: Suppose a computer's address size is k bits (using byte addressing), the cache size is S bytes, the block size is B bytes, and the cache is A-way set-associative. Assume that B is a power of two, so B = 2b. Figure out what the following quantities are in terms of S, B, A, b, and k: the number of sets in the cache, the number of index bits in the address, and the number of bits needed to implement the cache (see Exercise 7.12).

7.39: Consider a virtual memory system with the following properties:

  • 40-bit virtual byte address
  • 16 KB pages
  • 36 bit physical byte address What is the total size of the page table for each process on this processor, assuming that the valid, protection, dirty, and use bits take a total of 4 bits and that all the virtual pages are in use? (Assume that disk addresses are not stored in the page table.)

    7.40: Assume that the virtual memory system of Excercise 7.39 (above) is implemented with a two-way set-associative TLB with a total of 256 TLB entries. Show the virtual-to-physical mapping with a figure like Figure 7.24 on page 525. Make sure to label the width of all fields and signals. Include a Cache/data lookup in your diagram