1. parity
Odd parity codes are guaranteed a piece of data occurs an odd number.
The two codewords 00 and 01, to ensure the required odd parity, these two codewords can be added to . 1 00 and 0 01.
Even parity is an even number to ensure a piece of data occurs.
2. Hamming code
The disadvantages of using parity check code is only to check the whole data, and can not be verified locally, so the introduction of plain sea.
** Hamming code design: packet checksum ** -> a plurality of check bits -> parity bit error location indicated.
Provided information bits n, parity bit k, parity formula: 2 ^ K> = n-K + +. 1 .
Note : the parity bit for an on position Pi (i-1) of the 2 ^.
How checksum bit **?
The Hamming code bits: 2 7 = 2 + 2 1 + 2 0,6 2 = 2 + 2 1,5 2 = 2 + 2 0,3 2 = 1 + 2 ^ 0, index represents the weight P3, P2, P1 .
P1 = 0, P2 = 1, P3 = 0; Ruhai Ming fill the parity bit position;
Correction
The exclusive itself or, if the correct representative of all 0, is obtained if the second location 010 illustrate errors, which can be inverted.
CRC checksum
-
k-bit information bit, R bit parity check code bits N = K + R.
-
After the shift information code becomes 101001 000
-
With the remainder after shifting information code 101 001 000 1101 In addition to the binary code is the checksum. FIG follows:
. ** 4 Correction: ** received CRC code obtained by dividing the remainder bits 1101 is 000, then correctly.