Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 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
Course

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

Written for

Institution
Course

Document information

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

Subjects

$5.26
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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
105
Member since
5 year
Number of followers
71
Documents
22
Last sold
1 month ago

3.5

13 reviews

5
3
4
4
3
4
2
1
1
1

Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right 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 aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions