Method for generating error correction circuit

By constructing and sorting the generated matrix, a truncated P matrix is ​​formed to reduce the number of logic gates in multi-bit error correction code logic, solving the problem of excessive number of logic gates in the existing technology, and achieving resource saving and circuit simplification.

CN110941505BActive Publication Date: 2024-09-13TAIWAN SEMICONDUCTOR MANUFACTURING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910712119.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-02-26
Filing Date
2019-08-02
Publication Date
2024-09-13
Estimated Expiration
2039-08-02

AI Technical Summary

Technical Problem

In the existing technology, the number of logic gates in multi-bit error correction code logic is too large, which leads to resource waste and increased complexity, which is difficult to effectively reduce.

Method used

By constructing the generation matrix (G matrix) and transforming it into a system form, which is composed of a parity check matrix (P matrix) and a check matrix (H matrix), the rows of the P matrix are sorted according to the row weight to determine the number of rows to be truncated , and form an error correction circuit by truncating the P matrix to reduce the number of logic gates.

Benefits of technology

It effectively reduces the number of logic gates in the error correction circuit, saves decoder resources, simplifies the circuit structure, and improves efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110941505B_ABST
    Figure CN110941505B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method for generating an error correction circuit for correcting errors in a codeword read from a memory, comprising: constructing a G matrix; transforming the G matrix into a systematic form, the transformed G matrix consisting of a P matrix and an H matrix; sorting the rows of the P matrix according to row weights; determining the number of rows in the P matrix to be truncated in view of correction strength and the number of data bits; generating a truncated P matrix by truncating the sorted rows of the P matrix with a first row weight and keeping the sorted rows of the P matrix with a second row weight; and forming the error correction circuit according to the truncated P matrix to correct the errors in the codeword; wherein the first row weight is greater than the second row weight.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to systems and methods for reducing logic of multi-bit error correction codes. Background Art

[0002] Error correction codes (ECC) are used in many applications. One of the common applications is to detect and correct bit errors in memory. With aggressive technology scaling, reductions in supply voltages, and the development of emerging memory technologies such as magnetoresistive random access memory (MRAM) and resistive RAM (ReRAM), there is a renewed interest in the efficient implementation of ECC logic. Summary of the invention

[0003] One embodiment of the present invention relates to a method of generating an error correction circuit for correcting errors in a codeword read from a memory, comprising: constructing a generation matrix (G matrix); transforming the G matrix into a systematic form, wherein the transformed G matrix is ​​composed of a parity check matrix (P matrix) and a parity check matrix (H matrix); sorting rows of the P matrix according to row weights; determining the number of rows in the P matrix to be truncated in view of correction strength and the number of data bits; generating a truncated P matrix by truncating the sorted rows of the P matrix with a first row weight and keeping the sorted rows of the P matrix with a second row weight; and forming the error correction circuit according to the truncated P matrix to correct the errors of the codeword; wherein the first row weight is greater than the second row weight.

[0004] An embodiment of the present invention relates to a method of generating an error correction circuit for correcting errors in a codeword read from a memory, comprising: constructing a generation matrix (G matrix) given a t-bit error correction code (ECC) strength; transforming the G matrix into a systematic form, wherein the transformed G matrix is ​​composed of a parity check matrix (P matrix) and a parity check matrix (H matrix); sorting the rows of the P matrix in ascending order according to row weights; determining the number of rows in the P matrix to be truncated; determining that the first x groups of the sorted rows have a sum of row weights less than the number of data bits k×q, q being less than the row weight of the x+1th group; for the rows in the x+1th group, determining the sum of the row weights of each combined t rows; and forming the error correction circuit for determining the error of the codeword according to the P matrix to be truncated.

[0005] An embodiment of the present invention relates to a method of generating an error correction circuit for correcting an error in a codeword read from a memory, comprising: constructing a generation matrix (G matrix) given a t-bit error correction code (ECC) strength; transforming the G matrix into a systematic form, the transformed G matrix consisting of a parity check matrix (P matrix) and a parity check matrix (H matrix); generating a syndrome of a retrieved data bit vector by using the H matrix; combining u rows of the P matrix, u being a natural number not greater than t; determining the error when the combined u rows match the syndrome; and forming the error correction circuit according to the syndrome for correcting the error of the codeword. BRIEF DESCRIPTION OF THE DRAWINGS

[0006] Aspects of the present disclosure are best understood from the following detailed description when read in conjunction with the accompanying drawings. It should be noted that, in accordance with standard practice in the industry, various components are not drawn to scale. In fact, the dimensions of the various components may be arbitrarily increased or reduced for clarity of discussion.

[0007] Figure 1 A diagram illustrating a memory system having a BCH code scheme according to some embodiments.

[0008] Figure 2 is a diagram of an exemplary generation matrix (G matrix) in a non-systematic form.

[0009] Figure 3 is a diagram showing the relationship between the G matrix and the check matrix (H matrix) in a systematic form.

[0010] Figure 4 A flow chart illustrating a method of reducing logic in a memory device using two-bit error correction strength according to some embodiments.

[0011] Figure 5 A diagram showing a generated matrix according to some embodiments.

[0012] Figure 6 A flow chart illustrating a method of applying multi-bit error correction strength reduction logic of a memory device according to some embodiments.

[0013] Figure 7 A flow chart illustrating a method for determining error locations in a memory device using single bit error correction strength according to some embodiments.

[0014] Figure 8 A flow chart illustrating a method for determining error locations in a memory device using multi-bit error correction strength according to some embodiments.

[0015] Fig. 9is a system diagram of an exemplary logic circuit for determining an error location according to some embodiments. DETAILED DESCRIPTION

