GATE / CS ARCHIVE

GATE CSE 2023 / QUESTION 64

GATE CSE 2023 Q64

Computer Organization & Architecture · Cache Memory · Full GATE CSE 2023 paper

GATE 2023, Q64 2 marks · NAT
Report issue

Cache Memory

Question 64, GATE 2023: An 8-way set-associative cache has 64 KiB data capacity and 32-bit byte addresses divided into tag, set index, and block offset. Find the tag width.
Tap to enlarge
Answer & solution

Official answer: 19

Step through it (4 steps)

For byte addressing, cache data capacity equals associativity times number of sets times bytes per block. Therefore the number of sets times block size is 65536/8=8192=213. The index and block-offset fields together occupy 13 bits regardless of the particular power-of-two block size. The tag has 32-13=19 bits. As usual, the stated capacity is data capacity, excluding tag and replacement metadata.

Teaching detail. Let block size be 2b bytes and the number of sets be 2s. Eight ways means each set stores eight blocks, so 216=23·2s·2b and s+b=13. These lower address bits choose a set and byte within a block; the remaining bits identify which memory block occupies the selected way. Therefore tag width is independent of the unspecified block size, provided the conventional power-of-two partition is used. Associativity bits do not appear as a separate address field selecting a way.

Original paper, page 68 · Answer key