The understanding of TLB

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.