We looked at how the page table is used to map virtual addresses to physical addresses. We saw that the PDP-11 had the following address format:
That's 3 bits for the page number (hence 23 = 8 pages), and 13 bits for the offset into the page (hence 213 = 8192 memory words per page).
So, let's assume that the page table for one particular process looks like this:
<3, 16, 7, 4, 12, X, X, X, 0>
That is, page 0 maps to frame 3, page 1 maps to frame 16, page 2 maps to frame 7... and so on. Implicit in this example is the fact that the physical memory is actually larger than the virtual address space. In fact, the PDP-11 had up to 4MB of physical memory, requiring a 22-bit physical address space:
Now, let us map address 4C0616, using the page table above. First we represent 4C06 in binary:
0100 1100 0000 0110
The page number, the top 3 bits of the address (highlighted above), are 010, (binary for 2). In the page table above, page 2 maps to frame 7. 710 = 1112, so we can write the physical address as:
00 0000 1110 1100 0000 0110
(Remember that the physical address is 22 bits wide.) Note that the offset remains exactly the same.
Converting back into hex, this is address 00EC0616.
If you'd prefer decimal, the example above mapped virtual address 1946210 to physical address 6042210---but hex and binary are a lot easier to work with when we're fiddling with bits in this way.