[0016] The following disclosure provides many different embodiments or examples for implementing the different components of the provided subject matter. Specific examples of components and configurations are described below to simplify the present disclosure. Of course, these are only examples and are not intended to be limiting. For example, the first component in the following description is formed above or on the second component and may include an embodiment in which the first component and the second component are formed to be in direct contact, and may also include an embodiment in which an additional component may be formed between the first component and the second component so that the first component and the second component may not be in direct contact. In addition, the present disclosure may repeat reference numbers and / or letters in various examples. This repetition is for the purpose of simplification and clarity and does not itself indicate the relationship between the various embodiments and / or configurations discussed.

[0017] Additionally, for ease of description, spatially relative terms, such as "below," "beneath," "lower," "above," "upper," and the like, may be used herein to describe the relationship of one element or component to another element or components, as illustrated in the figures. The spatially relative terms are intended to encompass different orientations of the device in use or operation in addition to the orientation depicted in the figures. The device may be otherwise oriented (rotated 90 degrees or at other orientations) and the spatially relative descriptors used herein should likewise be interpreted accordingly.

[0018] In various embodiments, the present disclosure provides a method of reducing the logic required to implement a multi-bit error correction code by using a systematic check matrix. Furthermore, the present disclosure provides a method of locating erroneous bits in a multi-bit code.

[0019] Error correction codes (ECC) are used in many situations. One of the applications of ECC is to detect and correct errors in semiconductor memory. The general scheme of using ECC to protect memory is by adding redundant check bits to the data bits of semiconductor memory. These additional check bits extend the distance between two valid codewords. For example, the distance can be the number of bits between a valid codeword and an invalid codeword. A widely used common ECC set is called Bose-Chaudhuri-Hokungum (BCH) code. BCH codes widely used in modern memory are a class of cyclic error correction codes constructed using polynomials in a finite field (Galois field). The advantage of BCH codes is that during code design, there is precise control over the number of symbol errors that can be corrected by the code. A symbol can be a data block with a predetermined number of bits or size. Specifically, a binary BCH code that can correct multiple bit errors can be designed. Another advantage of BCH codes is that they can be easily decoded, that is, via an algebraic method called syndrome decoding. This simplifies the design of decoders using hardware. With BCH codes, the generation of check bits and syndrome bits can be represented by using a "generator matrix" (G matrix) and a "check matrix" (H matrix) constructed using the polynomial of the designed code.

[0020] Figure 1 A diagram illustrating a memory system 100 having a BCH code scheme according to some embodiments. The memory system 100 includes a memory 102 and an error correction circuit (or processor) 104. The memory 102 is configured to store codewords encoded by a BCH code. The error correction circuit 104, which may be a decoder or an encoder, is coupled to the memory 102 for correcting at least one error in the codeword read from the memory. The codeword may be read out of the memory 102 by a controller coupled to the memory 102 and the error correction circuit 104. For simplicity, Figure 1 The controller is not shown in FIG. According to some embodiments, the error correction circuit 104 is implemented or formed according to the following operations: constructing a generation matrix (G matrix); transforming the G matrix into a systematic form, the transformed G matrix consisting of a parity check matrix (P matrix) and a check matrix (H matrix); sorting the rows of the P matrix according to row weights (or may be referred to as row weights); determining the number of rows in the P matrix to be truncated in view of the correction strength and the number of data bits; generating a truncated P matrix by truncating the sorted rows of the P matrix with a first row weight and keeping the sorted rows of the P matrix with a second row weight; and forming the error correction circuit 104 according to the truncated P matrix. According to some embodiments, the error correction circuit 104 generates a syndrome according to a codeword; and determines an error according to the syndrome. According to some embodiments, the first row weight is greater than the second row weight. By forming the error correction circuit 104 using the above operations, the number of logic gates in the error correction circuit 104 can be reduced. The detailed operation of the error correction circuit is described in the following paragraphs.

[0021] For simplicity, binary BCH codes are discussed as an example in this disclosure. Given an integer m (m is greater than or equal to 3), there exists a binary BCH code with length 2. m = 1. For this BCH code to correct t bit errors (called a t-bit error-correcting BCH code), the minimum distance between valid codewords is at least 2t+1. Therefore, the number of check bits nk must be greater than or equal to (m+1)*t, where k is the number of data bits and n is the codeword length. As mentioned, BCH is a special kind of cyclic code based on polynomials in a Galois Field (GF). GF(2 m ) to construct these codes. Assume that α is GF(2 m ), length 2 m The generating polynomial g(x) of the t-bit error-correcting BCH code with a length of -1 is the lowest degree polynomial in GF(2) with α, α 2 , α 3 , …, α 2t Assume that is the minimum polynomial of α, then The generation function can be represented in matrix form (and referred to as the "G matrix"). The check bit is the dot product of the input vector and the G matrix. Figure 2 An exemplary generation matrix (G matrix) in a non-systematic form is illustrated. According to some embodiments, the G matrix has k rows and n columns, and the rows may be basis vectors g=[g0g1g2 ... g n-k-1 g n-k 00…0]. The elements in the basis vector g can be composed of the coefficients of the generating polynomial g(x), such as Figure 2 Illustration in Chinese.

[0022] By performing a linear transformation on the G matrix, a new G matrix in a systematic form is obtained. Figure 3 is a diagram showing the relationship between the generation matrix (G matrix) and the check matrix (H matrix) in a systematic form. Figure 3 H transpose is shown. In an embodiment of the present invention, the G matrix is ​​composed of a P matrix of dimension k×(nk) and an identity matrix of dimension k×k, where n is the size of the codeword and k is the size of the dataword. Therefore, the G matrix has dimensions of k×n, denoted as G k×n .

