Q1. Explain Translation Look Aside Buffer (TLB).
Ans.Translation look aside buffer is a special, small, fast-lookup hardware cache. The TLB is associative, high-speed memory. Each entry in the TLB consists of two parts:
A key (or tag) and
When the associative memory is presented with an item, the item is compared with all keys simultaneously. If the item is found, the corresponding value filed is returned. The search is fast, the hardware, however, is expensive. Typically, the number of entries in a TLB is small, often numbering between 64 and 1,024.
The TLB is used with page tables in the following way. The TLB contains only a few of the page table entries. When a logical address is generated by the CPU, its page number is found, its frame number is immediately available and is used to access memory. The whole task may takes less than 10 percent longer than it would if an unmapped memory reference were used.
If the page number is not in the TLB (known as a TLB miss), a memory reference to the page table must be made. When the frame number is obtained, we can use it to access memory. In addition, we add the page number and frame number to the TLB, so that they will be found quickly on the next reference. If the TLB is already full of entries, the operating system must select one for replacement.
Figure: Paging hardware with TLB