-
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 __________.
-
- 1.68
- 1.1
- 7.12
- None of the above
Correct Option: A
Total instructions = 100 instruction fetch operation + 60 memory operant read operation + 40 operant write operation Therefore, total of 200 instructions
Time taken for fetching 100 instructions (equivalent to read)
= 90 × 1ns + 10 × 5ns = 140ns
Memory operand Read operations = 90%(60) × 1ns + 10% (60) × 5ns
= 54ns + 30ns = 84ms
Memory operands write operation time = 90%(40) × 2 ns + 10%(40) × 10 ns
= 72ns + 40ns = 112ns
Total time taken for executing 200 instructions = 140 + 84 + 112 = 336 ns
∴ Average memory access time = | = 1.68 ns | |
200 |