Вы находитесь на странице: 1из 13

BCH CODE

In coding theory the BCH codes form a class of parameterised error-correcting codes which have been the subject of much academic attention in the last fifty years. BCH codes were invented in 1959 by Hocquenghem, and independently in 1960 by Bose and Ray-Chaudhuri.[1] The acronym BCH comprises the initials of these inventors' names.

Construction
A BCH code is a polynomial code over a finite field with a particularly chosen generator polynomial. It is also a cyclic code.

Simplified BCH codes


For ease of exposition, we first describe a special class of BCH codes. General BCH codes are described in the next section. Definition. Fix a finite field GF(qm), where q is a prime. Also fix positive integers n, and d such that n = qm 1 and . We will construct a polynomial code over GF(q) with code length n, whose minimum Hamming distance is at least d. What remains to be specified is the generator polynomial of this code. Let be a primitive nth root of unity in GF(qm). For all i, let mi(x) be the minimal polynomial of i with coefficients in GF(q). The generator polynomial of the BCH code is defined as the least common multiple . Example Let q = 2 and m = 4 (therefore n = 15). We will consider different values of d. There is a primitive root satisfying 4 + + 1 = 0 (1)

its minimal polynomial over GF(2) is :m1(x) = x4 + x + 1. Note that in GF(24), the equation (a + b)2 = a2 + 2ab + b2 = a2 + b2 holds, and therefore m1(2) = m1()2 = 0. Thus 2 is a root of m1(x), and therefore m2(x) = m1(x) = x4 + x + 1. To compute m3(x), notice that, by repeated application of (1), we have the following linear relations:

1 = 03 + 02 + 0 + 1 3 = 13 + 02 + 0 + 0 6 = 13 + 12 + 0 + 0

9 = 13 + 02 + 1 + 0 12 = 13 + 12 + 1 + 1

Five right-hand-sides of length four must be linearly dependent, and indeed we find a linear dependency 12 + 9 + 6 + 3 + 1 = 0. Since there is no smaller degree dependency, the minimal polynomial of 3 is :m3(x) = x4 + x3 + x2 + x + 1. Continuing in a similar manner, we find

The BCH code with d = 1,2,3 has generator polynomial

It has minimal Hamming distance at least 3 and corrects up to 1 error. Since the generator polynomial is of degree 4, this code has 11 data bits and 4 checksum bits. The BCH code with d = 4,5 has generator polynomial

It has minimal Hamming distance at least 5 and corrects up to 2 errors. Since the generator polynomial is of degree 8, this code has 7 data bits and 8 checksum bits. The BCH code with d = 6,7 has generator polynomial

It has minimal Hamming distance at least 7 and corrects up to 3 errors. This code has 5 data bits and 10 checksum bits. The BCH code with d = 8 and higher have generator polynomial

This code has minimal Hamming distance 15 and corrects 7 errors. It has 1 data bit and 14 checksum bits. In fact, this code has only two codewords: 000000000000000 and 111111111111111.

General BCH codes


General BCH codes differ from the simplified case discussed above in two respects. First, one replaces the requirement n = qm 1 by a more general condition. Second, the consecutive roots of the generator polynomial may run from . Definition. Fix a finite field GF(q), where q is a prime power. Choose positive integers m,n,d,c such that , gcd(n,q) = 1, and m is the multiplicative order of q modulo n. As before, let be a primitive nth root of unity in GF(qm), and let mi(x) be the minimal polynomial over GF(q) of i for all i. The generator polynomial of the BCH code is defined as the least common multiple . instead of

Properties
1. The generator polynomial of a BCH code has degree at most (d 1)m. Moreover, if q = 2 and c = 1, the generator polynomial has degree at most dm / 2. Proof: each minimal polynomial mi(x) has degree at most m. Therefore, the least common multiple of d 1 of them has degree at most (d 1)m. Moreover, if q = 2, then mi(x) = m2i(x) for all i. Therefore, g(x) is the least common multiple of at most d / 2 minimal polynomials mi(x) for odd indices i, each of degree at most m. 2. A BCH code has minimal Hamming distance at least d. Proof: We only give the proof in the simplified case; the general case is similar. Suppose that p(x) is a code word with fewer than d non-zero terms. Then

