You are on page 1of 30

Linear block codes

and cyclic codes

Chapter-2
(Part-1)

Dr. Anjaneyulu Pattem


Linear block codes

2.1 Introduction
2.2 Generator matrix
2.3 Parity check matrix
2.4 Error control capability
2.5 Standard Array
2.6 Syndrome decoding (Decoding Tables)

2
2.1 Introduction

A sequence of k-message bits when applied, an encoder


transforms this message into an n-tuple word, called it as a
code word.
Thus 2k n-tuple code words can be generated for k messages
and this block of 2k n-tuple code words is called as (n,k)
block code.
Def: A block code of length, n, and 2k code words is called a
linear block code if and only if its 2k code words form k-
dimensional subspace of the vector space of all n-tuples
over the field GF(2).
For a linear block code, C, it can be satisfied that modulo-2
sum of any two code words is again a code word of the
same set, C.
3
2.2 Generator matrix, G

As vectors of this block code, form a subspace of the all n-


tuples vector space, it is possible to find k-linearly
independent n-tuple vectors, (g0 , g1 ,…gk-1 ) from these all
n-tuples.
Any code word (v) of (n,k) linear block code, C, can be
generated from linear combination of this (or any other)
set of k-linearly independent n-tuples or vectors.
When this k linearly independent vectors are arranged as
rows of a matrix, then this matrix is called as Generator
matrix, G. Row vectors (g0 , g1 ,…gk-1 ) and elements of G,
are given as

4
Generator matrix, G

[ g0 [ g00 g01 g0,n-1


G = g1 g10 g11 g1,n-1
…. = …………………………….
gk-1,] gk-1,0 gk-1,1 gk-1,n-1 ]
For example, generator matrix, G , for a (7,4) block code is
given as
[ 1101000
G= 0110100
1110010
1 0 1 0 0 0 1 ]; …… (1)
Code vectors,v, for messages u=(u0 , u1,…uk-1) are given as
v = u0g0 + u1g1 +…………+ uk-1gk-1 …. (2)

5
Example-1

Using this generator matrix, (7,4) block code word for a


message u=[1011], can be obtained as follows:
Solution:
v is obtained as v=u.G
[1 1 0 1 0 0 0
v= [1 0 1 1] 0110100 = [1 0 0 1 0 1 1]
1110010
1 0 1 0 0 0 1]
v0= u0+u2+u3=1
v1= u0+u2=0
v2= u2+u3=0 and n-tuple code word, v = [1 0 0 1 0 1 1]

6
Table-1

Using generator matrix,G, shown in example-1, distinct (7,4)


code words (v) for messages (u) are given below:

Messages (u) Code words(v) u v


0001 1010001 1101 0001101
0010 1110010 1110 0101110
0011 0100011 1111 1111111
1000 1101000 0100 1100100
1001 0111001 0101 1100101
1010 0011010 0110 1000110
1011 1001011 0111 0010111
1100 1011100 0000 0000000

7
parity check equations

From v= u.G,
It can be obtained as
vj= u0.p0j…………uk-1pk-1,j …… (3)
Where j is given as 0≤j<n-k.
Eqs. 3 are called as parity check equations of the (n,k) linear
block code, C.

8
Code in Systematic form

Code word can be partitioned (divided) into two parts. First


part is of parity check bits, which are linear sums of
information digits and second part is of message bits.
When the message is also a part of the code word, then it is
called as systematic code otherwise non systematic.
Any generator matrix can be used for the generation of the
code word. But systematic code can be obtained from the
generator matrix, which is in systematic form.
A systematic generator matrix is of the form given as
G= [Pkx(n-k) | Ikxk ],
where Pkx(n-k) is parity check matrix
and Ikxk is identity matrix
9
2.3 Parity check Matrix

Another useful property of linear block code is, for every kxn
generator matrix , G, there exists, (n-k)xn matrix, H, such
that any row space of G is orthogonal to rows of H and vice
versa.
This gives an alternative way of (n, k) block code as, for
every n-tuple block code ,v, generated by generator matrix,
G, there exists a matrix H, satisfying , v, as v.HT =0.
This matrix, H, is called as parity matrix of the code, C.
2(n-k) Linear combinations of (n-k) linearly independent rows
of H form a (n, n-k) code called as dual code, Cd.
Thus H, is a parity matrix for code, C, and at the same time it
is a generator matrix for the dual code, Cd.
H takes the following form for the systematic code.

10
Parity check Matrix

