This disclosure relates to cyclic redundancy check (CRC)-based error detection codes that are combined with error correction codes and used to encode data prior to writing to a storage medium and to detect errors in data read from the storage medium.
Combined error detection and error correction codes typically exhibit poor performance when out-of-order codewords are received. For example, in one approach, a length of data (e.g., a sector of data) is parsed into N codewords and each codeword is individually encoded with both an error detection code (EDC) and an error correction code (ECC). Although individual codewords may be decoded independently, this approach is inefficient as it requires dedicated EDC coding for each codeword and, correspondingly, that extra information be stored and transmitted.
In another approach, EDC coding is applied across a number of codewords rather than to codewords individually. This approach may handle out-of-order codewords by waiting to receive the number of codewords, resequencing the codewords, and then performing EDC decoding. However, in this approach, a large buffer is required to store codewords that are received out of order until a sufficient number of consecutively sequenced codewords is received. Further, the buffering of codewords in this manner may lead to large decoding time delays and increased memory requirements.
Described herein are techniques for generating an overall CRC sequence for encoding data. Data comprising a plurality of codewords is received. For each codeword in the plurality of codewords, a partial CRC sequence for the codeword is determined and the codeword-level CRC sequence for each codeword in the plurality of codewords is combined to produce the overall CRC sequence. It is determined if there is an error in the data based on the overall CRC sequence.
Also described herein is a system for generating an overall CRC sequence for encoding data. The system comprises an ECC encoder configured to receive data comprising a plurality of codewords, for each codeword in the plurality of codewords, determine a partial CRC sequence for the codeword and combine the codeword-level CRC sequence for each codeword in the plurality of codewords to produce the overall CRC sequence, and determine if there is an error in the data based on the overall CRC sequence.
Further described herein are techniques for decoding data. A plurality of codewords is received in a first order, the first order different from a second order in which the plurality of codewords was encoded. A CRC check is initiated, in the first order, on each of the plurality of codewords to produce a respective plurality of codeword-level CRC values. The plurality of codeword-level CRC values is combined to produce an overall CRC sequence. It is determined if there is an error in the plurality of codewords based on the overall CRC sequence.
The above and other aspects and advantages of the invention will be apparent upon consideration of the following detailed description, taken in conjunction with the accompanying drawings, in which like reference characters refer to like parts throughout, and in which:
The disclosed technology relates generally to CRC encoding and decoding structures for write and read paths in data systems, respectively. More particularly, the disclosed technology relates to new encoding and decoding architectures and techniques for processing codewords that may be read in an arbitrary (e.g., out-of-order) sequence from a storage media.
Referring back to
Referring back to
Next, the ECC encoder 120 determines and appends error correction bits 2-111, 2-113, and 2-115 to the codewords 2-110, 2-112, and 2-114, respectively. Further, the ECC encoder 120 may determine the error correction bits 2-111, 2-113, and 2-115 as a function of the codewords 2-110, 2-112, and 2-114, respectively, through any suitable scheme. For example, the ECC encoder 120 may determine the error correction bits according to a Reed-Solomon, Golay, BCH, or multidimensional parity block encoding scheme.
Returning to
The architecture 100 includes an ECC decoder 140 and EDC decoder 150 for decoding the retrieved ECC encoded data 108. The ECC decoder 140 processes parity bits present in the retrieved ECC encoded data 108 and outputs a data stream that includes CRC check bits, i.e., retrieved EDC encoded data 116. As an illustrative example, the retrieved EDC encoded data 116 may be a recovered version of the EDC encoded data 2-104. The EDC decoder 150 detects whether any errors are present in the retrieved EDC encoded data 116 by performing a parity check based on CRC check bits included in the retrieved EDC encoded data 116.
If the parity check indicates that no errors are present in the retrieved EDC encoded data 116, then the EDC decoder 150 strips the CRC check bits from the retrieved EDC encoded data 116 to produce recovered data 112. If, on the other hand, the parity check indicates that errors are present in the retrieved EDC encoded data 116, then the EDC decoder declares that an error is present and may additionally output a decoded version of the retrieved EDC encoded data 116 (i.e., which contains one or more errors) as the recovered data 112.
With reference to
Before describing how the ECC encoder 110 appends CRC check bits (e.g., the CRC check bits 2-105) to data (e.g., the data 2-102) or how the EDC decoder 150 detects errors based on the appended CRC check bits in the case of multiple concatenated codewords, it is instructive to describe CRC checking in general terms. Generally, a set of k binary data symbols, u0, . . . uk−1, may be represented by a corresponding data polynomial
u(x)=uk−1xk−1+ . . . +u2x2+u1x+u0, (1)
where each of the data symbols u0, . . . uk−1 takes on a value of 0 or 1. The k data symbols are mapped into an n symbol codeword
c(x)=cn−1xn−1+ . . . +c2x2+c1x+c0,
where each of the data symbols c0, . . . cn−1 takes on a value of 0 or 1, based on a generator polynomial of order n−k
g(x)=xn−k+gn−k−1xn−k−1+ . . . +c2x2+c1x+c0,
where each of the generator symbols g0, . . . gn−k−1 takes on a value of 0 or 1.
Specifically, a parity check polynomial is derived from the data polynomial and the generator polynomial according to the following relationship
p(x)=[u(x)xn−k] mod g(x)=pn−k−1xn−k−1+ . . . +p2x2+p1x+p0, (2)
and the resultant parity check symbols, p0, . . . pn−k−1, which take on values of 0 or 1, are appended to the data symbols to create a codeword of the form
uk−1, . . . ,u1,u0,pn−k−1, . . . ,p1,p0.
As would be understood by one of ordinary skill in the art, based on the disclosure and teachings herein, the parity check symbols, p0, . . . pn−k−1, may be derived using a linear shift register.
Next, consider the case of ECC encoded data (e.g., the ECC encoded data 2-106) that includes multiple codewords (e.g., the codewords 2-110, 2-112, and 2-114). A technique for performing CRC (i.e., encoding and decoding operations) for out-of-order codewords is presented which advantageously requires no extra CRC bits to be written to media as compared to a CRC technique which corrects only for in-order codewords. Further, a minimum distance of the CRC code is not reduced compared to a CRC technique which corrects only for in-order codewords.
For illustrative purposes, consider the particular case where the ECC encoded data includes exactly four codewords which may be of varying lengths. In particular, denote the four codewords by u0(x), u1(x), u2(x), and u3(x), where ui(x)=[uk
Under the assumption that a number of zeros are appended to each of the codewords u0(x), u1(x), u2(x), and u3(x), so that the resultant modified codeword has a length of L, equation (1) for the multi-codeword case may be written
p(x)={[u0(x)x3L+u1(x)x2L+u2(x)xL+u3(x)]xn−k} mod g(x)
and exploiting the general property of the modulo operator that (A+B)mod C=(A mod C+B mod C)mod C the parity check polynomial may be written
p(x)={[u0(x)x3L+n−k] mod g(x)+[u1(x)x2L+n−k] mod g(x)+[u2(x)xL+n−k] mod g(x)+[u3(x)xn−k] mod g(x)} mod g(x). (3)
To understand how the parity check polynomial of equation (3) lends itself to the above-described advantages, it instructive to let pi denote the parity check vector for the codeword ui(x) (i.e., without any zero-padding added to the codeword ui(x)). Then equation (3) can be rewritten
p(x)=[(p0x3L)mod g(x)+(p1x2L)mod g(x)+(p2xL)mod g(x)+p3 mod g(x)] mod g(x). (4)
Next, noting that the operation p2xL mod g(x) is equivalent to multiplying the vector p2 with a (n−k)×(n−k) binary matrix D (i.e., a matrix that is fixed since the value of L is fixed), it follows that (p2, xL) mod g(x)=p2 D. Similarly, (p1 x2L) mod g(x)=p1 D2 and (p0 x3L) mod g(x)=p0 D3. Thus, equation (4) may be rewritten
p(x)=p0D3+p1D2+p2D+p3. (5)
Further, one of ordinary skill in the art would understand, based on the disclosure and teachings herein, that the derivations above are easily generalizable to case where ECC encoded data includes any number of constituent codewords. In particular, in the general case, the ECC encoded data includes N codewords, denoted by u0(x), u1(x), u2(x), and uN−1(x), where ui(x)=[uki-1 . . . u1 u0] are the data symbols of the ith codeword of the ECC encoded data and ki is the length, in symbols, of ui(x).
Letting L be any integer value larger than the maximum of k1 through kN, and under the assumption that a number of zeros are appended to each of the codewords u0(x), u1(x), u2(x), and uN−1(x), the parity check equation is expressed
p(x)=p0DN−1+p1DN−2+ . . . +pN−2D+pN−1, (6)
where pi denotes the parity check vector for the codeword ui(x) (i.e., without any zero-padding added to the codeword ui(x)) and D is the (n−k)×(n−k) parity check matrix defined through the equation (pN−2xL) mod g(x)=PN−2D. As would be understood by one of ordinary skill, based on the disclosure and teachings herein, encoding is performed in order for certain applications. In those applications, a conventional CRC encoding write path architecture may be used for encoding data in place of the architecture 300.
In equation (6), the matrix D is a function of the value of L, which is chosen to be any arbitrary value greater than the maximum of k1 through kN. Accordingly, in an arrangement, the value of L is chosen to produce a value of D that optimizes (i.e., reduces) a computational complexity associated with the evaluation of the parity check equation (6). For example, in an arrangement, multiple simulations are run based on different values of L and an average encoding (or decoding, or both) complexity is determined at each value of L. In this arrangement, the value of L producing the least complexity in encoding and decoding is selected.
p(x)=p0D+p1.
As indicated in the architecture 300, the two constituent codewords of the data 102, codeword 0305 and codeword 1310, are stored in respective registers, and have dedicated CRC generation circuitry. In particular, MCRC encoder 320 generates the parity vector p0 corresponding to the codeword 0305 and MCRC encoder 335 generates the parity vector p1 corresponding to the codeword 1310.
Next, multipliers 325 and 340 multiply their respective input parity vectors by the matrix D raised to the power indicated in equation (6). In particular, each of the multipliers 325 and 340 multiplies its respective input vector by the matrix raised to the power v, where v is given by the equation
v=N−1−CW—ID,
where N is again the number of constituent codewords in the data 102 and CW_ID is the index value of the codeword being encoded by the multiplier. In
On the read path corresponding to the write path of the architecture 300, CRC values are calculated on a per-codeword basis. In particular, when a constituent codeword of data is read, the CRC term for that codeword, piDj is computed, where i and j are determined from the equation (6). Once CRC values for all constituent codewords have been determined (possibly in an out of order sequence), the individual results are exclusive-ORed to produce a single overall parity check value for the data. If the parity check value is all-zero, the codeword is declared to be error free. Otherwise, the codeword is declared to contain one or more errors.
As would be understood by one of ordinary skill, based on the disclosure and teachings herein, in alternative arrangements, some of the circuitry depicted in
In an arrangement, the multiplier 325 (and/or the multiplier 340) is implemented using dedicated circuitry for each potential value of v in the equation v=N−1−CW_ID. In another arrangement, the multiplier 325 (and/or the multiplier 340) is implemented using single circuit containing logic for implementing the matrix D. In this arrangement, to compute the quantity Dv, the logic for implementing the matrix D is used v times.
Further, while the quantity v is described above as being given by the equation v=N−1−CW_ID, in an alternate arrange, the quantity v may be instead set equal to the index value of the codeword being encoded by the multiplier, i.e., v=CW_ID.
At 460, the process 400 exclusive-ORs each of the individual parity terms computed at 440 to produce an overall CRC value for the data, i.e., computes
p(x)=p0DN−1+p1DN−2+ . . . +pN−2D+pN−1.
The process 400 then proceeds to 470. At 470, the overall CRC value is evaluated to determine with is takes on all zero values. If so, the process 400 proceeds to 480, where the data is declared error free. Otherwise, the process 400 proceeds to 490, where the data is declared to contain one or more errors.
Therefore, the read path of
The above described implementations are presented for the purposes of illustration and not of limitation. Other embodiments are possible and one or more parts of techniques described above may be performed in a different order (or concurrently) and still achieve desirable results. In addition, techniques of the disclosure may be implemented in hardware, such as on an application specific integrated circuit (ASIC) or on a field-programmable gate array (FPGA). The techniques of the disclosure may also be implemented in software.
This patent application claims the benefit under 35 U.S.C. §119(e) of U.S. Provisional Application No. 61/576,302, filed Dec. 15, 2011, which is hereby incorporated by reference herein in its entirety.
Number | Name | Date | Kind |
---|---|---|---|
5410546 | Boyer et al. | Apr 1995 | A |
6223320 | Dubey et al. | Apr 2001 | B1 |
20040187064 | Takahashi et al. | Sep 2004 | A1 |
20050005224 | Ridgeway et al. | Jan 2005 | A1 |
20060039465 | Emerson et al. | Feb 2006 | A1 |
20070234177 | Jeon et al. | Oct 2007 | A1 |
20080046797 | Allen et al. | Feb 2008 | A1 |
20120192044 | Shafai et al. | Jul 2012 | A1 |
Number | Date | Country | |
---|---|---|---|
61576302 | Dec 2011 | US |