[0023] The check bit is generated according to the following formula.

[0024] c=m·P

[0025] The italic c and m represent bit vectors of check bits and data bits, respectively, and the symbol “·” represents a dot operation.

[0026] The codeword is the concatenation of data bits m and check bits c. When the G matrix is ​​transformed into a systematic form, the H matrix is ​​obtained, which is basically the transpose of the P matrix concatenated with another identity matrix. Figure 3 In the embodiment of the present invention, the H matrix is ​​obtained by taking the transpose of the P matrix and concatenating the transposed P matrix with the identity matrix of dimension (nk)×(nk), thereby resulting in H (n-k)×n . Figure 3 Display n×(nk) H T .

[0027] Furthermore, in order to detect whether the retrieved data r is a valid codeword, a syndrome S is generated by using the H matrix according to the following formula:

[0028] S=r·H T

[0029] Among them, H T represents the transpose of the H matrix.

[0030] Error correction code (ECC) is based on information redundancy to detect and correct bit errors. For k-bit data, the number of check bits (redundant bits) required to correct each error bit needs to satisfy:

[0031] x≧ceiling[log2(k+x+1)]

[0032] This equation arises because given x bits, 2 of the positions where the indicating bits have errors can be encoded. x Different information. There is an extra (+1) bit to indicate that there is no error. For example, if there is 128b data, 8 check bits (x=8) may be needed to correct each error bit because log2(128+8+1)<8. If x=7, the equation ceiling[log2(128+7+1)] is 8 and it is greater than 7. The inequality is not satisfied. To satisfy the inequality, x can be equal to 8. Therefore, for example, to correct 2 error bits (t=2), 128 data bits may require 16 check bits.

[0033] like Figure 3 , when the G matrix is ​​in systematic form, it shares a parity check matrix (P matrix) with the H matrix. Sharing the P matrix between the G matrix and the H matrix is ​​advantageous because only a single circuit needs to be designed for check bit generation and syndrome generation.

[0034] Typically in computing systems, data sizes are usually powers of 2 (for example, 32, 64, 128, etc.). In some embodiments, the maximum codeword size with a given check bit size is not a power of 2 (it is 2 m-1, for example 31, 63, 127, etc.). Therefore, a "truncated" codeword is usually used (for example, a codeword of 63 to protect a data width of 32). The truncated codeword can be obtained by picking a column from the H matrix. For example, if the data size is 128 bits (128b) with a correction strength of 2 bits, the number of check bits is 16. Therefore, the resulting codeword after truncation is 144b (=128b+16b). Therefore, a 255b codeword is obtained and then truncated to a resulting 144b codeword.

[0035] As discussed previously, the check bit c is generated by a "dot" operation of the data bit vector m and the P matrix, and by retrieving the bit vector r and H T The "dot" operation of the matrix produces the syndrome bit S. The dot product in the matrix operation is obtained by arithmetic multiplication and addition. In GF(2), multiplication is equivalent to the logical AND function and addition is equivalent to the logical XOR function. Therefore, if the item of the P matrix (similarly, the H matrix) is 0, the result of the "multiplication" is also 0 and there is no need to "add" 0. According to some embodiments, the number of XOR gates required to generate the check bit or syndrome bit is proportional to the number of 1s in the P matrix. To reduce the number of XOR gates, rows (or columns) with a relatively large number of 1s in the P matrix can be truncated. Specifically, when the item of the truncated P matrix is ​​1, the operation of the XOR gate is enabled. The larger the number of logical 1s in the P matrix, the more XOR gates should be used in the error correction circuit (or decoder / encoder). Therefore, in order to minimize the number of XOR gates in the error correction circuit 104, the number of 1s in the P matrix should be minimized. In the truncated P matrix, the number of 1s is minimized by truncating the rows with a large number of 1s in the P matrix. When the error correction circuit 104 is formed or manufactured according to a truncated P matrix, the number of XOR gates in the error correction circuit 104 can be reduced. Therefore, the resources of the decoder can be saved during the decoding operation. Therefore, when truncating the matrix to obtain a truncated code to fit the data width in the operation element, the row (column) with a smaller number of ones is selected or retained. An example of this optimization is the Hsiao-Code. A reference to the Hsiao-Code can be found in, for example, MY Hsiao, IBM Journal of Res. and Develop., Vol. 14, Chapter 4, pp. 395-401 (1970).

[0036] In various embodiments, the present disclosure provides a method of reducing the number of logic gates required to implement matching of syndromes to columns and combinations of columns in an H matrix (or rows in a P matrix) for correction (correction is accomplished by locating the position of the erroneous bit and then flipping the position). Figure 4 and Figure 6 The method is discussed in detail. Due to the large number of combinations of columns in the H matrix, a relatively large number of logic gates can be used to implement the matching of the syndrome with the combinations of columns in the H matrix. Therefore, most of the logic gates or resources in the decoder are used to implement the matching of the syndrome with the combinations of columns. For example, the BCH code for 128b data with two-bit correction capability (2-bit ECC strength) uses 16 check bits. The codeword required to protect 128b data is a (255,239,2) code. This code has 16 check bits that reach 144b of the total number of bits of the codeword. Since the matrix is ​​in systematic form, there will be a 16×16 unit matrix, and 128 rows of the 239 remaining rows of the P matrix can be selected. Therefore, there are C(239,128) different combinations, which is approximately 2.5E70. This number is too large to have an optimal solution. To optimize the logic gates, in some embodiments, the heuristic algorithm is as follows:

