Hamming code: Difference between revisions

Content deleted Content added
m Grammar. Plural/singular.
fixing an error
Line 20:
In [[mathematics|mathematical]] terms, Hamming codes are a class of binary linear code. For each integer {{Math|''r'' ≥ 2}} there is a code with [[Block code#The block length n|block length]] {{Math|''n'' {{=}} 2<sup>''r''</sup> − 1}} and [[Block code#The message length k|message length]] {{Math|''k'' {{=}} 2<sup>''r''</sup> − ''r'' − 1}}. Hence the rate of Hamming codes is {{Math|''R'' {{=}} ''k'' / ''n'' {{=}} 1 − ''r'' / (2<sup>''r''</sup> − 1)}}, which is the highest possible for codes with minimum distance of three (i.e., the minimal number of bit changes needed to go from any code word to any other code word is three) and block length {{Math|2<sup>''r''</sup> − 1}}. The [[parity-check matrix]] of a Hamming code is constructed by listing all columns of length {{Math|''r''}} that are non-zero, which means that the [[dual code]] of the Hamming code is the [[Hadamard code|shortened Hadamard code]]. The parity-check matrix has the property that any two columns are pairwise [[Linear Independence|linearly independent]].
 
Due to the limited redundancy that Hamming codes add to the data, they can only detect and correct errors when the error rate is low. This is the case in computer memory ([[ECCusually memory]]RAM), where bit errors are extremely rare and Hamming codes are widely used, and a RAM with this correction system is a ECC RAM ([[ECC memory]]). In this context, an extended Hamming code having one extra parity bit is often used. Extended Hamming codes achieve a Hamming distance of four, which allows the decoder to distinguish between when at most one one-bit error occurs and when any two-bit errors occur. In this sense, extended Hamming codes are single-error correcting and double-error detecting, abbreviated as '''SECDED'''.<ref>{{Cite document|last=Rahim|first=Robbi|title=Bit Error Detection and Correction with Hamming Code Algorithm|date=2017-09-26|doi=10.31227/osf.io/j3w5z|url=https://zenodo.org/record/243775}}</ref>
 
== History ==