Assume that we are using a hard disk with the following characteristics: Capacit
ID: 3851987 • Letter: A
Question
Assume that we are using a hard disk with the following characteristics:
Capacity 30 GB
Average seek time 6 msec
Spindle speed 15,000 rpm
Bytes per sector 512
Sectors per cluster 8
Sectors per track 400.
Assume that we have a file of 20, 000 records. Each record has 64 bytes. Answer the following questions:
5. Assuming contiguous storage, namely the records are stored in clusters from the same track as long as possible, how much is the total time for reading the whole file?
6. Assuming the minimal transfer unit is one cluster, how much is the time for reading one cluster, including the seek time, the average rotational delay, and the transfer time?
7. Assuming random storage of the records and every record is stored in a different cluster, reading a cluster will include the seek time, the average rotational delay, and the transfer time for that cluster, how much is the total time for reading the whole file?
Explanation / Answer
5.
Given file is of 20000 records and each record is 64 bytes.
Now total size of the file is = 20000 * 64 B = 1280000 B.
Given number of sectors per track is = 400 and sector size is = 512 B.
Hence total size of the track is = 400 * 512 B = 204800 B.
Now Number of tracks required to store the entire file is = 1280000 B / 204800 B = 6.25 = 7(approx).
Given records are stored in clusters from the same track as long as possible.
Hence we need to calculate the time required to read the entire track and finally
we have to multiply the same with 7.
Time need to read the entire track is = Seek time + Rotational delay
Given Seek time = 6 msec.
Given Spindle speed is = 15,000 rpm
15000 r ------> 60 sec (1 min for 15000 rotations)
1 r ------> 60 / 15000 = 4 msec
Hence Rotational delay = 4 msec.
We can read entire track in one rotation.
Hence time taken for one track is = 6 + 4 = 10 msec.
For 7 tracks it will be 7 * 10 msec = 70 msec.
6.
Given Number of Sectors per cluster is = 8.
Here Access time is = seek time + average rotational delay + transfer time
Here seek time is = 6 msec.
average rotational delay is = Rotational delay / 2 = 4/2 = 2 msec.
transfer time = R * Y / X
Here R = Rotational delay = 4 msec.
Y = cluster size = 8 * 512 B = 4096 B.
X = Track size = 204800 B.
transfer time = R * Y / X = 4 msec * 4096 B / 204800 B = 0.08 msec.
Hence Access time is = 6 + 2 + 0.08 msec = 8.08 msec.
7.
Given record size is = 64 bytes and given records are placed in differnt clusters.
Number of records per cluster is = Cluster size / record size = 4096 B / 64 B = 64.
Hence for 20000 records number of clusters is = 20000 / 64 = 312.5 = 313 (approx).
Hence total time for reading the whole file is = 313 * 8.08 msec = .2529.04 msec = 2.52904 sec