0% found this document useful (0 votes)
131 views2 pages

Tutorial 8 Sol

The document discusses memory allocation algorithms and paged memory references. It provides examples of how the First-Fit, Best-Fit, and Worst-Fit algorithms would allocate memory partitions of varying sizes to processes. It determines that Best-Fit is most efficient. It also explains that a paged memory reference takes 400 nanoseconds, with 200 nanoseconds to access the page table and another 200 for the word in memory. Finally, it shows how to translate a relative address to an absolute address using segment tables.

Uploaded by

akash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views2 pages

Tutorial 8 Sol

The document discusses memory allocation algorithms and paged memory references. It provides examples of how the First-Fit, Best-Fit, and Worst-Fit algorithms would allocate memory partitions of varying sizes to processes. It determines that Best-Fit is most efficient. It also explains that a paged memory reference takes 400 nanoseconds, with 200 nanoseconds to access the page table and another 200 for the word in memory. Finally, it shows how to translate a relative address to an absolute address using segment tables.

Uploaded by

akash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

King Saud University

College of Applied Studies and Community Service


Bachelor of Applied Computing
(GC310): Applied Operating Systems
Tutorial # 8

1. Given memory partitions of 100K, 500K, 200K, 300K, and 600K (in order),
how would each of the First-fit, Best-fit, and Worst-fit algorithms place
processes of 212K, 417K, 112K, and 426K (in order)? Which algorithm
makes the most efficient use of memory?

Solution:

First-Fit:
212K is put in 500K partition.
417K is put in 600K partition.
112K is put in 288K partition (new partition 288K = 500K - 212K).
426K must wait.

Best-Fit:
212K is put in 300K partition.
417K is put in 500K partition.
112K is put in 200K partition.
426K is put in 600K partition.

Worst-Fit:
212K is put in 600K partition.
417K is put in 500K partition.
112K is put in 388K partition.
426K must wait.

In this example, Best-Fit turns out to be the best.

2. Consider a paging system with the page table stored in memory. If a


memory reference takes 200 nanoseconds, how long does a paged
memory reference take?

Solution:
A paged memory reference would take 400 nanoseconds; 200 nanoseconds to access
the page table and 200 nanoseconds to access the word in memory.

1
King Saud University

College of Applied Studies and Community Service


Bachelor of Applied Computing
(GC310): Applied Operating Systems
Tutorial # 8

3. Assume a program P1 is loaded into memory with the following SMT:

Translate the address (1,50) to an absolute address.


Solution:

<#segment, Offset> <1, 50>


offset is less than limit 50 < 8000 (OK)
<base, offset> <2000 , 50> 2000 + 50 = 2050.

You might also like