retagged by
1,503 views
1 votes
1 votes
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$.
retagged by

2 Answers

Best answer
9 votes
9 votes

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 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?

Answer:

Related questions