Recall that

are roots of g(x), hence of p(x). This implies that satisfy the following equations, for : .

In matrix form, we have

The determinant of this matrix equals

The matrix V is seen to be a Vandermonde matrix, and its determinant is

, which is non-zero. It therefore follows that 3. A BCH code is cyclic. Proof: A polynomial code of length n is cyclic if and only if its generator polynomial divides xn 1. Since g(x) is the minimal polynomial with roots suffices to check that each of is a root of x 1. This follows immediately from the fact that is, by definition, an nth root of unity.
n

, hence p(x) = 0.

, it

Special cases

A BCH code with c = 1 is called a narrow-sense BCH code. A BCH code with n = qm 1 is called primitive.

Therefore, the "simplified" BCH codes we considered above were just the primitive narrow-sense codes.

A narrow-sense BCH code with n = qm 1 is called a Reed-Solomon code.

Decoding
There are many algorithms for decoding BCH codes. The most common ones follow this general outline:

1. 2. 3. 4.

Calculate the syndrome values for the received vector Calculate the error locator polynomials Calculate the roots of this polynomial to get error location positions. Calculate the error values at these error locations.

Calculate the syndromes


The received vector R is the sum of the correct codeword C and an unknown error vector E. The syndrome values are formed by considering R as a polynomial and evaluating it at . Thus the syndromes are[3] sj = R(c + j 1) = C(c + j 1) + E(c + j 1) for j = 1 to d 1. Since c + j 1 are the zeros of g(x), of which C(x) is a multiple, C(c + j 1) = 0. Examining the syndrome values thus isolates the error vector so we can begin to solve for it. If there is no error, sj = 0 for all j. If the syndromes are all zero, then the decoding is done.

Calculate the error location polynomial


If there are nonzero syndromes, then there are errors. The decoder needs to figure out how many errors and the location of those errors. If there is a single error, write this as , where i is the location of the error and e is its magnitude. Then the first two syndromes are

so together they allow us to calculate e and provide some information about i (completely determining it in the case of Reed-Solomon codes). If there are two or more errors,

RS CODE
In coding theory, ReedSolomon (RS) codes are non-binary cyclic error-correcting codes invented by Irving S. Reed and Gustave Solomon. They described a systematic way of building codes that could detect and correct multiple random symbol errors. By adding t check symbols to the data, an RS code can detect any combination of up to t erroneous symbols, and correct up to t/2 symbols.

Original view :{DESCRIPTION}


The original concept of ReedSolomon coding (Reed & Solomon 1960) describes encoding of k message symbols by viewing them as coefficients of a polynomial p(x) of maximum degree k 1 over a finite field of order N, and evaluating the polynomial at n > k distinct input points. Sampling a polynomial of degree k 1 at more than k points creates an overdetermined system, and allows recovery of the polynomial at the receiver given any k out of n sample points using (Lagrange) interpolation. The sequence of distinct points is created by a generator of the finite field's multiplicative group, and includes 0, thus permitting any value of n up to N. Using a mathematical formulation, let (x1, x2, ..., xn) be the input sequence of n distinct values over the finite field F; then the codebook C created from the tuplets of values obtained by evaluating every polynomial (over F) of degree less than k at each xi is

where F[x] is the polynomial ring over F, and k and n are chosen such that 1 k n N. As described above, an input sequence (x1, x2, ..., xn) of n = N values is created as

where is a primitive root of F. When omitting 0 from the sequence, and since N1 = 1, it follows that for every polynomial p(x) the function p(x) is also a polynomial of the same degree, and its codeword is a cyclic left-shift of the codeword derived from p(x); thus, a ReedSolomon code can be viewed as a cyclic code. This is pursued in the classic view of RS codes, described subsequently. As outlined in the section on a theoretical decoder, the original view does not give rise to an efficient decoding algorithm, even though it shows that such a code can work.

Classic view (ReedSolomon codes as BCH codes)


In practice, instead of sending sample values of a polynomial, the encoding symbols are viewed as the coefficients of an output polynomial s(x) constructed by multiplying the message polynomial p(x) of maximum degree k 1 by a generator polynomial g(x) of degree t = N k 1. The generator polynomial g(x) is defined by having , 2, ..., t as its roots, i.e.,

