Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16
Coding
(Part -6)
Dr. Asmita A. Moghe
Professor, Department of Information Technology UIT RGPV-Bhopal Contents Linear Block Codes (Another example) Cyclic Codes. Given an H matrix how to determine coded messages for given data words. Given H matrix as below of a (7,4) code find coded messages for all possible 4 bit words. 1 1 1 0 1 0 0 1 1 0 1 0 1 0 H 1 0 1 1 0 0 1 T P I ( n k )
Now we need to obtain G or generator matrix
from H matrix to determine code word. Since G matrix is a kxk identity matrix, followed by an rxr arbitrary P matrix, we can obtain G matrix from H matrix as below In given problem for (7,4) code, n=7 and k = 4 , => r=n-k =3 So G will be made of G = [I(3x3) : P]. So 1 0 0 0 111 0 1 0 0 11 0 G 0 0 1 0 101 0 0 0 1 0 11 I P ( 4 x 4) Now coded message is given by C=DG Consider 4 bit message as [0000] Then coded message can be formed as 1 0 0 0 111 0 1 0 0 1 1 0 C1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 0 0 0 1 0 1 1
Similarly all remaining 15 possible message
words from 0000 t0 1110 can be coded . Thus, given H matrix or G matrix in the problem, they can be derived from each other. Also one can check that GHT = 0 Syndrome computation S=CHT If R is received word then Syndrome of R is S= RHT = EHT Single bit errors can be corrected by comparing S with rows of HT and correcting ith received bit if S=ith row of HT Cyclic Codes Cyclic codes are a subclass of linear block codes. A cyclic code has the property that a cyclic shift of one code word of the code forms another code word. A 7 bit code word (1101001)written li nearly 0 B can be represented on a circle 0
1 1
0 0
A 1 Starting at some point say B, we can read 0 1 1 1010.
The two code words are related by a simple
rotation of one to give the other i.e. Related by a cyclic shift.
• Order in which words are generated depends on
direction of shift (clockwise or anti clock)
• Seven possible starting places therefore 7
possible words Cyclic codes have algebraic properties which allow them to be easily encoded and decoded.
Hamming code is one such code.
Encoding and syndrome can be computed with
simple shift registers.
Cyclic codes can also be generated by a
definite procedure. An (n,k) linear block code C is called a cyclic code if it satisfies the following property.
If an n tuple v =(v0, v1, v2, ....vn-1)-------(1)
is a code vector of C, then the n- tuple v(1) = (vn-1, vn, v1, ....vn-i-1) which is obtained by cyclic shifting v one place to right, is also a code –vector of C.
• From the above, it is seen that (2) is also a
code vector v(i) = (vn-i, vn-i+1, v1, ....v0, v1,.....vn-i-1)-----(2) The code word v can be represented as a code polynomial as V ( x) v0 v1 x v2 x 2 .... vn 1 x n 1 (3)
The coefficients of the polynomial are 0’s and 1’s
and they belong to binary field which satisfies the rules of binary addition and multiplication.
If G(x) is a polynomial of degree (n-k) and is a
factor of xn+1, then G(x) generates an(n,k) cyclic code in which code polynomial V(x) for a data vector D = (d0,d1,d2,...dk-1) by
V(x) = D(x)G(x) Example The generator polynomial of a (7,4) cyclic
code is g(x) = 1+ x +x3. Find the 16 code
words of this code. Let message be D = (d d d d )=(0101) 0 1 2 3 Then message polynomial is D(X) = (0)1 + (1)x + (0)x2 + (1)x3 = x +x3 • The code polynomial is given by V(X) = D(X)g(X) = (x +x3)(1+ x +x3) = x +x2 +x3 + x4 +x4 +x6 Now, x4 +x4 = (1+1)x4 (0)x4 = 0 Hence V(X) = x +x2 +x3 +x6 = (0)1 + (1)x + (1) x2 + (1) x3 + (0) x4 + (0) x5 + (1) x6
• Hence the code vector is (0111001)
• Similarly all code vectors can be found. • It is found that 7 code vectors with three 1’s in each of them and 7 code vectors with four 1’s in each of them satisfy equation (2). • Also two code vectors with all 0’s and all 1’s can be code words of any cyclic code. Message Code vector 0000 0000000 0001 0001101 0010 0011010 0011 0010111 0100 0110100 0101 0111001 0110 0101110 0111 0100011 1000 1101000 1001 1100101 1010 1110010 1011 1111111 1100 1011100 1101 1010001 1110 1000110 1111 1001011 n =2r -1 k = 2r – 1 – r Ex r =2 , k=1, n=3 (3,1) r =3, k=4,n=7,(7,4) R=4,(15,11) References R. P Singh & S.D Sapre, Communication Systems Taub & Schilling,Principles of Communication