Home › Practice › RTL Design › Guard bits that find a flip

Guard bits that find a flip

EasyRTLcombinationalcodes

Noise on a radio link can flip one bit of a message. If you add 3 check bits to the 4 data bits, the receiver can tell which bit was flipped and fix it. Build the sender side.

Concept first. A parity bit is the XOR of a chosen set of bits. Setting it so that the whole set has an even number of 1s lets the receiver notice when one of them flips. The Hamming idea is to number the 7 positions 1 to 7 and let each check bit watch a different set. The check bit at position 1 covers every position whose number has bit 0 set: 1, 3, 5, 7. The check bit at position 2 covers every position whose number has bit 1 set. The check bit at position 4 covers every position whose number has bit 2 set. Work out which positions those are, and notice that each check bit sits inside its own set.

What to build.

Solve in your browser →

No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.

More in this track

← Widen a signed numberLight up the volume bar →