0110110 (n = 8) If the k power of 2 is greater than or equal to n+k+ 1, it can be found that a detection bit k=4 is needed to configure the hamming code.
The original code 0110110 is recorded as B8, B7, B6, B5, B4, B3, B2, B 1.
The positions of the original code and the detection bits are arranged as follows:
Binary serial number:1234 56 78 911112.
Name c1c2b8c4b7b6b5c8b3b2b1
If the hamming code is configured according to the spouse principle, then
C 1 should make the number of "1" in 1, 3, 5, 7, 9, 1 1 even;
C2 should make the number of "1" in the 2nd, 3rd, 6th, 7th,1and1even;
C4. Make the number of "1" in bits 4, 5, 6, 7 and 12 even;
C8 should make the number of "1" at the 8th, 9th, 1, 12 positions even;
So C 1 should be 3 ⊕ 5 ⊕ 7 ⊕ 9 ⊕1,that is, C 1 = B8 ⊕ B7 ⊕ B5 ⊕ B4 ⊕.
Therefore, C2 should be 3 ⊕ 6 ⊕ 7 ⊕10 ⊕1,which means C2=B8⊕B6⊕B5⊕B3⊕B2.
So C4 should be 5 ⊕6 ⊕7 ⊕ 12, which means C4=B7⊕B6⊕B5⊕B 1.
So C8 should be 9 ⊕10 ⊕12, which means C8=B4⊕B3⊕B2⊕B 1.
That is to say,
c 1=b8⊕b7⊕b5⊕b4⊕b2=0⊕ 1⊕0⊕ 1⊕ 1= 1
c2=b8⊕b6⊕b5⊕b3⊕b2=0⊕ 1⊕0⊕ 1⊕ 1= 1
c4=b7⊕b6⊕b5⊕b 1= 1⊕ 1⊕0⊕0=0
c8=b4⊕b3⊕b2⊕b 1= 1⊕ 1⊕ 1⊕0= 1
So the Hamming check code of 01110 is c1c2b8c4b6b8b4b2b1=100/kloc.