Note: BCH codes are not limited to binary codes, but may be used with multilevel phase-shift keying whenever the number of levels is a prime number or a power of a prime number, such as 2, 3, 4, 5, 7, 8, 11, and 13. A BCH code in 11 levels has been used to represent the 10 decimal digits plus a sign digit.
BCH codes make use of field theory and polynomials over that field. The way the check polynomial is constructed provides the key to indicating that an error has occurred.
If we wish to construct a BCH code to detect and correct 2 errors we use the field GF(16) or Z2[x]/<x4+x+1>
Now if we have α a root of x4+x+1, m1(x)=x4+x+1. Now m1 is minimal for α since
This does not allow us to choose many codewords - so we look for the minimal polynomial for the missing power of α from above - α3, and then the minimal polynomial for this is
We take codewords having all of these as roots, so we form the polynomial
Now in GF(16) we have 15 nonzero elements, and thus our polynomial will be of degree 14 with 8 check and 7 information bits - we have 8 check bits since we have (*).
We then want to find a CR such that
CR=CI (mod m1,3(x))=c7+c6+...+c0
So we have the following codeword to send
C(x) = CI+CR (mod m1,3(x)) = 0
For example, if we are to encode (1,1,0,0,1,1,0)
If there is no error R(α)=R(α3)=0
If there is one error, ie r=c+ei where ei represents the ith basis vector for R14
So then
If there are two errors
Original source (first two paragraphs) from Federal Standard 1037CEncoding
Construct our information codeword as
so our polynomial will be
Call this CI.
and using polynomial long division of m1,3(x) and CI to get CR(x), in \'Z'2 we obtain CR to be
So then the codeword to send is
Decoding
Suppose we receive a codeword vector r (the polynomial R(x)).
so we can recognize one error. A change in the bit position shown by α's power will aid us correct that error.
then
which is not the same as S13 so we can recognize two errors. Further algebra can aid us in correcting these two errors.