1
votes

Assume a system with 6 bit virtual address and 16 byte pages per frame. The mapping of virtual page numbers to physical page of a process is:

Virtual Page       Physical Page
     0                   8
     1                   3
     2                   11
     3                   1

Translate the virtual address 40 (which is in decimal) to physical address in decimal.

From the 6 bit virtual address, I know there are 2^6 addresses in the virtual address space.

And there are 2^4 bytes pages per frame.

So there are (2^6)/(2^4) = 2^2 bytes to each address page and that means there is a 4 bit offset.

However, I do not know where to go on from there and use the table to translate the virtual address to physical address in decimal.

1

1 Answers

2
votes

40=0000000101000b

If we interpret this address for the VM 000.000010.1000b.
offset=1000b (4LSB)
virtual page number=000010 (6 next bits)

So virtual page number=2. If we look at the page table, we see that virtual page 2 maps to physical page 11=001011b

Hence physical address will be 00.001011.1000=8+16+32+128=184d