100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Summary

Summary Cos3721 Assignment 03 assignment solutions

Rating
-
Sold
7
Pages
7
Uploaded on
10-08-2023
Written in
2023/2024

100% pass Assignment 03 2023

Institution
Module









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Module

Document information

Uploaded on
August 10, 2023
Number of pages
7
Written in
2023/2024
Type
Summary

Subjects

Content preview

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

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
elenaprowriter University of South Africa (Unisa)
Follow You need to be logged in order to follow users or courses
Sold
101
Member since
4 year
Number of followers
70
Documents
20
Last sold
2 months ago

3.5

13 reviews

5
3
4
4
3
4
2
1
1
1

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions