-
The read access times and the hit ratios for different caches in a memory hierarchy are as given below.
Cache Read access time(in nanoseconds) Hit ratio
I-cache 2 0.8
D-cache 2 0.9
L2-cache 8 0.9
The read access time of main memory is 90 nanoseconds. Assume that the caches use the referred- word-first read policy and the write back policy. Assume that all the caches are direct mapped caches. Assume that the dirty bit is always 0 for all the blocks in the caches. In execution of a program. 60% of memory reads are for instruction fetch and 40% are for memory operand fetch. The average read access time in nanoseconds (up to 2 decimal places) is ________.
-
- 2.72
- 4.1
- 7.2
- 4.72
Correct Option: D
As given table is :
Read access time of Main memory is = 90
Hit ratio of Main memory is = 1.0
So, average read time is :
(Fraction of Instruction fetch * Average Instruction Fetch time + Frection of Data Fetch * Average Data fetch time).
So, First find out the average Instruction fetch time :
= (L1 acess time + L1 miss Rate * L2 access time + L1 miss rate* L2 miss rate * Memory Access time)
= (2 + 0.2 * 8 + 0.2 * 0.1 * 90) = 5.4 ns.
Average Data fetch Time = (L1 access time + L1 miss rate + L2 access time + L1 miss rate * L2 miss rate * memory access time)
= (2 + 0.1 * 8 + 0.1 * 0.1 * 90) = 3.7 ns.
So, Avg memory access time = (0.6 * 5.4 + 0.4 * 3.7) = 4.72 n sec.
Hence 4.72 is correct answer.