. The transmitter sends the N 1 coefficients of s(x) = p(x)g(x), and the receiver can use polynomial division by g(x) of the received polynomial to determine whether the message

is in error; a non-zero remainder means that an error was detected.[3] Let r(x) be the nonzero remainder polynomial, then the receiver can evaluate r(x) at the roots of g(x), and build a system of equations that eliminates s(x) and identifies which coefficients of r(x) are in error, and the magnitude of each coefficient's error. (Berlekamp 1984) (Massey 1969) If the system of equations can be solved, then the receiver knows how to modify his r(x) to get the most likely s(x). ReedSolomon codes are a special case of a larger class of codes called BCH codes. The BerlekampMassey algorithm has been designed for the decoding of such codes, and is thus applicable to ReedSolomon codes. To see that ReedSolomon codes are special BCH codes, it is useful to give the following alternative definition of ReedSolomon codes.[4] Given a finite field F of size q, let n = q 1 and let be a primitive nth root of unity in F. Also let be given. The ReedSolomon code for these parameters has code word if and only if are roots of the polynomial

With this definition, it is immediately seen that a ReedSolomon code is a polynomial code, and in particular a BCH code. The generator polynomial g(x) is the minimal polynomial with roots as defined above, and the code words are exactly the polynomials that are divisible by g(x).

Properties
The ReedSolomon code is a [n, k, n k + 1] code; in other words, it is a linear block code of length n (over F) with dimension k and minimum Hamming distance n k + 1. The Reed-Solomon code is optimal in the sense that the minimum distance has the maximum value possible for a linear code of size (n, k); this is known as the Singleton bound. Such a code is also called a maximum distance separable (MDS) code. The error-correcting ability of a ReedSolomon code is determined by its minimum distance, or equivalently, by n k, the measure of redundancy in the block. If the locations of the error symbols are not known in advance, then a ReedSolomon code can correct up to (n k) / 2 erroneous symbols, i.e., it can correct half as many errors as there are redundant symbols added to the block. Sometimes error locations are known in advance (e.g., side information in demodulator signal-to-noise ratios)these are called erasures. A ReedSolomon code (like any MDS code) is able to correct twice as many erasures as errors, and any combination of errors and erasures can be corrected as long as the relation 2E + S n k is satisfied, where E is the number of errors and S is the number of erasures in the block.

For practical uses of ReedSolomon codes, it is common to use a finite field F with 2m elements. In this case, each symbol can be represented as an m-bit value. The sender sends the data points as encoded blocks, and the number of symbols in the encoded block is n = 2m 1. Thus a ReedSolomon code operating on 8-bit symbols has n = 28 1 = 255 symbols per block. (This is a very popular value because of the prevalence of byteoriented computer systems.) The number k, with k < n, of data symbols in the block is a design parameter. A commonly used code encodes k = 223 eight-bit data symbols plus 32 eight-bit parity symbols in an n = 255-symbol block; this is denoted as a (n,k) = (255,223) code, and is capable of correcting up to 16 symbol errors per block. The above properties of ReedSolomon codes make them especially well-suited to applications where errors occur in bursts. This is because it does not matter to the code how many bits in a symbol are in error if multiple bits in a symbol are corrupted it only counts as a single error. Conversely, if a data stream is not characterized by error bursts or drop-outs but by random single bit errors, a ReedSolomon code is usually a poor choice compared to a binary code. The ReedSolomon code, like the convolutional code, is a transparent code. This means that if the channel symbols have been inverted somewhere along the line, the decoders will still operate. The result will be the inversion of the original data. However, the Reed Solomon code loses its transparency when the code is shortened. The "missing" bits in a shortened code need to be filled by either zeros or ones, depending on whether the data is complemented or not. (To put it another way, if the symbols are inverted, then the zerofill needs to be inverted to a one-fill.) For this reason it is mandatory that the sense of the data (i.e., true or complemented) be resolved before ReedSolomon decoding.

Applications:
Data storage Data transmission Bar code Satellite transmission

GOLAY
In mathematics and electronics engineering, a binary Golay code is a type of error-correcting code used in digital communications. The binary Golay code, along with the ternary Golay code, has a particularly deep and interesting connection to the theory of finite sporadic groups in mathematics. These codes are named in honor of Marcel J. E. Golay.

