Understanding TLB and Effective Memory Access Time (EMAT) – Explained Simply

In computer systems, the Translation Lookaside Buffer (TLB) plays a crucial role in speeding up memory access. But how does it work, and how is the Effective Memory Access Time (EMAT) calculated? Let’s break it down in simple terms, just like a 10th-grade explanation, and derive the formula step by step.
What is TLB?
The Translation Lookaside Buffer (TLB) is a special cache used by the CPU to store recently used page table entries. It helps reduce the time needed to translate virtual addresses to physical addresses. Without TLB, the CPU would have to access the main memory (RAM) every time it needs to translate an address, which is slow.
What is EMAT?
Effective Memory Access Time (EMAT) is the average time it takes for the CPU to access memory, considering both TLB hits and misses. It’s a weighted average of the time taken when the TLB finds the address (hit) and when it doesn’t (miss).
Step-by-Step Explanation
The TLB (Translation Lookaside Buffer) helps speed up the memory lookup process by storing frequently used page table entries. The Effective Memory Access Time (EMAT) depends on whether the page is found in the TLB or not.
Case 1: TLB Hit
If the page is found in the TLB:
- The TLB is accessed, which takes tTLB time.
- The required memory is accessed, which takes tMemory time.
Total time for a TLB hit:
Case 2: TLB Miss
If the page is not found in the TLB:
- The TLB is accessed, which takes tTLB time.
- The page table in memory is accessed, which takes another tMemory time.
- After finding the entry in the page table, the required memory is accessed again, which takes another tMemory time.
Total time for a TLB miss:
Combining Hits and Misses
The overall EMAT depends on the hit rate H (percentage of time the page is found in the TLB):
- For H percent of the time, the system uses the time for a hit.
- For (1 – H) percent of the time, the system uses the time for a miss.
Formula:
Substituting Values
Now substitute the values for tHit and tMiss:
Conclusion
This is how the formula for EMAT is derived, taking into account both TLB hits and misses, weighted by their respective probabilities.