The address structure of the analysis page storage management is one-dimensional, that is, the logical address (or physical address) is represented by only one numeric value. Given the logical address A, the size of the page is L, the page number p and the page address D can be evaluated as follows:
p=int [a/l]d=a MoD L
where int is the rounding function (the integer part of the numeric value), the MoD is the remainder function (the remainder part of the value is taken).
The purpose of a page table is to implement address mappings from page numbers to physical block numbers. Retrieves the page table with the page number of the logical address, obtains the physical block number of the page, and feeds the in-page address D directly into the in-block address field of the Physical address register. This allows the physical block number and the intra-block address to be spliced into the actual memory address, thus completing the conversion from the logical address to the physical address.
So the physical address is calculated as:
Physical Address = the size of the block (that is, the size of the page L)-block number f+ in the page address D
Example: In a paging storage management system, the page table for a job is shown below. If the page size is known to be 1024 bytes, try converting the logical address 1011,2148,4000,5012 to the corresponding physical address.
Page number |
Block number |
0 1 2 3 |
2 3 1 6 |
Jiuben, in order to describe the convenience, set the page number is P, the page displacement is D, then:
(1) For logical address 1011,p=int (1011/1024) =0,d=1011 mod 1024=1011. Page No. 0 on page 2nd, so the physical address is 1024′2+1011=3059.
(2) for logical address 2148,p=int (2148/1024) =2,d=2148 mod 1024=100. Page 2nd on page 1th, so the physical address is 1024+100=1124.
(3) For logical address 4000,p=int (4000/1024) =3,d=4000 mod 1024=928. Page 3rd on page 6th, so the physical address is 1024′6+928=7072.
(4) For logical address 5012,p=int (5012/1024) =4,d=5012 mod 1024=916. The logical address is illegal because the page number exceeds the page table length.