Similar questions 5 more →
Cache Memory

Answer & solution
Official answer: A
Block j maps to set s=j mod v. Each earlier set occupies k consecutive lines, so this set starts at sk and ends at sk+k−1. Substituting s gives the interval in A.
First choose the set, not a particular way: s=j mod v. There are s earlier sets, each occupying k line positions, so the first line of set s is sk. The k allowed ways occupy offsets 0 through k−1, hence last line sk+k−1. For example, v=4, k=2, j=6 gives s=2 and lines 4, 5. This example also shows why omitting the factor k, as in B, gives the wrong physical positions.