###### Question 10544 – Critical-Section
February 25, 2024
###### Question 7850 – Computer-Networks
February 26, 2024
###### Question 10544 – Critical-Section
February 25, 2024
###### Question 7850 – Computer-Networks
February 26, 2024

How many total bits are required for a direct-mapped cache with 128 KB of data and 1 word block size, assuming a 32-bit address and 1 word size of 4 bytes?

Question 71 Explanation:
Size of a cache line = block size = 4 bytes
Number of lines in the cache = cache size / line size = 128KB / 4 bytes = 32K = 2^15
In a direct mapped cache the address is split into 3 fields (TAG, LINE, OFFSET)
Here OFFSET is the number bits needed to identify a word within the cache line.
As line size = word size, we don’t need any bits to identify the word within a block so OFFSET = 0.

As there are 2^15 lines in the cache, LINE needs 15 bits.

From the 32 bits of physical address, TAG bits = 32 – 15 = 17 bits.

TAG directory size = Number of cache lines * TAG bits = 2^15 * 17 = 544 K bits
Cache data size = 128KB = 128 * 8 K bits = 1024 K bits

Total cache size = TAG directory size + cache data size = 544 K + 1024 K = 1564 K bits = 1.53 M bits

2 Mbits
1.7 Mbits
2.5 Mbits
1.5 Mbits