Library

4.5.6 Decoding

Although decoding could theoretically be performed by table lookup, this is impractical for large code sets. Instead, matrix algebra is used to verify and correct codewords efficiently. The decoder multiplies the received n-bit word by the transpose of a parity-check matrix, H, that has the property:

GHT=0
(4.18)

where T denotes matrix transposition (rows and columns interchanged). The parity-check matrix corresponding to the generator matrix in Equation (4.17) is:

H=[111010011010101011001]
(4.19)

The decoder computes the syndrome vector S by multiplying the received codeword, R, by the transpose of H:

S=RHT=0
(4.20)

If S=0, no error is detected; a non-zero syndrome identifies the presence (and pattern) of bit errors.


Example: Block Code

Using the generator matrix in Equation (4.17), determine the output codeword for the input data word D = 0011.

From the data vector D = [0011].

Multiply by G over GF(2):

C=DG=0.row10.row21.row31.row4

=[0010101][0001011]=[0011110]

So, the input data word [0011] is transformed into the output code word [0011110].

We can quickly check that the code word is systematic because we can see the data word [0011] as the first four bits of C.

We can further check that the code word is correct by multiplying it by the transpose of the parity check matrix from Equation (4.19) to identify the syndrome, S:

S=CHT=[0011110][111110101011100010001]=[000]

Since the syndrome is zero, the codeword is correct.

If we look a little closer at the Equation (4.20) we can note that, if we replace the original codeword with the received code word, R, which is the original codeword plus any error—that is R=C+E:

S=RHT=(C+E)HT=CHT+EHT=0+EHT=EHT
(4.21)

In other words, the syndrome of the received vector depends only on the error and is independent of the code word. Furthermore, the syndrome indicates the location of the error so a single-bit error can be detected and corrected.


Example: Block Code with Errors

In the previous example, we saw that using the generator matrix in Equation (4.17), determine the output codeword for the input data word D = 0011 is C = 0011110.

Consider that an error is introduced in the channel and the received codeword is R = [0011110] which has an error in the second bit (marked with an underscore in this example).

The decoder checks the syndrome, S:

S=CHT=[01_11110][111110101011100010001]=[110]

Since the syndrome is non-zero, the codeword is not correct. Furthermore, the syndrome points to the second row in the transpose matrix, indicating that the error is in the second bit.

A little further investigation will show why. The error vector is [0100000] so:

S=EHT=[01_00000][111110101011100010001]=[110]

Consider that two errors have been introduced in the channel and the received codeword is R = [0001110] which has an error in the second and third bits.

The decoder checks the syndrome, S:

S=CHT=[01_0_1110][111110101011100010001]=[011]

The syndrome indicates a single error in the fourth bit and therefore the output is [0100110] which is a valid code word corresponding to data word [0100]. So, the decoder detects that the received codeword is not valid but assumes it to be a single-bit error and therefore ‘corrects’ it inappropriately. Remember, with a minimum distance of 3 in a (7,4) code, two errors result in a received code word that is only a single bit different from a valid code word.

Of course, three errors will be undetected by the decoder because it will ‘correctly’ determine the codeword to be valid since in a (7,4) code there is a Hamming distance of 3 between valid code words.