edited by
6,732 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

1.1k
views
3 answers
0 votes
Sagar475 asked Jan 16, 2022
1,112 views
A hierarchical memory system that uses cache memory has cache access time of 80 nanoseconds, main memory access time of 200 nanoseconds, 85% of memory requests are ... the average access time of the system both for read and write requests ?
812
views
1 answers
0 votes
sushmita asked Dec 12, 2018
812 views
In this question can someone plz explain to me the write back part? Why are we taking write back time only for cache misses? Why not for hits? How to know when a block is going to be replaced and when to consider write back time.
874
views
0 answers
0 votes
Ajit J asked Dec 10, 2018
874 views
Consider a cache with a line size of 32 bytes and a main memory that requires 30 ns to transfer a 4-byte word. For any line that is written at least ... swapped out for a write-back cache to be more efficient that a write-through cache?
525
views
1 answers
0 votes
deepanshu sharma 3 asked Nov 17, 2018
525 views
Main disadvantage of direct mapping is that cache his ratio decreases sharply it two or more frequently used blocks map on to same region.For two level memory hierarchy ... WRITE BACK.is it true or false ? with reasons ?thank you in advance