Skip to content

Chapter 19 · Sending bits

Keeping bits honest

Bits are tough. We made a point of it last chapter: "one or zero?" is a crude question that survives a lot of weather. But tough is not the same as invincible, and two traps still wait for every stream of bits crossing a room. One is loud and obvious: a noise spike so big it turns a one into a zero outright. The other is so quiet you might never have thought of it, and it comes first, because it can garble a message without flipping a single bit.

The counting trap#

Send twenty zeros in a row with the schemes from last chapter and look at what the receiver actually gets: one long, unchanging stretch of wave. Nothing rises, nothing falls, nothing flips. The receiver's only job is to slice that stretch into bit cells and count them. So, was that nineteen zeros? Twenty? Twenty-one?

If the sender and receiver shared one perfect wall clock, counting would be easy. They don't. Each has its own little ticker, and no two tickers on Earth run at exactly the same speed. It's like clapping along to a song that suddenly goes silent for a while: while the music plays, every beat corrects you, but after a long pause, are you still clapping on the beat? Nobody can say. A receiver drifting by one bit in a long flat run doesn't hear a small error, either; every bit after the miscount lands in the wrong slot, and the rest of the message turns to nonsense. You can watch the trap close below: slow the receiver's ticker, just a little, and see a whole zero slip between its ticks.

what was sent: a one, eight zeros, a one12345678what the receiver counts, slicing by its own ticker12345678
Receiver's ticker, running slow by in step

there were 8 zeros · the receiver counted 8 the clocks agree: eight cells, eight zeros, nothing to correct

the amber dots are the only edges: after the first one, the receiver counts alone

The counting trap. After the last edge (amber dot) the receiver slices the flat run using its own ticker, and the slider makes that ticker run a touch slow. Each bit adds a little more slip, the receiver's cells slide out of step with the sender's, and past a certain drift one true zero never gets a cell of its own: eight were sent, seven get counted.

A beat in every bit#

The fix is lovely: if silence loses the beat, never be silent. Make the wave carry its own drumbeat. In , every bit is drawn as a step instead of a level: a one is a rise, and a zero is a fall (some radios use the reverse; it only matters that both ends agree). Whatever the message says, even a thousand zeros, there is now a crisp transition in the middle of every single bit cell, and each one re-nudges the receiver's clock back onto the beat. The drummer never stops.

The price is honest and plainly visible below: the wave has to wiggle twice as fast to carry the same bits, so you spend speed to buy certainty. Plenty of radios have judged that a fine trade. The early days of Ethernet spoke exactly this code, and many little radio tags (the kind a shop gate or a card reader wakes up with a whisper of energy) still do.

tap the bits (try making the run of zeros even longer)

1100000010drawn plain: the level is the bitlost count? 6 zeros… or was it 7?Manchester: a one rises, a zero fallsa step in the middle of every single cell (amber dots): the beat can never get lost
The same bits, two drawings. Plain, the run of zeros is one flat mystery stretch: lost count? Manchester-coded, every bit steps in the middle of its cell (amber dots), so the receiver's clock is corrected on every single bit. The cost is plain too: twice the wiggling.

When a bit still flips#

Staying on the beat solves the counting trap, but the louder danger remains: even a receiver counting perfectly will sometimes get a bit wrong, because a spike of noise landed right on top of it. The receiver has no way to notice on its own. A flipped bit is a perfectly respectable bit; it just happens to be the wrong one.

So we make the message tattle on itself. The simplest guard is one extra bit, chosen by the sender so that the count of ones in the group comes out even. That extra bit is called a parity bit, and the receiver just counts: an even number of ones means all is well, an odd number means something in here flipped. One added bit, and no single flip can ever sneak past. But notice the two things parity can't do. It knows a bit flipped, not which bit, so all it can say is "send that again." And if two bits flip, the count comes out even again and the damage slips through unseen.

Finding the culprit#

Now the beautiful part, the step from merely detecting an error to repairing it. Take sixteen message bits and arrange them in a little four-by-four square. Give every row its own parity bit, and every column its own parity bit too. Each bit now sits at the crossing of one row check and one column check, like a street address. Flip any single bit and watch what happens: exactly one row check fails, exactly one column check fails, and the two failures cross at exactly one square. The checks don't just smell the error. They point at it. And a pointed-at bit is a fixed bit, because a bit has only two values: if this one is wrong, flip it back. The message repairs itself from its own wreckage.

Try it below. You play the noise: flip any bit you like, then let the crosshairs hunt it down. Flip two, and watch it reach its honest limit.

right column: row checks · bottom row: column checks

Every check passes. Now be the noise: tap any bit to flip it, the checks included.

Sixteen message bits, four row checks, four column checks. Flip any one bit and a failing row and a failing column cross exactly on the culprit; press repair and the message heals. And the check bits crossed the same noisy air, so ask the sneaky question: flip one of them and see who gets blamed. Two flips light up the checks but scramble the crossings: detection survives, repair doesn't.

The digital cliff#

Real radios don't use this exact little square; they use its grander cousins. The family idea is always the same: sprinkle carefully chosen extra bits through the message so that the whole thing becomes a puzzle with only one consistent answer, and quite a lot of damage can be undone by whoever receives it. Engineers call it , and it is everywhere: Wi-Fi leans on it for every packet, your phone leans on it for every call, and deep-space probes lean on it hardest of all, whispering across billions of miles with codes that can heal whole shredded stretches of a message.

And this explains something you have surely seen. Old analog TV failed gently: a weak signal meant a snowy, ghosting picture that got a little worse mile by mile. Digital TV is either flawless or frozen, never snowy. That's error correction's signature. As the noise creeps up, the code quietly repairs every scratch, and the picture stays perfect, not merely good. Then comes the moment the damage exceeds what the code can heal, and everything collapses at once. Radio folk call it the digital cliff: flawless right up to the edge, nothing at all past it. The figure below puts the noise on a slider, so you can walk both copies toward the edge yourself.

how good it soundsmore noise →analog: a little more noise, a little more hissdigital: flawless……then nothingthe cliffthe analog copythe digital copy, error-corrected
Noise 30%

analog: noticeably hissy · digital: still perfect

Why digital fails all at once. Slide the noise up and watch the two copies underneath: the analog one degrades gracefully, a little worse for every notch, while the error-corrected digital one stays perfect for as long as the code can repair the damage. Then it drops off the cliff, and there is suddenly nothing left to watch at all.

So our bits now keep the beat, catch their own errors, and even heal themselves. Safety is handled. Which means it's finally time to get greedy. Every symbol we've sent so far answers a single timid yes-or-no, one bit per slice of wave. In the next chapter we ask the question this whole part of the book has been building toward: what if one little slice of wave could answer six questions at once?