Hamming code (Hamming code) of the working mechanism

First, the Hamming code is formed by:

  1, first of all by the Hamming code are parity bits and information bits of

  2, the digits to the relationship r information bits parity bit check bit information bits i 2 ^ r - 1> = i + r 

  3, the position check bit is a power of two such as 1248 ......

  4, the Hamming code bits packet 

    (In fact, since the Hamming code are parity packets, so the concept of a packet)

       1 - 1、3、5、7

       2 - 2、3、6、7

       4 - 4、5、6、7

      Rule is: the number of bits for each Hamming code consists of a number of parity check bits, parity check bits are also themselves.

                                 Each check bit is the number of bits (i.e., the position of the Hamming code) check bits equal to the number of bits and

  5, the parity bit is calculated after grouping:

     Spouse Principle: The number of the group 1 as an even Σpi% 2 = 0 

      With odd principle: the number of the group 1 is an odd number Σpi% 2 = 1

Second, the Hamming code Why can check an error?

          1. Why can find fault

                 Since the Hamming code when generated, in accordance with the principle of a spouse or with odd principle, so as long as there is an error, we'll check from group

                  Calculated found as generated according to the principle of a spouse Hamming code, found in a group number of 1 is an odd number, it shows that the group

                  A mistake.

         2, how to determine which one is wrong

                  We need to calculate the "Configuration Parameters" of each group, (the word is my own made) configuration parameter to 1, representing one of the group 1

                   Number does not comply with the principles arranged to generate configuration parameters set to 0 representing the configuration principles of generating the number of symbols 1 Hamming code.

                  According to a string of binary number of configuration parameters set by the group numbers in descending order of composition, we can directly calculate what a mistake

                  A.

          3. Why can discover which one wrong?

                   Because the packet, exclusive i-th group of 2 ^ (i-1) bits, the i-th group and the j-Sharing Group 2 ^ I '(i-1) + 2 ^ (j-1) bit, and so on.

                   Therefore, we are looking for what went wrong, we can compute the configuration parameters for each group look at that group have no errors

                   As long as the configuration parameters for each group are calculated, according to the mechanism can be shared check bits, to accurately calculate the dislocation

                   A position.

  

Guess you like

Origin www.cnblogs.com/studentWangqy/p/12594625.html