You are given the following information about a virtual memory system that emplo
ID: 3903500 • Letter: Y
Question
You are given the following information about a virtual memory system that employs both paging and segmentation in a two-level segmentation with paging fashion:
• Logical addresses have the form (s1, s2, p, d), where |s1|, |s2|, |p|, and |d| denote the length (in bits) of each of the four address component;
• Logical address size is 32 bits;
• Page size is 512 Bytes;
• A page table occupies one page.
(a) What is the value of |d|?
(b) What is the maximum number of pages per segment and what is the corresponding value of |p|?
(c) using the values of |p| and |d| determined above, which of the two following choices for |s1| and |s2|? Explain.
i. |s1| = |d| and s2 = 32 ? |s1| ? |p| ? |d| OR ii. |s2| = |d| and s1 = 32 ? |s2| ? |p| ? |d|
(d) Would either of the two choices above result in a larger virtual address space? Explain.
Explanation / Answer
Ans) (a) Value of |d|= 9, since the page size is 512= 29.
(b)The limit on this value comes from the requirement that a page table consume no more than one page. Since a page table entry consumes one word (there's a lot of wasted bits here!), a page table can cover up to 512 pages. Hence, |p| is also 9.
(c) Substituting, we have either |s1| = 9 and |s2| = n - 18 or |s1| = n - 18 and |s2| = 9. Thus, n must be at least 19. If n = 27 then the question is trivial: both fields have length 9, and so neither is preferable. If n != 18 then the question reduces to is it better to have |s1| larger than |s2| or not? and we instantiate the choice of rules above depending on the answer to this question and whether n is at least 20 or not.
In either case, there will be one segment table with a maximum size of 2|s1|words and 2|s1| second level segment tables, each of a maximum size of 2|s2| words. Hence, the maximum space that can be consumed by segment tables is 2|s1| + 2|s1| + |s2|. With no other information to go on, choosing a smaller |s1| results in less physical memory being devoted to segment tables.
One can imagine, however, a management scheme in which one had more first level segments, each devoted to a process. If a process never requires more than 2|s2|+|p|+|d| words of virtual memory, this scheme simplifies page and segment table management.
d) Neither choice, of course, will result in a larger virtual address space: in either case, there are 2n addressable words.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.