• edited by
13,311 views
30 30 votes

Consider a Direct Mapped Cache with 8 cache blocks (numbered $0-7$). If the memory block requests are in the following order

$3, 5, 2, 8, 0, 63, 9,16, 20, 17, 25, 18, 30, 24, 2, 63, 5, 82,17, 24.$

Which of the following memory blocks will not be in the cache at the end of the sequence ?

  1. $3$
  2. $18$
  3. $20$
  4. $30$

3 Answers

Best answer
39 39 votes

Answer is (B).

Cache location (memory block) = block req mod number of cache blocks. Since each block has only one location (associativity is $1$) the last mod $8$ request will be in cache (no need of any replacement policy as mapping is direct).

$3, 5, 2, 8, 0, 63, 9, 16, 20, 17, 25, 18, 30, 24, 2, 63, 5, 82, 17, 24$

Block $0- 8$, $ 0, 16, 24, 24$. At end contains $24.$
1- $9, 17, 25, 17.  $
2- $2, 18, 2, 82.$
3- $3$.
4- $20.$
5- $5, 5.$
6- $30.$
7- $63 63.$

So, memory block $18$ is not in cache while $3$, $20$ and $30$ are in cache.

• edited by
9 9 votes

in direct mapping function is used to map the data.

(main memory block number) MOD (number of cache memory line)=cache memory line number.

0 0 votes

….………………………………………………………….

Answer:
Position:
Show:

Related questions

84 84 votes
6 answers 6 answers
46.3k
46.3k views
Ishrat Jahan asked Oct 29, 2014
46,280 views
Following table indicates the latencies of operations between the instruction producing the result and instruction using the result.$$\begin{array}{|l|l|c|} \hline \textb...
40 40 votes
2 answers 2 answers
9.5k
9.5k views
Ishrat Jahan asked Oct 29, 2014
9,536 views
The floating point unit of a processor using a design $D$ takes $2t$ cycles compared to $t$ cycles taken by the fixed point unit. There are two more design suggestions $D...
62 62 votes
8 answers 8 answers
22.7k
22.7k views
Ishrat Jahan asked Oct 29, 2014
22,697 views
A processor takes $12$ cycles to complete an instruction I. The corresponding pipelined processor uses $6$ stages with the execution times of $3, 2, 5, 4, 6$ and $2$ cycl...
76 76 votes
9 answers 9 answers
41.0k
41.0k views
Kathleen asked Sep 13, 2014
41,022 views
The access times of the main memory and the Cache memory, in a computer system, are $500$ n sec and $50$ nsec, respectively. It is estimated that $80\%$ of the main memor...