សិល្បៈ
សម្រស់ និង សុខុមាលភាព
សិប្បកម្ម
វប្បធម៌ និង ប្រវត្តិសាស្ត្រ
ការកម្សាន្ត
បរិស្ថាន
ម្ហូប និង ភេសជ្ជៈ
វិស្វកម្មបញ្ច្រាស
វិទ្យាសាស្ត្រ
កីឡា
បច្ចេកវិទ្យា
ប្រដាប់ដែលស្លៀក
Hamming Code
Mark

បង្កើតដោយ

Mark

20. សីហា 2026FI
0
0
0
0
0

Hamming Code

A parity bit tells you that something is wrong. A Hamming code tells you exactly which bit is wrong, so you can flip it back. The trick is to use several parity bits, each checking a different overlapping subset of the data, chosen so that every possible single-bit error produces a unique pattern of failed checks — and that pattern, read as a binary number, is the position of the broken bit. Richard Hamming devised it at Bell Labs around 1950 out of ordinary frustration: he ran jobs on a relay machine over the weekend, the machine detected parity errors, gave up, and dropped the job, so he came back on Monday to nothing. His question was why a machine that could detect an error could not simply fix it.
មធ្យម
1 hour

ការណែនាំ

1

Place the parity bits at the powers of two

Positions 1, 2, 4 and 8 are reserved; everything else carries data.

  1. Number seven positions 1 to 7.
  2. Mark positions 1, 2 and 4 as parity; 3, 5, 6 and 7 hold four data bits.
  3. Write your four data bits into their positions.
The powers of two are chosen because each has exactly one 1 in its binary representation — which is what lets each parity bit own one binary digit of the answer. The placement is doing the arithmetic.

Materials for this step:

Graph PaperGraph Paper1 pad
Graphite Pencil SetGraphite Pencil Set1 ឈុត
2

Work out which bits each check covers

Each parity bit covers every position whose number contains its bit.

  1. P1 covers positions 1, 3, 5, 7 — those with a 1 in the ones place.
  2. P2 covers 2, 3, 6, 7 — a 1 in the twos place.
  3. P4 covers 4, 5, 6, 7 — a 1 in the fours place.
  4. Set each parity bit to make its own group even.
Write the position numbers in binary beside the list and the pattern is obvious. The overlapping groups are not arbitrary — they are the binary expansion of the position numbers, laid out as sets.

Materials for this step:

Cardstock Assorted Pack (50 Sheets)Cardstock Assorted Pack (50 Sheets)1 កញ្ចប់
3

Corrupt a bit and locate it

The correction, performed by arithmetic rather than by searching.

  1. Hand your seven-bit block to someone; have them flip one bit secretly.
  2. Check each parity group and write 1 for a failed group, 0 for a passed one.
  3. Read those results as a binary number: P4 P2 P1.
  4. That number is the position of the broken bit. Flip it back.
If groups 1 and 4 fail but 2 passes, the number is 101 — position 5. Notice the parity bits check themselves too, so an error in a parity bit is located just as cleanly. All zeros means no error detected.
4

Measure the cost and find the boundary

Every code pays for its capability, and every code has a limit.

  1. Count the overhead here: 3 parity bits for 4 data bits.
  2. Work out the overhead for 11 data bits — it needs only 4 parity bits.
  3. Now flip TWO bits and run the location procedure.
Overhead falls sharply as blocks get longer, which is why real codes use large blocks. And with two errors the syndrome points confidently at a third, innocent bit — so the code makes things worse outside its region. Adding one more overall parity bit lets it DETECT two errors while still correcting one, which is the standard extended form.
5

History and context

Richard Hamming published the code in 1950, having worked it out at Bell Labs where he had access to a relay computer only at weekends. His account of the motivation is refreshingly plain: the machine could tell something had gone wrong and then simply stopped, wasting the whole run, and he thought it should be able to do better.

What it added to the parity approach: a single parity bit detects one error and locates nothing. The two-dimensional grid in the parity blueprint locates an error but costs one bit per row and per column. Hamming's overlapping groups locate it with logarithmically few bits — for 11 data bits you need 4 parity bits where a grid would need far more. Same goal, three different costs, and the right choice depends on how much overhead the channel can afford.

Where it is used: ECC memory in servers uses a Hamming-derived code to correct single-bit errors caused by cosmic rays and electrical noise, silently, millions of times a day. Hamming distance — the number of positions in which two codewords differ — became a fundamental concept in coding theory and in fields far outside it, including genetics and machine learning.

Its neighbours in the space: Reed-Solomon handles bursts of adjacent errors and is what makes a scratched CD or an obscured QR code readable; convolutional and turbo codes suit continuous noisy streams like deep-space links; a simple retransmission request is often cheaper than any of them when the channel is bidirectional and cheap. Hamming's region is where errors are isolated, retransmission is impossible or expensive, and overhead must stay small.

សម្ភារៈ

3

ប្លង់ពាក់ព័ន្ធ

ប្លង់ទាំងនេះចែករំលែកចំណេះដឹង — បច្ចេកទេស សម្ភារៈ ឬគោលការណ៍

CC0 សាធារណៈ

ប្លង់នេះត្រូវបានចេញផ្សាយក្រោម CC0។ អ្នកមានសិទ្ធិចម្លង កែប្រែ ចែកចាយ និងប្រើប្រាស់ដោយមិនចាំបាច់សុំអនុញ្ញាត។

គាំទ្រអ្នកបង្កើតដោយទិញផលិតផលតាមរយៈប្លង់របស់ពួកគេ ដែលពួកគេទទួលបាន កម្រៃជើងសារអ្នកបង្កើត កំណត់ដោយអ្នកលក់ ឬបង្កើតកំណែថ្មីនៃប្លង់នេះ ហើយបញ្ចូលជាការតភ្ជាប់ក្នុងប្លង់របស់អ្នកដើម្បីចែករំលែកចំណូល។

ការពិភាក្សា

(0)

ចូល ដើម្បីចូលរួមពិភាក្សា

កំពុងផ្ទុកមតិ...