Question
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
Answer: Option A
Was this answer helpful ?
Position of main memory block in the cache (set) = (main memory block number) MOD
(number of sets in the cache).
As the lines in the set are placed in sequence, we can have the lines from 0 to (K – 1) in each
set.
Number of sets = v, main memory block number = j
First line of cache = (j mod v)*k; last line of cache = (j mod v)*k + (k – 1)
Was this answer helpful ?
Submit Solution