GATE 2026 CS (CS2) – Question 56
Consider a system with 1 MB physical memory and word length 1 byte. The system uses a direct-mapped cache, with block numbers starting from 0. The word with physical address `0xA2C28` is mapped to cache block number $176_{10}$. The maximum possible size of the cache, in KB, for this configuration is __________. (answer in integer)
Note: $1\text{ K}=2^{10}$ and $1\text{ M}=2^{20}$.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 128
Explanation
Let the block size be $2^b$ bytes. Since cache block number is 176, the address bits above the block offset must match binary 176, which is $10110000_2$. From the given address `0xA2C28`, bits 13 through 6 are exactly $10110000$, so the offset can use at most 6 bits, giving block size $2^6=64$ bytes. The higher index bits beyond those 8 bits must fit the address pattern; bits 16 through 14 are 0, so the index can be extended up to 11 bits in total. Therefore, the maximum cache size is $$2^{11}\text{ blocks}\times2^6\text{ bytes/block}=2^{17}\text{ bytes}=128\text{ KB}.$$ Hence the answer is 128.