Analysis of the most popular heiming coding calculation, error checking and Error Correction principles in history

Source: Internet
Author: User

The following is the PPT content of the author's video course, which explains the coding calculation, detection error and Error Correction principles of Haiming code in detail and in plain terms. If the PPT is concise and hard to understand, the video link of this course is as follows (Free to watch. All my courses are sold!): Http://edu.51cto.com/lesson/id-21540.html
I. Basic Idea of Haiming code error/Error Correction
Hamming Code is an error Code that can have multiple check bits and detect and correct one error Code. Therefore, Hamming Code is only used in environments with better channel characteristics, for example, Ethernet. Its basic ideas of error detection and error correction are as follows:

(1) divide the valid information into several groups according to a certain rule, and each group arranges a parity bit for verification through the exclusive or operation to obtain the specific verification code.

(2) check whether the verification results of each group are correct through the exclusive or operation at the receiving end, and observe the incorrect calibration group or the common check bits of multiple erroneous verification groups, obtain the specific error bit

(3) correct the wrong bit
Ii. Haiming code calculation
To calculate a Haiming code, perform the following steps: calculate the number of checksum digits → determine the checksum position → determine the checksum

1. Calculate the number of checksum digits

Assume that N is used to represent the binary digits of the transmitted information after the verification code bit is added, K is used to represent the number of valid digits, and r is used to represent the number of digits of the added verification code. The relationship between them should meet the following requirements: N = K + r ≤ 2r-1 (to ensure that the r bit verification code can verify all data bits, because the r bit verification code can represent the maximum decimal number 2r-1, at the same time, ensure that the codes themselves are not verified by other verification codes)

Information Code count

1

2 ~ 4

5 ~ 11

12 ~ 26

27 ~ 57

58 ~ 120

121 ~ 247

Check Code count

2

3

4

5

6

7

8

2. Determine the checksum position

The checksum of the Haiming code must be at the 2n Power Point (n starts from 0, representing 1st, 2, 4, 8, and 16 respectively from the left ......), The information code is in a non-2n power position.

3. Confirm the verification code

  • Check Position Selection Principle: The I-bit verification code starts from the current check bit. After each consecutive check I-bit, the I-bit is skipped, and then the I-bit is continuously verified, and the I-bit is skipped, and so on. Determine the bits verified by each verification code:
P1 verification code bit: 1st bits (that is, P1 itself), 3rd bits, 5th bits, 7th bits, 9th bits, 11th bits, 13th bits, .......
  • P2 verification code bit: 2nd bits (that is, P2 itself), 3rd bits, 6th bits, 7th bits, 10th bits, 11th bits, 14th bits, 15th bits, .......
  • P3 verification code bit: 4th bits (that is, P4 itself), 5th bits, 6th bits, 7th bits, 12th bits, 13th bits, 14th bits, 15th bits, 20th, 21st, 22nd, 23rd ,.......
  • The code field for Pn verification code bit verification is 2n-1 (I .e. Pn itself), 2n-1 + 1, 2n-1 + 2, 2n-1 + 3 ,...... , 2n-1, 3rd × 2n-1, 3rd × 2n-1 + 1 ,...... , 2nd × 2n-1 bits, 5th × 2n-1 bits, 5th × 2n-1 + 1 bits, 3rd × 2n-1 bits ,...... , 7th x 2n-1, 7th x 2n-1 + 1 ,...... , 4th x 2n-1 ,......, 2n-1 ,...... The m×2n-1 digit.

Finally, each group uses an exclusive or logical operation (same as the parity Verification Principle) to make the operation result of each group 0 to obtain the I-bit verification code value.

4. checksum and Error Correction

Divide the bits verified by the above verification codes into the corresponding groups, and then perform the logical "XOR operation" on each bits at the receiving end. If a parity check is used, under normal circumstances, all are 0.

If the verification results in only one verification group do not match, you can directly know that the verification code in the corresponding verification group has encountered an error during transmission, because the bits of all verification codes are verified only by the corresponding verification codes;
If multiple groups of verification results are found to be incorrect, view the public verification data bits in these groups (only data bits can be verified by several verification codes ), to determine which data bit has an error (only one error can be checked by the Haiming Code );
Finally, the error data bit can be reversed to Implement error correction.


Iii. Examples of Haiming code calculation

Original information code: 10011101

(1) determine the number of digits of the Verification Code

The original information code is 8 in total. According to the preceding table, we can know that the number of checksum digits is 4.

(2) determine the checksum position

?? 1? 001? 1101

(2) computer verification Codes

The code field for Pn verification code bit verification is 2n-1 (I .e. Pn itself), 2n-1 + 1, 2n-1 + 2, 2n-1 + 3 ,...... , 2n-1, 3rd × 2n-1, 3rd × 2n-1 + 1 ,...... , 2nd × 2n-1 bits, 5th × 2n-1 bits, 5th × 2n-1 + 1 bits, 3rd × 2n-1 bits ,...... , 7th x 2n-1, 7th x 2n-1 + 1 ,...... , 4th x 2n-1 ,......, 2n-1 ,...... The m×2n-1 digit.
P1 (n = 1): 1, 3, 5, 7, 9, 11 # ---- test bit, the same below

1 1 0 1 1 0 # ---- value of the corresponding bit, the same below

P2 (n = 2): 2, 3, 6, 7, 10, 11

1 1 0 0 1 1

P3 (n = 3): 4, 5, 6, 7, 12

0 0 0 1 1

P4 (n = 4): 8, 9, 10, 11, 12

1 1 1 0 1

The information code after the verification code is inserted is 111000111101.



[All my video courses are off, and will be effective before on January 1 !]

My video course home: http://edu.51cto.com/pack/view/id-3.html

Purchase a lifetime member, enjoy all courses, and join my public account "Wang da lecture hall" For details

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.