A Hamming code places check bits at positions 1, 2, 4 and other powers of two. Each checks positions whose binary position number contains its corresponding bit. In a basic Hamming(7,4) code, a nonzero syndrome locates a single-bit error when that error model applies.
Worked example
Use even parity and place data 1011 at positions 3, 5, 6 and 7. Check bits at positions 1, 2 and 4 become 0, 1 and 0, giving 0110011 in position order 1–7. If position 6 flips, checks 2 and 4 fail: syndrome 110 means position 6.
What to watch for
Basic Hamming(7,4) corrects a single error but cannot safely distinguish every double error from a single error. Adding an overall parity bit supports single-error correction and double-error detection.
Try it yourself
Which check results indicate an error at position 5?
Answer: Position 5 is binary 101, so checks 1 and 4 fail while check 2 passes. The syndrome is 101.
How to study this topic
Treat a code as a mapping with an explicit convention. Write the input, encoded bits and decoded result side by side. For error-checking examples, distinguish detecting an error from locating and correcting it.
Explore related programmes
These recorded programmes are upcoming. This article is general educational content, not a syllabus or course sample.
Digital Electronics