in GATE retagged by
1,522 views
1 vote
1 vote
The access time of cache memory is $10$ $ns$ and main memory is $100$ $ns$. It is estimated that $80 \%$ of memory requests are for read and remaining are for write. The hit ratio for read access only is $0.9$. A write through procedure is used. Pages are always available in cache for write operation. Then, the average access time is ______ $ns$.
in GATE retagged by
by
1.5k views

4 Comments

By default write will always available in cache means why you are multiplying with 100ns instead of 10ns??
1
1
read below comments please
0
0
ok got it thanks
0
0

@Niharika 1

Here we  are multiplying with 100 ns instead of 10 ns because it is write through policy used as mention in the question.

In case of Write Through we use write no allocate policy , that means On a cache miss, usually only memory is updated ( that why we multiply MM access time with miss rate ). 

1
1

2 Answers

9 votes
9 votes
Best answer

For hierarchical access and write-through:

Tread = H ×Tcache+ (1−H) × ( Tcache + Tmemory_block )

= hit ratio * hit time + Miss ratio * miss time

H = 0.9  [ given ]

1-H = 0.1

[ given = hit ratio for read access only is 0.9 , cache access time , Tcache = 10 ns ]

= 0.9 * 10 + 0.1 * 110 [ as it is hierarchical access , in case of cache miss we need to take cache access time + memory access time , that's why it is 100 + 10 = 110]

it is given in the question 80% of memory requests are for read ,

so for read it is 0.8 * ( T read )

and 20 % is for write, in write through it use write no allocate hence only Main Memory access time will be counted , for write it is 0.2 * 100 ..

hence total access time will be :

0.8 [0.9 * 10 ns + 0.1 * 110 ns] + 0.2 [ 100 ns]

= 36 ns

Reference: https://gateoverflow.in/14480/formula-write-back-write-through-access-time-parallel-serial

selected by

4 Comments

ohh i missed that.

thank u.
1
1
edited by
@Arjun sir

@Bikram sir,

Here in ques it is given 80 are read instructions and rest are write..its not 80%

And also,

total access time is ______ ns.

It should be average time ..isn't it?? total time will be dependent on exact no of instructions

https://gateoverflow.in/584/gate1992-5-a

https://gateoverflow.in/2078/gate2014-3-44
0
0

Here in ques it is given 80 are read instructions and rest are write..its not 80%

due to latex, % is not printed.

 

It should be average time ..isn't it??

yes, we always calculate average access time only.

 

i updated the question !

0
0
4 votes
4 votes

Write Through Method: 

Write through is a storage method in which data is written into the cache and the corresponding main memory location at the same time. The cached data allows for fast retrieval on demand, while the same data in main memory ensures that nothing will get lost if a crash, power failure, or other system disruption occurs.

80%- requests for Read and 20%- requests for Write

So, according to definition we have to count (memory+cache) only for Read requests while for Write requests we just need to count (Main Memory)

0.80 [ (0.90) {hit ratio for cache} (10 ns) + (0.1) (100+10 ns) ] + 0.20(100 ns) = 36 ns

P.S. 

Doubt-1: Why we taken Main Memory access time for Write Operaion instead of Taking 'Cache'

Doubt-2: What if here 80% Read Request not given?

Solutuion: (0.90) {hit ratio for cache} (10 ns) + (0.1) (100+10 ns) ???

Doubt-3: If they don't specify about method what we have to consider Strict Hierarchy or Simple one?

Doubt-4: What if here 'Write through' method was not used?

3 Comments

@smartmeet

see the answer here

https://gateoverflow.in/584/gate1992-5-a

0
0
@smartmeet

for those doubts read the Cache Memory chapter from this book - " Fundamentals of computer organization and architecture " By Mostafa Abd-El-Barr, Hesham El-Rewini , and see formula for write through in between page 125 to 127 .
0
0

@smartmeet

for your Doubt-1: Why we taken Main Memory access time for Write Operation instead of Taking "Cache" when we calculate 0.20(100 ns) ?

The answer is :  As it is mention in the question, it is Write Through technique used, in Write Through  method  data is written into the cache and the corresponding main memory location at the same time

In case of cache miss,  we just need to count (Main Memory access time) because on a cache miss, usually only memory is updated (no write allocate policy). 

 

For reference see the best answer :

https://gateoverflow.in/14480/formula-write-back-write-through-access-time-parallel-serial

 Because Write Through use  Write No allocate ,  in case of cache miss, here we have to count only memory access time in the formula ( 0.2 * 100 ) where 0.2 = cache miss , 100 = main memory access time

1
1
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

64.3k questions

77.9k answers

244k comments

80.0k users