Prev | Current Page 315 | Next

Carl Reynolds and Paul Tymann

"Schaum's Outline of Principles of Computer Science"

The offset within
the page is given by the low-order 12 bits as 2112 (the sum of 2048 and 64 from bits 11 and 6; remember, the
first bit is bit 0). Multiplying the page number (2) by the page size (4096) gives 8192, and adding the offset of
2112 gives 10304, the original address. Isn??™t that clever?
Now imagine how this works with a page table. The page address becomes an index into the page table.
The entry in the page table contains the physical frame number. The system simply substitutes the contents
of the page table entry, which is the physical frame number, for the page field of the address, and the result is
a complete physical address.
Suppose that the frame allocated for page 2 (the third page) of the process is frame 9. The page table entry
for page 2 would be the following (remember, there are only 20 bits for the frame address):
00000000 00000000 1001
Now the memory reference to location 10304 will result in the frame address of 9 being substituted
for the page address of 2, and the resulting physical address will be this address, which is located in
frame 9:
00000000 00000000 10011000 01000000
The physical address is 38976, in the 10th frame (again, the first frame is frame 0). Figure 6-1 shows
a representation of the page table for a process.


Pages:
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
gadżety reklamowe kredyt samochodowy swinoujscie spa nad morzem Ustawy Nr8