Error Correcting Code, ECC, 纠错码
奇偶校验
Parity,错误检测方案最基本的方法
- 为了检测出数据传送过程中可能出现的错误,通常在二进制编码中额外加上一个校验位,用于表示编码中 1 的个数是奇数还是偶数。
- 奇偶校验位 (Parity bit) 也称校验位 (check bit) 或 冗余位 (redundant bit)
- 偶校验 (even parity):当字符编码中 1 的个数为偶数时,校验位为 0
- 奇校验 (odd parity):当字符编码中 1 的个数为奇数时,校验位为 0
ㅤ | 偶校验 | 奇校验 |
1000001 | 01000001 | 11000001 |
多维度奇偶校验
Multidimensional parity-check code (MDPC)
奇偶校验将数据块中的所有比特位相加,并根据和的奇偶性来确定奇偶校验位的值。
BH 位置上的数据错误,因为水平和垂直列的奇偶校验与预期不符 。
海明编码
Hamming(7,4) Code
Using Venn Diagrams to add 3 parity bits on 4-bit code
The four data bits are assigned to the inner compartments of three intersecting circles.
Example: Original Data 1110
In the remaining compartments are filled with even parity bits.
Construct a 7-bit composite word
The check bits occupy positions 1, 2, 4 in the composite word as they are only in one circle each.
The 7 bit composite word becomes: 1111000
Checking for errors
Read the 7 bit composite word, and recompute the total parity of each circle.
If there are no errors then we should have:
Dealing with error bit
For example, we have the original data 1011011
Error position An error bit in position 5