A processor uses page tables for virtual to physical address translation. Page tables for both levels are stored in the main memory. Virtual and physical addresses are both bits wide. The memory is byte addressable. For virtual to physical address translation, the most significant bits of the virtual address are used as index into the first level page table while the next bits are used as index into the second level page table. The least significant bits of the virtual address are used as offset within the page. Assume that the page table entries in both levels of page tables are bytes wide. Further, the processor has a translation look-aside buffer (TLB), with a hit rate of . The TLB caches recently used virtual page numbers and the corresponding physical page numbers. The processor also has a physically addressed cache with a hit rate of . Main memory access time is ns, cache access time is ns, and TLB access time is also ns.
Assuming that no page faults occur, the average time taken to access a virtual address is approximately (to the nearest ns)
View worked solution
Answer: D
To find the average memory access time, we analyze the two possible scenarios based on the TLB lookup:
- Scenario 1: TLB Hit (Probability = )
The physical address is obtained directly from the TLB. We then access the physically addressed cache:
- Cache Hit (Probability = ): Time taken = .
- Cache Miss (Probability = ): Time taken = .
Average time for TLB Hit () = .
- Scenario 2: TLB Miss (Probability = )
We must perform a 2-level page table translation. Since both levels are stored in the main memory, we access them sequentially:
- First-level page table access =
- Second-level page table access =
After obtaining the physical address, we access the cache/memory for the actual data:
- Cache Hit (Probability = ): Time taken = .
- Cache Miss (Probability = ): Time taken = .
Average time for TLB Miss () = .
Overall Average Access Time:
Rounding to the nearest gives .
Free practice · Your answers on this page are not saved.
