Return to course page

For the following questions, refer to Figure 6.26 in the textbook.

Question 1: (see above) If a cache has 1024 sets, each containing two 128 byte blocks, then what is the number of block offset bits? Answer as a normal base-10 number.

Answer:

Question 2: (see above) If a cache for a processor with 32-bit physical memory addresses is direct-mapped, has 64 byte blocks, and 20 tag bits in each cache line, then the size of the cache (excluding overhead) is:

  1. 2KB

  2. 4KB

  3. 8KB

  4. 64KB

  5. 1MB

  6. 64MB

  7. there is not enough information to know

Question 3: (see above) If a cache for a processor with 64-bit physical memory addresses has 1024 sets and 2 lines per set, and each line contains a 32 byte block, then what is the number of tag bits in each line of the cache? Answer as a normal base-10 number.

Answer:

Question 4: Suppose a cache has 20 tag bits, 8 index bits, and 4 block offset bits. In which set would the memory address 0x12345678 be looked up?

  1. set number 0x78

  2. set number 0x56

  3. set number 0x34

  4. set number 0x12

  5. none of the above

Question 5: Which of the following changes can decrease the number of conflict misses in a cache?
Select all that apply

  1. doubling the number of lines per set and halving the number of sets

  2. doubling the block size and halving the number of sets

  3. doubling the number of sets and halving the block size

  4. doubling the block size and halving the number of lines per set

In the following, assume where possible that the changes listed are independent: that cache size can be changed without modifying block size, etc.

Question 6: (see above) Which of the following changes are likely to increase the hit rate of a cache?
Select all that apply

  1. Increasing the cache size

  2. Decreasing the cache size

  3. Increasing the block size

  4. Decreasing the block size

  5. Increasing the associativity

  6. Decreasing the associativity

Question 7: (see above) Which of the following changes are likely to increase the miss penalty of a cache?
Select all that apply

  1. Increasing the cache size

  2. Decreasing the cache size

  3. Increasing the block size

  4. Decreasing the block size

  5. Increasing the associativity

  6. Decreasing the associativity

Question 8: (see above) Which of the following changes to the cache are likely to increase how much it can benefit from spatial locality?
Select all that apply

  1. Increasing the cache size

  2. Decreasing the cache size

  3. Increasing the block size

  4. Decreasing the block size

  5. Increasing the associativity

  6. Decreasing the associativity

Return to main page
Return to course page