Coding Theory Calculator

Decoding Hamming Codes

A Hamming code of order rr over F=GF(q)F = GF(q) is an (n,k)(n,k)-code over FF with n=\ racqr1q1n = \ rac{q^r - 1}{q - 1} and k=nrk = n - r, and with PCM HrH_r, an r imesnr \ imes n matrix whose columns are scalar multiples of each other.

Suppose cCc \in C is sent and rVn(F)r \in V_n(F) is received. The error vector is e=rce = r - c.

Input: PCM HH and a received word rVn(F)r \in V_n(F).

  1. 1:

    Compute s=HrTs = Hr^T

  2. 2:

    If s=0s = 0, then accept rr as the transmitted word (so e=0e = 0); STOP

  3. 3:

    Compare ss with the columns of HH. If s=αhis = \alpha h_i for some ii, then set e=(0,,0,α,0,,0)e = (0, \ldots, 0, \alpha, 0, \ldots, 0) (α\alpha at iith position), and decode to c=rec = r - e; STOP

  4. 4:

    Report that more than one error has occurred

Decoded Word

Modulo

PCM H

Rows
2
Columns
2

Received Word r