Search code examples
memory-managementvirtual-memorypage-tables

Am I reading the virtual addresses correctly?


I have been given a page table for a system with 12-bit virtual ad physical addresses and 256-byte pages.

Say I am given an virtual address (in hexadecimal) that reads 0x3E5.

Am I reading this correctly by saying the first hexadecimal, in this case 3, is the page number and the other 2 hexadecimals are the offset?

This because the page sizes, 256-bytes, which is 2^8, meaning 8 bits are for the page size.


Solution

  • Yes, but only if it is a system with byte addressing. Otherwise, you would divide the page size (256 bytes) by the word size to determine the number of addresses within a page, log2 of which would give you the number of page offset bits.