Error Correction: Hamming Code

 Hamming Code

When data is moved or stored from the sender to the receiver, usually errors may occur. Hamming code is a technique which was developed by R. W. Hamming to correct these errors. It is a collection of error-correction codes that can be used to find and fix these errors. It is an error-correction method created by R. W. Hamming.

R. W. Hamming

Hamming codes can detect one-bit and two-bit errors or correct one-bit errors without detection of uncorrected errors.

For correcting an error, one must be aware of the precise location of the error. For example, in a single-bit error, the error correction code should determine which one of the seven bits is in the error. To do this we must include some additional Redundant bits. The number of redundant bits can be calculated using the following formula,

2r≥d+r+1

Where, r = redundant bit, d = data bit

The number of the redundant bits is expressed in Parity bits. For example, if you wanted to transmit 7 data bits, the formula would be 24 ≥ 7 + 4 + 1 So, r = 4 Parity bits are required.

Parity bits are bits which are appended to the original data of binary bits so that the total number of 1’s is even or odd. There are two types of parity bits,

Even parity - In case of even parity, if the total number of 1’s is even, then the parity bit value is set to 0. If the total number of 1’s is odd, then the parity bit value is set to 1.

Odd parity – In case of odd parity, if the total number of is even, then the parity bit value is set to 1. If the total number of 1’s is odd, then the parity bit value is set to 0.

Hamming code can be implemented in hardware and is comparatively easy to use. This also implies that computation time is short. Due to the possibility that radiation or cosmic rays might cause a bit flip or error in computer RAM, these characteristics make Hamming code ideal for use in error-correcting computer memory. ECC RAM combines Hamming code with SECDED to automatically correct single errors and raise an alarm on two errors.

However, data transmission in the present era does not employ hamming code. It may be quicker to request the sender to resend the faulty packet if an error is found since wired data links are typically not noisy enough to warrant the overhead of additional parity data. Low-density parity-check (LDPC) codes are also more computationally intensive than Hamming code, but they are more efficient for transmission. Since greater processing power is available on newer computers, LDPC is utilized for Wi-Fi 6 and 10GBASE-T Ethernet.

Satellite and space communications are one use for Hamming code in data transfer. It is chosen to employ the slower but more accurate Hamming code and compromise overall transmission rate because to the enormous distances involved, long transmit periods, and the need for correct data.



Denith Guruge