StreakPeaked· Practice

ExamsGATETechnical

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?

  1. 64 KB and 4 KB
  2. 128 KB and 16 KB
  3. 64 KB and 8 KB
  4. 128 KB and 6 KB

Correct answer: 64 KB and 4 KB

Solution

The main memory size can be calculated using the total number of addressable locations, which is determined by the tag and index bits. With 4 bits for the tag and 12 bits for the index, the total addressable memory is 2^(4+12) = 64 KB. The cache size is determined by the number of cache blocks, which is 2¹² = 4096 blocks, and since each block is 1 byte, the cache size is 4 KB.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →