Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Block Codes: Department of Electrical Engineering National Institute of Technology Rourkela

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 21

BLOCK CODES

BY
PROF. P.K. SAHU

Department Of Electrical Engineering


National Institute of Technology Rourkela

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.

 Types : 1). Systematic block code


2). Non systematic block code

 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.

 Types : 1). Systematic block code


2). Non systematic block code

 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.

Block code word Representation


 A code word with ‘n’ bits of which ‘k’ bits are data ( message) is written as (n,k)
Where
k = no. of message bits
r = no. of check bits

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

  The general form of block code word ‘C’ is expressed as

Where D= Data or message (‘k’ bits )


G=Generator matrix that creats the check bits from data bits
5 NITR
Generation of code words
 Ex. Take a (3,2) code where D is a 2 bits data word and G be the generator matrix
defined by the rule
G=
where = Identity matrix of order K
P= An arbitrary k*(n-k) or k*r matrix
 There is no fixed rule or procedure for designing ‘P’ matrix.
 For the above (3,2) code word let us take D=[1 0] and G=
 So C=DG=[1 0]
=[(1.1 0.0)] [(1.0 0.1)] [(1.1 0.1)]
=[(1 0)] [(0 0)] [(1 0)]=101

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’???

 Which detected no error


 Hence the limitation of (3,2)block code is that it can detected 1 bit error only. Multibit
error only. Multibit error can not be detected by this code. also it can not correct the
error.

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 :-0101101W=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.

Where d= no. of error that can be detected


c= no. of error that can be corrected
 Maximum no. of error detection =
 Under this condition correction is not possible.
 When detection and correction both possible
 Rounded to the next lowest integer if the number is fractional.

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=

 For D=, C=DG=


 Let the received code word R=1110010
 Then syndrome S=RHT is Hence error is detected.

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

 Hence no. of error that can be corrected=1


 If there are two error in the received code word ‘R’ as 1011011 then S=RHT=[1011011]
then S=RHT= hence error is detected.

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 is1010

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
C21
C41
 C4C2C1=111indicates 7th bit is in error.
 If R is 1011000 then C1 0
C2 1
C4 1
 C4C2C1=110indicates 6th bit is in error.
 If R=C=1011010 then C1 0
C2 0
C4 0
 C4C2C1=110indicates 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
C21
C41
 C4C2C1=100hence indicates error no correction possible
 dmin-1=2no 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

You might also like