homework-9 Version 0 |
|
👤 Author: by 1756894282qqcom 2020-12-15 05:40:06 |
The function of page table is to realize the address mapping from page number to physical block number.
The physical block number of the page is obtained by retrieving the page table with the page number of the logical address, and the in page address is directly sent into the block address field of the physical address register. In this way, the physical block number and the address in the block are spliced into the address of the actual access memory, thus completing the conversion from the logical address to the physical address
Logical address = page number + in page address
Physical address = block number + in page address
The examples are as follows:
The user programming space of a virtual memory is 32 pages, each page is 1KB, and the memory is 16kb. Suppose that the page number and physical block number of pages transferred into memory in a user page table at a certain time are as follows:
Page number physical block number
03
17
2 11
38
What is the physical address corresponding to the logical address 0a5c (H)? Requirements: write the main calculation process.
Problem solving process:
First of all, we should know that the logical address of page storage management is divided into two parts: page number and page address. The physical address is divided into two parts:
The relationship is as follows:
Logical address = page number + in page address
Physical address = block number + page address; search
Analysis question: (find out the page number. Block number and page address are the key)
It is known that: there are 32 pages in the user programming space, 2 ˆ 5 = 32. It is known that the part of page number occupies 5 bits. From "1KB per page", 1K = 210, it can be seen that the address in the page accounts for 10 bits.
According to "memory is 16kb", 2 ^ 4 = 16, the block number occupies 4 bits.
The binary representation of the logical address 0a5c (H) is as follows:
000010 1001011100, the last ten digits 1001011100 are the in page address,
The first five digits are 00010 as page number and page number into decimal system is 2. Find out the physical block number corresponding to 2 in the cross reference table is 11, and 11 is converted to 1011, then the physical address is 10111001011100, which is converted into hexadecimal 2e5c;
In other words, the physical address corresponding to the logical address 0a5c (H) is 2e5c