edited by
6,438 views
7 votes
7 votes
Consider a cache memory hit ratios for read and write operations are 80% and 90% respectively. If there is a miss then 2 word block is to be through from main memory to cache. Consider 30% updations and the cache access time is 20ns/word and memory access time 100 ns/word.

Q43 calculate the efficiency of the cache using write through scheme?

A. 13.8 million words/ sec

B 12.8 million words/sec

C 14.8 million words/sec

D 11.8 million words/sec

Q 44 find efficiency of cache using write back scheme?( in million words per sec)

A.15.5    b. 16.5    c. 14.5     d. 13.5
edited by

2 Answers

Best answer
7 votes
7 votes

1. Write through

$T_{read} =  20 + 0.2 \times 2 \times  100= 60 ns$

$T_{write} = 100 ns$ (Write through always goes to memory, so hit rate does not matter for time and only 1 word is written to)

$T_{avg} = 0.7 \times 60 + 0.3 \times 100 = 72 ns$

So, $\text{throughput} = \frac{\text{Amount of data transferred}}{\text{time taken}} \\= \frac{1}{72 \times 10^{-9} }\\ = 13.8 \text{million words per second}$.

Efficiency is a ratio - should be a mistake in question. 

2. Write back. To solve this we need amount of dirty bits or percentage of dirty page replacement. This is missing in question. 

See 35154 for reference. 

selected by
23 votes
23 votes
I happen to differ from Arjun Sir.
Please let me know my faults, if any.

Taking for write through
T(avg read)= Hit ratio (read)* access time of CM+ Miss ratio (read)*(Read allocate time+ access time of CM)

And,
T(avg write)= Hit ratio (write)*write through time + miss ratio (write)*(write allocate+write through time)

Because write/read allocate as given in the question is to get 2 word block to be transferred from MM to CM. Taking read/write allocate as 2*100ns

And write through time is max (Tm, Tc)= 100ns

So
T read= 0.8*20+0.2(100*2+20)
            =60ns
T write= 0.9*100+0.1(100*2+100)
             =120ns
Tavg= 0.7*60+0.3*120
         =78ns
Tavg is time for 1 word access
Therefore, in one second

1000/78 million words will be accessed on average.

This evaluates to 12.8 million words/second.
Hence, option b.

Related questions

0 votes
0 votes
1 answer
2