Answer: 155:156
To find the Average Memory Access Time (AMAT), we analyze the two primary cases based on the TLB hit ratio (h=0.95):
- Case 1: TLB Hit (Probability = 0.95)
The translation is found in the TLB, and then the main memory is accessed for the data.
Timehit=Ttlb+Tm=20+100=120 ns
- Case 2: TLB Miss (Probability = 0.05)
The page table in main memory must be accessed first (Ttlb+Tm=120 ns). Then, we check if the page is present in main memory:
- Page Hit (Probability = 0.90): The page is in memory. We access the data directly.
Timemiss, hit=(Ttlb+Tm)+Tm=120+100=220 ns
- Page Fault (Probability = 0.10): The page must be fetched from disk.
- With 20% probability, a dirty page is written back and the new page is read: 5000+5000=10000 ns.
- With 80% probability, only the new page is read: 5000 ns.
- Average Page Fault Service Time (Tpf) = 0.20×10000+0.80×5000=6000 ns.
After servicing the fault, the data is accessed in memory (Tm=100 ns).
Timemiss, fault=(Ttlb+Tm)+Tpf+Tm=120+6000+100=6220 ns
Average Timemiss=0.90×220+0.10×6220=198+622=820 ns
Now, we calculate the overall AMAT:
AMAT=0.95×Timehit+0.05×Average Timemiss
AMAT=0.95×120+0.05×820=114+41=155 ns
Thus, the average memory access time is 155 ns (which lies in the range 155 to 156).