Hamming check code--Determine check digit

Source: Internet
Author: User

Transferred from: http://blog.csdn.net/yudandan10/article/details/11878421

Computer composition of the Hamming check code, I believe that the learning will have to understand, then the verification of the determination of the bit, I think some people are not very clear, today I would like to detail how to determine the check bit to share

First look at the basic concepts:

2^r≥k+r+1

where r is the check bit, K is the information bit information bit is known, then how to determine the check bit, with an example to illustrate

For example: binary code 1011 to find the Hamming coding steps are as follows:

1, first determine the information bit, that is, 1011, then the length of K will also know that the 4-bit

2, determine the verification code is a few according to the above formula we go to try the closest and meet the conditions of the value, 1011 of the check bit is 3, that is, r=3, so just meet the conditions

3, determine the number of bits of the check bit is to determine the value of the check bit and assign the check bit

First of all, the allocation check bit: In general, the check digit is placed in the 2^n position, that is, 1, 2, 4, 8 ....

The second is determining the grouping (that is, determining the value of the check digit)

Through the initial problem solving we know that the check digit + information bit is 7 bits altogether, so let's first draw a table and fill in the data separately.

Note: I have seven positions in the 1~7 to indicate that when filling in the information to the high-level data to be filled to a higher position, for example, 1011 will be similar to the method of filling in the picture

Determine the grouping principle for the check digit:

1. The check digit of each position determines: To verify the first few (i) then I is equal to the location of the check digit Plus and a simple example, add I want to research 3rd, then 3=1+2 that is 3 by the second check bit to verify, according to such an algorithm, and so on, we can know where each location needs Check bit to verify the

The following is a 1011 calibration bit allocation table

Given the above-mentioned approach, we have made it clear where each location needs to be verified, and here's a key step.

We want to summarize these data, that is, each check bit to verify the location, respectively, the values of these locations by the same or calculate (that is, the same value is 0, the difference is taken 1) so that the value of each check bit

Let's take a look at each check bit to see which locations are verified separately:

It can be seen from this table that the position to be verified for the check bit has been determined, and the rest is the calculation of the value of the test bit, (use or operation)

Can get R1 R2 R3 value is 1,0,0 (if you do not also or operation here, then suggest Baidu Check, practice a simple example will and understand)

At this point, we find the value of the check bit, and the sea-codes are out.

Then for the validation of the sea-level error correction and other knowledge I do not introduce here, the above is my understanding of this part of the knowledge, welcome to Exchange Learning

(turn) Hamming check code--Determine the check digit

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.