GATE 2020 CS – Question 40
A computer system with a word length of 32 bits has a 16 MB byte-addressable main memory and a 64 KB, 4-way set associative cache memory with a block size of 256 bytes. Consider the following four physical addresses represented in hexadecimal notation.
A1 = 0x42C8A4, A2 = 0x546888, A3 = 0x6A289C, A4 = 0x5E4880
Which one of the following is TRUE?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (B) A2 and A3 are mapped to the same cache set.
Explanation
The cache has 64KB/256 = 256 blocks, which is 64 sets, so the set index is address bits 13:8 (the low 6 bits of the middle byte). Sets: A1 = 8, A2 = 40, A3 = 40, A4 = 8. Hence A2 and A3 share a set.