简体   繁体   中英

Virtual Memory To Physical Translation?

My book had the following image:

在此处输入图片说明

And a question of how many PTE's are there in L2 (or L1), the answer was 16 = 2^4 but why is that?

In the question it's given that each PTE size is 2 bytes so the answer should be 2^4/2 = 8 Since L2 index holds where we will point to. For example if it's 2 then it point to second half of the first PTE and not the second PTE.

What am I missing here?

You are overthinking. There are 4 bits used to index the L1 page table entry, so there are 2^4 possible values for this index and thus 2^4 possible page tables entries.

The size of a page table entry is not relevant to this question. It is asking "how many", not "how large".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM