How many total bits are required for a directmapped cache wi
How many total bits are required for a direct-mapped cache with 2048 entries each holding an 8 word (of 32 bits or 4 bytes) block, assuming a 32-bit address? Discuss with the help of a diagram the logic to check a hit or miss (that is, presence or absence) of a required memory block in the cache described in 1 (a), and access a specific word of the block in case of a hit. Label all the fields in a cache word.
Solution
Q1) a)
•16 KB = 4K words = 2^12 words
• Block size of 4 words => 2^10 blocks
• Each block has 4 x 32 = 128 bits of data + tag + valid bit
• tag + valid bit = (32 – 10 – 2 – 2) + 1 = 19
• Total cache size = 2^10*(128 + 19) = 2^10 * 147
Therefore, 147 KB are needed for the cache
