Magnetic data storage relies on the relationship between electricity and magnetism. When an electrical current flows through a wire, it produces a magnetic field around it. If the wire is wound into a coil, each turn of wire adds to the strength of the magnetic field. This principle is used to create electromagnets and electric motors.
This relationship works in reverse as well. When a wireor coil of wire- is moved through a magnetic field an electrical current is created in the wire. An electrical current is also generated when the magnetic field surrounding a conductor changes in strength or polarity (direction).
Floppy disks and hard drives are similar in the way in which data is stored. The disks are made from a substrate (underlying layer) of a nonmagnetic material Mylar plastic for floppy disks, aluminum or glass for hard disks coated with a layer of iron oxide.
The magnetic particles in the coating media are initially arranged in a random fashion; think of playing a blank videotape on which nothing has yet been recorded. The result is only snow on the screen. As the recording head passes over the disk, a tiny electromagnet creates a magnetic field which causes the magnetic particles in the media to align themselves and remain in that pattern after the head has passed.
The direction of the current through the coil determines the direction of the magnetic flux. Reversing the polarity of the electrical current reverses the direction of the magnetic field on the disk surface.
Current is generated in the coil only when the magnetic field changes. A current spike is produced each time the head passes over a transition from one magnetic polarity to another.
Synchronization between the rotating disk and the heads is critical to reading and writing data. Imagine asking a band to hold a long sustained note and then hit the next note at exactly the same time, without a conductor to keep time.
To ensure synchronization, a clock signal must be encoded with the data. Encoding is based on flux transitions rather than on the polarity of the magnetic field. Run-Length Limited (RLL) encoding is the most common for modern hard disks.
RLL 2,7 Encoding
The code is designed
so that there is a minimum length and maximum limit to the number of cells
between transitions. For example, RLL 2,7 encoding has a minimum of two
spaces between transitions, and a maximum of 7 spaces between transitions.
The string 000000000 would be encoded NNNTNNNNNTNNNNNTNN, ensuring that
the there are no long gaps between transitions.