Generator matrix for the extended binary Golay code

Mathematical definition
In mathematical terms, the extended binary Golay code consists of a 12-dimensional subspace W of the space V=F224 of 24-bit words such that any two distinct elements of W differ in at least eight coordinates. Equivalently, any non-zero element of W has at least eight non-zero coordinates.

The possible sets of non-zero coordinates as w ranges over W are called code words. In the extended binary Golay code, all code words have the Hamming weights of 0, 8, 12, 16, or 24. Up to relabeling coordinates, W is unique.

The perfect binary Golay code is a perfect code. That is, the spheres of radius three around code words form a partition of the vector space. The automorphism group of the binary Golay code is the Mathieu group M23. The automorphism group of the extended binary Golay code is the Mathieu group M24. The other Mathieu groups occur as stabilizers of one or several elements of W. The Golay code words of weight eight are elements of the S(5,8,24) Steiner system.

Constructions
1. Lexicographic code: Order the vectors in V lexicographically (i.e., interpret them as unsigned 24-bit binary integers and take the usual ordering). Starting with w1 = 0, define w2, w3, ..., w12 by the rule that wn is the smallest integer which differs from all linear combinations of previous elements in at least eight coordinates. Then W can be defined as the span of w1, ..., w12. 2. Quadratic residue code: Consider the set N of quadratic non-residues (mod 23). This is an 11-element subset of the cyclic group Z/23Z. Consider the translates t+N of this subset. Augment each translate to a 12-element set St by adding an element . Then labeling the basis elements of V by 0, 1, 2, ..., 22, , W can be

3. 4.

5.

6.

defined as the span of the words St together with the word consisting of all basis vectors. (The perfect code is obtained by leaving out .) As a Cyclic code: The perfect G23 code can be constructed via factorization of x23 1, it is the code generated by x11 + x10 + x6 + x5 + x4 + x2 + 1 / x23 1 The Miracle Octad Generator of R. T. Curtis: This uses a 46 array of square cells to picture the 759 Hamming-weight-8 code words, or "octads," of the extended binary Golay code. The remaining code words are obtained via symmetric differences of subsets of the 24 cells-- i.e., by binary addition. Winning positions in the mathematical game of Mogul: a position in Mogul is a row of 24 coins. Each turn consists of flipping from one to seven coins such that the leftmost of the flipped coins goes from head to tail. The losing positions are those with no legal move. If heads are interpreted as 1 and tails as 0 then moving to a codeword from the extended binary Golay code guarantees it will be possible to force a win. A generator matrix for the binary Golay code is I A, where I is the 1212 identity matrix, and A is the complement of the adjacency matrix of the icosahedron.

Practical applications of Golay codes


NASA Deep Space Missions
The Voyager 1 & 2 spacecraft needed to transmit hundreds of color pictures of Jupiter and Saturn in their 1979, 1980, and 1981 fly-bys within a constrained telecommunications bandwidth.

ALE HF data communications

The new American government standards for automatic link establishment (ALE) in High Frequency (HF) radio systems specifies the use of an extended (24,12) Golay block

The minimum Hamming distance between any two code words (the number of bits by which any pair of code words differs) is eight.

Cyclic redundancy check


A cyclic redundancy check (CRC) is an error-detecting code designed to detect accidental changes to raw computer data, and is commonly used in digital networks and storage devices such as hard disk drives. Blocks of data entering these systems get a short check value attached, derived from the remainder of a polynomial division of their contents; on retrieval the calculation is repeated, and corrective action can be taken against presumed data corruption if the check values do not match.

Introduction

