The GATE Grind

GATE 2013 CS (CS1) – Question 30

Computer Organization and Architecture · Memory Interfacing and Hierarchy · 1 mark · Multiple choice

A k-way cache has v sets of k consecutive lines, with set s preceding s+1. Memory blocks are numbered from zero. To which line range can block j map?

  1. (j mod v)k through (j mod v)k+k−1
  2. j mod v through j mod v+k−1
  3. j mod k through j mod k+v−1
  4. (j mod k)v through (j mod k)v+v−1

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) (j mod v)k through (j mod v)k+k−1

Explanation

Block j selects set s=j mod v. Since each earlier set occupies k lines, set s starts at line sk and ends at sk+k−1. Substitution yields option A. Any of its k ways may hold the block.

More Memory Interfacing and Hierarchy questions

All Memory Interfacing and Hierarchy questions →