Answer: 1.68
To find the average memory access time (AMAT) for the given sequence of instructions, we first categorize the operations into Read and Write operations.
1. Categorizing the Operations
- Instruction Fetch: This is a read operation.
Number of instruction fetches = 100
- Memory Operand Read: This is a read operation.
Number of operand reads = 60
- Memory Operand Write: This is a write operation.
Number of operand writes = 40
Thus, we have:
- Total Read Operations (NR): 100+60=160
- Total Write Operations (NW): 40
- Total Operations (Ntotal): 160+40=200
2. Calculating Average Access Times
Given the cache hit ratio (h) is 0.9, the miss ratio (m) is 1−0.9=0.1.
Average Read Access Time (TR):
TR=(h×TR,hit)+(m×TR,miss)
TR=(0.9×1 ns)+(0.1×5 ns)=0.9+0.5=1.4 ns
Average Write Access Time (TW):
TW=(h×TW,hit)+(m×TW,miss)
TW=(0.9×2 ns)+(0.1×10 ns)=1.8+1.0=2.8 ns
3. Calculating Overall Average Memory Access Time (AMAT)
AMAT=Ntotal(NR×TR)+(NW×TW)
AMAT=200(160×1.4)+(40×2.8)
AMAT=200224+112=200336=1.68 ns