6,517 views
Following $7$ bit single error correcting hamming coded message is received.
$$\overset{7\qquad 6\qquad 5 \qquad 4\qquad 3 \qquad 2 \qquad 1}{\boxed{1 \qquad 0\qquad 0 \qquad 0 \qquad 1 \qquad 1 \qquad 0}} \qquad \overset{\textbf{bit No.}}{\boxed{X}}$$
Determine if the message is correct (assuming that at most $1$ bit could be corrupted). If the message contains an error find the bit which is erroneous and gives correct message.

Here, answer is yes. There is error in This message. Error is in bit $6$.

How to calculate it? First of all reverse given input to get it in correct position from $1$ to $7$.

$0110001$

$\text{Bit-1, Bit-2 & Bit-4}$ are partity bits.

Calculating position of error $\Rightarrow$

$\text{$\large c_4 c_2 c_1$}$

$\text{1 1 0}$

Here, $c4 = \text{bit}4\oplus \text{bit}5 \oplus \text{bit}6 \oplus \text{bit}7=0\oplus 0\oplus 0\oplus 1=1$
$\text{ (Taking Even parity )}$

$c2 = \text{bit}2\oplus \text{bit}3\oplus \text{bit}6\oplus \text{bit}7=1\oplus 1\oplus 0\oplus 1=1$

$c1= \text{bit}1\oplus \text{bit}3\oplus \text{bit}5\oplus \text{bit}7=0\oplus 1\oplus 0\oplus 1=0$

Reference: $\Rightarrow$ https://en.wikipedia.org/wiki/Hamming%287,4%29

When you correct bit $6$.

You get a message as $0110011$.

If you calculate $\large c_4,c_2,c_1$ all will be $0$ now!

edited

@ankit3009

when we apply hamming code the sequence we follow is 1,2,3,4…

but here 7,6,5,4,3….  is given.

So to handle that situation reverse is applied.

i.e. it become more easy to count in increasing order like 1,2,3,4,..

than decreasing order like 100,99,98,...

for human mind.

@GateOverflow04

but is it necessary to reverse??

check this link  Hamming Code in Computer Network - GeeksforGeeks

No it's not necessary to reverse,

It totally depend on you, if you can directly solve it, then it's okay

Error bit is 6 ... Msg is 1100110

Yes there is an error in this message at 6-bit position so the correct message is 1100110

### 1 comment

Thanks for such a nice explanation
6th bit is having error both parity bit 2 and 4 support this so 6 bit need to be 1 and data must be 1100110

1 vote