[ h00 h01 h0,n-1


H= h10 h11 h1,n-1
= …………………………….
hk-1,0 hk-1,1 hk-1,n-1 ]
A systematic parity matrix, H, is of the form given as
H= [I(n-k) | PTn-kxk ],
where PT (n-k)xk is parity matrix
and I(n-k) is identity matrix
Also H, satisfies, G. HT =0.
From v.HT =0 , it can be verified that the parity check
equations same as eq.3 can be obtained. Thus parity check
matrix, H completely specifies code, C.

11
Example-2: Property of G, and H for (6,3) code

G H
110100 100101
011010 010111
111001 001011

HT G.HT = 000
100
010
001
110
011
111
12
2.4.1 Error detecting capability

Principles of error detecting and error correcting are given in


chapter-1.
Error detecting and error correcting capabilities of a linear
block code can be estimated from the minimum distance of
the code, dmin.
Let v be a transmitted code word and r be the received word.
Let l errors occurred during transmission. Then r, and v
are differed in l positions. it implies, d(v,r)=l.
if dmin is the minimum distance of the code, then no two code
words with less than dmin, can change one code word into
another code word.
Thus a word with less than dmin (i.e dmin-1) errors cant be a
code word.

13
Error detecting capability

If dmin errors are occurred in the transmission, then the


decoder cant detect the errors in the code word.
This is because, word with dmin errors, may be again a code
word in the code that follows from the definition of
minimum distance of the code and linear property of the
block code.
Thus if r is with errors dmin or more, then the resultant code
word is again a code word and hence these errors cant be
detected.
But if r is with errors (dmin-1), the resultant word is not in the
code and hence (dmin-1) errors can be detected.
Thus a linear block with dmin distance, error detection
capability is (dmin-1).

14
2.4.2 Error correcting capability

Let t be a positive integer and dmin be the minimum distance


of the code. As dmin is either odd or even, it can be written
as
2t+1 ≤ dmin ≤ 2t+2 ---(1)
Let v be a transmitted code, r be the received code and w be
any other code word in C. then following triangle
inequality, it can be written as
d(v,r) + d(w,r) ≥ d(v,w) --------(2)
Suppose t’, errors occurred in the transmission, then
d(v,r)=t’. Also v and w are two code words, it can be
written as
d(v,w) ≥ dmin ≥ 2t+1 ------(3)
15
Error correcting capability

From eqs. 2 and 3, it can be written as


d(w,r) ≥ 2t+1 -t’ ------(3)
If t’ ≤ t , then d(w,r) >t ------(4)
Eq.4 indicates that d(v,r) is less than d(w,r).
Hence the decoder detects r as v which is the transmitted
vector. Thus the decoder corrects t errors, which is equal to
{(dmin -1)/2}.
It can also be proved that if l errors > t, occurred in the
transmission and the received word cant be detected by the
decoder.
Thus the error correcting capability of a linear block code is
t= |{(dmin -1)/2}| (largest integer not greater than (dmin -
1)/2). 16
2.5 Standard Array

When a code word, v, from a (n, k) block code is transmitted


over a noisy channel, then received vector may be with
errors due to the channel effects.
For this block code, for all possible 2n n-tuples, there will be
only distinct 2k n-tuple code words.
Thus there will be (2n-k ) error patterns.
A proper decoding principle is partitioning of 2n n-tuples into
2k n-tuple code words .
Thus for any transmitted vector, when combined with
different error patterns, if it is arranged that, the received
word, r, should fall into one of (2n-k ) error patterns and for
each error pattern there will be 2k disjoint code words,
then by identifying error pattern, transmitted code word
can be obtained, by adding the error pattern to r.
17
Standard Array

This principle is used in the Standard Array decoding.


2k n-tuple code words are arranged in first row, with all zero
word,v1, as the first element in the row. Thus v1…v2k are
the code words in the first row.
Then from the possible (2n-k ) error patterns, selecting an
error pattern, e2 which has smallest number of 1s, and is
placed below, v1.
Now adding e2, to all the remaining code vectors in the first
row, vi, and the sum (e2 + vi ) is placed below their
respective, vi. This forms the second row.
Third row can be obtained by proceeding in the same way as
second row by selecting unused error pattern, e3, and
placing the sums (e2 + vi ) below their respective, vi.

18
Figure-3: Structure of Standard array

19
Standard array

Continuing this, other rows can be obtained for all possible


error patterns and the resultant array is called as Standard
array, as shown in the following Figure-3.
In this array, rows are called as cosets, and starting element
of each row is called as coset leader. These coset leaders are
the correctable error patterns.
Correctable error patterns are arranged starting from the
smallest number of 1s.
From the received word, r, which is falling in one of the
elements in the rows of the array is identified. Noting the
coset leader, i.e. error pattern, ei, corresponding to that
row, and adding ei, to r, results the decoded word, vi, which
is considered as the transmitted word.
20
Example- 3

