A two-level page table is created to enable paging for a 4GB logical address spa
ID: 3823371 • Letter: A
Question
A two-level page table is created to enable paging for a 4GB logical address space. In this scheme, the page size is 4 KB, and each page table entry has a size of 4 bytes. The root page table can fit in a single 4 KB page. a. How much memory space is needed in total for this two-level page table? b. Assume you want to implement a hashed page table for the same addressing scheme, using a hash function that maps the 20-bit page number into a 12-bit hash value. The table entry has a size of 8 bytes, containing the page number, the frame number, and a chain pointer. How much memory space does the hashed page table take? Compared to the two-level page table, how much memory space has been saved with the hashed page table? c. Suppose that the page size and the size of page table entries stay the same, how many levels of page tables would be required to map a 64-bit address space, if the top-level page table still needs to fit into a single page?Explanation / Answer
1>>>
The page table needs one section for each page. Expecting a 4GB (2^32 byte) virtual and physical address space and a page size of 4kB (2^12 bytes), we see that the 2^32 byte address space must be part into 2^20 pages. This implies the page table must have 2^20 sections. How expansive are the passages? Every passage contains an edge number. Since there are 2^32 physical locations partitioned into edges of size 2^12 (edge measure = page estimate), we see that there are 2^20 edges, so we require 20 bits to store the edge number.
We likewise require some additional bits: since pages might be swapped out to circle, we require a legitimate piece in the page table passage to show whether the page is substantial (i.e. right now introduce in memory) or not. We can likewise store a grimy piece so we can abstain from composing pages back to circle on the off chance that we have to swap them out. To bolster division (examined beneath), we can likewise store read, compose, and execute authorization bits. This gives a sum of 25 bits for each passage. The math is considerably simpler in the event that we round to bytes: every passage is 4 bytes. Along these lines the aggregate size of the page table is 2^20 sections * 2^2 bytes/passage = 2^22 bytes = 4MB.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.