Disclosure of Invention
The invention provides a low-resource-loss low-delay frequency BCH decoding method for a high-error-rate memory.
The technical scheme adopted by the invention is as follows:
the BCH decoding method for the high bit error rate memory is characterized by comprising the following steps under the finite field rule:
1) Calculating a syndrome S i, that is, S i(x),(aj)i, of an externally input codeword polynomial R (x) by using a syndrome calculation circuit according to formulas (1) and (2) to i-th power of a finite field primitive polynomial a j, wherein coefficients (R 0~rn-1 in formula (1)) refer to binary values in all polynomials of the finite field, and 0, x-x n-1 refer to positions of the binary values:
R (x) =r 0+r1x……+rn-1xn-1 (1)
2) Obtaining an error equation coefficient delta j by adopting an error equation generating circuit according to formulas (3) and (4), wherein t is the maximum error correction capability, and v refers to the sequence index of error bits:
s j+v+δ1 Sj+v-1+…+ δv-1Sj+1+δvSj = 01 +.j +.2t-v (3)
3) The Chien search circuit of the verification equation sub-circuit is multiplexed to solve the error equation, and finally the error position is obtained, wherein the multiplexing period of the Chien search circuit is set to be M, the value of M is between 1 and n, and n/M positions are searched for in each clock period through the control of a counter.
Further, the syndrome generating circuit performs modulo addition calculation by using a bit exclusive OR, takes an externally input codeword polynomial R (x) as an enabling logic signal in the form of a binary logic sequence for controlling a gating switch input by the exclusive OR, and controls whether a binary representation sequence of an element a i in a finite field corresponding to a bit number i of each bit binary R i corresponding to R (x) in the codeword is input as the exclusive OR.
Further, the error equation generating circuit performs error equation calculation by using a constant modulus multiplier and a modulus adder (bit exclusive OR), wherein the constant modulus multiplier maps the coefficient relation of the polynomial multiplication result in a real number domain and a finite domain according to the power-down identity related to the primitive polynomial in the finite domain, and performs logic optimization on the mapping relation according to the used constant to convert the mapping relation into pure exclusive OR logic.
Further, the 1 st group is input when the counter count is 1, the M th group is input when the counter count is M, if n/M has remainder, M+1 cycles are searched, the M+1 cycles are divided into M+1 groups, finite field elements corresponding to possible error positions in the groups are substituted into an error equation one by one for verification, and if the equation value is zero under the premise that the error number is within the error correction capability range, the position represented by the error is represented by the equation value.
The beneficial effects of the invention are as follows:
based on the Petersen decoding theory, for the (n, k, t) BCH codes with the length of n-bit coded words, k-bit data bits and t-bit error correction capability, the invention realizes BCH decoding by multiplexing the verification equation sub-circuits of the Qian's search circuit and combining the accompanying generation circuit, the error equation generation circuit and the counter, and the invention obviously reduces the circuit area of the decoder, and simultaneously can automatically adjust the multiplexing condition of the verification equation sub-circuits of the Qian's search circuit and achieve the results of low decoding beat and low resource loss by combining actual scenes. Experiments show that the invention has quite high application value under the condition that the error correction capability is smaller than 5.
Detailed Description
The entire design is described below in terms of a 2-cycle chien search circuit-based BCH decoder implementation based on (44,32,2) BCH codes (total codeword 44 bits, data bits 32 bits, error correction capability 2 bits) in the galois field GF (2 6).
(44,32,2) BCH codes have the common feature of several BCH codes:
1. The number of data bits before encoding is k=32, the number of total codeword bits after encoding is n=44 bits, and the number of check bits is n-k=12.
2. (44,32,2) BCH code has error correction capability of 2, and can correct two-bit random errors in 44-bit total codeword at maximum, and its encoding and decoding operation occurs in galois field GF (2 6) because of 2 6-1>44>25 -1, and if m=6, the length of check bit is mt=6x2=12.
As shown in fig. 1, the specific steps of the present invention are as follows:
1) The syndrome generating circuit performs modulo addition calculation by a bit exclusive OR, wherein the finite field element a 0~a43 and the third power thereof (a 0)3~a43 are used as constant input, whether the finite field element a 0~a43 enters the modulo addition calculation by the bit exclusive OR or is controlled by a code word r 0~r43 as an enabling signal, and when r i is zero, a i does not enter the modulo addition calculation. The constant input can be stored as a fixed circuit structure for use in this calculation process. According to the accompanying formulas S 1 and S 3 corresponding to the BCH code (5, 6),
The syndrome calculation circuit calculates the syndrome value by replacing "+" with bitwise exclusive or, i.e., modulo addition, as shown in fig. 2.
2) With syndromes S 1 and S 3 as inputs, the relationship between coefficients δ 0、δ1 and δ 2 and syndromes S 1 and S 3 (equations 8, 9, 10) is obtained by equation 7), and the error equation generation circuit uses a constant modulo multiplier and a modulo adder (bit exclusive or) to calculate the error equation coefficients, and the modulo addition operation can be replaced by bit exclusive or, as shown in fig. 3.
Δ 0+δ1x+δ2x2 =0 (7)
Delta 0=S1 (8)
Delta 1=S1 2 (9)
Delta 2=S1 3+S3 (10)
According to the logical relation of the constant and the syndrome variable modular multiplier, the corresponding constant modular multipliers are designed one by one for the constant 1 (a -1)2,(a-2)2……(a-43)2;1,a-1……a-43) corresponding to all finite field elements used for verification.
In this example, the design process of the constant modulo multiplier is as follows:
The primitive polynomial of GF (2 6) domain is P (x) =x 6 +x+1, P (a) =0, yielding a 6 =a+1. So for any two elements a (x) and b (x), and their multiplication result c (x) in the real number field, and multiplication result w (x) in the finite field, there are:
And c(x)=(a5x5+a4x4+a3x3+a2x2+a1x+a0)*(b5x5+b4x4+b3x3+b2x2+b1x+b0) coefficients are:
Since in GF (2 6) domain, x 6、x8......x10 is a polynomial that can be scaled to the highest power of 5 by x 6 =x+1, and since the addition in the finite domain is a bit exclusive or, the addition of the two terms of the same power is 0, the coefficients of the modular multiplication result in GF (2 6) domain can be derived as:
Substituting a constant into one of the multipliers, for example, taking an a 22 constant modulo multiplier, let b (x) equal to a 22, namely:
a 22=x5+x4+x2 +1 type (14)
B 0、b2、b4、b5 of a 22 is 1 and b 1、b3 is 0 in the above formula, and coefficients of the above polynomial are substituted into the formula in chapter 2 to obtain:
The method is characterized in that the method is continuously simplified to obtain:
Substituting the above formula into a result polynomial to obtain a constant modulus product result polynomial as follows:
combining the two above-mentioned expressions can result in a more compact expression:
Modulo multiplication and modulo addition computation are implemented using a constant modulo multiplier and bit exclusive OR, respectively.
3) Using a chien search circuit (see FIG. 4), the 1's (44 finite field elements of a -1)2,(a-2)2……(a-43)2;1,a-1……a-43) representing the location of the error and its third power are substituted into the error equation to generate 44 validation equations. If the result of the verification equation is 0, the corresponding position is indicated to have errors. The vector characterizing the error location, i.e. the error pattern, is finally obtained. Then, the corresponding error position is found by the relation a -i=a63-i in the finite field and the corresponding relation of the error position (shown in the following table):
The Qian's search circuit is subjected to 2-period multiplexing (as shown in fig. 5), and consists of 22 verification equation sub-circuits, 22 position numbers can be checked at a time, and all positions can be verified in 2 periods to obtain the error position. The circuit area is about one half of that of a single-period Chien search circuit.
The multiplexing period of the Chien search circuit is set to be M, wherein the value of M is between 1 and n, each clock period is controlled by a counter to search n/M positions, the 1 st group is input when the count is 1, the M th group is input when the count is M, if n/M has a remainder, the M+1 periods are searched and divided into M+1 groups, finite field elements corresponding to possible error positions in the groups are substituted into an error equation one by one for verification, and if the equation value is zero on the premise that the error number is within the error correction capability range, the position represented by the error equation is represented.
The output registers and the output registers of the corresponding groups are set according to the multiplexing cycle number M, the bit width of each group of registers is n/M, namely, the number of the positions searched by the Chien search circuit in each cycle is the same as that of the position set searched by the Chien search circuit in the x-th cycle, and the position set searched by the Chien search circuit in the x-th cycle is the same as that of the code words stored in the x-th output register and the x-th output register. When the system inputs data, the received code words are grouped according to the grouping rule which is the same as the money search and stored in the input register, and after the error pattern is obtained by the X-th period Chien search circuit, the error pattern and the code words in the X-th input register are subjected to exclusive OR operation, so that the error bits in the code word part are turned over to obtain correct code words, and the correct code words are stored in the X-th output register. And finally, splicing the code words in sequence by all the output registers to be used as output, and obtaining the decoded code words.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims.