0

I need to find how many hierarchical levels is in hierarchical paging, based on this data:

64-bit computer system that uses pure paging with 16KB page size, if each page table entry is 4 bytes long. Assume that 2-level of hierarchy corresponds to an outer page table and an inner page table

I based my calculation on this question: Multi-level page tables - hierarchical paging . But in the end I get 1 level of hierarchy! It can't be true. Just 1 level. I did this:

Find all entries in 1 page Page size/ entry size = 2^50/2^5 = 2^45 entries in the each page. To address it we need 45 bits. Total number of bit to encode entry is 64 bits. So we need 64/45. It is around 1 and something.

What am I doing wrong?

Community
  • 1
  • 1
Ophelia
  • 549
  • 1
  • 5
  • 26

2 Answers2

0

So just following what was mentioned on that link 16KB pages need 14 bits to represent (log16*1024) entries in one page table = 16*1024/4 = 4096 need 12 bits (log 4096) address space is 64, so subtract page offset bits (64 - 14 = 50) 50 / 12 = 4.16666667 round up = 5. Hope it helps

0

Since your page size if 16KB (or 2^14) and each entry is 4 bytes(2^2), one page can store maximum 2^12 physical address. Thus, you can have 12 bits at 2nd paging level, effectively giving you a combination as <38,12,14>. And you can on as long as you can't further break down. So here it will be <26,12,12,14>. The common mistake people make here is forget that the 2nd paging level tells the offset within a page which gives a physical address.

uzumas
  • 632
  • 1
  • 8
  • 23