GATE / CS ARCHIVE

GATE CSE 2021 SET 1 / QUESTION 22

GATE CSE 2021 Set 1 Q22

Computer Organization & Architecture · Cache Memory · Full GATE CSE 2021 Set 1 paper

GATE 2021 Set 1, Q22 1 mark · NAT
Report issue

Cache Memory

Question 22, GATE 2021: A system has 2^32 bytes of byte-addressable main memory and a 32 KB direct-mapped cache, with 1 KB=2^10 bytes and 64-byte cache blocks. How many bits are in the address tag?
Tap to enlarge
Answer & solution

Official answer: 17

Step through it (6 steps)

A byte address has 32 bits. The64-byte block uses 6 offset bits; 32KB/64=512 cache lines use 9 index bits. The remaining tag has 32−6−9=17 bits.

A direct-mapped address is partitioned into tag | line index | block offset. The offset selects one of 64 bytes, so it takes log2 64=6 bits. The data capacity contains 32768/64=512 lines, so index needs log2 512=9 bits. Address width is log2(232)=32 bits, leaving 17. Cache size is assumed to mean data capacity, as usual in this exercise, not data plus tag-store overhead.

Original paper, page 21 · Answer key