The memory access time is 1 nanosecond for a read operation with a hit in…
2014
The memory access time is 1 nanosecond for a read operation with a hit in cache, 5 nanoseconds for a read operation with a miss in cache, 2 nanoseconds for a write operation with a hit in cache and 10 nanoseconds for a write operation with a miss in cache. Execution of a sequence of instructions involves 100 instruction fetch operations, 60 memory operand read operations and 40 memory operand write operations. The cache hit-ratio is 0.9. The average memory access time (in nanoseconds) in executing the sequence of instructions is __________.
Attempted by 74 students.
Show answer & explanation
Correct answer: 1.68
Key idea: compute the average time for reads and writes, multiply by their counts, sum, and divide by total accesses.
Average time for a read (instruction fetch and memory read): 0.9×1 ns + 0.1×5 ns = 1.4 ns.
Average time for a write: 0.9×2 ns + 0.1×10 ns = 2.8 ns.
Total accesses: 100 instruction fetches + 60 memory reads + 40 memory writes = 200 accesses.
Total time = 100×1.4 + 60×1.4 + 40×2.8 = 160×1.4 + 40×2.8 = 224 + 112 = 336 ns.
Average memory access time = 336 ns ÷ 200 accesses = 1.68 ns.
A video solution is available for this question — log in and enroll to watch it.