GATE | GATE-CS-2007 | Question 10
Consider a 4-way set associative cache consisting of 128 lines with a line size of 64 words. The CPU generates a 20-bit address of a word in main memory. The number of bits in the TAG, LINE and WORD fields arerespectively:
(A)
9,6,5
(B)
7, 7, 6
(C)
7, 5, 8
(D)
9, 5, 6
Answer: (D)
Explanation:
Here the number of sets = 128/4 = 32 (as it is 4 way set associative)
We have total 64 words then we need 6 bits to identify the word
So the line offset is 5 bits and the word offset is 6 bits
and the TAG = 20-(5+6) =9 bits
so it should be 9,5,6
Quiz of this Question
Please comment below if you find anything wrong in the above post
Last Updated :
19 Nov, 2018
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...