[0037] (1) For each row of the P matrix (or each column of the H matrix), determine the weight of 1's in the row.

[0038] (2) Next, sort the rows using ascending weight.

[0039] (3) Select the first j rows from the front of the sorted rows, where j is greater than the number of data bits (k). j may be much greater than k because there will be many rows with the same weight. For example, there may be x rows with the same weight and only a portion of the x rows are selected to satisfy the data width k.

[0040] (4) Select the last few rows with the same weight (just enough rows to satisfy k rows) so that these rows overlap the most with the previous rows of this weight. This is approximated by selecting the row with the least number of 1s for all combined rows.

[0041] As also discussed previously, to check if the search bit vector r is a valid codeword, a syndrome S is generated. Otherwise, if S is a zero vector, the resulting codeword is valid. Then, the correct data is obtained by selecting the data field of the codeword. This is one of the advantages of using a systematic codeword because the data field and the check field in a systematic codeword are separated. If S is one-hot (only 1 bit is "1"), one of the check bits is wrong.

[0042] In some embodiments, since the rows of the P matrix are independent of each other, any combination of z columns of the H matrix or any combination of columns less than z of the H matrix is ​​also independent of each other, where z is less than or equal to t. In addition, the syndrome S is the result of combining the columns in which the bit(s) are in error. For example, if S matches one of the nk rows in P (columns in H), then the matching column is in error and a single-bit error is detected. If the resulting syndrome S is equal to the combined columns i and j of the H matrix, then the bits in positions i and j are in error. Referring to Figure 7 and Figure 8 Methods of determining error locations in a memory device are discussed in detail.

[0043] Figure 4 A flowchart showing a method for reducing logic gates of an error correction circuit of a memory device using two-bit error correction strength according to some embodiments. The method can be used to implement or generate Figure 1 The error correction circuit 104 of FIG. 104 is used to illustrate the proposed optimization method using the exemplary ECC code below. This example is a 2-bit BCH error correction code with 128 data bits. In this example, the parameters are: m=8, k=128, n=144 and nk=16. In vector form, {g0, g1, g2, ... g 16} = {10110111101100011}, which can represent the generating polynomial as 1 + x 2 +x 3 +x 5 +x 6 +x 7 +x 8 +x 10 +x 11 +x 15 +x 16 .

[0044] refer to Figure 4 and Figure 5 In operation 401, a generation matrix (G matrix) is constructed given two bits of error correction code (ECC) strength. Figure 5 As shown in FIG. 1 , the G matrix is ​​in a non-systematic form and the G matrix can be a cyclic shift of the basis vectors in the G matrix, that is, a vector of the form {g0, g1, g2, … g 16}={10110111101100011}.

[0045] In operation 403, the G matrix is ​​transformed into a systematic form. The transformed G matrix is ​​composed of a parity check matrix (P matrix) and a check matrix (H matrix), both of which are also in a systematic form. According to some embodiments, for example, a linear transformation operation is performed on the G matrix to obtain a transformed G matrix in a systematic form, such as Figure 3 The diagram is shown in the figure. Figure 2 The G matrix is ​​in a non-systematic form. The following code illustrates an example of transforming the G matrix in a non-systematic form into a systematic form:

[0046]

[0047] Next, in operation 405, when the G matrix in the system form is obtained, the P matrix can be automatically obtained via the relationship G=[P][I], where the matrix [I] is the identity matrix. According to some embodiments, the P matrix is ​​the G matrix without the identity matrix [I]. In the P matrix, the weight of each row of the P matrix depends on the number of logical "ones" (i.e., 1) in the row. It should be noted that the P matrix is ​​the transpose of the H matrix, i.e., P=H T . In addition, the rows of the P matrix are sorted in ascending order according to the row weight (number of logical ones). According to this example, the lowest weight of the P matrix is ​​4. There are 8 rows with the lowest weight (i.e., the number of logical ones is 4). In addition, there are 21, 31, 30, and 45 rows with weights 5, 6, 7, and 8, respectively.

[0048] In operation 407, the sorted rows are then formed into groups according to their row weight. Thus, each group includes rows of a particular weight. For example, the particular weight may be weight 4, 5, 6, 7, and 8.

[0049] In operation 409, the number of rows in the P matrix to be truncated is determined to obtain a truncated P matrix. In this example, the total number of rows of the truncated P matrix is ​​128.

[0050] In operation 411, the xth group is identified. The first x groups of sorted rows have a sum of row weights less than the number of data bits, k×q, where q is less than the row weight of the x+1th group. In this example, k is 128. The first x groups are groups of 8 rows with weight 4, 21 rows with weight 5, 31 rows with weight 6, and 30 rows with weight 7. The x+1th group is rows with weight 8. The total number of rows in the first x groups is 8+21+31+30=90. Therefore, q is 38, i.e., 128-90=38.

[0051] Then, in operation 413, q rows in the x+1th group are randomly selected so that the sum of the row weights of the first x groups and the selected q rows is equal to k. In this example, 38 (i.e., 38 out of 45) rows with weight 8 are picked to form a truncated P matrix with a total number of rows of 128 (i.e., 8+21+31+30+38=128). Then, the remaining rows are truncated in operation 415. The truncated rows include (if any) the x+2th and higher groups, which have more 1s than the first x+1 groups. The truncated rows also include the rows in the x+1th group, but excluding the selected q rows.

[0052] In operation 413, the algorithm is performed on the rows in the x+1th group to select q rows in the x+1th group, i.e., 38 rows out of 45 with weight 8. To find the row with the minimum weight, an exemplary code (e.g., Python code) of the algorithm may be used below.

