BCH_code

download BCH_code

of 35

Transcript of BCH_code

  • 8/13/2019 BCH_code

    1/35

    BCH Codes

    Yunghsiang S. Han

    Graduate Institute of Communication Engineering,

    National Taipei University

    Taiwan

    E-mail: [email protected]

  • 8/13/2019 BCH_code

    2/35

    Y. S. Han BCH codes 1

    Description of BCH Codes

    The Bose, Chaudhuri, and Hocquenghem (BCH) codes form a

    large class of powerful random error-correcting cyclic codes.

    This class of codes is a remarkable generalization of the

    Hamming code for multiple-error correction.

    We only consider binary BCH codes in this lecture note.

    Non-binary BCH codes such as Reed-Solomon codes will bediscussed in next lecture note.

    For any positive integers m 3 and t

  • 8/13/2019 BCH_code

    3/35

    Y. S. Han BCH codes 2

    We call this code a t-error-correctingBCH code.

    Let be a primitive element in GF(2m). The generator

    polynomial g(x) of the t-error-correcting BCH code of length

    2m 1 is the lowest-degree polynomialover GF(2) which has

    , 2, 3, . . . , 2t

    as its roots.

    g(i) = 0 for 1 i 2t and g(x) has , 2, . . . , 2t and their

    conjugates as all its roots.

    Let i(x) be the minimal polynomial of i. Then g(x) must be

    the least common multipleof1(x), 2(x), . . . , 2t(x), i.e.,

    g(x) = LCM{1(x), 2(x), . . . , (x)2t}.

    Ifi is an even integer, it can be expressed as i= i2, where i is

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    4/35

    Y. S. Han BCH codes 3

    odd and > 1. Then i =

    i2

    is a conjugate of i

    . Hence,

    i(x) = i(x).

    g(x) = LCM{1(x), 3(x), . . . , 2t1(x)}.

    The degree ofg(x) is at most mt. That is, the number ofparity-check digits, n k, of the code is at most equal to mt.

    Ift is small, n k is exactly equal to mt.

    Since is a primitive element, the BCH codes defined are usually

    called primitive(or narrow-sense) BCH codes.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    5/35

    Y. S. Han BCH codes 4

    Example

    Let be a primitive element ofGF(24) such that 1 + + 4 = 0.

    The minimal polynomials of , 3, and 5 are

    1(x) = 1 + x + x4,

    3(x) = 1 + x + x2 + x3 + x4,

    5(x) = 1 + x + x2,

    respectively. The double-error-correcting BCH code of length

    n= 24 1 = 15 is generated by

    g(x) = LCM{1(x), 3(x)}

    = (1 + x + x4)(1 + x + x2 + x3 + x4)

    = 1 + x4 + x6 + x7 + x8.

    n k= 8 such that this is a (15, 7, 5) code. Since the weight of

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    6/35

    Y. S. Han BCH codes 5

    the generator polynomial is 5, it is a (15, 7, 5) code.

    The triple-error-correcting BCH code of length 15 is generated by

    g(x) = LCM{1(x), 3(x), 5(x)}

    = (1 + x + x4)(1 + x + x2 + x3 + x4)(1 + x + x2)

    = 1 + x + x2 + x4 + x5 + x8 + x10.

    n k= 10 such that this is a (15, 5, 7) code. Since the weight

    of the generator polynomial is 7, it is a (15, 5, 7) code.

    The single-error-correcting BCH code of length 2m 1 is a

    Hamming code.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    7/35

    Y. S. Han BCH codes 6

    !"#$"%"&'(')*&% *, -./0123 #/42 5 416 4 6 7

    89#*&"&')(:

    ;*'(')*&

    )(:

    ;*'(')*&

    ?)&($=

    ;*'(')*&

    @"A)>(:

    ;*'(')*&

    B)&)>(:

    )(:

    C C CCCC C 9!

    C 7 CCC7 7 9 6 7!

    7 4 CC7C 0 916 9 6 7!0 40 C7CC 1 916 9 6 7!

    D 4D 7CCC E 916 9D6 906 9 6 7

    !1 4 6 7 CC77 D 916 9 6 7!

    F 406 4 C77C G 906 9 6 7!

    G 4D6 40 77CC 70 916 9D6 906 9 6 7

    !H 4D6 4 6 7 7C77 77 916 9D6 7!

    E 406 7 C7C7 F 916 9 6 7!

    I 4D6 4 7C7C 7C 916 9D6 906 9 6 7

    !7C 406 4 6 7 C777 H 906 9 6 7

    !77 4D6 406 4 6 7 777C 71 916 9D6 7!

    70 4D6 406 4 6 7 7777 7F 916 9D6 906 9 6 7!

    7D 4D6 406 7 77C7 7D 916 9D6 7!

    71 4D6 7 7CC7 I 916 9D6 7

    !!0!1!E!7G!!!

    D!G!70!01!1E!!D

    !!I

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    8/35

    Y. S. Han BCH codes 7

    Examples of Finite Fields

    "#$%&

    ' !"#$%'()*+)&

    ,),&- .$)' / )&

    ,),&01.23435678

    92575623:28;32;

    92575623?4@6

  • 8/13/2019 BCH_code

    9/35

    Y. S. Han BCH codes 8

    BCH Codes of Lengths Less than 210 1 (1)

    ! " # $ ! " # $ ! " # $ " # $ " # $

    % & ' ( "# )' & ()& *+ (% )** (,& - )** &( )-

    ' (* (( ( (, (+ '% (' (&- (+ .% %+

    & ) (. (( %. (* (&( (( ** %(

    * % (+ (% )- )( (.% () '& ')

    * %( ). ( & (* )) )% (** (% '* '%

    )( ) $ ()& ()+ ( (* )& ('& (' %& '*

    (. % ((% ) , %( (%- (* )- '&

    (( * (+. % , )** )'& ( (%( (, )( **

    . & -- ' )%- ) ()% (- (% *-

    . .% *& ( -) * )%( % ((* )( - .%

    *( ) ,* . ))% ' (+& )) *(( *+) (

    '* % &, & )(* * -- )% '-% )

    %- ' &( - )+& . -( )* ',' %

    %. * .' (+ (-- & ,& ). '&* '

    %+ . *& (( (-( , &- )& '.. *

    %&' ( )*+,,

    - . / 0 *(

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    10/35

    Y. S. Han BCH codes 9

    BCH Codes of Lengths Less than 210 1 (2)

    ! # $ ! # $ ! # $ ! # $ ! # $

    %&& '%( ) %&& *++ ++ %&& &,* '* %&& %- ,& &.+* ,** ,

    ''- ( *&* +* &-' '% ', ,* ,+* &.

    '*, - *.' +% &(% ') '. ,% ,&* &&

    '*. , +,% +) &)) '( *& &., ,.* &+

    '+& &. +-) +( &%( %& +- &&& -,* &*

    '&+ && +(( +- &'- %* &, &&, --* &'

    '.* &+ +)- +, &*, %' &. &+& -(* &%

    *,' &* +%, *. &*. %% &.&* & -)* &)

    *-% &' +%. *& &+& %- &.+* &..* + -%- &(

    *() &% +'& *) &&+ %, ,,* *

    *)( &) +*- *( &.* )& ,-* '

    *%- &- ++, *- ,' )+ ,(* %

    *', &, ++. *, -% )* ,)* )

    *'. +. +&& '& () -% ,%* (

    **& +& +.+ '+ )( -( ,'* -

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    11/35

    Y. S. Han BCH codes 10

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    12/35

    Y. S. Han BCH codes 11

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    13/35

    Y. S. Han BCH codes 12

    Minimal Polynomials of the Elements in GF(26)

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    14/35

    Y. S. Han BCH codes 13

    Generator Polynomials of All BCH Codes of Length 63

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    15/35

    Y. S. Han BCH codes 14

    Parity-Check Matrix of a BCH Code

    We can define a t-error-correcting BCH code of length

    n= 2m 1 in the following manner: A binary n-tuple

    v= (v0, v1, . . . , vn1) is a code word if and only if the polynomialv(x) =v0+ v1x + + vn1x

    n1 has , 2, . . . , 2t as roots.

    Since i is a root ofv(x) for 1 i 2t, then

    v(i) =v0+ v1i + v2

    2i + + vn1(n1)i = 0.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    16/35

    Y. S. Han BCH codes 15

    This equality can be written as a matrix product as follows:

    (v0, v1, . . . , vn1)

    1

    i

    2i

    ...

    (n1)i

    = 0 (1)

    for 1 i 2t.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    17/35

    Y. S. Han BCH codes 16

    Let

    H=

    1 2 3 n1

    1 (2) (2)2 (2)3 (2)n1

    1 (3) (3)2 (3)3 (3)n1

    ......

    1 (2t) (2t)2 (2t)3 (2t)n1

    . (2)

    From (1), ifv= (v0, v1, . . . , vn1) is a code word in the

    t-error-correcting BCH code, then

    vHT =0.

    If an n-tuple v satisfies the above condition, i is a root of thepolynomial v(x). Therefore, v must be a code word in the

    t-error-correcting BCH code.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    18/35

    Y. S. Han BCH codes 17

    H is a parity-check matrix of the code.

    If for some i andj, j is a conjugate of i, then v(j) = 0 if and

    only ifv(i) = 0.

    The Hmatrix can be reduced to

    H=

    1 2 3 n1

    1 (3) (3)2 (3)3 (3)n1

    1 (5) (5)2 (5)3 (5)n1

    ......

    1 (2t1) (2t1)2 (2t1)3 (2t1)n1

    .

    If each entry ofHis replaced by its corresponding m-tuple overGF(2) arranged in column form, we obtain a binary parity-check

    matrix for the code.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    19/35

    Y. S. Han BCH codes 18

    BCH Bound

    The t-error-correcting BCH code defined has minimum distance

    at least 2t + 1.

    Proof: We need to show that no 2t of fewer columns ofH sum

    to zero. Suppose that there exists a nonzero code vector v with

    weight 2t. Let vj1 , vj2 , . . . , vj be the nonzero components of

    v. Then

    0 = v HT

    = (vj1 , vj2 , . . . , vj)

    j1 (2)j1 (2t)j1

    j2 (2)j2 (2t)j2

    j3 (2)j3 (2t)j3

    ... ... ...

    j (2)j (2t)j

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    20/35

    Y. S. Han BCH codes 19

    = (1, 1, . . . , 1)

    j1 (j1 )2 (j1 )2t

    j2

    (j2

    )

    2

    (j2

    )

    2t

    j3 (j3 )2 (j3 )2t

    ......

    ...

    j (j )2 (j)2t

    .

    The equality above implies the following equality:

    (1, 1, . . . , 1)

    j1 (j1 )2 (j1 )

    j2 (j2 )2 (j2 )

    j3 (j3 )2 (j3 )

    ... ... ...

    j (j)2 (j )

    =0,

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    21/35

    Y. S. Han BCH codes 20

    which the second matrix on the left is a square matrix. To

    satisfy the above equality, the determinant of the matrix

    must be zero. That is,

    j1 (j1 )2 (j1 )

    j2 (j2 )2 (j2 )

    j3 (j3 )2 (j3 )

    ......

    ...

    j (j)2 (j)

    = 0.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    22/35

    Y. S. Han BCH codes 21

    Then

    j1+j2++j

    1 j1 j1(1)

    1 j2 j2(1)

    1 j3 j3(1)

    ......

    ...

    1 j j(1)

    = 0.

    The determinant in the equality above is a Vandermonde

    determinantwhich is nonzero. Contradiction!

    The parameter 2t + 1 is usually called the designed distanceof

    the t-error-correcting BCH code.

    The true minimum distance of the code might be larger than

    2t + 1.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    23/35

    Y. S. Han BCH codes 22

    Syndrome Calculation

    Let

    r(x) =r0+ r1x + r2x2 + + rn1x

    n1

    be the received vector and e(x) the error pattern. Then

    r(x) =v(x) +e(x).

    The syndrome is a 2t-tuple,

    S= (S1, S2, . . . , S 2t) =r HT,

    where His given by (2).

    Si=r(i) =r0+ r1

    i + r22i + + rn1

    (n1)i

    for 1 i 2t.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    24/35

    Y. S. Han BCH codes 23

    Dividing r(x) by the minimal polynomial i(x) of i, we have

    r(x) =ai(x)i

    (x) +bi(x),

    where bi(x) is the remainder with degree less than that ofi(x).

    Since i(i) = 0, we have

    Si =r(i) =bi(

    i).

    Since 1, 2, . . . , 2t are roots of each code polynomial, v(i) = 0

    for 1 i 2t.

    Then Si=e(i) for 1 i 2t.

    We now consider a general case that is also good for non-binary

    case.

    Suppose that the error pattern e(x) has v errors at locations

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    25/35

    Y. S. Han BCH codes 24

    0 j1 < j2

  • 8/13/2019 BCH_code

    26/35

    Y. S. Han BCH codes 25

    (3) can be rewritten as follows:

    S1 = Y1X1+ Y2X2+ + YvXv

    S2 = Y1X21 + Y2X

    22 + + YvX

    2v

    S3 = Y1X31 + Y2X

    32 + + YvX

    3v

    ...

    S2t = Y1X2t1 + Y2X

    2t2 + + YvX

    2tv . (4)

    We need to transfer the above set of non-linear equations into a

    set of linear equations.

    Consider the error-locator polynomial

    (x) = (1 X1x)(1 X2x) (1 Xvx)

    = 1 + 1x + 2x2 + + vx

    v. (5)

    Multiplying (5) by YiXj+vi , where 1 j v, and set x= X

    1i

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    27/35

    Y. S. Han BCH codes 26

    we have

    0 =YiXj+vi 1 + 1X1i + 2X2i + + vXvi .

    for 1 i v.

    Summing all above v equations, we have

    0 =v

    i=1

    Yi

    Xj+vi + 1X

    j+v1i + + vX

    ji

    =v

    i=1

    YiXj+vi + 1

    vi=1

    YiXj+v1i + + v

    vi=1

    YiXji

    = Sj+v+ 1Sj+v1+ 2Sj+v2+ + vSj .

    We have

    1Sj+v1+ 2Sj+v2+ + vSj = Sj+v

    for 1 j v.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    28/35

    Y. S. Han BCH codes 27

    Putting the above equations into matrix form we have

    S1 S2 Sv1 Sv

    S2 S3 Sv Sv+1...

    Sv Sv+1 S2v2 S2v1

    v

    v1

    ...

    1

    =

    Sv+1

    Sv+2...

    S2v

    . (6)

    Since v t, S1, S2, . . . , S 2v are all known. Then we can solve for

    1,2, . . . ,v.

    We still need to find the smallest v such that the above system of

    equations has a unique solution.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    29/35

    Y. S. Han BCH codes 28

    Let the matrix of syndromes, M, be defined as follows:

    M=

    S1 S2 Su

    S2 S3 Su+1...

    ......

    Su Su+1 S2u1

    .

    M is nonsingular ifuis equal to v, the number of errors thatactually occurred. M is singular ifu > v.

    Proof: Let

    A=

    1 1 1

    X1 X2 Xu

    ......

    ...

    Xu11 Xu12 X

    u1u

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    30/35

    Y. S. Han BCH codes 29

    with Aij =Xi1j and

    B =

    Y1X1 0 00 Y2X2 0...

    ......

    0 0 YuXu

    with Bij =YiXiij , where

    ij =

    1 i= j

    0 i =j.

    We have

    ABAT

    ij

    =u

    =1

    Xi1

    uk=1

    YXkXj1k

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    31/35

    Y. S. Han BCH codes 30

    =u

    =1

    Xi1

    YXXj1

    =u

    =1

    YXi+j1

    =Mij .

    Hence, M=ABAT. Ifu > v, then det(B) = 0 and then

    det(M) = det(A)det(B)det(AT) = 0. Ifu= v, then det(B) = 0.

    Since A is a Vandermonde matrix with Xi =Xj , i =j ,

    det(A) = 0. Hence, det(M) = 0.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    32/35

    Y. S. Han BCH codes 31

    The Peterson-Gorenstein-Zierler Algorithm

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    33/35

    Y. S. Han BCH codes 32

    Example

    Consider the triple-error-correcting (15, 5) BCH code with

    g(x) = 1 + x + x2 + x4 + x5 + x8 + x10. Assume that the received

    vector is r(x) =x2 + x7. The operating finite field is GF(24). Then

    the syndromes can be calculated as follows:

    S1 = 7

    +2

    = 12

    S2 = 14 +4 = 9

    S3 = 21 +6 = 0

    S4 = 28 +8 = 3

    S5 =

    35

    +

    10

    =

    0

    = 1S6 =

    42 +12 = 0.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    34/35

    Y. S. Han BCH codes 33

    Set v= 3, we have

    det(M) =

    S1 S2 S3

    S2 S3 S4

    S3 S4 S5

    =

    12

    9 0

    9 0 3

    0 3 1

    = 0.

    Set v= 2, we have

    det(M) =

    S1

    S2

    S2 S3

    =

    12

    9

    9 0

    = 0.

    Graduate Institute of Communication Engineering, National Taipei University

  • 8/13/2019 BCH_code

    35/35

    Y. S. Han BCH codes 34

    We then calculate

    M1 = 0 6

    6

    9

    .Hence,

    2

    1

    = M1

    0

    3

    =

    9

    12

    and

    (x) = 1 +12x +9x2

    =

    1 + 2x

    1 + 7x

    = 9 x 8

    x 13

    .Since 1/8 = 7 and 1/13 = 2, we found the error locations.

    Graduate Institute of Communication Engineering, National Taipei University