• retagged by
1,597 views
0 0 votes
Disk request come into disk driver for cylinders 5, 17, 60, 125, 28, 170, 8, 32. Total moves using SCAN algorithm when disk head is currently positioned at 35 and moving toward higher cylinder number________.(Disk system has 200 cylinders (0 - 199)

1 Answer

2 2 votes

SCAN algorithm : - it starts from given position and moves till the end and then changes its direction and starts moving towards the other end and keeps doing it until all requests are processed.

5,17,16,125,28,170,8,32.

first write the given request in ascending order and also add the position where the disk head is currently present(35), starting and ending of disk.

0, 5 , 8 , 16 , 17 , 28 , 32 , 35 ,125 , 170 , 199.

start from the current head location and move in the direction mentioned in the question(moving towards higher cylinder number)

 35 -> 125 -> 170 -> 199.

now head came to the end so it changes its direction and processes the remaining disk request.

199 -> 32 -> 28 -> 17 -> 16 -> 8 -> 5.

since 5 is the last disk request we don't need to move further.

so head in SCAN algo is moving like

 35 -> 125 -> 170 -> 199 -> 32 -> 28 -> 17 -> 16 -> 8 -> 5.

calculate difference between each consecutive digits.

|125 - 35| = 90

|125 - 170| = 45

|170-199| =  29

|199 -32 | = 167

|32 - 28 | =4

|28 -17| = 11

| 17-16 | =1

| 16 -8 | =8

| 5 -8 | =3.

add the difference

90+45+29+167+4+11+1+8+3 = 358 .....this is the total number of head movements required.

 

                  

Position:
Show:

Related questions

0 0 votes
0 0 answers
952
952 views
vijay_jr asked Nov 16, 2017
952 views
A disk has 8 equidistant tracks. The diameters of the innermost and outermost tracks are 1 cm and 8 cm respectively. The innermost track has a storage capacity of 10 MB.I...
0 0 votes
1 1 answer
955
955 views
`JEET asked Jan 16, 2019
955 views
0 0 votes
0 0 answers
2.1k
2.1k views
`JEET asked Jan 1, 2019
2,084 views
Consider the following grammar:S → XXX → bX → aX Where S and X are non-terminals and a, b are terminals. Which of the following can be the viable prefixes?aabSaaaaaSbcbaa...
1 1 vote
0 0 answers
1.2k
1.2k views
`JEET asked Dec 18, 2018
1,150 views
Compute the coefficient value of $ x^3 y^2z$ in the $(x-y+3z)^6$