retagged by
814 views
6 votes
6 votes

Assume a cache memory with the following properties:

  • The cache size $\text{(C)}$ is 512 bytes (contains $512$ data bytes)
  • The cache uses an LRU (least recently used) policy for eviction.
  • The cache is initially empty.

Suppose that for the following sequence of addresses sent to the cache, $\mathrm{0 , 2 , 4 , 8 , 1 6 , 3 2}$, the hit rate is $\mathrm{0. 3 3}$. Then what is the block size $\text{(B)}$ of the cache?

  1. $\text{B}=4$ bytes
  2. $\text{B}=8$ bytes
  3. $\text{B}=16$ bytes
  4. None of the above.
retagged by

1 Answer

6 votes
6 votes

For (A) the sequence of accesses will result in $\textsf{M H M M M M},$ hit rate $= 0.16$
For (B) the sequence of accesses will result in $\textsf{M H H M M M,}$ hit rate $= 0.33$
For (C) the sequence of accesses will result in $\textsf{M H H H M M},$ hit rate $= 0.5$

Hence, the answer is (B).

Helpful Comment: https://gateoverflow.in/421140/go-classes-test-series-2024-mock-gate-test-13-question-54?show=421376#c421376 

edited by
Answer:

Related questions