[0053]

[0054] According to operations 401 to 415, a truncated P matrix and a combined matrix having a minimum total number of logical 1s are obtained. According to some embodiments, the combined matrix is ​​a matrix constructed with pairs of two rows in the truncated P matrix.

[0055] Then, logic gates and logic circuits (e.g., error correction circuit 104) can be designed according to the truncated structure. Since rows in the P matrix (or columns in the H matrix) with a large number of 1s are truncated, some logic gates can be eliminated by using the truncated P matrix, resulting in a relatively simple circuit structure. Specifically, the truncated P matrix is ​​configured to perform a "dot" product operation with the retrieved bit vector to generate a check bit and a syndrome bit, wherein the "dot" product operation is to add the product of the corresponding items of the truncated P matrix and the retrieved bit vector. In the error correction circuit, the addition operation is performed by the XOR gate, and the multiplication operation is performed by the AND gate. Therefore, when the item of the truncated P matrix is ​​0, the result of multiplying the item of the truncated P matrix with the item of the retrieved bit vector is also 0 (i.e., using the AND gate). When the result of multiplying the two items is 0, there is no need to perform the operation of adding "0" in the "dot" product, i.e., the XOR gate can be omitted. On the contrary, when the item of the truncated P matrix is ​​1, the operation of the XOR gate is enabled. The larger the number of logical 1s in the P matrix, the more XOR gates should be used in the error correction circuit 104. Therefore, to minimize the number of XOR gates in the error correction circuit 104, the number of 1s in the P matrix should be minimized. In the truncated P matrix, the number of 1s is minimized by truncating the rows in the P matrix that have a larger number of 1s. Therefore, some logic gates (e.g., some XOR gates) in the error correction circuit 104 can be eliminated, resulting in a relatively simple circuit structure.

[0056] Figure 6 1 is a flow chart showing a method for reducing logic gates of an error correction circuit in a memory device using multi-bit error correction strength according to some embodiments. The error correction circuit may be Figure 1 The error correction circuit 104 is provided.

[0057] refer to Figure 6 In operation 601, a generation matrix (G matrix) is constructed given a t-bit error correction code (ECC) strength, where t is greater than one (1).

[0058] Operations 403, 405, 407, 409, and 411 are similar to Figure 4 After the xth group is identified in operation 411, the sum of the row weights of each combined t rows is determined in operation 613 for the rows in the x+1th group. The row weight depends on the number of logical ones in the row, as described above. Taking t equal to 2 as an example, every two rows in the P matrix are summed byte by byte by a logical "OR" function to determine the sum of each of the combined rows.

[0059] In operation 615, q rows in the x+1th group are selected that each result in a row weight less than the unselected row when combined with other rows. Subsequently, the remaining rows with higher row weights are truncated in operation 617. The truncated rows include (if any) the x+2th and higher groups that have more 1s than the first x+1 groups. According to operations 601 to 617, a truncated matrix with a minimum total number of logical 1s is obtained. As described above, the greater the number of logical 1s in the P matrix, the more XOR gates should be used in the error correction circuit. In the truncated P matrix, the number of 1s is minimized by truncating rows with a larger number of 1s in the P matrix. Therefore, some logic gates (e.g., some XOR gates) in the error correction circuit can be eliminated, resulting in a relatively simple circuit structure.

[0060] Figure 7 1 is a flow chart showing a method for determining error locations in a memory device using single bit error correction strength according to some embodiments. Figure 1 The error correction circuit 104 performs the method.

[0061] In operation 701, a generation matrix (G matrix) is constructed given a single bit error correction code (ECC) strength.

[0062] refer to Figure 7 , after transforming the G matrix into a systematic form, the data bit vector is retrieved in operation 705. According to some embodiments, the data bit vector may be a codeword retrieved / read out from a semiconductor memory (eg, 102), and the data bit vector may contain bit errors that need to be corrected.

[0063] Next, in operation 707, a syndrome of the retrieved data bit vector is generated by using the H matrix. The syndrome may be used to determine the error of the retrieved data bit vector. As described above, the syndrome is generated by multiplying the retrieved data bit vector with the transpose of the H matrix.

[0064] A determination is made in operation 709 whether the syndrome vector is equal to zero. If so, the retrieved data bit vector is determined to be valid in operation 711. Next, another data bit vector may be retrieved in operation 705, followed by a syndrome test through operations 707 and 709. If the syndrome is not equal to zero (given a unit ECC strength in an embodiment of the present invention, the syndrome is equal to 1) in operation 709, then an error is determined to exist in the retrieved data bit vector in operation 713. Subsequently, by comparison with the syndrome vector, a row of the P matrix that matches the syndrome vector is identified and the error bit is determined.

[0065] Figure 8 1 is a flow chart showing a method for determining error locations in a memory device using multi-bit error correction strength according to some embodiments. Figure 1 The error correction circuit 104 performs the method.

[0066] refer to Figure 8 In operation 801, a generation matrix (G matrix) is constructed given a t-bit error correction code (ECC) strength, where t is greater than one (1).

[0067] Operations 403, 705, 707, 709, and 711 are similar to Figure 7 In operation 709, if it is determined that the syndrome vector is not equal to zero (which means that the retrieved data bit vector has one or more error bits given the t-bit ECC strength), then in operation 813 it is determined whether a row of the P matrix matches the syndrome. If so, then in operation 815 it is determined that the retrieved data bit vector has one error bit. Subsequently, by comparison with the syndrome vector, a row of the P matrix that matches the syndrome vector is identified and the error bit is determined.

