Skip to content

GATE CS 1990 Q7a — Memory Hierarchy: Cache, Main Memory and Secondary Storage

Explain with AI

A block-set associative cache memory consists of 128128 blocks divided into four block sets. The main memory consists of 16,38416, 384 blocks and each block contains 256256 eight bit words.

  1. How many bits are required for addressing the main memory?
  2. How many bits are needed to represent the TAG, SET and WORD fields?
View worked solution

Answer: 22

We can determine the address structure by analyzing the specifications of the main memory and the cache memory.

1. Bits required for addressing the main memory

  • Number of blocks in main memory: 16,384=21416,384 = 2^{14} blocks
  • Block size: 256=28256 = 2^8 words
  • Total number of words in main memory: Total Words=214 blocks×28 words/block=222 words\text{Total Words} = 2^{14} \text{ blocks} \times 2^8 \text{ words/block} = 2^{22} \text{ words}
  • Since each word is individually addressable, the number of bits required to address the main memory is: log⁡2(222)=22 bits\log_2(2^{22}) = 22 \text{ bits}

2. Bits for TAG, SET, and WORD fields

The 22-bit physical address is divided into three fields: [ TAG | SET | WORD ].

  • WORD field: Since each block contains 256=28256 = 2^8 words, we need 88 bits for the WORD (offset) field.
  • SET field: The cache has 128128 blocks divided into 44-block sets (4-way set associative). Number of sets=128 blocks4 blocks/set=32 sets=25 sets\text{Number of sets} = \frac{128 \text{ blocks}}{4 \text{ blocks/set}} = 32 \text{ sets} = 2^5 \text{ sets} Thus, we need 55 bits for the SET field.
  • TAG field: TAG bits=Total Address bits−(SET bits+WORD bits)\text{TAG bits} = \text{Total Address bits} - (\text{SET bits} + \text{WORD bits}) TAG bits=22−(5+8)=9 bits\text{TAG bits} = 22 - (5 + 8) = 9 \text{ bits}

Summary of fields:

  • TAG: 99 bits
  • SET: 55 bits
  • WORD: 88 bits

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Memory Hierarchy: Cache, Main Memory and Secondary Storage questions