Encoding Process
c= uG
u: binary data sequence of length 4( input)
G: Generator matrix which is 7*4
c: Codeword
Decoding Process
s= rH^{T}
r: received data sequence of length 7 ( input) H: Parity-Check Matrix
s: Syndrome to check error-position
If some output values of the encoding and decoding multiplication is over than 1, the value should be changed into remainder on division of itself by 2. (Ex: (4 2 1 ) => (0 0 1))
s(Syndrome) detect error position. We can know the single-error-bit position in the table below.
Fig. Decoding table for Hamming code(7,4)
If s is [0 0 0] and r= [0 1 0 0 0 1 1], it supposes that there is no error and transmitted data is [0 0 1 1]. If s is [0 1 0] and r = [1 0 1 0 0 1 0], it supposes that 2^{th} bit is corrupted, so r should be changed to [1 1 1 0 0 1 0], and transmitted data is lower 4bits, [0 0 1 0].