Hamming Technique (7,4) : In this case, we will have 4 bits of data and we will add 3 bits of redundant with the data by calculating the 4bit data. For example, taking a 4bit data as,
The encoder will encode the data as follows
Thus the decoder will receive,
0

1

1

0

0

1

1

And the decoder will decode the data to retrieve the original data along with detecting and correcting errors,
As the values of C_{4}, C_{2}, C_{1} are 0 then the received data has no error. Now to check error detection and correction applying a error in the data which was received by the decoder by changing a value of any bit. Here changing the value of the h_{5} bit from 1 to 0. So the data which will receive by the decoder will be as follows,
0

1

0

0

0

1

1

Now the decoder will decode again,
As the values of C_{4}, C_{2}, C_{1} are not all 0 then it will arrange the data as C_{4} C_{2} C_{1} = 101 and we know 101 is equivalent to 5, thus the decoder will confirm that the h_{5} bit has the error and it will change the value of h_{5}, Thus the error detection and correction will be done.