How to calculate page table size?

前端 未结 3 1512
南方客
南方客 2021-02-01 07:41

Given : 64 bit virtual byte address, 16 KB pages, 32-bit physical byte address.

What is the total size of page table on this machine, assuming that the valid, protectio

3条回答
  •  悲哀的现实
    2021-02-01 08:07

    You have a 16 KB page size = 2^14, therefore you need 14 bits for the page offset. Out of the 64 bit virtual address, if you take out this offset, you'll be left with 50 bits. This implies that you have 2^50 entries in your page table.

    Further, since your physical address is 32 bits, and the offset makes up 14 bits out of this 32 bits, you are left with the 18 bits that has to come from the page table.

    Out of these 18 bits, 4 bits are your valid, use, etc.

    Anyway, the per entry, the bits used = 18

    Total memory for the page table (this is per process, so you'd have to multiply it by the number of processes if that's specified) = 2^50 * 18 bits

提交回复
热议问题