Practice Exercise 17 Answers

  1. A disk drive has 400 tracks per surface and 80 sectors per track. Each sector holds 512 bytes.
a.) If it had only one surface, how many bytes of storage would it provide? (Assume there is no parity.)
               400 x 80 x 512 = 16,384,000 bytes
b.) If you wanted to store 1 Gigabyte on such a disk drive, how many separate surfaces would you need?
               1,073,741,824 bytes / 16,384,000 = 65.536 surfaces,
               so round up to 66.
c.) Suppose that you did not want to have this many surfaces. What could possibly change to reduce this number but still have 1 Gb? You could increase the bit density so that a sector holds more than 512 bytes. You could increase the track density so there are more than 400 tracks on a surface. Increasing the number of sectors is really just the same as increasing the bit density, and in fact it would be better to put more bits (or bytes) into a single sector than to break the larger number of bits up into more sectors, due to the wasted space between sectors.
  1. Parity is the error correcting code that is often used to detect and even correct simple errors in tapes, disk drives and other devices. There are two types of parity: even parity and odd parity. Given a bit string, say 11010001, even parity adds 0 if the number of 1s is even, or it adds 1 if the number of 1s is odd, so that the total number of 1s after adding the parity bit is even. (Symmetrically, odd parity preserves oddness of the number of 1s.)
a.) Show what the string of two ASCII characters "ABC" would look like when encoded using even parity.
               ABC encoded with even parity would be: (the gaps are for
               readability only)
               
               01000001 0 01000010 0 01000011 1
                  A           B          C
b.) If a disk drive uses even parity and can store 100,000 sectors, each 0.5K long, how many additional Kilobytes would be needed for parity if each byte were monitored by a parity bit? 100,000 x 512 = 51,200,000 bytes. Since each byte gets a new parity bit, there will be 51,200,000 more bits. Divide this by 8 to get 6,400,000 extra bytes just devoted to parity. Divide 6,400,000 by 1024 to get 6,250 Kilobytes worth of space just devoted to parity. c.) Continuing with part b, what percentage of the total bits would be devoted to data, and what percentage to parity?
               1/9 would be parity, or 11%
               8/9 would be data, or 89%.

  1. Suppose a hard disk drive has 3 platters, totaling 4 surfaces. (The two outer platters only have 1 usable surface each; the inner one has two.) Each surface is divided into 400 tracks (concentric circles) and each of these is broken into 80 sectors. Each sector holds 512 bytes. It is spinning at 3600 rpm (revolutions per minute).
a.) How long would it take for a read/write head to read one sector? 3600 rpm is 60 revolutions per second (because 60 secs in a minute). This means that 1 revolution takes 1/60 or .0167 seconds. Since in this time the read/write head can whiz past 80 sectors, it must only take .0167 / 80 = .0002083 secs to read 1 sector. b.) Assume that it takes on the average 30 msec (milliseconds, 1 msec = .001 sec) to seek to any track. Taking into account the seek time, rotational latency and the time to read one sector, how long would it take this disk drive to fetch and read an arbitrary track? We assume that on average, the rotational latency is 1/2 the time it takes for one revolution. This is .00835 sec (since 1 rev. takes .0167 sec). Thus we add up the times:
                 .03      sec   to seek to an arbitrary track
                 .00835   sec   to wait for the platter to spin around so
                                the desired sector is under read/write head
               + .0002083 sec   to read one sector
               ----------------------------------------------------
                 .038558  sec   to seek and read an arbitrary sector
c.) If files are comprised of sectors scattered all over the disk drive, how long would it take to read a file consisting of 1,064,960 bytes?
               1,064,960 bytes / 512 bytes/sec = 2080 sectors
               Multiply .038558 x 2080 sectors = 80.2 seconds, or 1.33 minutes.
d.) If files are arranged so that the sectors in a file are as contiguous as possible and it only takes 3 msec to seek to a new track, how long would it take to read the same file of 1,064,960 bytes? If the sectors are clumped together into tracks, then there are 26 tracks that this file takes up. Assume it takes .03 sec to seek to the first track, then wait for rotational latency and then read the entire track. Reading the entire track takes .0167 secs. Here's the time for the first track: .03 + .00835 + .0167 = .05505 sec. Now the stepper motor has to kick on for only .003 sec to move to the next track. However, we will have to wait for the rotational latency again because the first sector of that track will no longer be under the read write head. Keep doing this for the other 25 tracks:
               25 x (.003 + .00835 + .0167) = .70125 secs
Add this to .05505 sec to get 0.7563 seconds. This is quite a dramatic savings over the other method where the sectors were scattered all over the place!