GATE / CS ARCHIVE

GATE CSE 2017 SET 2 / QUESTION 53

GATE CSE 2017 Set 2 Q53

Computer Organization & Architecture · Cache Memory · Full GATE CSE 2017 Set 2 paper

GATE 2017 Set 2, Q53 2 marks · NAT
Report issue

Cache Memory

Question 53, GATE 2017: A byte-addressable main memory contains 2^32 bytes, divided into 32-byte blocks. A direct-mapped cache has 512 lines. How many address bits form the tag field?
Tap to enlarge
Answer & solution

Official answer: 18.0

Our answer: 18

Step through it (6 steps)

1. There are 232 separately addressable bytes, so a memory address needs 32 bits. A 32-byte block needs log₂32=5 low-order offset bits to select a byte within it.

2. A direct-mapped cache with 512=29 lines uses 9 index bits to select the one cache line where a block may reside.

3. The remaining high-order bits distinguish the different memory blocks that map to that same line: tag=32-5-9=18 bits. Equivalently, memory has 227 blocks and each of 29 lines represents 218 possible blocks. Do not use 512 as the cache byte capacity; it is the number of lines.

Original paper, page 21 · Answer key