GATE CS 2013 · Question 20 · Computer Organization and Architecture · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

In a k-way set associative cache, the cache is divided into v sets, each of which consists of k lines. The lines of a set are placed in sequence one after another. The lines in set s are sequenced before the lines in set (s+1). The main memory blocks are numbered 0 onwards. The main memory block numbered j must be mapped to any one of the cache lines from

  1. (A) (j mod v) * k to (j mod v) * k + (k-1)
  2. (B) (j mod v) to (j mod v) + (k-1)
  3. (C) (j mod k) to (j mod k) + (v-1)
  4. (D) (j mod k) * v to (j mod k) * v + (v-1)
Answer

Answer (A)

Answer from the official GATE CS 2013 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes