Hardware Engineering · Storage Hardware
Writing and Reading a Magnetic Bit on a Spinning Platter
How a write head sets the direction of magnetisation in a granular medium, why transitions rather than levels carry the data, and what the read sensor and channel must recover.
A hard disk stores data as the direction of magnetisation in a thin film of granular magnetic material. It reads that direction back by sensing the field the film produces. Between those two statements sits an awkward fact that shapes every layer above: the medium does not store an isolated bit. It stores a transition, a boundary between two regions of opposite orientation, and the read head responds to the boundary rather than to either region.
Why the transition is the bit, not the level
A region of uniformly oriented grains produces a steady field that a magnetoresistive sensor reads as a constant resistance offset. A constant offset carries no information unless it is measured against something, and measuring an absolute field reliably is exactly what the medium makes hard: grain size, film thickness, and head fly height all vary across the platter, so the absolute field a region produces varies with position. A system that encoded ones and zeros as two absolute field strengths would need a reference that tracks those variations, and the reference would be indistinguishable from a slow drift in the data.
A transition produces something the sensor can find without an absolute reference: a peak. As the head passes over a boundary, the field it sees swings from one polarity to the other, crossing zero at the boundary. Differentiating the sensor output turns the swing into a pulse whose polarity encodes the direction of the transition and whose timing encodes the transition’s position. The channel can then work with pulse timing rather than absolute amplitude, which is immune to the offsets that would corrupt an amplitude decision. At low density each pulse is resolved on its own; at the densities drives now run at, adjacent pulses overlap and the channel has to sample the waveform and detect whole sequences instead.
The cost of this encoding is that the achievable density is limited by how close two transitions can be placed and still be resolved as two. That spacing is set by the transition width, which is set by the write field gradient and the medium’s switching field distribution — not by the head’s ability to position itself. Later gains in density came instead from overlapping the written tracks, the arrangement behind shingled magnetic recording.
Setting the orientation
Writing is a two-step process in the medium. The head’s write pole generates a field; where that field exceeds the medium’s coercivity, the grains under the pole switch their orientation to align with the field. Where it does not, they keep whatever orientation they had.
The complication is the medium’s granularity. Each bit cell contains many grains, and a bit is reliable only if enough of its grains are oriented the same way, so the medium’s switching field is not a single value but a distribution over the grains. The write field must exceed the top of that distribution to set the bit reliably, and the field must then fall off quickly enough that it does not partially switch the neighbouring cell’s grains. The spatial gradient of the write field, measured in field change per nanometre along the track direction, is the parameter that controls transition width: a sharper gradient switches fewer grains at the boundary and yields a narrower transition.
Perpendicular recording changed the geometry to make that gradient achievable at high density. In longitudinal recording the magnetisation lay in the plane of the film, and adjacent bits opposed each other end to end, producing strong demagnetising fields that pushed transitions to broaden as density rose. In perpendicular recording the magnetisation points out of the film plane, adjacent bits are parallel rather than opposed, and the demagnetising field at a transition is much weaker. The medium also gains a soft underlayer that provides a return path for the head’s flux, concentrating the field and steepening its gradient. The cost is a more complex head with a main pole and a return pole, and a medium with a soft magnetic layer under the recording layer that must itself be deposited uniformly.
The head’s field must also be strong enough to overcome the medium’s coercivity but not so strong that it erases the neighbouring track. Track edges are where this shows up: the write field extends laterally, and a track written repeatedly at slightly different positions accumulates partially switched grains at its edges. Media manufacturers spec a track pitch larger than the written track width for this reason, and the difference is what makes a drive’s formatted capacity lower than the product of the raw linear density and the raw track density.
Reading the field back
The read sensor is a separate element on the same slider, physically smaller than the write pole. It is smaller because the sensor’s size determines the spatial resolution of the read: a sensor spanning several bit cells averages their fields and cannot resolve individual transitions.
Two sensor families matter. The giant magnetoresistive sensor is a multilayer whose resistance depends on the relative orientation of two magnetic layers, one pinned and one free. The free layer follows the medium’s field, and the resistance changes in proportion to the component of that field along the sensor’s sensitive axis. The tunnel magnetoresistive sensor replaces the metallic spacer with a thin insulating barrier and passes current through it by tunnelling; the magnetoresistance ratio is larger, which yields a larger signal for the same field. Both are biased so that the quiescent operating point sits where the resistance-to-field curve is steepest and most linear.
The sensor’s output is a small analogue voltage, on the order of millivolts, riding on a larger offset and buried in noise from the sensor’s own thermal agitation, from the head amplifier, and from the medium’s granularity. Recovering the transition timing from that signal is the job of the read channel.
The read channel is a partial-response equaliser and a detector
The signal from a transition is not a sharp pulse. It is a broad shape whose width is set by the transition width convolved with the sensor’s response. Consecutive transitions interfere: their pulses overlap, and at high linear density the overlap is severe enough that the peak of one pulse is shifted by its neighbours. This is intersymbol interference, and treating each pulse independently fails once the density is high enough.
The channel therefore models the readback as a known linear response driven by the written symbol sequence, plus noise. Equalisation filters the sensor output so that the combined response of medium, sensor, and filter matches a target partial-response polynomial — a short, known set of tap weights. The target is chosen so that the resulting samples depend on only a few adjacent symbols, which keeps the detector’s state space small. A three-tap target, for instance, makes each sample a function of the current symbol and the two before it, so the trellis has four states.
Given the equalised samples, the detector runs a Viterbi search over the possible symbol sequences, keeping for each state the most likely path so far. Because the channel is a finite-state machine with few states, the search is linear in the number of samples rather than exponential. The output is a sequence of bits, and the whole structure — partial response target, equaliser, Viterbi detector — is why the readback path is described as PRML.
Errors in the detector’s output are not independent. A Viterbi detector makes errors in bursts, because a wrong path diverges from the correct one and stays wrong for several symbols before reconverging. The error-correcting code that follows must therefore be designed for burst errors rather than for isolated bit flips, which is why drives have used Reed-Solomon codes over interleaved symbol blocks rather than a simple bit-level Hamming code, and why the low-density parity-check codes in current designs work on long blocks with soft information.
/* A three-tap partial-response equaliser applied to sensor samples.
Target response: (1, 2, 1) — each output depends on three input samples. */
#include <stdint.h>
void pr_equalise(const int16_t *in, int16_t *out, size_t n, int32_t gain)
{
for (size_t i = 2; i < n; i++) {
int32_t acc = (int32_t)in[i] + 2 * (int32_t)in[i - 1] + (int32_t)in[i - 2];
out[i] = (int16_t)((acc * gain) >> 16); /* fixed-point scaling */
}
}
The arithmetic is trivial; the point is that the equaliser’s output at sample i is a function of three input samples, which is what lets the detector keep a small number of states.
Servo, and why the head never quite knows where it is
The head must be positioned over a track whose width is measured in tens of nanometres while the arm is pushed by air turbulence, spindle vibration, and thermal expansion. Position feedback comes from servo patterns written into the medium at intervals along each track — bursts whose relative amplitudes tell the channel how far off-centre the head is. The patterns are written by a dedicated servo writer at the factory, and their spacing sets how often the position is re-measured: a few hundred servo fields per revolution, so a correction every few tens of microseconds.
Between servo samples the position is open loop, predicted from the actuator’s model and the last correction. That is why a seek has two phases: a velocity-controlled coarse move, then a settle in which the head lands on the target track and the servo loop damps the residual oscillation. Settling, not the coarse move, often dominates short seeks, which is why average seek time specifications do not scale linearly with distance. The rotational and positioning costs are treated separately in seek time, rotational latency, and the cost of queueing.
None of this is visible above the block layer. What the layers above see is a device that reports 512-byte or 4096-byte logical sectors, each of which the drive’s own controller has mapped onto a physical track and offset, with the sector’s own error-correcting code appended by the drive. That indirection hides a medium whose natural unit — the transition — has no relationship at all to the sector the host reads.
References
- The Physics of Ultra-High-Density Magnetic Recording — M. Plumer, J. van Ek, D. Weller (eds.), Springer
- Hard Disk Drive: Mechatronics and Control — A. Al Mamun, G. Guo, C. Bi, CRC Press
- Perpendicular Magnetic Recording: Writing Process — S. Khizroev, D. Litvinov, Journal of Applied Physics 95, 4521 (2004)