A1: solution to written question ------------------------------------------------------------------------ Notes regarding marking and alternative solutions: * No rotational delay was calculated between tracks in the same cylinder, under the implicit assumption that the sectors would have been properly staggered as the cylinder were being filled. But since this assumption was not explicitly stated, solutions in which rotational delays incurr between tracks in the same cylinder are equally acceptable. * if you wrote correct formulas, but made small computation mistakes, you would have no discount. ------------------------------------------------------------------------ Each track holds 100 records. Each cylinder holds 400 records. Number of full cylinders required to store the file = 4000 Number of full tracks required to store the file = 16000 Time to read a record randomly = average seek time + average rotational delay + transfer time for 1 sector = 12 msec + 6 msec + 12/50 msec = 18.24 msec 1a) positioning to first cylinder = =average seek time + average rotational delay=12+6=18msec moving between cylinders = = track-to-track seek time = 1 msec transfer time to read each cylinder = 48 msec time to read file sequentially= =18 msec + 3999*1 msec + 4000*48 msec= 196.017 sec 1b) avg time to read random record within the file = 18.24 msec (approx) avg time to read file in random order = 1,600,000 * 18.24 msec = 29,184 sec 2a) avg time to read each cylinder in sequential order = = average seek time + average rotational delay + transfer time for cylinder = = 12 msec + 6 msec + 48 msec = 66 msec total time for all cylinders = 4,000*66 msec= 264 sec 2b) avg time to read random record within the file = 18.24 msec avg time to read file in random order = 1,600,000 * 18.24 msec = 29,184 sec 3a) avg time to read each track in sequential order = = average seek time + average rotational delay + transfer time for track = = 12 msec + 6 msec + 12 msec = 30 msec total time for all tracks = 16000*30msec = 480 sec 3b) same as 2b. 4a) avg time to read each sector in sequential order (for randomly dispersed sectors)= = avg time to read a random sector in disk = 18.24 msec Number of sectors used in the file = #records in file/#records per sector= = 1,600,000/2 = 800,000. Total time to read all sectors sequentially=800,000*18.24msec=14,592 sec 4b) same as 2b. 5) In this case, the file fits completely into 2 cylinders or 8 tracks. All cases would change for the following reasons. Moving randomly among 2 cylinders would incur seek time in only half of the cases (in the previous case it would be incurred in 3,999/4,000 of the cases which was approximated to 100\%); similarly, for tracks randomly dispersed only 7/8 of the cases would incurr seek time. In addition, jumping randomly among 2 contiguous cylinders in the case of 1) would incurr at most 1msec (track-to-track seek time), while before we were randomly jumping between 4,000 out of 4,092 cylinders which would incurr approximately 6 msec - the average seek time. The case in which calculations change the most is 1) avg time to read random record within THE FILE = = time to read the first sector + + 799/2*(time to read a sector in other cylinder)+ + 799/2*(time to read a sector in the same cylinder)= = time to read the first sector + 799/2*(track-to-track seek time + average rotational delay+transfer time for sector)+ + 799/2*(average rotational delay+transfer time for sector)= = 18.24 + 799/2 * (1+6+12/50) + 799/2 (6+12/50)= 5403.5 msec or more roughly: = 800/2*(time to read a sector in other cylinder)+ 800/2*(time to read a sector in the same cylinder)= = 800/2*(track-to-track seek time + average rotational delay+transfer time for sector) + 800/2*(average rotational delay+transfer time for sector)= = 800/2 * (1+6+12/50) + 800/2 (6+12/50)= 5392 msec If calculated in the original approximate way, we would obtain: 800*18.24 msec = 14,592 msec (a unacceptable approximation) ----------------------------------------------------------------------------