[0068] If it is determined in operation 813 that a single row of the P matrix does not match the syndrome (which means that the retrieved data bit vector has two or more erroneous bits), then it is determined in operation 817 whether the combination of two rows of the P matrix matches the syndrome. In one embodiment, the combination is performed by a logical exclusive or "XOR" function. If the combined rows match the syndrome, then it is determined in operation 821 that the retrieved vector has two erroneous bits, and the two erroneous bits associated with the two rows may be determined.

[0069] If it is determined in operation 817 that the two rows of the P matrix do not match the syndrome when combined, then it is determined in operation 819 that the retrieved data bit vector has three or more error bits. Operations 817 and 819 are repeated until the error bit positions are determined given the t-bit ECC strength. Thus, if the syndrome is equal to zero, then the retrieved data bit vector is valid and has no error bits. If the syndrome is not equal to zero and one row matches the syndrome, then there is one error bit. If the syndrome is not equal to zero and the two rows combined match the syndrome, then there are two error bits. Likewise, if the syndrome is not equal to zero and the t rows combined match the syndrome, then there are t error bits.

[0070] Fig. 9 is a system diagram of an exemplary logic circuit for determining an error location according to some embodiments.

[0071] refer to Fig. 9 , when the syndrome is not equal to zero, the syndrome is compared with the rows of the truncated P matrix (or the columns of the truncated H matrix) to determine the error position of the bit. According to some embodiments, the complexity of truncating the H matrix has been reduced by truncating columns with relatively large weights. Therefore, the complexity of determining the error position is also reduced. For example, in Fig. 9 In , the column vector [v11, v12 ... v1n] of the H matrix is ​​compared bit by bit with the syndrome S by using an XOR gate followed by an OR gate to add the output from the XOR gate. When the column vector [v11, v12 ... v1n] of the H matrix matches the syndrome S bit by bit (i.e., the output of the OR gate is zero), then the column vector [v11, v12 ... v1n] is in error and a bit error is detected. Fig. 9 The exemplary logic circuit shown in is used to detect one error bit. To determine t bit errors, more logic gates and wiring are required. As previously discussed, since rows in columns in the H matrix with a larger number of 1s are truncated, the total number of columns in the H matrix is ​​reduced. Therefore, the operation of comparing the truncated H matrix with the syndrome S is greatly reduced, and resources or logic gates of the decoder can be saved.

[0072] According to some embodiments, the error correction circuit 104 may be formed or manufactured by a semiconductor process. The error correction circuit 104 may be implemented in digital electronic circuitry or in computer hardware, firmware, software, or a combination thereof. The error correction circuit 104 may be supplemented by or incorporated in a specially designed application specific integrated circuit (ASIC) or a suitably programmed field programmable gate array (FPGA).

[0073] Furthermore, the apparatus of the embodiments may be implemented in a computer program product tangibly embodied in a machine-readable storage device for execution by a computer processor; and the method steps of the embodiments may be performed by a computer processor executing the program to perform the functions of the embodiments by operating on input data and generating output. Suitable processors (as examples) include both general-purpose microprocessors and special-purpose microprocessors. Storage devices suitable for tangibly embodying computer program instructions include all forms of non-volatile memory, including (but not limited to): semiconductor memory devices such as EPROM, EEPROM, and flash devices.

[0074] In some embodiments, the present disclosure provides a method for generating an error correction circuit for correcting errors in a codeword read from a memory. The method includes: constructing a generation matrix (G matrix); transforming the G matrix into a systematic form, the transformed G matrix consisting of a parity check matrix (P matrix) and a check matrix (H matrix); sorting the rows of the P matrix according to row weights; determining the number of rows in the P matrix to be truncated in view of correction strength and the number of data bits; generating a truncated P matrix by truncating the sorted rows of the P matrix with a first row weight and keeping the sorted rows of the P matrix with a second row weight; and forming the error correction circuit according to the truncated P matrix to correct the errors of the codeword; wherein the first row weight is greater than the second row weight.

[0075] In some embodiments, the present disclosure also provides a method for generating an error correction circuit for correcting errors in a codeword read from a memory. The method includes: constructing a generation matrix (G matrix) given a t-bit error correction code (ECC) strength; transforming the G matrix into a systematic form, the transformed G matrix consisting of a parity check matrix (P matrix) and a check matrix (H matrix); sorting the rows of the P matrix in ascending order according to row weights; determining the number of rows in the P matrix to be truncated; determining that the first x groups of the sorted rows have a sum of row weights less than the number of data bits k×q, q less than the row weight of the x+1th group; and for the rows in the x+1th group, determining the sum of the row weights of each combined t rows; and forming the error correction circuit according to the P matrix to be truncated for determining the error of the codeword.

[0076] In some embodiments, the present disclosure provides a method for generating an error correction circuit for correcting errors in a codeword read from a memory. The method includes: constructing a generation matrix (G matrix) from the codeword given a t-bit error correction code (ECC) strength; transforming the G matrix into a systematic form, the transformed G matrix consisting of a parity check matrix (P matrix) and a check matrix (H matrix); generating a syndrome of a retrieved data bit vector by using the H matrix; combining u rows of the P matrix, u being a natural number not greater than t; determining that the u rows of the P matrix match the syndrome when combined; and forming the error correction circuit according to the syndrome for correcting the error of the codeword.

[0077] The foregoing briefly describes the features of several embodiments so that those skilled in the art can better understand aspects of the present disclosure. Those skilled in the art will appreciate that they can easily use the present disclosure as a basis for designing or modifying other processes and structures for carrying out the same purposes and / or achieving the same advantages of the embodiments described herein. Those skilled in the art will also appreciate that these equivalent constructions do not depart from the spirit and scope of the present disclosure, and that various changes, substitutions, and modifications may be made herein without departing from the spirit and scope of the present disclosure.

