linuxmemorymemory-managementpagingmemory-fragmentation

How many bits required for page frame number on 32-bit system with 2^20 Bytes physical memory and 4KB page size?


How many bits required for page frame number on 32-bit system with 2^20 Bytes physical memory and 4KB page size?

is it 11 bits??

Need an answer please help! Thank you.


Solution

  • If your page size is 4K, then that means the page frame number must specify all but the low 12 bits of the page address (4K == 2^12). So, in a 32-bit system, the page frame number will generally specify the upper 20 bits (32 - 12).

    Strictly speaking since you only have 2^20 bytes of total memory, the lowest 8 (20 - 12) of those is sufficient to unambiguously define which page is being referenced, but it's likely that your system is designed to support more than 2^20.