The TLB, of course, also has an individual called the Lenovo Register, which is used to store a small part of the page table. This macro-angle is not difficult to understand the truth, but how to use, the process needs a good reason.
Normally, a page table item is divided into two parts, the high part is the virtual page number, the lower part is the corresponding physical page number, sometimes called its page frame number.
The TLB is mainly for this virtual page number of the fuss, and the page frame number is the same anyway, so you can analogy to the cache in the page address.
On the other hand, the background knowledge of TLB is the front of all-connected technology and group-connected technology, specific problems and specific analysis.
If the TLB is not grouped, then regardless of the other tag bits, such as a valid bit, just how to match the virtual page number. In fact, very concise, just higher than the number of pages can be. That is: Take a virtual address, calculate the virtual page number directly after the same number of bits compared to the TLB.
And after the group of TLB, the number of virtual page number is not equal, why? Because the low (higher than the page frame number) is assigned several positions to represent the group number. In this way, a group can store several page table entries, which means that the top of the page table items in this group is the same.
This is all the basic knowledge of mathematics. In summary, given a binary or hexadecimal virtual address, it is easy to calculate the virtual page number, to investigate the TLB is not in the time, first look at the TLB is divided into several groups, calculated with a few to do the group number, remove the virtual page number of the same number of low-level, this is the page table item mark, go to compare with the TLB If there is a TLB, there is no TLB.
For example, a virtual page number is 024h,tlb divided into two groups, that is, with one expression. 024H = 0000,0010,0100b, a total of 12 bits. What is the TLB tag for this virtual page number? Ha, remove the lowest bit one, the rest is the **0000,0010,010**b, this number converted into 16 binary. 012h!
So see the TLB in a 012H, dare not think found.
Of course, the premise is to understand the logic behind this.