Open In App

GATE | GATE CS 2021 | Set 2 | Question 29

Like Article
Like
Save
Share
Report

Consider a set-associative cache of size 2KB (1KB=210 bytes) with cache block size of 64 bytes. Assume that the cache is byte-addressable and a 32 -bit address is used for accessing the cache. If the width of the tag field is 22 bits, the associativity of the cache is _________ .
(A) 2
(B) 4
(C) 1
(D) 8


Answer: (A)

Explanation: Number of lines in Cache
= Cache size / Block Size
So number of lines
= 2^11/2^6
= 2^5

No of sets
= Number of lines/ Number of lines in one set

Total bits = Tag bits + Set bits + Offset bits

Set bits = 32-22-6 = 4

2^4= 2^5/ Number of lines in one set

On solving we get associativity = 2.



Quiz of this Question


Last Updated : 13 Aug, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads