100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Summary Cos3721 Assignment 03 assignment solutions $4.95   Add to cart

Summary

Summary Cos3721 Assignment 03 assignment solutions

 28 views  7 purchases
  • Course
  • Institution

100% pass Assignment 03 2023

Preview 2 out of 7  pages

  • August 10, 2023
  • 7
  • 2023/2024
  • Summary
avatar-seller
Operating Systems and Architecture
COS3721


Assignment 3 [Total marks 50]
Important note:

Please note that the questions are based on the exercises in the prescribed textbook but,

are not the necessary the same. So, if you do the exercises in the textbook, you will not

have the same answers and your work will not be given any mark.



Question 1- (based on 11.12 and 11.15, p.526) [25]

(Ex0 11.12, p.526): Suppose that a disk drive has 4000 cylinders, numbered 0 to 3,999. The

drive is currently serving a request at cylinder 1,150, and the previous request was at cylinder

1,805. The queue of pending requests, in FIFO order, is:

2,069; 1,212; 2,296; 2,800; 544; 1,618; 356; 1,523; 3,965; 3,681

Starting from the current head position, what is the total distance (in cylinders) that the disk arm

moves to satisfy all the pending requests for each of the following disk-scheduling algorithms?

a. FCFS (5)

b. SCAN (5)

c. C-SCAN (5)



~ calculate the distance traveled for each request and then sum up these distances to get the total
distance.



Given:

- Current position: 1,150

- Previous request position: 1,805

- Pending requests: 2,069; 1,212; 2,296; 2,800; 544; 1,618; 356; 1,523; 3,965; 3,681

- Total number of cylinders: 4,000



a. FCFS (First-Come, First-Served):

, In FCFS, the requests are served in the order they were received.



Total distance = Sum of absolute differences between consecutive request positions



1,150 -> 2,069 = 919

2,069 -> 1,212 = 857

1,212 -> 2,296 = 1,084

2,296 -> 2,800 = 504

2,800 -> 544 = 2,256

544 -> 1,618 = 1,074

1,618 -> 356 = 1,262

356 -> 1,523 = 1,167

1,523 -> 3,965 = 2,442

3,965 -> 3,681 = 284



Total distance = 919 + 857 + 1,084 + 504 + 2,256 + 1,074 + 1,262 + 1,167 + 2,442 + 284 = 12,909



b. SCAN (Elevator):

In SCAN, the arm moves in one direction (either towards the end or towards the beginning) until it
reaches the end of the disk, and then it reverses direction.



Total distance = Sum of distances within the current direction + Distance to the end + Distance to the
last request



1,150 -> 3,999 = 2,849 (towards the end)

3,999 -> 3,681 = 318 (reversing direction)

3,681 -> 356 = 3,325 (reversing direction)

356 -> 544 = 188 (reversing direction)

544 -> 1,212 = 668 (reversing direction)



Total distance = 2,849 + 318 + 3,325 + 188 + 668 = 7,348

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller elenaprowriter. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $4.95. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

79789 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$4.95  7x  sold
  • (0)
  Add to cart