Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Exercises Explain the circumstances where one might be preferred o 2. Explain th

ID: 3756795 • Letter: E

Question

Exercises Explain the circumstances where one might be preferred o 2. Explain the function of the Page Map Table in the memo pare and contrast internal fragmentation and extern over the other. 1. Com allocation schemes described in this chapter. Explain your answer with examples frton oh that use a PMT. rames of 100 bytes each 3. If a program has 471 bytes and will be loaded into pa and the instruction to be used is at byte 132, answer the How many pages are needed to store the entire job? b. Compute the page number and the exact displacement for addresses where the data is stored. (Remember that pa each of the byt at zero). 4. Assume a program has 510 bytes and will be loaded into page frames of 256 bytes each, and the instruction to be used is at byte 377. Answer t following questions: a. How many pages are needed to store the entire job? b. Compute the page number and exact displacement for each of the byte he addresses where the data is stored.

Explanation / Answer

1. Difference between internal and external fragementation.

Whenever the memory is partitioned into fixed size internal fragementation is preferred over external as it can be easily solved using best fit technique. But in cases when we have huge contiguous memory external fragmentation occurs and can be avoided using paging technique.

2. Page Map Table is a data structure that is used to store the mapping between virtual memory(page) to physical memory(frame).

Paging is a technique that extensively uses Page Map Table to keep track of relation between page of a process and its corresponding frame number in the physical memory.

3. As the given program is 471 bytes in size and each given page frame is of size 100 bytes, we can use unitary method to solve this problem.

Since we can have only integer values for number of pages, we round up the answer to nearest integer.

a) Therefore the required number of pages = 471/100 = 4.71 = 5(round up).

b) Since each page is of size 100 byte we can see that a single page can hold only upto 100 bytes of data. So the byte 132 should be on the next page.

A simple observation leads to this formula:

address = (page frame size) * page number + displacement. (Page number starts fro 0 not 1).

132=(100)*1 + displacement

So displacement=32.

4. This problem is similar to previous problem.

Size of program= 510. Size of page frame=256

a) Number of pages required = 510/256 = 1.992 = 2(round up).

b) address = (page frame size) * page number + displacement.  (Page number starts fro 0 not 1).

Since 377>256 we are on page number 1.

So displacement = 377 - 256 = 121.

6. Sequence a,c,b,d,a,c,e,a,c,b,d,e.

Each time when a new request is made for the page, if it is not found in the page frames, we say it is a page fault. Above given sequnce is the page request sequence. Initially all three page frames are empty so there first request will be a miss.

Total 12 request.

Failure ratio = 10/12=0.833 Success ratio= 2/12 =0.166

b) Increasing 1 more page frame.

Failure Ratio = 8/12 = 0.66 Success Ratio = 4/12 =0.33

c) It can be observed that if we increase the number of page frames available, we can increase the success ratio and reduce the failure ratio of our process. As we can accomodate more and more previous request it further reduces the page miss chance hence improving hit ratio.

Internal Fragmentation External Fragmentation Occurs when memory is allocated in fixed partitions. Occurs whem memory is allocated in variable sized partition to the process dynamically. When the assigned memory is slightly larger than required it leaves a small gap causing internal frag. Whenever a process is removed from the memory it creates a gap causing external frag. Can be resolved by using variable partitions and best fit allocation technique. Can be resolved by Paging, Segmentation and Compaction.
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote