retagged by
1,037 views
0 votes
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)
retagged by

1 Answer

2 votes
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.

 

                  

Related questions

0 votes
0 votes
1 answer
2
`JEET asked Jan 16, 2019
340 views
0 votes
0 votes
1 answer
3
aritrik7849 asked Nov 24, 2023
517 views
Find seek time using FCFS,SSTF, SCAN.C-SCAN, LOOK for the following string98, 183, 37, 122, 14, 124, 65, 67Assume that request queue (0-199).and Head pointer 53