If the information is a 32-bit binary code, how many parity bits do you need to add to form a Hamming code?

Hamming code is another extension of parity check code. The difference is that Hamming code adopts multi-bit check, and each of these check bits performs parity check on different information data.

Let's make a simple derivation to see how long parity bits are needed for information data with data bit m to meet the requirements of error correction.

The k-bit check code can have 2 k values. Obviously, one of the values indicates that the data is correct, and the remaining two values of k- 1 indicate that the data is incorrect. If it can satisfy: 2 k- 1 > M+k(m+k is the total length after encoding), in theory, k check codes can determine which bit (including information code and check code) has a problem.

So in theory, 32-bit data should be added with 6-bit check code.

Generally speaking, the parity code of Hamming Code will be inserted into the position of 1, 2, 4, 8 … data. According to the Hamming parity equation, the Hamming parity code can be obtained.