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
Recommended Posts:
- GATE | GATE CS 2012 | Question 1
- GATE | GATE CS 2012 | Question 2
- GATE | GATE CS 2012 | Question 3
- GATE | GATE CS 2012 | Question 4
- GATE | GATE CS 2012 | Question 5
- GATE | GATE CS 2012 | Question 7
- GATE | GATE CS 2012 | Question 8
- GATE | GATE CS 2012 | Question 9
- GATE | GATE CS 2012 | Question 10
- GATE | GATE CS 2012 | Question 11
- GATE | GATE CS 2012 | Question 12
- GATE | GATE CS 2012 | Question 65
- GATE | GATE CS 2012 | Question 14
- GATE | GATE CS 2012 | Question 15
- GATE | GATE CS 2012 | Question 16
- GATE | GATE CS 2012 | Question 17
- GATE | GATE CS 2012 | Question 18
- GATE | GATE CS 2012 | Question 19
- GATE | GATE CS 2012 | Question 65
- GATE | GATE CS 2012 | Question 65