And standard array for (n, k) code is shown in Figure-4.


In this figure, for illustration, array is shown only for half of
the (n, k) codes. (It can be noted that array principle is
applicable to the other half also).
Decoding of the transmitted word, when single error occurs,
is given in the following example.
For example, let transmitted word, v is 0100011
and the received word, r, is 0100111,
From standard array in Figure-4, for r, falling in one of the
cosets,
the error pattern is identified as, ei = 0000100,
now the decoded word is vi = (ei + r) = 0100011,
which is assumed as transmitted word.
21
Figure-4: Standard Array for (7,4) block code

0000000 1010001 1110010 0100011 1101000 0111001 0011010 1001011


1000000 0010001 0110010 1100011 0101000 1111001 1011010 0001011
0100000 1110001 1010010 0000011 1001000 0011001 0111010 1101011
0010000 1000001 1100010 0110011 1111000 0101001 0001010 1011011
0001000 1011001 1111010 0101011 1100000 0110001 0010010 1000011
0000100 1010101 1110110 0100111 1101100 0111101 0011110 1001111
0000010 1010011 1110000 0100001 1101010 0111011 0011000 1001001
0000001 1010000 1110011 0100010 1101001 0111000 0011011 1001010

22
2.6 Decoding Table

Some theorems, which obey the algebraic structure of the


linear block codes, are given below:
Theorem-1: No two n-tuple words in any row are identical
and any n-tuple word can exist at one and only one place
in a row.
Theorem-2: For (n.k) block code having dmin, there exists t
number of correcting errors.
Theorem-3: Cosets in a row all have the same syndrome and
different cosets will have different syndromes.
Using theorem-3, it can be noted that there is a one to one
correspondence in between error pattern and syndrome.
Decoding is simplified using the above and is called as
syndrome decoding or look up table or decoding table
method.
23
Syndrome and error pattern

Syndrome decoding or decoding table is based on the relation


between syndrome, S and error pattern, e.
When a code word, v, is transmitted over noisy channel, then
the received word, r, is considered as sum of code word, v
and an n-tuple (e0 , e1 ,…en-1 ) error pattern, e.
From the received word, the decoder should identify, whether
received word is consisting of errors or not. For this the
decoder computes syndrome, S, using parity check matrix,
H. This syndrome is given as
S = r .HT
If S is 0, then there is no error and the received word, r, is
taken as transmitted word, v.

24
Decoding Table

Or if S is non zero, it implies that errors occurred in the


transmission.
The above syndrome equation, can be simplified as
S = r HT = (v + e ) HT = e .HT , since v HT =0
Thus for an error pattern, e, syndrome, S can be estimated
from the above equation.
As there is one to one correspondence in between, e and S, as
given in theorem-3, this property can be used in the
decoding table method. In this method possible error
patterns and their corresponding syndromes are listed in a
table, as shown in the following example-4.
Then the decoding procedure is consisting of the following
steps:

25
Decoding Table

1. A list of syndromes and their respective error patterns are


arranged in a table as shown in Table-3.
2. Syndrome is computed from the received vector, s= r.HT
3. Error pattern, ei, (coset leader) corresponding to this
syndrome is identified from the decoding table.
4. This ei is added to r, the resultant modulo sum is the
decoded word, which is considered as the transmitted code
word.
In this method, eventhough there are some undetectable
errors, which happen when the number of errors convert a
code word into another code word, this method is suitable
for less number of random errors occurring in the
transmission.

26
Table-3 : Decoding Table

Parity check matrix, H, for (7,4) block code is obtained from


the example-1. Then the syndromes for the error patterns
(starting from smallest number of 1s) are estimated using =
T
S=e .H and are listed as given below:
Error pattern Syndrome
1000000 100
0100000 010
0010000 001
0001000 110
0000100 011
0000010 111
0000001 101
27
Example- 4: Decoding Table

When a code word is transmitted and is corrupted in the


transmission through a channel, then the received word
can be decoded using the decoding table as given below:
Let transmitted word, v is 0100011, and the received word, r,
is 0100111.
For the data above, S is estimated as 011 from s= r.HT.
From the above decoding table, for this S, the error patter, e,
is identified as, e= 0000100.
Now using, e, vector, the received word, r, is decoded as v, by
adding e to r.
therefore the decoded word considered as transmitted word,
v is given as
v= (e+r) = (0000100 + 0100111) =0100011

28
29
30

You might also like