GATE 2025 CS (CS2) – Question 39
For a direct-mapped cache, 4 bits are used for the tag field and 12 bits are used to index into a cache block. The size of each cache block is one byte. Assume that there is no other information stored for each cache block.
Which ONE of the following is the CORRECT option for the sizes of the main memory and the cache memory in this system (byte addressable), respectively?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) 64 KB and 4 KB
Explanation
With a 1-byte block there is no offset, so the address is 4 + 12 = 16 bits and main memory is $2^{16}$ = 64 KB. The cache has $2^{12}$ blocks of 1 byte, which is 4 KB.