GATE / CS ARCHIVE

GATE CSE 2005 / QUESTION 67

Direct-mapped cache index and tag

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

GATE 2005, Q67 2 marks · MCQ
Report issue

Cache Memory

Question 67, GATE 2005: Direct-mapped cache data capacity 32 KB, block 32 bytes, CPU 32-bit byte addresses. Required(index bits, tag bits): A(10, 17); B(10, 22); C(15, 17); D(5, 17). Use binary capacity units.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (6 steps)

The cache contains 32 KiB/32 bytes =1024 lines, so its index needs 10 bits. A block offset needs log2(32)=5 bits. Of the 32 address bits, 32−10−5=17 remain for the tag. Thus (10, 17), option A.

First divide data capacity by block size to obtain 1024 distinct cache positions. Choosing one needs 10 bits. Choosing a byte within 32-byte block needs 5 low-order bits. The tag identifies which memory block is currently occupying that position, using the remaining 32−10−5=17 bits. Check 10+17+5=32. The cache’s total number of bytes is not the number of line indices.

Original paper, page 9