GATE / CS ARCHIVE

GATE CSE 2008 / QUESTION 71

Total virtual cache-tag storage

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

GATE 2008, Q71 2 marks · MCQ
Report issue

Cache Memory

Question 71, GATE 2008: A machine has a 64-KiB, two-way set-associative data cache with 16-byte blocks, managed using 32-bit virtual addresses; pages are 4 KiB. A row-major double ARR[1024][1024] starts at the beginning of virtual page 0xFF000. A double occupies 8 bytes. The cache is initially empty, there is no prefetching, and only ARR causes data-memory references. The code is:
for(i=0;i<1024;i++)
 for(j=0;j<1024;j++) ARR[i][j]=0.0;
What is the total tag storage in the cache directory?

(A) 32 Kibits
(B) 34 Kibits
(C) 64 Kibits
(D) 68 Kibits
Question 71, GATE 2008: A machine has a 64-KiB, two-way set-associative data cache with 16-byte blocks, managed using 32-bit virtual addresses; pages are 4 KiB. A row-major double ARR[1024][1024] starts at the beginning of virtual page 0xFF000. A double occupies 8 bytes. The cache is initially empty, there is no prefetching, and only ARR causes data-memory references. The code is:
for(i=0;i<1024;i++)
 for(j=0;j<1024;j++) ARR[i][j]=0.0;
What is the total tag storage in the cache directory?

(A) 32 Kibits
(B) 34 Kibits
(C) 64 Kibits
(D) 68 Kibits
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. The 64-KiB cache with 16-byte blocks contains 4096 lines. Two ways give 2048 sets, requiring 11 index bits; the byte offset needs 4 bits.
2. The 32-bit virtual address therefore leaves 32−11−4=17 tag bits per line. Total tag storage is 4096×17=69632 bits=68 Kibits, option D.
3. Valid, dirty and replacement bits are not tags and are excluded.

Original paper, page 15