Parity is a bit that says if a string of binary should have an even or odd amount of ones
0
is even1
is odd
Hamming Distance is (in this context) basically the amount of bits need to be flipped until error detection fails
[0/1]
is the parity bit
0101[0]
has a hamming distance of 2 because only 2 bits need to be flipped until parity is even again
03
is opcode for starting the metadata sectionA0
is opcode for starting the row of parity bit sectionA1
is opcode for starting the coloum of parity bit sectionA3
is opcode for starting the final parity bit section (parity of all parity bits)04
is opcode for ending the metadata section05
is opcode for starting the frame section06
is opcode for ending the frame section
03 A0 [..row of parity bits..] A1 [..coloum of parity bits..] A3 [..final parity..] 04 05 [..data..] 06 [..rest of data..] 06
In the frame we have 06
, which is also the opcode to end the frame. To prevent corrupted frames we can compare the frame to the paritys, because it was cut off, it will not match and we can ignore this 06
Hamming Distance of 4 bits