CRCs are based on the theory of cyclic error-correcting codes. The use of systematic cyclic codes, which encode messages by adding a fixed-length check value, for the purpose of error detection in communication networks was first proposed by W. Wesley Peterson in 1961.[1] Cyclic codes are not only simple to implement but have the benefit of being particularly well suited for the detection of burst errors, contiguous sequences of erroneous data symbols in messages. This is important because burst errors are common transmission errors in many communication channels, including magnetic and optical storage devices. Typically, an n-bit CRC, applied to a data block of arbitrary length, will detect any single error burst not longer than n bits, and will detect a fraction 12n of all longer error bursts Specification of a CRC code requires definition of a so-called generator polynomial. This polynomial resembles the divisor in a polynomial long division, which takes the message as the dividend and in which the quotient is discarded and the remainder becomes the result, with the important distinction that the polynomial coefficients are calculated according to the carry-less arithmetic of a finite field. The length of the remainder is always less than the length of the generator polynomial, which therefore determines how long the result can be. In practice, all commonly used CRCs employ the finite field GF(2). This is the field of two elements, usually called 0 and 1, comfortably matching computer architecture. The rest of this article will discuss only these binary CRCs, but the principles are more general. The simplest error-detection system, the parity bit, is in fact a trivial 1-bit CRC: it uses the generator polynomial x+1.

Application
A CRC-enabled device calculates a short, fixed-length binary sequence, known as the check value or improperly the CRC, for each block of data to be sent or stored and appends it to the data, forming a codeword. When a codeword is received or read, the device either compares its check value with one freshly calculated from the data block, or equivalently, performs a CRC on the whole codeword and compares the resulting check value with an expected residue constant. If the check values do not match, then the block contains a data error and the device may take corrective action such as rereading or requesting the block be sent again, otherwise the data is assumed to be error-free (though, with some small probability, it may contain undetected errors; this is the fundamental nature of error-checking).

CRCs and data integrity


CRCs are specifically designed to protect against common types of errors on communication channels, where they can provide quick and reasonable assurance of the integrity of messages delivered. However, they are not suitable for

protecting against intentional alteration of data. Firstly, as there is no authentication, an attacker can edit a message and recalculate the CRC without the substitution being detected. This is even the case when the CRC is encrypted, leading to one of the design flaws of the WEP protocol.

Specification of CRC
The concept of the CRC as an error-detecting code gets complicated when an implementer or standards committee turns it into a practical system. Here are some of the complications:

Sometimes an implementation prefixes a fixed bit pattern to the bitstream to be checked. This is useful when clocking errors might insert 0-bits in front of a message, an alteration that would otherwise leave the check value unchanged. Sometimes an implementation appends n 0-bits (n being the size of the CRC) to the bitstream to be checked before the polynomial division occurs. This has the convenience that the remainder of the original bitstream with the check value appended is exactly zero, so the CRC can be checked simply by performing the polynomial division on the received bitstream and comparing the remainder with zero. Sometimes an implementation exclusive-ORs a fixed bit pattern into the remainder of the polynomial division. Bit order: Some schemes view the low-order bit of each byte as "first", which then during polynomial division means "leftmost", which is contrary to our customary understanding of "low-order". This convention makes sense when serial-port transmissions are CRC-checked in hardware, because some widespread serial-port transmission conventions transmit bytes least-significant bit first. Byte order: With multi-byte CRCs, there can be confusion over whether the byte transmitted first (or stored in the lowest-addressed byte of memory) is the leastsignificant byte or the most-significant byte. For example, some 16-bit CRC schemes swap the bytes of the check value. Omission of the high-order bit of the divisor polynomial: Since the high-order bit is always 1, and since an n-bit CRC must be defined by an (n+1)-bit divisor which overflows an n-bit register, some writers assume that it is unnecessary to mention the divisor's high-order bit. Omission of the low-order bit of the divisor polynomial: Since the low-order bit is always 1, authors such as Philip Koopman represent polynomials with their high-order bit intact, but without the low-order bit (the x0 or 1 term). This convention encodes the polynomial complete with its degree in one integer.

These complications mean that there are three common ways to express a polynomial as an integer: the first two, which are mirror images in binary, are the constants found in code; the third is the number found in Koopman's papers. In each case, one term is omitted. So the polynomial x4 + x + 1 may be transcribed as:

0x3 = 0011b, representing x4 + 0x3 + 0x2 + 1x1 + 1x0 (MSB-first code)

0xC = 1100b, representing 1x0 + 1x1 + 0x2 + 0x3 + x4 (LSB-first code) 0x9 = 1001b, representing 1x4 + 0x3 + 0x2 + 1x1 + x0 (Koopman notation)

Вам также может понравиться