Main Memory Template
Assuming a 1-KB page size, indicate the page numbers and offsets for the following address references (provided as decimal numbers) in the table below:
Address Reference Page Offset
Consider a logical address space of 256 pages with a 4-KB page size, mapped onto a physical memory of 64 frames.
How many bits are required in the logical address? Explain how you arrived at this solution.
How many bits are required in the physical address? Explain how you arrived at this solution.
Consider the following segment table:
Segment Base Length
0 219 600
1 2300 14
2 90 100
3 1327 580
4 1952 96
What are the physical addresses for the following logical addresses?
Logical Addresses Physical Addresses
Consider a paging system with the page table stored in memory.
If a memory reference takes 50 nanoseconds, how long does a paged memory reference take? Explain how you arrived at this solution.
If we add TLBs, and 75 percent of all page-table references are found in the TLBs, what is the effective memory reference time? (Assume that finding a page-table entry in the TLBs takes 2 nanoseconds, if the entry is present.) You must show your calculations to receive full credit.
5. Given six memory partitions of 300 KB, 600 KB, 350 KB, 200 KB, 750 KB, and 125 KB (in order), how would the ﬁrst-ﬁt, best-ﬁt, and worst-ﬁt algorithms place processes of size 115 KB, 500 KB, 358 KB, 200 KB, and 375 KB (in order)? First-fit is already done for you as an example.
115 KB is put in 300 KB partition, leaving (185 KB, 600 KB, 350 KB, 200 KB, 750 KB, 125 KB)
500 KB is put in 600 KB partition, leaving (185 KB, 100 KB, 350 KB, 200 KB, 750 KB, 125 KB)
358 KB is put in 750 KB partition, leaving (185 KB, 100 KB, 350 KB, 200 KB, 392 KB, 125 KB)
200 KB is put in 350 KB partition, leaving (185 KB, 100 KB, 150 KB, 200 KB, 392 KB, 125 KB)
375 KB is put in 392 KB partition, leaving (185 KB, 100 KB, 150 KB, 200 KB, 17KB, 125 KB)
d. Rank the algorithms in terms of how efﬁciently they use memory. Explain how and why you ranked them as you did.
6. In a minimum of 100 words, explain the difference between internal and external fragmentation.
7. In a minimum of 100 words, compare the memory organization schemes of contiguous memory allocation, pure segmentation, and pure paging with respect to the following issues:
a. External fragmentation
b. Internal fragmentation
c. Ability to share code across processes