Parity checksum codes and sea-code

Source: Internet
Author: User

Parity checksum Code

Parity check code is the odd check code and even check code collectively. They all consist of adding a check digit to the encoding to be verified.

Odd Check code: plus the check digit, the number of 1 in the code is odd number.

Parity code: With the check digit, the number of 1 in the encoding is an even number.

Shunpingchi Parity Checksum Code

Cases:

Original code Odd check Even check
0000 0000 1 0000 0
0010 0010 0 0010 1
1100 1100 1 1100 0
1010 1010 1 1010 0

  

Vertical parity Checksum Code

Cases:

There are 32 bits of data 10100101 00110110 11001100 10101011

Vertical odd Check Perpendicular parity
Original code 10100101 10100101
00110110 00110110
11001100 11001100
10101011 10101011
Check code 00001011 11110100

  

Disadvantages:

Only the odd bit error can be detected and the error cannot be detected.

The original code is set to 0000, and the transmission process becomes 1001. If the use of odd check, the original code is 00001, the transmission will become 10011,1 is still odd number, can not be verified, if the use of parity, the original code is 00000, the transmission will become 10010,1 is still an even number, the same can not be verified.

 Sea-PlainText

Also, the use of the parity to verify the data, it is a multi-parity check error system. By inserting a k check bit between data bits, the code spacing is enlarged to achieve error detection and correction.

Note: The code distance refers to the number of different digits of the number in the corresponding bit of two code group.

Suppose that the number of bits of data is m, to the power of 2, such as 1,2,4,8 ... ) you are inserting K-bit parity codes and satisfying m+k+1<2k

Example:101101100, to seek the sea-plaintext.

101101100,9+k+1<2k

Solution, k=4, that is, the number of check code is 4 bits

Position 1 2 3 4 5 6 7 8 9 10 11 12 13
Original information bit 1 0 1 1 0 1 1 0 0
Check code used Check digit 1 Check Digit 2 1+2=3 Check Digit 3 1+4=5 2+4=6 1+2+4=7 Check digit 4 1+8=9 2+8=10 1+2+8=11 4+8=12 1+4+8=13

That is, each check bit verifies which location:

  bit1=3,5,7,9,11,13

  bit2=3,6,7,10,11

  bit4=5,6,7,12,13

  bit8=9,10,11,12,13

Through the original information bit, you do modulo 2 operation (XOR: The same as 0, the difference is 1) to get:

Bit1=1,0,1,0,1,0=1

Bit2=1,1,1,1,1=1

Bit4=0,1,1,0,0=0

Bit8=0,1,1,0,0=0

Check codes are: 1,1,0,0

Parity checksum codes and sea-code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.