Claims

1. A method of generating an error correction circuit for correcting errors in a codeword read from a memory, comprising: Construct the generator matrix G matrix; Transforming the G matrix into a systematic form, wherein the transformed G matrix is ​​composed of a parity check matrix P matrix and a check matrix H matrix; Sorting the rows of the P matrix according to row weights; determining the number of rows to be truncated in the P matrix in view of the correction strength and the number of data bits; generating a truncated P matrix by truncating sorted rows of the P matrix having first row weights and retaining the sorted rows of the P matrix having second row weights so as to minimize the number of logic gate operations; as well as generating an error correction circuit structure having the number of logic gate operations minimized according to the truncated P matrix to correct the errors of the codeword; wherein the first row weight is greater than the second row weight; as well as The error correction circuit is formed by implementing the error correction circuit structure in at least one of a digital electronic circuit, an application specific integrated circuit, a field programmable gate array, and a computer circuit implemented as at least one of hardware, firmware, and software. The method of claim 1 , wherein the H matrix is ​​the transpose of the P matrix.

3. The method according to claim 1, after sorting, further comprises: forming the sorted rows into groups according to their row weights; and It is determined that the sum of row weights of the first x groups of the sorted rows is less than the number of data bits k times q, q being less than the row weight of the (x+1)th group.

4. The method according to claim 3, wherein the correction intensity is one bit, the method further comprising: randomly selecting q rows in the (x+1)th group so that the sum of the row weights of the first x groups and the selected q rows is equal to k; and Truncate the remaining lines.

5. The method according to claim 3, wherein the correction strength is t bits, t is a natural number greater than one, and the method further comprises: combining every t rows in the (x+1)th group; and Determine the sum of the row weights for each combined t rows.

6. The method of claim 5, wherein the step of combining every t rows further comprises: Each t rows are combined bit by bit through a logical OR gate.

7. The method according to claim 5, further comprising: selecting q rows in the (x+1)th group that, when combined with other rows, each generate a smaller row weight than unselected rows; and Truncate the remaining lines.

8. The method according to claim 7, further comprising: The number of logic gates is determined based on the P matrix after truncation.

9. A method of generating an error correction circuit for correcting errors in a codeword read from a memory, comprising: Construct the generator matrix G matrix given the t-bit error correction code ECC strength; Transforming the G matrix into a systematic form, wherein the transformed G matrix is ​​composed of a parity check matrix P matrix and a check matrix H matrix; Sorting the rows of the P matrix in ascending order according to the row weights; determining the number of rows to be truncated in the P matrix so as to minimize the number of logic gate operations; Determining that the sum of row weights of the first x groups of sorted rows is less than the number of data bits k times q, q being less than the row weight of the (x+1)th group; For the rows in the (x+1)th group, determining a sum of row weights of each combined t rows; as well as generating an error correction circuit structure having the number of logic gate operations minimized according to the P matrix to be truncated for determining the error of the codeword; as well as The error correction circuit is formed by implementing the error correction circuit structure in at least one of a digital electronic circuit, an application specific integrated circuit, a field programmable gate array, and a computer circuit implemented as at least one of hardware, firmware, and software.

10. The method of claim 9, wherein the H matrix is ​​the transpose of the P matrix.

11. The method according to claim 9, after sorting, further comprising: The sorted rows are formed into groups according to their row weights.

12. The method of claim 9, further comprising: selecting q rows in the (x+1)th group that, when combined with other rows, each generate a smaller row weight than unselected rows; and Truncate the remaining lines.

13. The method according to claim 12, further comprising: The number of logic gates is determined based on the P matrix after truncation.

14. The method of claim 9, wherein determining a sum of row weights for each combined t rows further comprises: combining every t rows in the (x+1)th group; and Determine the sum of the row weights for each combined t rows.

15. The method of claim 13, wherein combining every t rows further comprises: Each t rows are combined bit by bit through a logical OR gate.

16. A method of generating an error correction circuit for correcting errors in a codeword read from a memory, comprising: Construct the generator matrix G matrix given the t-bit error correction code ECC strength; Transforming the G matrix into a systematic form, wherein the transformed G matrix is ​​composed of a parity check matrix P matrix and a check matrix H matrix; generating a syndrome of the retrieved data bit vector by using the H matrix; Combining u rows of the P matrix so as to truncate the P matrix, where u is a natural number not greater than t; The error is determined when the combined u rows match the syndrome ; as well as forming the error correction circuit for correcting the error of the codeword based on the syndrome, wherein a number of logic gate operations in the error correction circuit is minimized in response to truncating the P matrix; generating an error correction circuit structure for correcting the error of the codeword according to the syndrome; as well as The error correction circuit is formed by implementing the error correction circuit structure in at least one of a digital electronic circuit, an application specific integrated circuit, a field programmable gate array, and a computer circuit implemented as at least one of hardware, firmware, and software.

17. The method of claim 16, wherein combining u rows further comprises: Each u row is combined bit by bit by means of a logical exclusive or "XOR" gate.

18. The method of claim 16, wherein after transforming the G matrix, the method further comprises: sorting the rows of the P matrix in ascending order according to row weights; and The sorted rows are formed into groups according to their row weights.

19. The method of claim 18, further comprising: Determining the number of rows to be truncated in the P matrix; and It is determined that the sum of row weights of the first x groups of the sorted rows is less than the number of data bits k times q, q being less than the row weight of the (x+1)th group.

