-
2007-04-10
10/115,577
2002-04-02
US 7,203,896 B2
2007-04-10
-
-
Joseph D. Torres
2024-02-06
A method for determining r error detection bits that can be associated with a word of m bits to be coded, including the step of calculating the product of a vector with m components representative of the word of m bits to be coded and of a parity control matrix of dimension rΓm. The parity control matrix is such that each column of matrix includes an odd number of β1sβ greater than or equal to three. The present invention also relates to a method for determining a syndrome.
Get notified when new applications in this technology area are published.
H03M13/00 IPC
Coding, decoding or code conversion, for error detection or error correction; Coding theory basic assumptions; Coding bounds; Error probability evaluation methods; Channel models; Simulation or testing of codes
1. Field of the Invention
The present invention relates to error detection and/or correction codes, and in particular to linear codes of Hamming type.
2. Description of the Related Art
The Hamming code is an error detection and correction code used in many fields, for example for data storage or transmission. Its use for the storage of data in a memory will be described, in the case where the data to be stored are in the form of 16-bit words.
Let X be the word to be stored. X can be represented by a vector Xe, the 16 components X0 to X15 of which correspond to the 16 bits of the word to be stored. Five error detection bits Ci (C0 . . . C4) are obtained by multiplying a parity control matrix H, called a Hamming matrix, of dimensions 5Γ16, by vector Xe in the form of a column vector.
FIG. 1A illustrates Hamming matrix H for 16 bits and FIG. 1B illustrates how to obtain the detection bits. Calling hij the elements of matrix H, the error detection bits Ci are given by:
C
i
=
β
j
=
0
15
β’
h
ij
Β·
X
j
Xj being the j-th component of vector Xe.
In write mode, 21-bit words, formed of the 16 data bits Xj and of the 5 detection bits Ci, are written into the memory. In read mode, the read word includes 16 bits Xr corresponding to the data bits and 5 bits Cr corresponding to the detection bits. It is possible for Xr and Cr not to be equal to Xj and Ci if errors occur during transmission.
To detect and/or correct possible errors on the read bits, a syndrome S with five components S0, . . . S4 is calculated by multiplying a determined matrix Hβ² of dimensions 5Γ21 by a column vector with 21 components, including the 16 bits Xr and the 5 received bits Cr.
FIG. 2A illustrates matrix Hβ². The first 16 columns of matrix Hβ² correspond to the 16 columns of matrix H. The 5 following columns each include a single β1β. The 17-th column has its β1β on the first line, the 18-th column has its β1β on the second line, and so on until the 21rst column, which has its β1β on the fifth line. The last five columns of matrix Hβ² are used to determine possible errors in the detection bits.
FIG. 2B illustrates the calculation of syndrome S.
If syndrome S has all its components equal to 0, the storage occurs with no error and all the bits of the read word, be they data bits or detection bits, are correct.
If S is different from 0, the read word includes one or several errors. If a single bit of the read word is erroneous, the obtained syndrome enables correcting the error. Indeed, the obtained syndrome corresponds in this case to the column having had its elements multiplied by the erroneous bit. Thus, if the calculated syndrome is equal to:
S
=
(
0
0
0
1
1
)
,
the components (00011) of the syndrome correspond to the elements of the first column of the Hamming matrix, which means that the first bit, X0, is erroneous.
Similarly, if the calculated syndrome is equal to:
S
β³
=
(
1
0
0
0
0
)
,
and there is a single error in the read word, this means that the first detection bit C0 is erroneous.
A disadvantage of the above Hamming code is that it cannot detect two errors. For example, if an error has occurred on bits X1 and X2, the obtained syndrome is equal to the sum modulo 2 of the syndromes corresponding to errors on X1 and X2, that is, to: Sβ²β³=(00101)+(00110)=(00011). The obtained syndrome indicates an error on bit X0, which is wrong.
Indeed, the Hamming code is known to have a minimum code distance d=3 and a linear code like the Hamming code is known to be able to correct L errors and to detect L+1 errors if its minimum code distance d is strictly greater than 2L+1.
To improve the above code and turn it into a code having a minimum code distance equal to 4, it is known to add to the word to be stored a total parity bit P.
Total parity bit P is calculated by adding modulo 2 all the data bits and all the detection bits. The parity bit is added to the word to be stored, and the word to be stored, the detection bits, and the total parity bit are altogether stored.
In read mode, the read word is multiplied by parity control matrix Hβ³ shown in FIG. 3A. Matrix Hβ³ has one more line and one more column than matrix Hβ². Matrix Hβ³ includes, to the top left, that is, on the first five lines and on the first 21 columns, a block identical to matrix Hβ². The last line D of matrix Hβ³ only includes βisβ and the last column of matrix Hβ³ only includes β0sβ, except for the last element of the column which contains a The obtained syndrome Sβ² is illustrated in FIG. 3B. Syndrome Sβ² includes six components S0 to S5, and is obtained by multiplying matrix Hβ³ by a column vector including the 22 bits of the read word, formed of the 16 read data bits, followed by the five read detection bits, and by the read total parity bit.
The code thus obtained is a so-called βSEC-DEDβ code (βSingle Error CorrectionβββDouble Error Detectionβ). This code can detect two errors in all cases, two errors being indicated by the fact that the last component of the syndrome, S5, is zero while the syndrome is different from the zero vector. However, the above code has the disadvantage of requiring the calculation of total parity bit P. This calculation is long, since it requires adding modulo 2 each of the data bits and of the detection bits. The calculation of the total parity bit cannot be performed in parallel with the detection bits, since its calculation requires the previous knowledge of the detection bits. Accordingly, it must be awaited that all detection bits have been calculated to calculate total parity bit P. This results in a loss of time, as well as in a high number of adders modulo 2.
Another disadvantage of the above-described Hamming code is that the Hamming matrix is neither symmetrical, nor regular. Considering that the elements of a column correspond to the binary representation of a number, the variation of this number is not regular and includes jumps. Such jumps make difficult the forming of a circuit implementing the Hamming code as well as the syndrome decoding, that is, the determination of the erroneous bit.
An embodiment of the present invention provides an error detection and/or correction code of SEC-DED type, that enables correction of one error and detection of two errors, which is simpler than the corresponding Hamming code.
Another embodiment of the present invention provides a method for implementing such an error detection and/or correction code. The method can be implemented in a simple way by an integrated circuit and enables easy decoding.
The method for determining r error detection bits that can be associated with a word of m bits to be coded, including the step of calculating the product of a vector with m components representative of the word of m bits to be coded and of a parity control matrix of dimension rΓm. The parity control matrix is such that each column of the matrix includes an odd number of β1sβ greater than or equal to three.
According to an embodiment of the present invention, the last rβ3 elements of each column of the matrix belong to a first sub-matrix of rank i, the binary representation of the rβ3 elements indicating the rank i of the first sub-matrix.
According to an embodiment of the present invention, the first sub-matrixes includes sub-matrixes of dimension (rβ3)Γ1 and sub-matrixes of dimension (rβ3)Γ3. According to an embodiment of the present invention, the first three lines of the parity control matrix include second sub-matrixes, in which the second sub-matrixes include sub-matrixes of dimension 3Γ1 and sub-matrixes of dimension 3Γ3, the second sub-matrixes of dimension 3Γ1 including only β0sβ or only β1sβ, and the second sub-matrixes of dimension 3Γ3 being either the identity matrix, or its inverse.
According to an embodiment of the present invention, the first second sub-matrix is a sub-matrix of dimension 3Γ1 only including β1sβ and the other first sub-matrixes of dimension 3Γ1 only include β0sβ.
According to an embodiment of the present invention, the second sub-matrix of rank i has a number of columns equal to the number of columns of the first sub-matrix of same rank.
According to an embodiment of the present invention, two or several lines and/or columns of the parity control matrix are permuted.
According to an embodiment of the present invention, the number r of the error detection bits is equal to n+2, n being such that the number of bits of the word to be coded can be represented by n bits.
The present invention also relates to a method for determining a syndrome representative of possible errors having occurred, in a processing, to an m+r-bit word, the m+r bits corresponding, before processing, to m bits of a word to be coded and r error detection bits applied to the m-bit word to be coded, the syndrome being obtained in a step of multiplying a specific matrix of dimension rΓ(m+r) by a vector with m+r components representative of the m+r-bit word. The specific matrix includes for the first m columns, a block of dimension rΓm corresponding to the parity control matrix used in the coding, and for the last r columns, a block of dimension rΓr in the form of a diagonal matrix, including only β1sβ on its main diagonal and β0sβ everywhere else.
The foregoing objects, features and advantages of the present invention will be discussed in detail in the following non-limiting description of specific embodiments in connection with the accompanying drawings.
FIGS. 1A and 1B, previously described, respectively show a Hamming matrix H and how to obtain detection bits to code a 16-bit word;
FIGS. 2A and 2B, previously described, respectively show a Hamming matrix Hβ² for calculating a syndrome and the syndrome calculation mode for a 16-bit word;
FIGS. 3A and 3B, previously described, respectively illustrate a Hamming matrix Hβ³ used in a code enabling detection of two errors for 16-bit words and the corresponding syndrome calculation mode;
FIG. 4A shows a parity control matrix M according to the present invention for coding a 16-bit word;
FIG. 4B shows a matrix Mβ² according to the present invention for decoding a 16-bit word;
FIG. 4C schematically shows a circuit for decoding a word coded by means of matrix M;
FIG. 4D shows an element of the circuit of FIG. 4C;
FIGS. 5A and 5B respectively show a parity control matrix M2 according to the present invention for coding a 32-bit word and a matrix Mβ²2 for decoding a word coded by means of matrix M2;
FIG. 6A shows a parity control matrix M3 according to the present invention for coding a 64-bit word; and
FIG. 6B shows an alternative of matrix M3.
FIG. 4A illustrates a parity control matrix M enabling coding 16-bit words. Matrix M is a matrix of dimension 6Γ16.
The first three lines of matrix M are formed by six sub-matrixes Ai, i representing the position of the sub-matrix and ranging from 0 to 5. Sub-matrix A0 includes a single column which includes only β1sβ. The next sub-matrixes are square sub-matrixes of dimension 3Γ3. Sub-matrixes A1, A2, and A4 are identical. They include Os on their main diagonal and Is everywhere else. Sub-matrixes A3 and A5 are identical. They include is on their main diagonal and Os everywhere else. Sub-matrixes A3 and A5 correspond to identity matrix I and sub-matrixes A1, A2, and A4 to the inverse of the identity matrix, Δͺ.
The last three lines of matrix M are formed by six sub-matrixes Bi, i representing the position of the sub-matrix and ranging from 0 to 5. Each sub-matrix Bi is located under the matrix Ai of same rank and has the same number of columns. All the columns of a matrix Bi are identical. The binary representation of a column of sub-matrix Bi indicate the rank i of the sub-matrix. Thus, for example, sub-matrix B0 includes a single column formed of elements β000β and each of the three columns of sub-matrix B4 is formed of elements β100β, which is a binary representation of number 4.
Each column of matrix M is different from the other columns of matrix M. The columns of matrix M are linearly independent two by two, that is, the sum modulo 2 of any two columns of matrix M does not provide a column of matrix M. Further, each of the columns of matrix M only includes three β1sβ.
To code a 16-bit word, 6 detection bits C0 to C5 are first determined by multiplying matrix M by a column vector having as components the bits of the word to be coded. Then, the 6 detection bits are assigned to the 16 bits of the word to be coded and all this is stored.
FIG. 4B shows matrix Mβ² used to decode words coded by means of matrix M. At the decoding, the read word is a 22-bit word, formed of 16 data bits and of 6 detection bits.
Matrix Mβ² is a matrix of dimension 6Γ22. Matrix Mβ² is formed of two blocks. A first block, to the left, forming the first 16 columns of matrix Mβ², is identical to matrix M. A second block C, to the right, representing the last 6 columns of matrix Mβ², is a square diagonal matrix of dimension 6Γ6 which includes only β1sβ on its main diagonal and β0sβ everywhere else. All columns of matrix Mβ² are different from one another and linearly independent two by two.
The code implemented by means of matrixes M and Mβ² is a code of SEC-DED type, that is, enabling correction of one error and detection of two errors. At the decoding, matrix Mβ² is multiplied by a column vector having as components the data and detection bits of the read word. The result of this multiplication is a syndrome appearing in the form of a column vector having six components, S0 to S5.
If the obtained syndrome is the zero vector (all its components are equal to zero), there is no error, neither on the data bits, nor on the detection bits. If the obtained syndrome is not the zero vector and the syndrome parity is odd (S0βS1βS2βS3βS4βS5=1), there is a single error. This error can be corrected, the syndrome components corresponding to the column of matrix Mβ² which has been multiplied by the erroneous bit. It should be noted that, since the binary representation of the elements of a sub-matrix Bi corresponds to the rank of the sub-matrix, the search for the erroneous bit is very simplified as compared to prior art. If the obtained syndrome is not the zero vector and the parity of the syndrome is even, two errors have occurred and are detected.
FIG. 4C schematically shows a circuit 1 for calculating the preceding syndrome. On 22 inputs E0 to E21, the circuit receives the 16 read data bits X0 to X15 and the 6 read detection bits C0 to C5. The circuit includes 6 outputs S0 to S5 providing the six syndrome components. Each input Ei is connected to a column of rank i of the circuit. Each output Sj is connected to a line of rank j. At the intersection of column i and of line j, there can be an adder modulo 2 Gi,j indicated by a circle marked with a cross. The adders are for example formed by XOR gates.
As shown in FIG. 4D, adder Gi,j includes two inputs ei and ej. Input ei is connected to input Ei and input ej receives the signal present on line j to the left of adder Gi,j. Adder Gi,j also includes an output s located on line j to the right of adder Gi,j.
When there is no adder at the intersection of column i and of line j, this means that column i and line j cross with no influence upon each other. This means that the bit provided to the involved input is not used to calculate component Sj of the syndrome. An additional column a, located to the left of column 0, connects input ej of each first adder of a line to ground (GND).
The operation of the decoding circuit will be explained for the calculation of component S3 of the syndrome, corresponding to the line of rank 3. Starting from the left, the first encountered adder is adder G10,3. Input e3 of adder G10,3 is connected to ground and its input e10 receives data bit X10 via input E10 of the circuit. At the output of adder G10,3, s=0βX10, that is, X10. The signal provided by adder G10,3 drives input e3 of adder G11,3, which calculates X10βX11. The calculation carries on in this way until adder G19,3 is reached, which adds modulo 2 the result provided by adder G15,3 and detection bit C3. Thus:
S3=X10βX11βX12βX13βX14βX15βC3,
which effectively corresponds to the multiplication of the fourth line of matrix Mβ² by a vector having as components the bits of the read word. Generally, the decoding circuit of FIG. 4C uses the structure of matrix Mβ², the lines and columns of the circuit corresponding to the lines and columns of matrix Mβ², an adder modulo 2 being placed where matrix Mβ² includes a 1.
In the code described in relation with FIGS. 4A to 4D, it is useless to calculate a total parity bit to detect two errors, conversely to prior art. All the syndrome components can be calculated in parallel, which saves time. The pattern formed by the adders is rather repetitive, which favors the circuit forming. The circuit used for the coding has not been shown. It corresponds to the decoding circuit, except for the last six columns, which are suppressed. The outputs of the coding circuit provide the detection bits.
Of course, it is possible to generalize the coding and decoding of the present invention to words having more than 16 bits.
FIG. 5A illustrates a parity control matrix M2 for coding 32-bit words. In the description of the forming of matrix M2, the general principles used to form the parity control matrix according to the present invention will be discussed.
Generally, in the code according to the present invention, each column of the parity control matrix includes an odd number of β1sβ greater than or equal to 3. Generally again, although this is not necessary, all possible column combinations includes three β1sβ will first be formed, followed by the combinations including five β1sβ, and so on if necessary.
To form a parity control matrix according to the present invention, the number of necessary detection bits, which determines the dimension of the parity control matrix, is first determined. Generally, the number of detection bits used in the present code is equal to n+2, 2n representing a number greater than or equal to the number of bits of the word to be coded. Thus, in the preceding example for 16 bits, 16=24, which provides a number of detection bits equal to 4+2=6. In the present example, 32 is equal to 25. There are thus 7 detection bits and parity control matrix M2 has dimension 7Γ32.
Then a block L of the matrix formed by the first three lines is isolated. Block L will be divided into sub-matrixes Ai. According to what is appropriate, sub-matrixes Ai will be column sub-matrixes formed of elements β111β or β000β or of the square sub-matrixes of dimension 3Γ3 corresponding to identity matrix I or to its inverse Δͺ. If need be, the last sub-matrix of block L is incomplete.
Under block L are nβ1 lines, the elements of which form the columns of sub-matrixes Bi. The elements of a column of any sub-matrix Bi are identical to the elements of the other columns of sub-matrix Bi, if they exist, and their binary representation indicates the rank i of the sub-matrix. The sub-matrixes Ai and Bi of same rank are located one above the other and have a same number of columns.
The forming of matrix M2 of FIG. 5A will now be detailed, insisting on the choice between one and three columns for sub-matrixes Bi. In FIG. 5A, when a sub-matrix Bi includes three columns, a single column is shown, for clarity.
The first sub-matrix Bi is sub-matrix B0 of rank 0. Sub-matrix B0 is a column sub-matrix and all its elements are zeros. Since at least three β1sβ per column are desired to be obtained, a column sub-matrix A0 of type β111β must be placed above sub-matrix B0. Sub-matrix B0 necessarily includes a single column since it is impossible to have a configuration including three β1sβ and ending with β0000β other than configuration β1110000β.
Thus, sub-matrixes B1 and A1, of rank 1, are determined. The elements of a column of sub-matrix B1 having to represent the rank of the sub-matrix, a column of sub-matrix B1 is formed of elements β0001β. Since three β1sβ are desired for each column of matrix M2, a column of sub-matrix B1 must be topped with three elements, two of which are β1sβ and one of which is a β0β. This corresponds to three possible combinations and sub-matrix B1 will include three columns. Sub-matrix B1 is topped with sub-matrix A1, of dimension 3Γ3. Each column of sub-matrix A1 must include two β1sβ per column. All columns of sub-matrix A1 must further be different and linearly independent two by two. Since the columns of the inverse matrix of the identity matrix fulfill these criteria, said matrix will be chosen as matrix A1.
Then, sub-matrix B2 has three identical columns formed of elements β0010β, the binary representation of which is number 2. Above the three columns of matrix B2, a matrix A2 is placed, which is again the inverse of the identity matrix, Δͺ, since this matrix includes two β1sβ for each column.
The three columns of sub-matrix B3 are formed of elements β0011β. Since each column of sub-matrix B3 here includes two β1sβ, a sub-matrix A3 including a single β1β in each column is placed above sub-matrix B3, the columns of sub-matrix A3 being different and linearly independent two by two. Identity matrix I, which fulfills these criteria, is chosen as sub-matrix A3.
Of course, any two columns of sub-matrixes A1, A2, or A3 may be permuted while remaining within the framework of the present invention. Generally speaking, actually, any permutation of two or more lines or columns of a parity control matrix according to the present invention provides a code having the same effects and advantages as those described.
Sub-matrixes B4, B5, and B6 are formed according to the preceding principles. They each include three columns, respectively including elements β0100β, β0101β, and β0110β. The corresponding sub-matrixes A4, A5, and A6 are respectively formed by matrixes Δͺ, I and I. The first 19 columns of matrix M2 are so defined.
The next matrix, B7, has a single column. Indeed, the binary representation of number 7 is β0111β. This binary representation already includes three β1sβ. Since it is desired that all columns of matrix M2 first include all possible combinations having three β1sβ only, sub-matrix B7 will have one column only and the elements of sub-matrix A7 will be chosen to be equal to β000β.
Sub-matrixes B8, B9, and B10 each have three columns of respective elements β1000β, β1001β, β1010β and the corresponding sub-matrixes A8, A9, and A10 respectively are matrixes Δͺ, I and I.
The binary representation of number 11 is β1011β. Since this binary representation already includes three β1sβ, sub-matrix B11 has a single column. The corresponding column sub-matrix A11 has elements β000β, since all possible combinations of three β1sβ are first desired to be used for the columns of matrix M2.
Thirty columns of matrix M2 are already coded. There only remain two columns to be determined. These two columns correspond to a sub-matrix B12, each column of which has expression β1100β. Above, a sub-matrix A12 formed of a portion only of identity matrix I will be placed. In FIG. 5A, the first two columns of identity matrix I have been taken, but any two columns of identity matrix I could of course be taken without departing from the field of the present invention.
Matrix M2 is now entirely formed. All its columns are distinct from one another, linearly independent two by two, and each includes exactly three β1sβ.
FIG. 5B shows a matrix Mβ²2 used to decode words coded by means of matrix M2. Matrix Mβ²2 is formed of two blocks, a first block of dimension 7Γ32, to the left and corresponding to matrix M2, followed by a second block Cβ³ of dimension 7Γ7, corresponding to a diagonal matrix with β1sβ on the main diagonal and β0sβ everywhere else.
As in the preceding case, the code obtained by using matrixes M2 and Mβ²2 is a SEC-DED code, enabling correction of one error and detection of two errors. If the syndrome obtained by multiplying matrix Mβ²2 by the read word is the zero vector, there is no error. If the obtained syndrome is not the zero vector and the syndrome parity is odd, there is a single error that can be corrected, the syndrome components corresponding to the column of matrix Mβ²2 which has been multiplied by the erroneous bit. If the obtained syndrome is not the zero vector and the syndrome parity is even, two errors have occurred and are detected.
Up to now, only parity control matrixes including exactly three β1sβ per column have been formed. However, if longer words are desired to be coded, all three-bit combinations may be used, and combinations including five β1sβ per column will then be used.
Table 1 hereafter indicates the number of detection bits used according to the number of bits of the word to be coded, the dimension of the parity control matrix used in the coding, the number of possibilities of columns with three β1sβ, and the number of columns having to include five β1sβ.
| TABLE 1 | ||||
| Number of | Number of | Number of | ||
| bits of the | Number of | possibilities with | columns | |
| word to be | detection bits | Matrix | three β1sβ per | including |
| coded (2β³) | (n + 2) | dimension | column | five β1sβ |
| β16 = 24 | 6 | 6 Γ 16 | 6 Γ 5 Γ 4/3! = 20 > 16 | 0 |
| β32 = 25 | 7 | 7 Γ 32 | 7 Γ 6 Γ 5/3! = 35 > 32 | 0 |
| β64 = 26 | 8 | 8 Γ 64 | 8 Γ 7 Γ 6/3! = 56 | 8 |
| 128 = 27 | 9 | β9 Γ 128 | 9 Γ 8 Γ 7/3! = 84 | 44 |
The number of possibilities of columns with three β1sβ is provided by formula: (nβ2)(nβ1)n/3!, with 3!=3Γ2=6. In table 1, it can be seen that for 16 and 32 bits, the possibilities of columns including three β1sβ are greater than the number of columns of the parity control matrix. Accordingly, it is useless to use columns including five β1sβ to build these matrixes. For 64-bit words to be coded, 8 detection bits are required and each column in the parity control matrix includes 8 elements. The total number of columns with three β1sβ is equal to 56. Accordingly, the 56 possibilities offered for columns with three β1sβ will be used, which will be completed by 64β56=8 columns including five β1β. For 128-bit words, 9 detection bits are used. The parity control matrix is of dimension 9Γ128. The total number of different columns including three β1sβ is equal to 84 and the parity control matrix will have to be completed with 44 columns including five β1sβ.
As an example, to illustrate how these columns including five β1sβ are introduced, the forming of the parity control matrix according to the present invention will be explained for 64-bit words. It should be noted that, if it was desired to code words including a very large number of bits, it is possible, after using all combinations of columns with five β1sβ, to create columns including seven β1sβ, etc., since the present invention is not limited to columns including three or five β1sβ.
FIG. 6A shows a parity control matrix M3 according to the present invention intended to code 64-bit words. The number of detection bits is equal to 8 and matrix M3 has dimension 8Γ64. The first 32 columns of matrix M3 correspond to the columns of matrix M2, except that each of the first 32 columns of matrix M3 includes 8 elements instead of 7, the fourth element of each column being an additional element equal to 0. In FIG. 6A, the first 30 columns of matrix M3 have not been shown in detail. They include, on the first three lines, sub-matrixes A0, . . . A11 of matrix M2. Then, still only considering the first thirty columns, there is a fourth line including only β0sβ. Below, the last four lines include sub-matrixes B0 to B11 of matrix M2.
The next two columns, that is, the columns of rank 30 and 31, correspond to the last two columns of matrix M2. Here, however, sub-matrix B12 is a sub-matrix of dimension 5Γ3, in which the elements of a column are β01100β. Sub-matrix B12 is topped with identity matrix I of dimension 3Γ3, so that each of columns 31, 32, and 33 of matrix M3 includes three β1sβ. The rest of matrix M3 is formed according to the principles described in relation with the preceding examples.
Thus, sub-matrix B13 only has one column of elements β01101β, topped with three β0sβ, since there already are three β1sβ in the binary expression of number 14. Then, comes column sub-matrix B14 of elements β01110β, also topped with three β0sβ.
To form sub-matrix B15, number 15 is first expressed in binary form, which gives β01111β. For the first time, four β1sβ are present in a column of a sub-matrix Bi. Since an odd number of β1sβ per column is desired, a sub-matrix A15 equal to identity matrix I will be placed above matrix B15.
Then comes sub-matrix B16, the column of which has expression β10000β, topped with matrix I, to have three β1sβ per column. Sub-matrixes B17, B18, and B20 include two β1sβ per column. Sub-matrixes B17, B18, and B20 have three columns each and are topped with corresponding sub-matrixes Ai equal to identity matrix I. Sub-matrixes B19, B21, and B22 have columns including three β1sβ. Sub-matrixes B19, B21, and B22 have a single column each, topped with a sub-matrix Ai having elements β000β.
The next sub-matrix, B23, has three columns expressed as β10111β, which include four β1sβ, like sub-matrix B15. For the corresponding columns of matrix M3 to include five β1sβ, a sub-matrix A23 equal to identity matrix I is placed on sub-matrix B23. Matrix M3 now includes six columns with five β1sβ. In FIG. 6A, the references of sub-matrixes Bi surrounded with a circle are those corresponding to columns of matrix M3 including five β1sβ.
The next sub-matrix B24 has three columns expressed as β11000β. It is topped with identity matrix I. The next sub-matrix B25 has a single column expressed as β11001β. It is topped with three β0sβ. The next sub-matrix B26 has a single column expressed as β11010β. It is topped with a column sub-matrix A26 having elements β000β.
The next sub-matrix B27 has columns of which the expression, β11011β, includes four β1sβ. Since it has been seen, in relation with table 1, that 8 columns including five β1sβ were necessary and that 6 columns with five β1sβ are already present, sub-matrix B27 will be incomplete and will only include two columns. They will be topped with any two columns of identity matrix I. For example, in FIG. 6A, the first two columns of the identity matrix have been taken, that is, β100β and β010β.
Sub-matrix B27 is followed by sub-matrix B28 including a single column expressed as β11100β, topped with β000β. The 64 columns of matrix M3 are now formed. The columns of matrix M3 are all different, linearly independent two by two, and include either three β1sβ, or five β1sβ. All combinations of columns with three β1sβ have been used.
In the forming of matrix M3 of FIG. 6A, the total number of columns with five β1sβ to be used has had to be remembered, to be sure to use all possible combinations of columns with three β1sβ only. Thus, sub-matrix B27 has been incomplete and has included two columns only, to enable the last possibility with three β1sβ (β00011100β) to be present in matrix M3. However, the code according to the present invention could very well have used a complete matrix B27, topped with identity matrix I, and not have used the last possibility offered by the combinations with three β1sβ. Such a code also belongs to the present invention.
If it is desired to avoid keeping in mind the number of necessary possibilities with five elements, a matrix M4 is formed, still to code 64-bit words, as described in relation with FIG. 6B.
In FIG. 6B, same references designate same elements as in FIG. 6A. Matrix M4 uses the first 35 columns of matrix M3, that is, the columns including sub-matrixes B0 to B14. Sub-matrix B15 is identical to that of FIG. 6A, but it is not placed after sub-matrix B14, since it includes four β1sβ. Sub-matrix B15 is put aside and will be placed after all combinations with three β1sβ have been used. Thus, the sub-matrix following sub-matrix B14 is sub-matrix B16. The next sub-matrixes are sub-matrixes B17, B18, B19, B20, B21, and B22. The sub-matrix Bi following sub-matrix B22 is sub-matrix B24, since sub-matrix B23 includes four β1sβ and is temporarily put aside. Sub-matrix B24 is followed by sub-matrixes B25, B26, and B28, sub-matrix B27 being put aside. With column sub-matrix B28, all possibilities of columns including three β1sβ have been used. This amounts to 56 columns, as appears in table 1. The sub-matrixes Bi temporarily put aside are then placed, to form the remaining columns of matrix M4. The three columns of sub-matrix B15, the three columns of sub-matrix B23, and two columns of sub-matrix B27 are thus placed, to form the 64 columns of matrix M4. By so operating, the last formed sub-matrix is, if necessary, incomplete and it is not necessary to keep in mind the number of columns including five β1sβ to use all the possibilities of columns with three β1sβ.
It should be noted that in each of the codes of the present invention, it is useless to calculate a total parity bit, and that the formed matrixes exhibit repetitive patterns, favoring the implementation of coding and decoding circuits.
Of course, the present invention is likely to have various alterations, modifications, and improvements which will readily occur to those skilled in the art. In particular, any permutation of two or several columns and/or lines of a parity control matrix according to the present invention results in an equivalent code within the field of the present invention.
The number of bits of the word to be coded is not necessarily a multiple of two. It may also be smaller than 16. For example, the word to be coded may be a 7-bit word.
It should be noted that, above an incomplete matrix Bi, any one or two columns of identity matrix I or of its inverse Δͺ may be used, according to the case. Thus, if the incomplete matrix Bi includes a single column, any column of sub-matrixes I or Δͺ may be retained. If the incomplete sub-matrix Bi includes two columns, any two columns of sub-matrixes I or Δͺ may be retained.
It should also be noted that it is possible to use other combinations of columns with three or five β1sβ than those described in relation with FIGS. 4A to 6B. Thus, any 16 possibilities may be chosen from among the 20 possibilities of columns with three β1sβ to code a 16-bit word, without necessarily using the choice made in relation with FIG. 4A.
It should also be noted that the code according to the present invention applies to any field in which error correction and/or detection codes are used, for example for transmission.
Such alterations, modifications, and improvements are intended to be part of this disclosure, and are intended to be within the spirit and the scope of the present invention. Accordingly, the foregoing description is by way of example only and is not intended to be limiting. The present invention is limited only as defined in the following claims and the equivalents thereto.
1. A circuit-implemented method for encoding a word of m bits to be coded, comprising:
determining r error detection bits by calculating the product of a vector with m components representative of the word of m bits to be coded and of a parity control matrix of dimension rΓm, wherein the parity control matrix has lines and columns such that each column of said matrix includes an odd number of β1sβ greater than or equal to three, wherein the last rβ3 lines of the parity control matrix form a plurality of first sub-matrixes each having one or more columns, each column of each first sub-matrix including rβ3 elements that form a binary representation of a position of the first sub-matrix within the parity control matrix; and
encoding the word using the r error detection bits.
2. The method of claim 1 wherein a first one of the first sub-matrixes is a sub-matrix of dimension (rβ3)Γ1 and a second one of the first sub-matrixes is a sub-matrix of dimension (rβ3)Γ3.
3. The method of claim 1 wherein the first three lines of the parity control matrix include second sub-matrixes, in which the second sub-matrixes include sub-matrixes of dimension 3Γ1 and sub-matrixes of dimension 3Γ3, the second sub-matrixes of dimension 3Γ1 including only β0sβ or only β1sβ, and the second sub-matrixes of dimension 3Γ3 being either the identity matrix, or its inverse.
4. The method of claim 3 wherein a first of the second sub-matrixes is a sub-matrix of dimension 3Γ1 only including β1sβ and wherein the other second sub-matrixes of dimension 3Γ1 only include β0sβ.
5. The method of claim 3 wherein each second sub-matrix corresponds to a respective one of the first sub-matrixes, has a number of columns equal to the number of columns of the corresponding first sub-matrix, and the column or columns of the second sub-matrix and the corresponding first sub-matrix are parts of the same column or columns of the parity control matrix.
6. The method of claim 1 wherein the number r of the error detection bits is equal to n+2, n being the smallest number such that 2n is greater than or equal to m.
7. The method of claim 1 wherein the parity control matrix has m columns, wherein each column includes a first group of three bits and a second group of rβ3 bits constituting a binary representation of a rank i of the column, the parity control matrix including:
one column in which i=0;
three columns in which i=1; three columns in which i2;
mβ7 columns in which i=3 if mβ7 is less than 3 and greater than zero, zero columns in which i=3 if mβ7 is zero or less, and three columns in which i=3 if mβ7 is 3 or greater;
mβ10columns in which i=4 if mβ10is less than 3 and greater than zero, zero columns in which i=4 if mβ10 is zero or less, and three columns in which i4 if mβ10is 3 or greater;
mβ13 columns in which i=5 if mβ13 is less than 3 and greater than zero, zero columns in which i=5 if mβ13 is zero or less, and three columns in which i5 if mβ13 is 3 or greater;
mβ16 columns in which i=6 if mβ16 is less than 3 and greater than zero, zero columns in which i=6 if mβ16 is zero or less, and three columns in which i=6 if mβ16 is 3 or greater;
one column in which i=7 if m is greater than or equal to 20 and zero columns in which i=7 if m is less than 20;
mβ20 columns in which i=8 if mβ20 is less than 3 and greater than zero, zero columns in which i=8 if mβ20 is zero or less, and three columns in which i8 if mβ20 is 3 or greater;
mβ23 columns in which i=9 if mβ23 is less than 3 and greater than zero, zero columns in which i=9 if mβ23 is zero or less, and three columns in which i9 if mβ23 is 3 or greater;
mβ26 columns in which i=1 0 if mβ26 is less than 3 and greater than zero, zero columns in which i=10 if mβ26 is zero or less, and three columns in which i10 if mβ26 is 3 or greater;
one column in which i=11 if m is greater than or equal to 30 and zero columns in which i=11 if m is less than 30; and
mβ30 columns in which i=12 if mβ30 is less than 3 and greater than zero, zero columns in which i=12 if mβ30 is zero or less, and three columns in which i=12 if mβ30 is 3 or greater.
8. The method of claim 7 wherein the columns that share the same rank are positioned adjacent to one another in the parity control matrix.
9. The method of claim 7 wherein the first groups for each set of three columns sharing the same rank i form either the identity matrix or an inverse of the identity matrix.
10. The method of claim 9 wherein for each set of three columns sharing the same rank i, the first groups form the identity matrix if the binary representation of the rank i has an even number of β1sβ and the first groups form the inverse of the identity matrix if the binary representation of the rank i has an odd number of β1sβ.
11. The method of claim 7 wherein the first group for the column having a rank i of zero consists of three β1sβ and, for the columns having a rank whose binary representation has exactly three β1sβ, the first groups consist of three β0sβ.