The GATE Grind

GATE 2020 CS – Question 40

Computer Organization and Architecture · Memory Interfacing and Hierarchy · 2 marks · Multiple choice

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?

  1. A1 and A4 are mapped to different cache sets.
  2. A2 and A3 are mapped to the same cache set.
  3. A3 and A4 are mapped to the same cache set.
  4. A1 and A3 are mapped to the same cache set.

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.