Question
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 _____.
Official answer and solution
- Official answer
- 1.68
- From
- Official GATE 2014 answer key
Solution
Compute weighted average access times for reads and writes separately, then find the overall average memory access time across all 200 operations.
-
Operation Breakdown:
- Instruction fetch operations: (these are memory read operations).
- Memory operand read operations: .
- Total Read operations = .
- Memory operand write operations: .
- Total memory operations = .
-
Given Latencies and Hit Ratio ():
- Read operations:
- Hit latency = ns
- Miss latency = ns
- Average read latency: ns.
- Write operations:
- Hit latency = ns
- Miss latency = ns
- Average write latency: ns.
- Read operations:
-
Total Access Time for the Sequence:
-
Average Memory Access Time:
1.68
Treating instruction fetches separately or forgetting to count them as read operations.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 Computer Science and Information Technology (CS) Session 3
- Question
- 54 of 65, printed as CS Q.44
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.