1 / 27

III. Cyclic Codes

III. Cyclic Codes. Cyclic Shift: v=( v 0 ,v 1 ,v 2 , … , v n-1 ) Cyclic shift of v: v (1) = ( v n-1 ,v 0 ,v 1 , … ,v n-2 ) It means cyclically shifting the components of v one place to the right

Télécharger la présentation

III. Cyclic Codes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. III. Cyclic Codes

  2. Cyclic Shift: v=(v0,v1,v2,…, vn-1) Cyclic shift of v: v(1)=(vn-1,v0,v1,…,vn-2) It means cyclically shifting the components of vone place to the right v(i)=(vn-i, vn-i+1,…, vn-1,v0,v1,…,vn-i-1): cyclically shifting v i places to the right Description of Cyclic Codes Definition of Cyclic Codes: An (n,k) linear code C is called a cyclic code if every cyclic shift of a codeword in C is also a codeword in C

  3. Code Polynomials • Each codeword corresponds to a polynomial of degree n-1 or less: • For a codeword v=(v0,v1,v2,…, vn-1) thecorresponding code polynomial is: v(X)= v0+v1X+v2X2+…+vn-1Xn-1 • Code polynomial for v(i): v(i)(X)=vn-i+vn-i+1X+…+vn-1Xi-1+v0Xi+v1Xi+1+…+vn-i-1Xn-1

  4. Example: (7,4) cyclic code

  5. Algebraic Relation between v(X) and v(i)(X) Xiv(X)=v0Xi+v1Xi+1+…+vn-i-1Xn-1+…+vn-1Xn+i-1 Add (vn-i+vn-i+1X+…+vn-1Xi-1)twice Xiv(X)= vn-i+vn-i+1X+…+vn-1Xi-1+ v0Xi+v1Xi+1+…+vn-i-1Xn-1+…+vn-1Xn+i-1+ vn-i+vn-i+1X+…+vn-1Xi-1 Xiv(X)= vn-i+vn-i+1X+…+vn-1Xi-1+v0Xi+v1Xi+1+…+vn-i-1Xn-1+ vn-iXn+vn-i+1Xn+1+…+vn-1Xn+i-1+vn-i+vn-i+1X+…+vn-1Xi-1=v(i)(X)+(Xn+1)(vn-i+vn-i+1X+…+vn-1Xi-1) v(i)(X) is the remainder of dividing Xiv(X) by (Xn+1) Xiv(X)=v(i)(X)+(Xn+1)q(X)

  6. Theorem 1 The nonzero code polynomial of minimum degree in a cyclic code is unique Proof: • Let g(X)=g0+ g1X+…+gr-1Xr-1+Xr be a non-zero code polynomial of minimal degree in C • If g(X) is not unique, there a exists a code polynomial g’(X) such that: g’(X)=g’0+ g’1X+…+g’r-1Xr-1+Xr • For C to be linear g(X)+g’(X) is…… a Codeword. The corresponding code polynomial is: (g0+ g’0)+(g1+ g’1)X+…+(gr-1+ g’r-1)Xr-1 with degree<r • THIS CONTRADICTS THE DEFINITION THAT g(X) IS THE NON-ZERO CODE POLYNOMIAL OF MINIMUM DEGREE

  7. Theorem 2 Let g(X)=g0+ g1X+…+gr-1Xr-1+Xr be a non-zero code polynomial of minimal degree in an (n,k) cyclic code C. Then g0 must be equal to 1 Proof: • Suppose g0=0 • g(X)=g1X+…+gr-1Xr-1+Xr • If we cyclically shift g(X) 1 place to the left we get another code polynomial g’(X)=g1+g2X…+Xr-2+Xr-1 with degree<r • THIS CONTRADICTS THE DEFINITION THAT g(X) IS THE NON-ZERO CODE POLYNOMIAL OF MINIMUM DEGREE • Therefore g0=1

  8. From Theorems 1 & 2 The non-zero code polynomial of minimal degree in an (n,k) cyclic code C has the form: g(X)=1+ g1X+g2X2+…+gr-1Xr-1+Xr In the table for the (7,4) cyclic code in slide 4 g(X)=1+X+X3

  9. The polynomials Xg(X), X2g(X),…,Xn-r-1g(X) are cyclic shifts of g(X) where: Xg(X) = g(1)(X) X2g(X) = g(2)(X) : : Xn-r-1g(X) = g(n-r-1)(X) Cyclic Shifts of the Minimal Degree Polynomial g(X) They are code polynomials Given that Xg(X), X2g(X),…, Xn-r-1g(X) are code polynomials in a linear code v(X)= [u0+u1X+u2X2+…+un-r-1Xn-r-1]g(X) is also a code polynomial in C

  10. Theorem 3 Let g(X)=1+ g1X+g2X2+…+gr-1Xr-1+Xr be the minimal degree polynomial in an (n,k) cyclic code C. A binary polynomial of degree n-1 or less is a code polynomial if and only if it is a multiple of g(X) Proof: • Let v(X) be a binary polynomial of degree n-1 or less such that v(X) is a multiple of g(x). Then: v(X)= [a0+a1X+a2X2+…+an-r-1Xn-r-1]g(X). v(X) is a linear combination of code polynomials, g(X), Xg(X), …Xn-r-1g(X) • Let v(X) be a code polynomial in C v(X)=a(X)g(X)+b(X) where the degree of b(X)<r b(X)=v(x)+a(X)g(X) v(X) is a code polynomial, a(X)g(X) are code polynomials b(X) is also a code polynomial of degree<r g(X) is the minimal degree nonzero polynomial b(X)=0 v(X) is a code polynomial in C v(X) is a multiple of g(X)

  11. The Number of Code Polynomials From Theorem 3: A code polynomial must be a multiple of g(X) & Any multiple of g(X) is a code polynomial The number of multiples of g(X) of degree<n-1 are: n-r The number of code polynomials are 2n-r k=n-r where k is the number of information bits in the code word, r is the number of parity check bits in the codeword g(X)=1+g1X+g2X2+…+gn-k-1Xn-k-1+Xn-k

  12. Theorem 4 In an (n,k) cyclic code, there exists one and only one code polynomial of degree n-k g(X)=1+g1X+g2X2+…+gn-k-1Xn-k-1+Xn-k 1. Every code polynomial is a multiple of g(X) 2. Every binary polynomial of degree n-1 or less that is multiple of g(X) is a code polynomial

  13. Generator Polynomial From Theorem 4: Every code polynomial v(X) in an (n,k) cyclic code could be expressed as: v(X)= u(X)g(X) =(u0+ u1X+…+uk-1Xk-1 )g(X) If (u0, u1,…,uk-1) is the information message, v(X) represents the corresponding codeword An (n,k) cyclic code is completely specified by its non zero minimal degree code polynomial g(X) g(X) is called the generator polynomial

  14. Theorem 5 The generator polynomial g(X) of an (n,k) cyclic code is a factor of Xn+1 Proof: Multiply g(X) by Xk Xkg(X) has a degree n. By dividing Xkg(X) by Xn+1 Xkg(X)=(Xn+1)+g(k)(X) g(k)(X) is a cyclic shift of g(X) and therefore is a code polynomial g(k)(X) is a multiple of g(X) g(k)(X)=a(X)g(X) Xkg(X)=(Xn+1)+a(X)g(X) (Xn+1)=[XK+a(X)]g(X) Therefore g(X) is a factor of Xn+1

  15. Theorem 6 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 Proof: • It is possible to generate 2k polynomials from linear combinations of the polynomials g(X), Xg(X), …,Xk-1g(X) v(X)=(u0+ u1X+…+uk-1Xk-1)g(X)WE HAVE A LINEAR BLOCK CODE • IS THIS CODE CYCLIC? Xv(X)=vn-1(Xn+1)+v(1)(X) Since BOTH Xv(X) and (Xn+1) are divisible by g(X), v(1)(X) must be also be divisible by g(X) Therefore v(1)(X) must be a linear combination of g(X), Xg(X), …,Xk-1g(X) Therefore v(1)(X) must be a code polynomial in the (n,k) linear block code

  16. Example (X7+1)=(1+X)(1+X+X3)(1+X2+X3) There are two factors of degree 3 Each factor could be used to generate a (7,4) cyclic code

  17. Generator Matrix of Cyclic Codes Any Codeword is a Linear Combination of: g(X), Xg(X), …,Xk-1g(X) Example: (7,4) Cyclic Code with g(X)=1+X+X3 Could be converted to systematic form with the help of row operations

  18. Parity Check Matrix of Cyclic Codes (Xn+1)is divisible by g(X), i.e., let (Xn+1)=g(X)h(X) where h(X)=h0+h1X+h2X2+…+hkXk Therefore v(X)h(x) = a(X)g(X)h(X) = a(X)(Xn+1) The degree of a(X)≤k-1, therefore, The powers Xk,Xk+1,…,Xn-1 do not appear in a(X)(Xn+1) v(X)h(X)=(v0+v1X+…vn-1Xn-1) (h0+h1X+…hkXk), therefore vkh0 +vk-1h1+ … + v0hk =0 vk+1h0+vkh1 + … + v1hk =0 . vn-1h0+vn-2h1+ … + vn-k-1hk=0

  19. Parity Check Matrix of Cyclic Codes Example: (7,4) Cyclic Code with g(X)=1+X+X3 h(X)=(X7+1 )/g(X) h(X)=1+X+X2+X4

  20. Cyclic Codes in Systematic form Consider an (n,k) cyclic code g(X) is the generator polynomial u(X) is a message polynomial of degree<k Xn-ku(X)=u0Xn-k+u1Xn-k+1+… +uk-1Xn-1 Divide Xn-ku(X) by g(X), Therefore Xn-ku(X)=a(X)g(X)+b(X) The degree of b(X) must be n-k-1 or less, i.e., b(X)=b0+b1X+…+bn-k-1Xn-k-1 Rearranging: b(X)+Xn-ku(X)=a(X)g(X) b(X)+Xn-ku(X) is a multiple of g(X) and therefore is a code polynomial in the cyclic code b(X)+Xn-ku(X) corresponds to the codeword: (b0,b1,…, bn-k-1,u0,u1,…,uk-1) The code is systematic

  21. Example Consider a (7,4) cyclic code with g(X)=1+X+X3 Given u=(1 0 0 1). Find the corresponding codeword if • The code is nonsystematic v(X)=u(X)g(X)=(1+X3)(1+X+X3)=1+X+X4+X6 v=(1 1 0 0 1 0 1) • The code is systematic X3u(X)=X3+X6. Dividing by g(X). The remainder b(X)=X2+X v(X)=b(X)+X3u(X)=X+X2+X3+X6 V=(0 1 1 1 0 0 1)

  22. Three Steps: Multiply the message polynomial u(X) by Xn-k Dividing Xn-ku(X) by g(X) to obtain the remainder b(X) Forming the codeword b(X)+Xn-ku(X) Encoding of Cyclic Codes in Systematic Form Encoding Circuit is a Division Circuit Gate g2 gn-k-1 g1 .. + + + + bn-k-1 b1 b2 b0 Xn-ku(X) Codeword Information Bits Parity Check Bits

  23. Encoding Circuit Example: Implementation Encoding Circuit of (7,4) Cyclic Code with g(X)=1+X+X3 Gate + + b1 b2 b0 Assume u=(1 0 1 1) Xn-ku(X) Codeword Information Bits Parity Check Bits Codeword: (1 0 0 1 0 1 1)

  24. u=(1 0 1 1)  u(X) = 1+X2+X3 X3u(X) = X3+X5+X6 X3u(X)/g(X) = (1+X+X2+X3) +1/g(X)  b(X) = 1 v(X) = 1+X3+X5+X6  v = (1 0 0 1 0 1 1) Encoding Circuit Example: Verification

  25. Let Received Polynomial represent the received vector r(X)=a(X)g(X)+s(X) s(X) is called the syndrome polynomial Syndrome Polynomial and Error Detection Error Detection All codewords MUST BE divisible by g(X). i.e., s(X) is identical to zero if and only if r(X) is a code polynomial If s(X)≠0  An Error Pattern is Detected

  26. Syndrome Circuit Syndrome Circuit is a Division Circuit Gate g2 gn-k-1 g1 r(X) .. + + + + sn-k-1 s1 s2 s0 Received Vector

  27. Syndrome Circuit Example: Implementation Syndrome Circuit of (7,4) Cyclic Code with g(X)=1+X+X3 Gate + + s1 s2 s0 Assume r=(0 0 1 0 1 1 0) Syndrome: (1 0 1)

More Related