Block Codes: Department of Electrical Engineering National Institute of Technology Rourkela
Block Codes: Department of Electrical Engineering National Institute of Technology Rourkela
Block Codes: Department of Electrical Engineering National Institute of Technology Rourkela
BY
PROF. P.K. SAHU
1 NITR
BLOCK CODES
Block codes are codes in which there are possible message blocks
of ‘k’ bits, to which are added ‘r’ redundant check bits generated
from the ‘k’ message bits by a predetermined rule.
In a systematic block code, the first or last ‘k’ bits of the code word
are the message bits and the remaining ‘r’ bits are check bits.
2 NITR
BLOCK CODES
Block codes are codes in which there are possible message blocks
of ‘k’ bits, to which are added ‘r’ redundant check bits generated
from the ‘k’ message bits by a predetermined rule.
In a systematic block code, the first or last ‘k’ bits of the code word
are the message bits and the remaining ‘r’ bits are check bits.
3 NITR
In
a non systematic block codes, there is no specific rule of placing the message bits in
specific position of the code word.
Usually the systematic block codes are used for error decteion and correction by
communication engineers.
4 NITR
For example (6,3) or (7,4) systematic block code word can be expressed as
011 101
110 110
Check bits
Code word Message or
(6,3) data bits
6 NITR
Similarly other code word in this set
are 000 for data 00
011 for date 01
110 for data 11
Transmitted code word is deneoted by ‘C’ and received code word is denoted by ‘R’.
If the received code word is error free then
R=C
otherwise R=C+E
where E= Error vector.
7 NITR
Error dectetion using Block Code
Consider the same (3,2) block code and the generated code word are
` 101,000,011 and 110
Take 101 as the transmitted and 111 as the received code words
i.e C=101
R=111
Transmitted Received
101 111
This bit
is error
How to check ‘R’ that it is error free for the received code word ‘R’ to be error free
R. must be equal to zero.
8 NITR
R.=0 is the condition
where H= parity check matrix
H is defined as
if R=C, then R.HT =C.HT=0 and C.H is always “Zero”
if R.HT=0, it indicates R=C and received code word is “error free”
if then R=C+E and
=(C+E)HT=C.HT+E.HT 0
= 0+E.HT0 means received code word is in “error”
Hence ‘R’ to be error free
RHT=S to be zero
Sis known as the error syndrome.
Hence S=RHT=(C+E)HT
S=EHT
9 NITR
For the above case R=111
H= and HT=
Hence RHT=S=
Hence error is decteted
10 NITR
Check for multibit Error
TX RX
101 011
Find ‘S’???
11 NITR
Error detection and correction capability of block code
There are some basic theorem that define the capability of linear block codes in terms
of weights, distance and minimum distance.
The weights (Hamming weights), ‘W’ of a code word ‘C’ is the number of nonzero
components of ‘C’.
Example :-0101101W=4
The distance (Hamming distance) ‘d’ between two code vectors C1 and C2 is the
number of components by which the differ.
Example:-
12 NITR
The Hamming distance or the minimum Hamming distance ‘dmin’ is the smallest
distance between any pair of code word in the entire code.
Example:- (7,4) block code taken
Data (D) Code word (C) Weight (W)
0000 0000000 -----------
0001 0001011 3
0010 0010101 3
0011 0011110 4
0100 0100110 3
0101 0101101 4
0110 0111000 3
0111 0111000 3
1000 1000111 4
1001 1001100 3
1010 1010010 3
1011 1011001 4
1100 1100001 3
1101 1101010 4
1110 1110100 4
1111 1111111 7
13 NITR
By using any pair of code word from the entire code we found dmin=3.
This ‘dmin’ also same as the minimum weights of any nonzero code word of the set.
Hence dmin=minimum weights of any non zero code word.
14 NITR
Case study
A (7,4) block code has the following generator matrix ‘G’ for which the possible 16
code word as shown in the table.
G= and H=
15 NITR
Correction:-
The syndrome vector ‘S’ indicates the presence of error and the content ‘110’ is
identical to the second row of HT matrix.
Hence the content of syndrome indicates that second bit of the received code word is in
error however the error correction capacity of the above code is limited to one only as
16 NITR
If you go for correction, according to content of syndrome vector, sixth bit of ‘R’will be
changed from 1 to 0 which is not actually corrupted and hence correction is not
approximate.
Because of limitation of error detection capacity, it can detected a max. of 2nos. of
errors.
As (detection)max.=dmin-1
=3-1=2
More than 2 error can not be detected even.
Consider a case of 3 bit error R=1110100
Then S=RHT=[000] this indicates no error.
Hence (7,4) block code fails to detect error.
As the no. of error in the code word are beyond its capacity.
17 NITR
Error detection and correction using non systematic
block code
In a non systematic block code, check bits can be placed any where within the
code length.
Consider a (7,4) non systematic block code data is1010
1 2 3 4 5 6 7
C1 C2 C3 C4 C5 C6 C7
- - 1 - 0 1 0 D
1 0 1
1 0 1 1 0 1 0 C
1 0 1 1 0 1 1 R
18 NITR
Check ‘R’ for C1 1
C21
C41
C4C2C1=111indicates 7th bit is in error.
If R is 1011000 then C1 0
C2 1
C4 1
C4C2C1=110indicates 6th bit is in error.
If R=C=1011010 then C1 0
C2 0
C4 0
C4C2C1=110indicates 0th bit is in error means no error.
19 NITR
Write the bit positions as 1 10 11 100 101 110 111 1000 1001 1010 1011
etc
for 1 2 3 4 5 6 7 8 9 10 11
For 1st Check bit, all bit positions whose LSB 1 are considered for parity
check.
Example: 1,3,5,7,9,11 etc
Foe 2nd Check bit, all bit positions whose 2nd bit is 1 from LSB are
considered for parity check
Example: 2, 3, 6, 7, 10, 11 etc
Similarly for 3rd Check bit, all bit positions whose 3rd bit is 1 from LSB are
considered for parity check
Example: 4, 5, 6, 7, 12, 13, 14, 15 etc
20 NITR
Two bit error detection
R=1001011
Check C1 1
C21
C41
C4C2C1=100hence indicates error no correction possible
dmin-1=2no of errors detection and no of error correction
Like systematic block code words of (7,4), these non systematic block code words also
have minimum Hammimng distance dmin =3.
This (7,4) block code is also known as Hammimng code.
21 NITR