Docsity

Cache Organization and Performance | Computer Architecture ll | CS 232, Exams of Computer Architecture and Organization

Toggle sidebar
bg1
3
Question 2: Cache Organization and Performance (40 points)
Part (a)
Compute how many bits of storage are requi red to implement the following cache for a machine wi th 32-bit
addresses (include all data, tag, and control state): a write-back, write-no-allocate, 4-way set associative cache
with 1024 32-byte blocks. Five bits are requi red for each set to store full LRU (4! = 4x3x 2x1 = 24 < 25). You
can leave your answer as an expression. Show work for partial credit. (10 points)
Part (b)
Given a direct-mapped cache with 4 blocks of 4 bytes, which of the followi ng byte accesses hit? (10 points)
110101
100001
001110
100101
110010
010001
001100
001111
100111
Miss110001
Hit/MissAddress (binary)
Address
Tag Index Block
offset
pf3
pf4
pf5

Partial preview of the text

Download Cache Organization and Performance | Computer Architecture ll | CS 232 and more Exams Computer Architecture and Organization in PDF only on Docsity!

Question 2: Cache Organization and Performance (40 points) Part (a) Compute how many bits of storage are required to implement the following cache for a machine with 32-bit addresses (include all data, tag, and control state): a write-back, write-no-allocate, 4-way set associative cache with 1024 32-byte blocks. Five bits are required for each set to store full LRU (4! = 4x3x2x 1 = 24 < 25 ). You can leave your answer as an expression. Show work for partial credit. ( 10 points) Part (b) Given a direct-mapped cache with 4 blocks of 4 bytes, which of the following byte accesses hit? (10 points) 110101 100001 001110 100101 110010 010001 001100 001111 100111 110001 Miss Address Address (binary)^ Hit/Miss Tag Index Block offset

Question 2, continued Part (c) Compute the average memory access time for a 4-way set-associative, unified L 2 cache with 64B blocks and a 95% hit rate. The access time for this 1MB cache is 8 cycles, and it take 80 cycles to move a 64B block from memory to the cache. You can leave your answer as an expression. (10 points) Part (d) Consider a cache that holds two blocks of 1 - byte each. Write 2 sequences of accesses using the following notation: A 1 , A 2 , A 3 , etc. are distinct addresses that map to the first block, and B 1 , B 2 , B 3 , etc. are distinct addresses that map to the second block of a direct mapped cache. For example: A 2 , B 1 , B 1 , A 9 , B 7 , A 6. Sequence 1 : Write a sequence of at most 5 accesses that has a better hit rate on a direct mapped cache than on a fully- associative cache (using LRU). (5 points) Sequence 2 : Write a sequence of at most 5 accesses that has a better hit rate on a fully-associative cache (using LRU) than on a direct mapped cache. (5 points)

Question 2, continued Part (e) Given a direct-mapped cache with 4 blocks of 8 bytes, which of the following byte accesses hit? For those accesses that hit indicate whether the hit is because of spatial locality, temporal locality, or neither in the reason column. ( 20 points) Part (f) If you were given a processor’s base CPI (i.e., the CPI that a processor would have if it never missed in the data cache), what information would you need in order to compute its CPI with a real cache? (5 points) 011100


Reason 111111 000111 110111 111111 000100 011111 010000 111111 010101 000000 Miss Address (binary) Hit/Miss Address Tag Index Block offset

Question 1: Cache Organization and Performance (55 points) For the following questions, consider a write-allocate, write-back, direct-mapped cache that holds 32KB of data in 32-byte blocks. Part (a) How large would the index, tag, and block offset fields be for 32-bit addresses? ( 5 points) Part (b) Compute how many bits of storage are required to implement the cache for a machine with 32-bit addresses (include all fields: data, tag, etc.). You can leave your answer as an expression. Show work for partial credit. (10 points) Part (c) Assuming the cache was initially empty, which of the following byte accesses would hit in the cache? Note: We’ve only shown the bottom 20 bits of the addresses; the top bits are all zeros. (10 points) Address Tag (^) Index Block offset 0x 0x 0x439bf 0x 0x 0x439af 0x Address (hex) Load Store Store Load Store Load Store Type 0 1 1 0 1 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 0 0 0 0 1 1 1 0 0 1 1 0 1 1 1 1 1 1 0 0 1 0 0 1 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 1 1 1 0 0 1 1 0 1 0 1 1 1 1 Miss 0 0 1 0 0 1 0 0 0 0 1 1 0 0 1 0 0 1 0 1 Miss Address (binary) Hit/Miss