 In this video, we're going to explain the structure and functioning of hard disk drives. Hard disk drives are one of the common systems that are present in computers today to store data. The structure of one of these drives, it's basically made out of several surfaces, circular surfaces, disks that are encapsulated with a spindle that makes them rotate all together. Each one of these surfaces is typically called a platter, and it is covered with some magnetic component that allows to store information in both sides of this platter. Then the important mechanism to read and write this platter is an arm, which is capable of going towards the center and towards the edge of these disks. This arm is holding what we call the read-write heads, typically one on each surface. These read-write heads, what they're doing is they advance towards the center of the disk or towards the edge of the disk and positions themselves in different locations to read different tracks as we're going to see right away. These are the read-write heads. If you look at one of these platters from the top, we can see that it is divided into a certain number of areas. The number of areas of this division depends from manufacturer to manufacturer, but in principle the area is divided in portions like this. Each one of these surfaces in both sides, what we have here, like concentric circles, is the notion of a track, so this is what is called a track. Again, it's another parameter that varies from manufacturer to manufacturer, but each platter has a certain number of tracks per surface, and all of them are concentric. The division in these areas produces that each track is divided into an area like this, which is called a sector, and in the sector is where we find the data stored. This sector, if we draw it expanded like this, is actually made out of three regions. The first one is called a header in which we have information identifying the sector. Then we have the data that is stored, and the last portion of this sector is what is called a trailer, and contains information to correct errors. In other words, if there is an error reading the data, this information here is used to correct the data previously read. Now the information that in a hard drive is organized around three concepts. The first one is the concept of cylinder. It's a bit counterintuitive because there is nothing inside the disk that has actually that shape. However, cylinder, it is known as the set of tracks, one from each platter, or I should say each surface, that are at the same distance from the spindler. So the concept of cylinder can be seen here. The heads are all of them at the same distance from the axis, from the rotation axis. Therefore, what I have is one, two, three, four, five, six heads right now reading six different tracks. If I look them from above, these tracks, they are actually organized as if it was a cylinder, and this is the concept of cylinder that is used to refer to how the disk is organizing the information. The first parameter worth studying is the number of cylinders in a disk, and this is typically directly related to the number of tracks per surface, or the number of tracks per platter. In other words, if I look at this platter and I see there are ten tracks here, then when I put all three of these platters here, or all six surfaces, then I will have ten cylinders, and I can refer to them like cylinder zero to cylinder nine. The second parameter that is important for the disk is to know the number of tracks that are per cylinder. And this, as we can see here, once we have the concept of a cylinder, the number of tracks depends directly on the number of platters, surfaces, or the number of read-write heads. So this is actually the number of read-write heads, or the number of platters times two if the platters can be written in both sides of both surfaces, which is typically the case. The third dimension to consider a disk organization is the number of sectors per track. And as we can see here, we have one track, and in this specific example, although again, this division changes significantly from manufacturer to manufacturer, each track is divided into one, two, three, four, five, six, seven sectors. Now with these three parameters, what we are able to compute is the number of sectors that are available in the disk. If we add the number of bytes per sector, then with these four parameters, we are capable of calculating the disk capacity or disk size. Let's now analyze how much time is needed for one of these disk drives to locate and read or write one of the sectors. So the operation goes as follows. The first operation is to make sure that the read-write heads are positioned on top of the appropriate cylinder. So step number one is finding which is the appropriate cylinder. The time it takes this arm to move the heads either towards the axis or towards the edge of the platter to find the right cylinder is what is called seek time. And it's time for the head to reach the right cylinder. Once the read-write heads are positioned in the right cylinder, what we have to do, let's assume that the head is already positioned here and we're trying to read this sector over here, what we have to do is if this disk is spinning in this direction, it's wait until this sector passes right underneath this head and this information can be read. This delay is what is called rotational delay. And it's exactly the time that takes the sector to reach the head. If we add these two magnitudes, then we come up with one very important parameter of a disk, which is the axis time. So again, the axis time is the time that it takes for the arm to position the read-write heads in the right cylinder and for the sector to reach the read-write head. However, we don't have access to the information yet. We have to wait for this sector to pass entirely underneath the head and then we're able to read the header, the data and the trailer, as we said. That time is what is called as read time. In other words, it's time to read one sector. Once it is placed exactly underneath the head. If we add these two magnitudes, then as a result we have another very important dimension which is the transfer time. Now to give an example of the type of magnitudes we're talking about here, let's focus on the rotational delay. Let's make an example. Suppose there is a disk that is spinning at 3,600 rpm. With a very simple operation, we translate this, take the inverse, multiply by 60 seconds per minute and divide by 2. And this corresponds precisely with the time it takes a sector to perform half a rotation. Now this half rotation is very important because if we want to calculate what is the value of the rotational delay, it could be 0 if the sector is right here next to the head or it could be an entire rotation if the sector just passed underneath the head and we have to wait until it comes back. So what is typically done is the rotational delay is computed in average and in order to take the average what we assume is that the sector is halfway down. So it's neither next to the head nor just past the head. It's somewhere in between and that's the reason why we divide here by 2. So to give an example, a disk that is turning at 3,600 rpm, it takes the average rotational delay 8.32 milliseconds. And this gives you an idea of the type of, the amount of time you have to wait for one of these devices to read an entire sector. This is just a rotational delay, we have to add the C time, again the time that this arm takes to place on top of the right cylinder and then add the read time which is the time it takes for the entire sector to go underneath the head. We also should know that the time to locate the right track to be read within the cylinder requires no time because choosing the right track in the cylinder is as simple as selecting one of these read-write heads which will read the sector from the right surface of the platter and therefore there is no delay involved in selecting the track. However we do have delay on selecting the right number of the right cylinder and the right sector and of course the read time to wait for the sector to pass underneath the head. And this is how our drives work.