Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

5.3 By convention, a cache is named according to the amount of data it contains

ID: 3807490 • Letter: 5

Question

5.3 By convention, a cache is named according to the amount of data it contains (i.e., a 4 KiB cache can hold 4 KiB of data); however, caches also require SRAM to store metadata such as tags and valid bits. For this exercise, you will examine how a cache’s configuration affects the total amount of SRAM needed to implement it as well as the performance of the cache. For all parts, assume that the caches are byte addressable, and that addresses and words are 64 bits

5.3.1 [10] <§5.3> Calculate the total number of bits required to implement a 32 KiB cache with two-word blocks.

5.3.2 [10] <§5.3> Calculate the total number of bits required to implement a 64 KiB cache with 16-word blocks. How much bigger is this cache than the 32 KiB cache described in Exercise 5.3.1? (Notice that, by changing the block size, we doubled the amount of data without doubling the total size of the cache.)

5.3.3 [5] <§5.3> Explain why this 64 KiB cache, despite its larger data size, might provide slower performance than the first cache.

5.3.4 [10] <§§5.3, 5.4> Generate a series of read requests that have a lower miss rate on a 32 KiB two-way set associative cache than on the cache described in Exercise 5.3.1.

Explanation / Answer

1.Calculate the total number of bits required to implement a 32 KiB cache with two-word blocks.

Solution : Number of bits in a cache 2^n X (block size + tag size + valid field size)
(2^index bits) * (valid bits + tag bits + (data bits * 2^offset bits))
total bits = 2^15 (1+14+(32*2^1)) = 2588672 bits

2.Calculate the total number of bits required to implement a 64 KiB cache with 16-word blocks. How much bigger is this cache than the 32 KiB
cache described in Exercise 5.3.1? (Notice that, by changing the block size, we doubled the amount of data without doubling the total size
of the cache.)

Solution : using: (2^index bits) * (valid bits + tag bits + (data bits * 2^offset bits))
for the cache with 16 word blocks i get
total bits = 2^13(1 +13+(32*2^4)) = 4308992

3.Explain why this 64 KiB cache, despite its larger data size, might provide slower performance than the first cache.
You need to convert the KB to words and get the index bits.
Use the answer from part 1 to get your tag bits.
Plug them into this formula.
(2^(index bits)) * ((tag bits)+(valid bits)+(data size))
data size is 64 bits in this case and valid bit is 1. So just find the index and tag bits.
the next smallest cache with 16 word blocks and a 32 bit address works out to be 2158592 bits, smaller than the first cache.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote