edited by
23,779 views
45 votes
45 votes
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 memory request are for read the rest for write. The hit ratio for the read access only is $0.9$ and a write-through policy (where both main and cache memories are updated simultaneously) is used. Determine the average time of the main memory (in ns).
edited by

4 Answers

Best answer
70 votes
70 votes

Average memory access time $=$  Time spend for read $+$ Time spend for write

$=$ Read time when cache hit $+$ Read time when cache miss $+$ Write time when cache hit $+$ Write time when cache miss

$= 0.8 \times 0.9 \times 50 + 0.8 \times 0.1 \times (500+50) $

(assuming hierarchical read from memory and cache as only simultaneous write is mentioned in question) $+ 0.2 \times 0.9 \times 500 + 0.2 \times 0.1 \times 500 $ (simultaneous write mentioned in question)

$= 36 + 44 + 90 + 10 = 180$ ns.

Reference: http://www.howardhuang.us/teaching/cs232/24-Cache-writes-and-examples.pdf

edited by
86 votes
86 votes
They are asking for the average memory access time.

 

If nothing is mentioned whether it is a simultaneous memory access or hierarchical memory access, we need to consider it as hierarchical memory access only. Here in this question nothing is given about read operation so we need to take it as hierarchical memory access for read operation. But for write it is given as write through policy, which will result in simultaneous memory access. Also for write operations write-through cache always go to the main memory, in main memory its hit rate is 100%. Hence Hit rate for write= 1.

 

Since there are 80% read operations and 20% write operations,

Average memory access time =  0.8 * Time spent for read + 0.2 * Time spent for write

 

Time spent for read = Hit-rate-for-read * cache access time + Miss-rate-for-read(cache access time + main memory access time)

= ( 0.9 ⨯ 50 + 0.1 ⨯ (500+50) )

= 45+55 = 100

 

Time spend for write = 500ns (simultaneous write mentioned in question)

 

Average memory access time =  0.8 * 100 + 0.2 * 500 = 80+100 = 180ns
13 votes
13 votes
when write through is implemented in a simultaneous access memory organization ,then hit ratio for write operation always become 1.(There is nothing given about write hit ratio)

$T_{avg\ write }$=500 ns.

$T_{avg \ read}=h_1*T_c+(1-h_1)*T_m$

                 $=.9*50 ns+.1*500 ns$

                 $=95ns$

 the average time of the main memory$=.8*95ns+.2*500ns$

                                                            $=176ns$

correct me if done any mistake.thank you
1 votes
1 votes
answer is 200ns=50+ 0.2x500x0.9(write through that are in cache)+ 0.8x0.1x500(read misses)+0.2x(500+500)x0.1(write through that are not in cache)
Answer:

Related questions

0 votes
0 votes
1 answer
3
19 votes
19 votes
2 answers
4
Kathleen asked Sep 12, 2014
2,287 views
Many microprocessors have a specified lower limit on clock frequency (apart from the maximum clock frequency limit) because _____