48.4k views
4 votes
(2 points) how many total bits are required for a direct-mapped cache with 2^12 blocks (12-bit index), two-word in each block, assuming 64-bit address? compare this total cache size with the 2^13 words for storage of data as given above. hint: n (cache size) and m (one bit for selecting two-word block) is given, and then derive tag size (two bits for byte offset). then, find the total bits for address/data and compare that with pure data bits. what is the ratio?

User Frank Roth
by
7.2k points

1 Answer

0 votes

Final answer:

To determine the total number of bits required for a direct-mapped cache, we need to calculate the tag size first. The tag size is the number of bits needed to uniquely identify each block in the cache. Comparing this with the 2^13 words for data storage, the ratio between the cache size and the data storage size can be calculated. The ratio between the cache size and the data storage size can be calculated as: cache size / data storage size = 78 bits / 2^17 bits = 1 / 2^15.

Step-by-step explanation:

To determine the total number of bits required for a direct-mapped cache, we need to calculate the tag size first. The tag size is the number of bits needed to uniquely identify each block in the cache. In this case, the cache has 2^12 blocks, so we would need a 12-bit index. We also need to consider the byte offset, which requires 2 bits for a two-word block.

The total number of bits for the address/data in the cache is equal to the tag size plus the index size plus the bits for offset. Therefore, the total number of bits required for the cache is 64 (tag size) + 12 (index size) + 2 (offset size) = 78 bits.

Comparing this with the 2^13 words for data storage, we need to convert the word size to bits. If each word is 64 bits, then the total number of bits for data storage is 2^13 (64 bits/word) = 2^17 bits. The ratio between the cache size and the data storage size can be calculated as: cache size / data storage size = 78 bits / 2^17 bits = 1 / 2^15.

User Freddygv
by
7.6k points