20. The method of claim 19, further comprising: For the rows in the (x+1)th group, determining a sum of row weights for each combined t rows; and Select q rows in the (x+1)th group that, when combined with other rows, each generate a smaller row weight than unselected rows.

21. A method of generating an error correction circuit for correcting errors in a codeword read from a memory, comprising: Construct the generator matrix G matrix; Transforming the G matrix into a systematic form, wherein the transformed G matrix is ​​composed of a parity check matrix P matrix and a check matrix H matrix; Sorting the rows of the P matrix according to row weights; determining the number of rows to be truncated in the P matrix in view of the correction strength and the number of data bits; generating a truncated P matrix by maintaining sorted rows of the P matrix having weights less than or equal to the weights of the truncated rows of the P matrix so as to minimize the number of logic gate operations; as well as An error correction circuit having the number of logic gate operations minimized according to the truncated P matrix is ​​formed in at least one of a digital electronic circuit, an application specific integrated circuit, a field programmable gate array, and a computer circuit implemented as at least one of hardware, firmware, and software to correct the errors of the codeword.

22. The method of claim 21, wherein the H matrix is ​​the transpose of the P matrix.

23. The method according to claim 21, after sorting, further comprising: forming the sorted rows in groups by their row weights; and It is determined that the sum of row weights of the first x groups of the sorted rows is less than the number of data bits k times q, q being less than the row weight of the (x+1)th group.

24. The method of claim 23, wherein the correction intensity is one bit, the method further comprising: randomly selecting q rows in the (x+1)th group so that the sum of the row weights of the first x groups and the selected q rows is equal to k; and Truncate the remaining lines.

25. The method according to claim 23, wherein the correction strength is t bits, t being a natural number greater than one, the method further comprising: combining every t rows in the (x+1)th group; and Determine the sum of the row weights for each combined t rows.

26. The method of claim 25, wherein the step of combining every t rows further comprises: Each t rows are combined bit by bit through a logical OR gate.

27. The method of claim 25, further comprising: selecting q rows in the (x+1)th group that, when combined with other rows, each generate a smaller row weight than unselected rows; and Truncate the remaining lines.

28. The method of claim 27, further comprising: The number of logic gates is determined based on the P matrix after truncation.

29. A method of generating an error correction circuit for correcting errors in a codeword read from a memory, comprising: Construct the generator matrix G matrix given the t-bit error correction code ECC strength; Transforming the G matrix into a systematic form, wherein the transformed G matrix is ​​composed of a parity check matrix P matrix and a check matrix H matrix; Sorting the rows of the P matrix in ascending order according to the row weights; Determining the number of rows to be truncated in the P matrix; Determine that the total number of the first x groups of sorted rows is less than the number of data bits k times q, and q is less than the number of rows in the (x+1)th group; For the rows in the (x+1)th group, determining a sum of row weights of each combined t rows; as well as An error correction circuit is formed in at least one of a digital electronic circuit, an application specific integrated circuit, a field programmable gate array, and a computer circuit implemented as at least one of hardware, firmware, and software for determining the errors of the codeword based on the P matrix to be truncated, wherein a subset of the (x+1)th group is truncated from the P matrix.

30. The method of claim 29, wherein the H matrix is ​​the transpose of the P matrix.

31. The method according to claim 29, after sorting, further comprising: The sorted rows are formed into groups according to their row weights.

32. The method of claim 29, further comprising: selecting q rows in the (x+1)th group that, when combined with other rows, each generate a smaller row weight than unselected rows; and Truncate the remaining lines.

33. The method of claim 32, further comprising: The number of logic gates is determined based on the P matrix after truncation.

34. The method of claim 29, wherein determining a sum of row weights for each combined t rows further comprises: combining every t rows in the (x+1)th group; and Determine the sum of the row weights for each combined t rows.

35. The method of claim 34, wherein combining every t rows further comprises: Each t rows are combined bit by bit through a logical OR gate.

36. A method of generating an error correction circuit for correcting errors in a codeword read from a memory, comprising: Construct the generator matrix G matrix given the t-bit error correction code ECC strength; Transforming the G matrix into a systematic form, wherein the transformed G matrix is ​​composed of a parity check matrix P matrix and a check matrix H matrix; generating a syndrome of the retrieved data bit vector by using the H matrix; Combining u rows of the P matrix so as to truncate the P matrix, where u is a natural number not greater than t; The error is determined when the combined u rows match the syndrome ; as well as forming the error correction circuit for correcting the errors of the codeword based on the syndrome, wherein a number of logic ones in the truncated P matrix is ​​minimized in response to truncating the P matrix; generating an error correction circuit structure for correcting the error of the codeword according to the syndrome; as well as The error correction circuit is formed by implementing the error correction circuit structure in at least one of a digital electronic circuit, an application specific integrated circuit, a field programmable gate array, and a computer circuit implemented as at least one of hardware, firmware, and software.

37. The method of claim 36, wherein combining u rows further comprises: Each u row is combined bit by bit by means of a logical exclusive or "XOR" gate.

38. The method of claim 36, wherein after transforming the G matrix, the method further comprises: sorting the rows of the P matrix in ascending order according to the row weights; and The sorted rows are formed into groups according to their row weights.

39. The method of claim 38, further comprising: Determining the number of rows to be truncated in the P matrix; and It is determined that the sum of row weights of the first x groups of the sorted rows is less than the number of data bits k times q, q being less than the row weight of the (x+1)th group.

40. The method of claim 39, further comprising: For the rows in the (x+1)th group, determining a sum of row weights for each combined t rows; and Select q rows in the (x+1)th group that, when combined with other rows, each generate a smaller row weight than unselected rows.