You first work out what virtual page that address belongs to, the offset from that virtual page, and then use your page table to look up the equivalent physical address.
Assuming the virtual address space is linear with no holes, the conversion from address to page can be done by dividing by the page size (512 in your case).
The offset within the page is the difference between the virtual address and the virtual page start address.
In the example above, the virtual page would be page 3, with an offset of 213.
You then look up the physical page that corresponds to virtual page 3 in your page table. Here, it is x
. So the physical address would be (physical address of the start of page x
+ offset into the page), i.e. (start of page X)+213.
The start of page X, again assuming linear mapping with no holes would be (pages size * x
).
So the physical address would be:
(page_size * x) + offset
Here:
(512 * x) + 213