GATE | GATE CS 2012 | Question 54



A computer has a 256 KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit.
The number of bits in the tag field of an address is

(A) 11
(B) 14
(C) 16
(D) 27


Answer: (C)

Explanation: A set-associative scheme is a hybrid between a fully associative cache, and direct mapped cache. It’s considered a reasonable compromise between the complex hardware needed for fully associative caches (which requires parallel searches of all slots), and the simplistic direct-mapped scheme, which may cause collisions of addresses to the same slot (similar to collisions in a hash table). (source: http://www.cs.umd.edu/class/spring2003/cmsc311/Notes/Memory/set.html). Also see http://csillustrated.berkeley.edu/PDFs/handouts/cache-3-associativity-handout.pdf

 

Number of blocks = Cache-Size/Block-Size = 256 KB / 32 Bytes = 213

Number of Sets = 213 / 4 = 211

Tag + Set offset + Byte offset = 32
Tag + 11 + 5 = 32
Tag = 16


Quiz of this Question



My Personal Notes arrow_drop_up

Article Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.