Ok. hammering code, is a way of encoding a string of data, to ensure that the data will get from point a to point b saftely. It's an error prevention code, so that interfernce such as single bit errors cuased to a signal distrutption.
Hammering code works as follows.
Original code (in binary)
1 0 1 0 1 1 1 0 1 1 0
For Hammering code, you work with powers of 2
so 2 to the 0 is is 1
2 the 1st is 1
2 to the 2nd is 4
and so on, as long as your string allows.
There are check bits, which is how the hammering code allows for the check of errors
So....you have the following code
1 0 1 0 1 1 1 R8 0 1 1 R4 0 R2 R1
R1 check the parity (even parity) of everyother bit. So in other works, it check the parity of bits 1, 3, 5, 7, 9, 11, 13, 15, ect....
R2 check 2,3 skips 2 bits, checks 6,7 skips 2 and checks 10, 11 ect.
R4 checks 4,5,6,7, skips 4, checks 12,13,14,15 skip 4 ect
R8 checks bits 8,9,10,11,12,13,14,15, skips 8 and check the next 8 bits
For each power of 2 that you can have in the sting, that value is a check bit
which checks the 2 to the x value of bits, skips that amount, and checks the next amout in line.
Remember the the check bit, CHECKS IT'S SELF as well
ok so with out orignal code...
R1 check
1 0 1 0 1 1 1 R8 0 1 1 R4 0 R2 R1
1 0 1 0 1 1 1 R8 0 1 1 R4 0 R2 1 // R1 becomes a 1 becasue when checking the parity of the bits it checks, it finds there are 5 1's, to make it even, it becomes a 1 to make 6
R2 check
1 0 1 0 1 1 1 R8 0 1 1 R4 0 R2 1 // R2 found 5 1's and became a 1 to make even
1 0 1 0 1 1 1 R8 1 1 1 R4 0 1 1
R4 check
1 0 1 0 1 1 1 R8 1 1 1 R4 0 1 1
1 0 1 0 1 1 1 R8 1 1 1 1 0 1 1 // R4 changes
R8 check
1 0 1 0 1 1 1 R8 1 1 1 1 0 1 1
1 0 1 0 1 1 1 1 1 1 1 1 0 1 1 // R8 changes
Now not every time are they going to change, but every time it looks to see the number of 1's in it's check pattern, and if working with even parity is going to changes according to the parity of it's check bits.
Hammering Code is efficent for detecting, and correcting errors after transmission.
If you have more questions I'll try to help out.