WO2011000176A1 - Coding and decoding method and codec of error correction code - Google Patents

Coding and decoding method and codec of error correction code Download PDF

Info

Publication number
WO2011000176A1
WO2011000176A1 PCT/CN2009/073148 CN2009073148W WO2011000176A1 WO 2011000176 A1 WO2011000176 A1 WO 2011000176A1 CN 2009073148 W CN2009073148 W CN 2009073148W WO 2011000176 A1 WO2011000176 A1 WO 2011000176A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
short
symptom
long
zero
Prior art date
Application number
PCT/CN2009/073148
Other languages
French (fr)
Chinese (zh)
Other versions
WO2011000176A8 (en
Inventor
杨宗杰
Original Assignee
慧帝科技(深圳)有限公司
慧荣科技股份有限公司
芯光飞株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 慧帝科技(深圳)有限公司, 慧荣科技股份有限公司, 芯光飞株式会社 filed Critical 慧帝科技(深圳)有限公司
Priority to KR1020127002747A priority Critical patent/KR101314232B1/en
Publication of WO2011000176A1 publication Critical patent/WO2011000176A1/en
Publication of WO2011000176A8 publication Critical patent/WO2011000176A8/en

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M13/00Coding, 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
    • H03M13/03Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M13/00Coding, 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
    • H03M13/03Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words
    • H03M13/05Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words using block codes, i.e. a predetermined number of check bits joined to a predetermined number of information bits
    • H03M13/13Linear codes
    • H03M13/15Cyclic codes, i.e. cyclic shifts of codewords produce other codewords, e.g. codes defined by a generator polynomial, Bose-Chaudhuri-Hocquenghem [BCH] codes

Definitions

  • the present invention relates to the field of data communication technologies, and more particularly to a coding and decoding method for an error correction code and a codec. Background technique
  • the error correction code is used to correct data errors.
  • the data transmitted by the communication system is often encoded as an error correction code (including data messages and check codes) before being transmitted on the transmission side.
  • error correction code including data messages and check codes
  • data storage systems often encode stored data as error correction codes before storing the data.
  • Common error correction codes such as BCH, Ray-Chaudhuri, and Hocquenghem code and RS code (; Reed-Solomon code).
  • BCH is often used for the storage of flash data
  • the RS code is often used for the storage of optical data.
  • the decoder receives an error correction code (step 102).
  • the decoder calculates a plurality of symptom codes based on the parity of the error correction code (syndrome X step 104).
  • the decoder checks if the symptom codes are all zero (step 106). If the symptom code is zero, there is no error in the error correction code, so no further correction is needed.
  • the decoder calculates a plurality of coefficients of an error-location polynomial based on the symptom codes (step 108).
  • the decoder performs a Chien search to find the root of the error polynomial (step 110). Since the root of the error polynomial indicates the position of the bit in the error correction code where the error occurred, the decoder can follow the error polynomial The root corrects the error correction code (step 112), and obtains an error-free error correction code, that is, obtains the correct data.
  • step 108 when the decoder calculates the coefficients of the error polynomial in step 108, it takes a lot of time. Similarly, when the decoder performs a Qin search in step 110 to find the root of the error polynomial, it also takes a lot of time. In the conventional decoding method 100, as long as one of the plurality of symptom codes of the error correction code is not zero, it indicates that an error has occurred, so step 108 and step 110 must be performed in order to correct the error, thereby causing the decoding time of the system. delay.
  • the coefficient of the error polynomial is calculated in step 108 and the Qin search is performed in step 110.
  • the required decoding time can be greatly reduced, and the performance of the decoder is improved. Therefore, there is a need for an encoding and decoding method that reduces the decoding time of an erroneous correction code.
  • the technical problem to be solved by the present invention is to provide a coding and decoding method for an error correction code and a codec for the above-mentioned drawbacks of the prior art.
  • One of the technical solutions adopted by the present invention to solve the technical problem is: constructing an encoding and decoding method for an error correction code, comprising the steps of: receiving a raw data; dividing the original data into a plurality of sector data; A first generator polynomial generates short parity codes of the segment data respectively; and the short check codes are appended to the segment data to respectively generate a plurality of short codewords (short codeword) Combining the short codewords to obtain an encoded data; generating a long parity of the encoded data according to a second generator polynomial, wherein the first generating polynomial is the second generating polynomial At least one minimum polynomial function; appending the long check code to the encoded data to generate a long codeword of the error correction code.
  • the method for encoding and decoding an error correction code according to the present invention wherein the first generator polynomial is a least common multiple of at least one minimum polynomial of the second generator polynomial.
  • the method for encoding and decoding the error correction code according to the present invention further includes storing the long codeword in a storage medium.
  • the method for encoding and decoding the error correction code according to the present invention further includes:
  • Reading the long codeword from a storage medium extracting the short codewords contained therein from the long codeword; calculating a plurality of short symptoms of the short codewords according to the short check codes of the short codewords a code; checking whether the short symptom codes are all zero; and correcting the corresponding short codes by using the non-zero short symptom codes when one or more non-zero short symptom codes of the short symptom codes are not zero word.
  • the method for encoding and decoding the error correction code according to the present invention further includes:
  • the short symptom code After the short symptom code is calculated, calculating a long symptom code of the long codeword according to the long check code of the long codeword; checking whether the long symptom code is zero; when the long symptom code is not zero, Checking whether the non-zero short symptom codes can correctly correct the corresponding short code words; and when the non-zero short symptom codes can correctly correct the corresponding short code words, use the non-zero short symptoms
  • the code corrects the long symptom code to get a correction and a long symptom code.
  • the method for encoding and decoding the error correction code according to the present invention further includes:
  • the short symptom word that cannot be correctly corrected is corrected by the long symptom code.
  • the method for encoding and decoding an error correction code according to the present invention wherein the long codeword and the short codeword are BCH codes or RS codes.
  • the second technical solution adopted by the present invention to solve the technical problem is: constructing a codec of an error correction code, comprising an error correction code encoder and an error correction code decoder; the error correction code encoder receiving one Raw data, the original data is divided into a plurality of segment data, and short parity codes of the segment data are generated, and the short check codes are appended to the segment data to respectively generate a plurality of short codes.
  • Short codeword combining the short code words to obtain an encoded data, generating a long parity of the encoded data, and appending the long check code to the encoded data to generate a long codeword (long Codeword) for storing in a storage medium;
  • the error correction code decoder reads the long codeword from the storage medium, and extracts the short codewords contained therein from the long codeword, according to the short codewords
  • the short check codes calculate a plurality of short syndromes of the short code words, check if the short symptom codes are all zero, and when one of the short symptom codes is one to several non-zero short When the symptom code is not zero, the corresponding short code words are corrected by using the non-zero short symptom codes.
  • the codec of the error correction code according to the present invention wherein the error correction code encoder is based on Generating a polynomial to generate the short check codes of the segment data, and generating a long check code of the encoded data according to a second generating polynomial, wherein the first generating polynomial is the second generating polynomial At least one function of the smallest polynomial.
  • the codec of the error correction code of the present invention wherein the first generator polynomial is a least common multiple of at least one minimum polynomial of the second generator polynomial.
  • the codec of the error correction code of the present invention wherein the error correction code encoder comprises: a short codeword encoder, according to the first generating polynomial to generate the short check codes of the segment data; a first adder, the short check code is appended to the segment data to respectively generate the short codewords; a long codeword encoder combining the short codewords to obtain the encoded data, and according to the first Generating a polynomial to generate the long check code of the encoded data; and a second adder appending the long check code to the encoded data to generate the long codeword.
  • the codec of the error correction code according to the present invention wherein when the short symptom code is calculated, the error correction code decoder calculates a long symptom code of the long codeword according to the long check code of the long codeword , check whether the long symptom code is zero, when the long symptom code is not zero, check whether the non-zero short symptom code can correctly correct the corresponding short code words, when the non-zero short symptom code can be When the corresponding short code words are correctly corrected, the long symptom code is corrected by using the non-zero short symptom codes to obtain a corrected long symptom code.
  • the codec of the error correction code according to the present invention wherein when the long symptom code is not zero, and the part of the non-zero short symptom code cannot correctly correct the corresponding short codeword, the error correction code is decoded.
  • the long symptom code is used to correct the short code words that cannot be correctly corrected.
  • the codec of the error correction code of the present invention wherein the error correction code decoder comprises: a symptom code calculation module, and calculating the short codes of the short code words according to the short check codes of the short code words a symptom code, and calculating the same symptom code of the long codeword according to the long check code of the long codeword; a control circuit, checking whether the short symptom codes are all zero, when the short symptom code is in the If the non-zero short symptom code is not zero, the non-zero short symptom code is used to correct the corresponding short code words, and it is checked whether the long symptom code is zero, and if the long symptom code is not zero, check whether the non-zero is The zero short symptom code can correct the corresponding short code words correctly, and correct the long symptom code by using the non-zero short symptom codes when the non-zero short symptom codes can correctly correct the corresponding short code words. .
  • the codec of the error correction code according to the present invention wherein the long codeword and
  • the third technical solution adopted by the present invention to solve the technical problem is: constructing a decoding method of the error correction code, comprising the steps of: receiving a long codeword of the error correction code, wherein the long codeword Include a plurality of short codewords and a long parity code, each of the short codewords including a short parity code; extracting the included code from the long codeword Short code words; calculating a plurality of short symptom codes of the short code words according to the short check codes of the short code words; checking whether the short symptom codes are all zero; when the short symptom codes are When one of the plurality of non-zero short symptom codes is not zero, the non-zero short symptom codes are used to correct the corresponding short code words; when the short symptom codes are calculated, according to the length of the long code words
  • the check code calculates a long symptom code of the long code word; checks whether the long symptom code is zero; when the long symptom code is not zero, it is checked whether the non-zero short symptom
  • the method for decoding the error correction code according to the present invention further includes:
  • the short symptom word that cannot be correctly corrected is corrected by the long symptom code.
  • the method for decoding an error correction code according to the present invention wherein the short check codes of the short code words are generated according to a first generating polynomial, and the long check code of the long code words is generated according to a second generating polynomial And the first generating polynomial is a function of at least one minimum polynomial of the second generating polynomial.
  • the method for decoding an error correction code according to the present invention wherein the first generator polynomial is a least common multiple of at least one minimum polynomial of the second generator polynomial.
  • the method for decoding an error correction code according to the present invention wherein the long codeword and the short codeword are BCH codes or RS codes.
  • the technical solution of the present invention has the following beneficial effects: the decoding time of the error correction code is reduced, the probability of false positives is reduced, and the performance of the decoder is improved.
  • 1 is a flow chart of a conventional decoding method of an error correction code
  • FIG. 2 is a block diagram of a data storage system of the present invention
  • Figure 3A is a block diagram of an error correction code encoder of the present invention.
  • 3B is a flowchart of a method of encoding an error correction code of the present invention.
  • Figure 4 is a schematic illustration of a long codeword produced by the present invention.
  • Figure 5 is a circuit diagram of an encoder of the present invention, which may be a short codeword encoder or a long codeword encoder of Figure 3A;
  • Figure 6 is a block diagram of the error correction code decoder of the present invention.
  • Figure 7 is a circuit diagram of a symptom code calculation module of the present invention.
  • Figure 8 is a flow chart showing a decoding method of the error correction code of the present invention.
  • 306 is a long codeword encoder; 308 is a second adder; CL is a long codeword; C S1 , C S2
  • C SN is a short code word
  • DD 2 , ..., D N is sector data
  • PS PS 2 , ..., PS N is a short check code
  • PL is a long check code
  • 500 is a short code word encoder or a long code word code 530
  • 511-51N is a buffer
  • 501-50N is an adder
  • 521-52N is a multiplier
  • 600 is an error correction code decoder
  • 602 is a symptom code calculation module
  • 604 is an error polynomial calculation module
  • Search module; 608 is the control circuit
  • 700 is the symptom code calculation module
  • 701, 702, ..., 70K are symptom code generators
  • 731-73K is the adder
  • 721-72K is the multiplier
  • 711-71K is the buffer Device.
  • the data storage system 200 includes a host 202 and a data storage device 204.
  • the data storage device 204 includes a controller 212 and a storage medium 214.
  • the controller 212 includes an error correction.
  • the error correction code encoder 222 of the controller 212 first encodes the data into the error correction code d, and the controller 212 stores the error correction code ( ⁇ in the storage medium 214.
  • the controller 212 When the host 202 reads the data D 2 from the data storage device 204, the controller 212 first reads the error correction code C 2 containing the data D 2 from the storage medium 214, and then corrects the error by the error correction code decoder 224 of the controller 212. The code 2 is decoded into the data D 2 , and finally the controller 212 transmits the data 0 2 to the host 202.
  • the data storage device 204 is a memory card
  • the storage medium 214 is a flash memory
  • the error correction code is C 2 is a BCH code.
  • the data storage device 204 is an optical drive
  • the storage medium 214 is an optical disk
  • the error correction code ( ⁇ and ⁇ is ! ⁇ code. Please note that the storage device and the error
  • the type of correction code is not a limitation of the present invention, and those skilled in the art can apply it to any type of storage device and error correction code under the teachings of embodiments of the present invention.
  • Figure 3A is a block diagram of the error correction code encoder 300 of the present invention.
  • the error correction code encoder 300 includes a short codeword encoder 302, a first adder 304, a long codeword encoder 306, and a second adder 308.
  • Fig. 3B is a flow chart of the encoding method 350 of the error correction code of the present invention.
  • the error correction code encoder 300 of Fig. 3A encodes the original data D into a long code word CL of the error correction code in accordance with the encoding method 350 of Fig. 3B.
  • the error correction code encoder 300 receives an original data I step 352).
  • the error correction code encoder 300 divides the original data D into a plurality of extent data (step 354).
  • the short codeword encoder 302 After the short codeword encoder 302 receives the segment data, the short codeword encoder 302 then generates a short parity Ps of the segment data according to a first generator polynomial (generator polynomi
  • the first adder 304 appends the short check codes Ps to the segment data to generate a plurality of short code words (short code worc ⁇ Cs step 358).
  • the long codeword encoder 306 then combines the short codewords Ps to obtain an encoded data (step 360), and generates a long parity PL of the encoded data according to a second generator polynomial.
  • the second appender 308 appends the long check code PL to the encoded data to generate a long codeword CL of the error correction code (step 364).
  • the first generator polynomial of the short codeword encoder 302 is a function of at least one minimum polynomial of the second generator polynomial of the long codeword encoder 306.
  • the first generating polynomial is the second A least common multiple (LCM:) of at least one minimum polynomial of the polynomial is generated.
  • LCM second A least common multiple
  • a second long code word encoder 306 corresponding to a plurality of polynomials g ⁇ minimal polynomial ⁇ ( ⁇ ), ⁇ 2 ( ⁇ ), ..., v k (x) is the smallest common multiple ⁇ ( ⁇ ) ⁇ 2 ( ⁇ ) x .. . x Vk(X) ⁇ .
  • the first generator polynomial corresponding to the short codeword encoder 302 is a minimum polynomial ⁇ ( ⁇ :>.
  • the first generator polynomial g' corresponding to the short codeword encoder 302 (x) ) is the least common multiple of the minimum polynomial ⁇ ⁇ and ⁇ 2 0 [ ⁇ 0 ⁇ ⁇ 2 0 ].
  • FIG. 4 is a schematic illustration of a long codeword CL produced by the present invention.
  • the long codeword CL is composed of N short code words C S 1 , C S2 , ..., C SN and a long check code PL.
  • Each of the short code words C S 1 , C S2 , ..., C SN includes a sector data and a short check code.
  • the short codeword C S 1 is formed by the check code P S1 following the corresponding segment data
  • the short code word C S2 is formed by the check code P S2 following the corresponding segment data D 2 .
  • the short codeword C SN is connected to the corresponding sector data by the check code P SN
  • the original data is cut into a plurality of extent data DD 2 D N , and the original data is encoded by the error correction code encoder 300 of FIG. 3A to form the long codeword CL of FIG.
  • FIG. 5 is a circuit diagram of an encoder 500 of the present invention, which may be a short codeword encoder 302 or a long codeword encoder 306 of FIG. 3A.
  • encoder 500 according to a generating polynomial g (x) is converted into the data D A check code P, generating polynomial ⁇ x) primary coefficient is gl, quadratic coefficient g 2, ..., N order terms The coefficient is g N .
  • the encoder 500 includes an adder 540, multipliers 521 to 52N, adders 501 to 50N, and buffers 51 1 to 51N and 530. First, the bits of the data D A are sequentially sent to the adder 540.
  • the adder 540 sequentially adds the bit of the data D A to the data bit D DN stored in the buffer 51N to obtain the data D B .
  • the multipliers 521, 522, 52N then multiply the data 0 6 by the coefficients gl , g 2 , ..., g N of the generator polynomial g(x) to obtain the data D C1 , D C2 , ..., D CN , respectively .
  • the adders 501, 502, ..., 50N are sequentially added to the data D C1 , D C2 , ..., D CN , respectively, to obtain the data D DN .
  • the buffer 51N stores the data D DN
  • the data D DN is output as the check code P.
  • Figure 6 is a block diagram of the error correction code decoder 600 of the present invention.
  • the error correction code decoder 600 includes a symptom code calculation module 602, an error polynomial calculation module 604, a Qin search module 606, and a control circuit 608.
  • the error correction code decoder 600 receives a long codeword of the error correction code, the error correction code decoder 600 extracts a plurality of short codes contained therein from the long codeword. Word.
  • the symptom code calculation module 602 calculates a plurality of short syndromes S la , S lb , S 1N of the short code words according to the short check codes of the short code words, and according to the long code words
  • the long check code calculates a plurality of long syndromes S 1 , S 2 , S K of the long codeword.
  • the error polynomial calculation module 604 is configured to calculate the coefficient of the error location polynomial of the long codeword according to the long symptom code S h S 2 , S K of the long codeword.
  • the Qin search module 606 is used to find a plurality of roots of the error polynomial for correcting the long codeword of the error correction code.
  • the error polynomial calculation module 604 also calculates the error polynomial of the short code word according to the short symptom code that is not zero, and is determined by Qin.
  • the search module 606 performs a Qin search to find the root of the error polynomial of the short codeword to immediately correct the error that occurred in the short codeword. Similar to the conventional method 100 of FIG. 1, the control circuit 608 checks whether the long symptom code S l5 S 2 , S K is zero, and stops the error polynomial calculation when the equal length symptom codes S l5 S 2 , S K are all zero.
  • Control circuit 604 calculates the coefficients of the error polynomial and stops the Qin search module 606 from searching for the root of the error polynomial.
  • control circuit 608 has other functions that reduce the time required to decode long codewords and improve the performance of error correction code decoder 600. This part of the function will be illustrated in Figure 8.
  • FIG. 7 is a circuit diagram of the symptom code calculation module 700 of the present invention.
  • the symptom code calculation module 700 includes a plurality of symptom code generators 701, 702, ..., 70K, respectively, which generate long symptom codes S 2 of long symptom codes, ... , S K .
  • Symptoms code generator 701 also generates a plurality of short code words symptoms short code S la, S lb, ⁇ ⁇ ⁇ , S 1No
  • the length codeword data bits are sequentially delivered to the D code generator 702 SYMPTOMS 70K, when the data bit D of the long code word is processed, the symptom code generator 702 70K generates the long symptom code S 2 S of the long code word, and the data bit D of the short code word is also sequentially delivered to the symptom code generation.
  • the symptom code generator 701 Whenever the data bit D of a short codeword is processed, the symptom code generator 701 generates a short symptom code corresponding to the short codeword. For example, when the segment data and the short check code P S1 are input to the symptom code generator 701, the symptom code generator 701 generates a short symptom code of the short code word C S1 ; when the segment data D 2 and the short check code P When S2 is input to the symptom code generator 701, the symptom code generator 701 generates a short symptom code of the short code word C S2 .
  • the symptom code generator 701 After processing the data bits D of the plurality of short code words included in the long codeword, the symptom code generator 701 generates the long symptom code S 1 Q of the long codeword.
  • Each symptom code generator 701, 702 70K in Fig. 7 includes an adder, a multiplier, and a buffer.
  • the buffer 71 1 stores data and outputs it.
  • the adder 731 adds the data bit D of the long code word to the data output from the buffer 71 1 to obtain a first symptom code Si.
  • the multiplier 721 multiplies the coefficient ⁇ by the symptom code Si to obtain data, and the newly obtained data is sent to the buffer 71 1 for storage.
  • the coefficient ⁇ of the symptom code generator 701 is a common root of the generator polynomial of the long codeword encoder and the generator polynomial of the short codeword encoder, and the coefficients of the other symptom code generators 702, ..., 70 ⁇ are ⁇ 2 , ..., respectively.
  • ⁇ and ⁇ , ⁇ 2 , ..., ⁇ ⁇ are the roots of the generator polynomial of the long codeword encoder.
  • FIG. 8 is a flow chart of a method 800 of decoding an error correction code of the present invention.
  • the error correction code decoder 600 of FIG. 6 performs decoding of the error correction code in accordance with the method 800.
  • the error correction code decoder 600 receives a long codeword (step 802).
  • the symptom code calculation module 602 sequentially calculates a short symptom code of a short code word in the long code word (step 804).
  • the error correction code decoder 600 firstly compares the first short code word C S1 in the long code word CL. Calculation.
  • the control circuit 608 checks if the calculated short symptom code is zero (step 806).
  • the symptom code calculation module 602 continues to calculate the short symptom code of the other short codewords in the long codeword (step 804), for example, then calculating the second short The code word C S2 , the third short code word C S3 ... until all short code words in the long code word are processed (step 812).
  • the control circuit 608 corrects the short code word with a non-zero short symptom code and records the corrected result (step 808), and continues to calculate the symptom code calculation module 602.
  • the short symptom code of the short codeword in the long codeword step 804) until all short codewords in the long codeword have been processed (step 810).
  • symptom code calculation module 602 calculates a long symptom code for the long codeword (step 814). If the long symptom code is zero (step 816), indicating that the long codeword is correct, the decoding of the long codeword ends. If the long symptom code is not zero (step 816), it indicates that the long code word has an error. Control circuit 608 now continues to check if all non-zero short symptom codes correctly correct the short codeword (step 818).
  • control circuit 608 corrects the long symptom code using a non-zero short symptom code (step 820), for example, if the fourth short codeword is ⁇ 4 If the short symptom code is not all zero, then use the non-zero short The symptom code is to correct the corresponding position in the non-zero long symptom code. If corrected, the symptom code is zero (step 820).
  • control circuit 608 utilizes the original long symptom code for a short codeword that cannot be correctly corrected. A correction is made (step 824) to obtain the correct long codeword, and the decoding of the long codeword ends.
  • short symptom codes are considered to be correct when all the short symptom codes are zero, misjudgment may occur. Because the correction ability of the short symptom code is low, there may be only one or two bits of correction ability, and when the error of the short code word exceeds the correction ability of the short symptom code, for example, an error of 8 bits occurs. Short symptom codes may also be calculated as zero. Therefore, it is necessary to re-test with a long symptom code with stronger correction ability. The long symptom code has a higher correction ability and may have a correction ability of 24 bits. Therefore, if there is an 8 bit error in a short codeword, it can still be found through the long symptom code and make subsequent corrections. The chance of a false positive can be reduced.

Abstract

A coding and decoding method and a codec of an error correction code are provided. The method comprises the following steps: receiving original data; dividing the original data into a plurality of blocks of data; generating short parities of the blocks of data according to a first generator polynomial, respectively; attaching the short parities to the blocks of data from behind to respectively generate a plurality of short code words; combining the short code words to obtain coded data; generating a long parity of the coded data according to a second generator polynomial, wherein the first generator polynomial is a function of at least one minimal polynomials of the second generator polynomial; attaching the long parity to the coded data from behind to generate a long code word of the error correction code. The method reduces the time for correcting error codes, thus improving the efficiency of the decoder.

Description

错误修正码的编码及解码方法以及编码解码器 技术领域  Error correction code encoding and decoding method and codec
本发明涉及数据通信技术领域, 更具体地说, 涉及一种错误修正码的编 码及解码方法以及编码解码器。 背景技术  The present invention relates to the field of data communication technologies, and more particularly to a coding and decoding method for an error correction code and a codec. Background technique
错误修正码 (error correction code)用于修正数据的错误。 通信系统所传输 的数据于传输端传送前经常事先被编码为错误修正码 (包含数据讯息及检查 码) 。 当接收端收到错误修正码数据时, 即使数据于传输过程中遭受损毁而产 生随机错误, 亦可藉解码错误修正码而回复正确的数据。 同样的, 数据储存系 统亦经常在储存数据前将所储存的数据编码为错误修正码。当数据于储存过程 中遭受损毁而产生随机错误时,亦可藉解码错误修正码而回复正确的数据。常 见的错误修正码如 BCH码 (Bose, Ray-Chaudhuri, and Hocquenghem code)及 RS 码 (; Reed-Solomon code)。 BCH码常用于闪存数据的储存, 而 RS码常用于光盘 数据的储存。  The error correction code is used to correct data errors. The data transmitted by the communication system is often encoded as an error correction code (including data messages and check codes) before being transmitted on the transmission side. When the receiving end receives the error correction code data, even if the data is corrupted during transmission and a random error occurs, the correct data can be recovered by decoding the error correction code. Similarly, data storage systems often encode stored data as error correction codes before storing the data. When the data is corrupted during storage and a random error occurs, the correct error can be recovered by decoding the error correction code. Common error correction codes such as BCH, Ray-Chaudhuri, and Hocquenghem code and RS code (; Reed-Solomon code). The BCH code is often used for the storage of flash data, and the RS code is often used for the storage of optical data.
当数据储存系统欲取出其所储存的数据时, 所取出的为编码后的错误修 正码, 因此在数据使用前必须先解码错误修正码, 以还原为原始数据。 图 1 为错误修正码的习知解码方法 100的流程图。首先,解码器接收一错误修正码 (步骤 102)。 接着, 解码器依据该错误修正码的检查码 (parity) 计算多个症状 码 (syndromeX步骤 104)。接着, 解码器检查是否该等症状码皆为零 (步骤 106)。 若该等症状码为零, 表示错误修正码没有发生错误, 因此不需进一步的修正。 反之, 若该等症状码有其中之一不为零, 表示错误修正码有错误发生, 因此必 须对错误修正码进行修正。 首先, 解码器依据该等症状码计算一错误多项式 (error-location polynomial)的多个系数 (;步骤 108)。 接着, 解码器执行一秦氏搜 寻 (; Chien search)以找出该错误多项式的根 (;步骤 110)。 由于该错误多项式的根 指示错误修正码中发生错误的位的位置,因此解码器便可依据该错误多项式的 根修正该错误修正码 (步骤 112), 而得到无错误的错误修正码, 亦即得到正确 的数据。 When the data storage system wants to take out the data stored by it, the extracted error correction code is taken, so the error correction code must be decoded before the data is used to be restored to the original data. 1 is a flow chart of a conventional decoding method 100 for error correction codes. First, the decoder receives an error correction code (step 102). Next, the decoder calculates a plurality of symptom codes based on the parity of the error correction code (syndrome X step 104). Next, the decoder checks if the symptom codes are all zero (step 106). If the symptom code is zero, there is no error in the error correction code, so no further correction is needed. Conversely, if one of the symptom codes is not zero, it indicates that an error correction code has occurred, so the error correction code must be corrected. First, the decoder calculates a plurality of coefficients of an error-location polynomial based on the symptom codes (step 108). Next, the decoder performs a Chien search to find the root of the error polynomial (step 110). Since the root of the error polynomial indicates the position of the bit in the error correction code where the error occurred, the decoder can follow the error polynomial The root corrects the error correction code (step 112), and obtains an error-free error correction code, that is, obtains the correct data.
然而, 当解码器于步骤 108计算错误多项式的系数时, 会耗费许多时间。 同样的, 当解码器于步骤 110进行秦氏搜寻以找出错误多项式的根时,亦会耗 费许多时间。于习知的解码方法 100中, 只要错误修正码的多个症状码其中之 一不为零便表示有错误发生,因此必须执行步骤 108与步骤 110以便修正错误, 也因而造成系统的解码时间的延迟。于错误修正码的多个症状码不为零时, 若 能在部分情况中以其它方式修正错误修正码,进而避免于步骤 108中计算错误 多项式的系数以及于步骤 110中进行秦氏搜寻以找出错误多项式的根,则可大 大的减少所需的解码时间, 而增进解码器的效能。 因此, 需要一种可减少错误 修正码的解码时间的编码及解码方法。 发明内容  However, when the decoder calculates the coefficients of the error polynomial in step 108, it takes a lot of time. Similarly, when the decoder performs a Qin search in step 110 to find the root of the error polynomial, it also takes a lot of time. In the conventional decoding method 100, as long as one of the plurality of symptom codes of the error correction code is not zero, it indicates that an error has occurred, so step 108 and step 110 must be performed in order to correct the error, thereby causing the decoding time of the system. delay. When the plurality of symptom codes of the error correction code are not zero, if the error correction code can be modified in other manners in some cases, the coefficient of the error polynomial is calculated in step 108 and the Qin search is performed in step 110. By the root of the error polynomial, the required decoding time can be greatly reduced, and the performance of the decoder is improved. Therefore, there is a need for an encoding and decoding method that reduces the decoding time of an erroneous correction code. Summary of the invention
本发明所要解决的技术问题在于针对现有技术的上述缺陷, 提供一种错 误修正码的编码及解码方法以及编码解码器。  The technical problem to be solved by the present invention is to provide a coding and decoding method for an error correction code and a codec for the above-mentioned drawbacks of the prior art.
本发明解决其技术问题所采用的技术方案之一是: 构造一种错误修正码 的编码及解码方法, 其包括下列步骤: 接收一原始数据; 将该原始数据分割为 多个区段数据; 依据一第一产生多项式 (generator polynomial)分别产生该等区 段数据之短检查码 (short parity); 附加该等短检查码于该等区段数据之后, 以 分别产生多个短码字 (short codeword); 结合该等短码字以得到一编码数据; 依 据一第二产生多项式 (generator polynomial)以产生该编码数据之长检查码 (long parity) , 其中该第一产生多项式为该第二产生多项式之至少一个最小多项式 (minimum polynomial)的函式; 附加该长检查码于该编码数据之后, 以产生该 错误修正码之一长码字 (long codeword)。  One of the technical solutions adopted by the present invention to solve the technical problem is: constructing an encoding and decoding method for an error correction code, comprising the steps of: receiving a raw data; dividing the original data into a plurality of sector data; A first generator polynomial generates short parity codes of the segment data respectively; and the short check codes are appended to the segment data to respectively generate a plurality of short codewords (short codeword) Combining the short codewords to obtain an encoded data; generating a long parity of the encoded data according to a second generator polynomial, wherein the first generating polynomial is the second generating polynomial At least one minimum polynomial function; appending the long check code to the encoded data to generate a long codeword of the error correction code.
本发明所述的错误修正码的编码及解码方法, 其中该第一产生多项式为 该第二产生多项式的至少一个最小多项式的最小公倍式。  The method for encoding and decoding an error correction code according to the present invention, wherein the first generator polynomial is a least common multiple of at least one minimum polynomial of the second generator polynomial.
本发明所述的错误修正码的编码及解码方法, 更包括储存该长码字于一 储存媒体中。 本发明所述的错误修正码的编码及解码方法, 更包括: The method for encoding and decoding the error correction code according to the present invention further includes storing the long codeword in a storage medium. The method for encoding and decoding the error correction code according to the present invention further includes:
自一储存媒体读出该长码字; 自该长码字取出其所包含的该等短码字; 依据该等短码字的该等短检查码计算该等短码字的多个短症状码;检查是否该 等短症状码皆为零;以及当该等短症状码其中的一至数个非零短症状码不为零 时, 利用该等非零短症状码更正对应的该等短码字。  Reading the long codeword from a storage medium; extracting the short codewords contained therein from the long codeword; calculating a plurality of short symptoms of the short codewords according to the short check codes of the short codewords a code; checking whether the short symptom codes are all zero; and correcting the corresponding short codes by using the non-zero short symptom codes when one or more non-zero short symptom codes of the short symptom codes are not zero word.
本发明所述的错误修正码的编码及解码方法, 更包括:  The method for encoding and decoding the error correction code according to the present invention further includes:
当该等短症状码计算完毕后, 依据该长码字的该长检查码计算该长码字 的一长症状码; 检查是否该长症状码为零; 当该长症状码不为零时, 检查是否 该等非零短症状码均可正确更正对应的该等短码字;以及当该等非零短症状码 均可正确更正对应的该等短码字时, 利用该等非零短症状码更正该长症状码, 以得一更正后长症状码。  After the short symptom code is calculated, calculating a long symptom code of the long codeword according to the long check code of the long codeword; checking whether the long symptom code is zero; when the long symptom code is not zero, Checking whether the non-zero short symptom codes can correctly correct the corresponding short code words; and when the non-zero short symptom codes can correctly correct the corresponding short code words, use the non-zero short symptoms The code corrects the long symptom code to get a correction and a long symptom code.
本发明所述的错误修正码的编码及解码方法, 更包括:  The method for encoding and decoding the error correction code according to the present invention further includes:
当该长症状码不为零, 且该等非零短症状码的部分无法正确更正对应的 该等短码字时, 利用该长症状码对无法正确更正的该等短码字进行修正。  When the long symptom code is not zero, and the portion of the non-zero short symptom code cannot correctly correct the corresponding short code word, the short symptom word that cannot be correctly corrected is corrected by the long symptom code.
本发明所述的错误修正码的编码及解码方法, 其中该长码字及该等短码 字为 BCH码或 RS码。  The method for encoding and decoding an error correction code according to the present invention, wherein the long codeword and the short codeword are BCH codes or RS codes.
本发明解决其技术问题所采用的技术方案之二是: 构造一种错误修正码 的编码解码器, 其包括一错误修正码编码器以及一错误修正码解码器; 该错误 修正码编码器接收一原始数据,将该原始数据分割为多个区段数据,产生该等 区段数据之短检查码 (short parity), 附加该等短检查码于该等区段数据之后以 分别产生多个短码字 (short codeword), 结合该等短码字以得到一编码数据, 产 生该编码数据之长检查码 (long parity),以及附加该长检查码于该编码数据之后 以产生一长码字 (long codeword), 以供储存于一储存媒体; 该错误修正码解码 器自该储存媒体读出该长码字, 自该长码字取出其所包含的该等短码字, 依据 该等短码字的该等短检查码计算该等短码字的多个短症状码 (short syndrome), 检查是否该等短症状码皆为零,以及当该等短症状码其中之一至数个非零短症 状码不为零时, 利用该等非零短症状码更正对应之该等短码字。  The second technical solution adopted by the present invention to solve the technical problem is: constructing a codec of an error correction code, comprising an error correction code encoder and an error correction code decoder; the error correction code encoder receiving one Raw data, the original data is divided into a plurality of segment data, and short parity codes of the segment data are generated, and the short check codes are appended to the segment data to respectively generate a plurality of short codes. Short codeword, combining the short code words to obtain an encoded data, generating a long parity of the encoded data, and appending the long check code to the encoded data to generate a long codeword (long Codeword) for storing in a storage medium; the error correction code decoder reads the long codeword from the storage medium, and extracts the short codewords contained therein from the long codeword, according to the short codewords The short check codes calculate a plurality of short syndromes of the short code words, check if the short symptom codes are all zero, and when one of the short symptom codes is one to several non-zero short When the symptom code is not zero, the corresponding short code words are corrected by using the non-zero short symptom codes.
本发明所述的错误修正码的编码解码器, 其中该错误修正码编码器依据 一第一产生多项式以产生该等区段数据的该等短检查码,并依据一第二产生多 项式以产生该编码数据的该长检查码,其中该第一产生多项式为该第二产生多 项式的至少一个最小多项式的函式。 The codec of the error correction code according to the present invention, wherein the error correction code encoder is based on Generating a polynomial to generate the short check codes of the segment data, and generating a long check code of the encoded data according to a second generating polynomial, wherein the first generating polynomial is the second generating polynomial At least one function of the smallest polynomial.
本发明所述的错误修正码的编码解码器, 其中该第一产生多项式为该第 二产生多项式的至少一个最小多项式的最小公倍式。  The codec of the error correction code of the present invention, wherein the first generator polynomial is a least common multiple of at least one minimum polynomial of the second generator polynomial.
本发明所述的错误修正码的编码解码器,其中该错误修正码编码器包括: 一短码字编码器, 依据该第一产生多项式以产生该等区段数据的该等短 检查码; 一第一添附器, 附加该等短检查码于该等区段数据之后以分别产生该 等短码字; 一长码字编码器, 结合该等短码字以得到该编码数据, 并依据该第 二产生多项式以产生该编码数据的该长检查码; 以及一第二添附器, 附加该长 检查码于该编码数据之后以产生该长码字。  The codec of the error correction code of the present invention, wherein the error correction code encoder comprises: a short codeword encoder, according to the first generating polynomial to generate the short check codes of the segment data; a first adder, the short check code is appended to the segment data to respectively generate the short codewords; a long codeword encoder combining the short codewords to obtain the encoded data, and according to the first Generating a polynomial to generate the long check code of the encoded data; and a second adder appending the long check code to the encoded data to generate the long codeword.
本发明所述的错误修正码的编码解码器, 其中当该等短症状码计算完毕 后,该错误修正码解码器依据该长码字的该长检查码计算该长码字的一长症状 码, 检查是否该长症状码为零, 当该长症状码不为零时检查是否该等非零短症 状码均可正确更正对应的该等短码字,当该等非零短症状码均可正确更正对应 的该等短码字时,利用该等非零短症状码更正该长症状码以得一更正后长症状 码。  The codec of the error correction code according to the present invention, wherein when the short symptom code is calculated, the error correction code decoder calculates a long symptom code of the long codeword according to the long check code of the long codeword , check whether the long symptom code is zero, when the long symptom code is not zero, check whether the non-zero short symptom code can correctly correct the corresponding short code words, when the non-zero short symptom code can be When the corresponding short code words are correctly corrected, the long symptom code is corrected by using the non-zero short symptom codes to obtain a corrected long symptom code.
本发明所述的错误修正码的编码解码器, 其中当该长症状码不为零, 且 该等非零短症状码的部分无法正确更正对应的该等短码字时,该错误修正码解 码器利用该长症状码对无法正确更正的该等短码字进行修正。  The codec of the error correction code according to the present invention, wherein when the long symptom code is not zero, and the part of the non-zero short symptom code cannot correctly correct the corresponding short codeword, the error correction code is decoded. The long symptom code is used to correct the short code words that cannot be correctly corrected.
本发明所述的错误修正码的编码解码器,其中该错误修正码解码器包括: 一症状码计算模块, 依据该等短码字的该等短检查码计算该等短码字的 该等短症状码, 并依据该长码字的该长检查码计算该长码字的该等长症状码; 一控制电路, 检查是否该等短症状码皆为零, 当该等短症状码其中的该 等非零短症状码不为零时利用该等非零短症状码更正对应的该等短码字,检查 是否该长症状码为零,当该长症状码不为零时检查是否该等非零短症状码均可 正确更正对应的该等短码字,以及当该等非零短症状码均可正确更正对应的该 等短码字时利用该等非零短症状码更正该长症状码。 本发明所述的错误修正码的编码解码器, 其中该长码字及该等短码字为The codec of the error correction code of the present invention, wherein the error correction code decoder comprises: a symptom code calculation module, and calculating the short codes of the short code words according to the short check codes of the short code words a symptom code, and calculating the same symptom code of the long codeword according to the long check code of the long codeword; a control circuit, checking whether the short symptom codes are all zero, when the short symptom code is in the If the non-zero short symptom code is not zero, the non-zero short symptom code is used to correct the corresponding short code words, and it is checked whether the long symptom code is zero, and if the long symptom code is not zero, check whether the non-zero is The zero short symptom code can correct the corresponding short code words correctly, and correct the long symptom code by using the non-zero short symptom codes when the non-zero short symptom codes can correctly correct the corresponding short code words. . The codec of the error correction code according to the present invention, wherein the long codeword and the short codeword are
BCH码或 RS码。 BCH code or RS code.
本发明解决其技术问题所采用的技术方案之三是: 构造一种错误修正码 的解码方法,其包括下列步骤:接收该错误修正码之一长码字 (long codeword), 其中该长码字包括多个短码字 (short codeword)及一长检查码 (long parity),每一 该等短码字均包括一短检查码 (short parity); 自该长码字取出其所包含的该等 短码字; 依据该等短码字的该等短检查码计算该等短码字的多个短症状码 (short syndrome); 检查是否该等短症状码皆为零; 当该等短症状码其中之一至 数个非零短症状码不为零时, 利用该等非零短症状码更正对应之该等短码字; 当该等短症状码计算完毕后,依据该长码字的该长检查码计算该长码字的一长 症状码 (long syndrome); 检查是否该长症状码为零; 当该长症状码不为零时, 检查是否该等非零短症状码均可正确更正对应之该等短码字;当该等非零短症 状码均可正确更正对应之该等短码字时,利用该等非零短症状码更正该长症状 码, 以得一更正后长症状码。  The third technical solution adopted by the present invention to solve the technical problem is: constructing a decoding method of the error correction code, comprising the steps of: receiving a long codeword of the error correction code, wherein the long codeword Include a plurality of short codewords and a long parity code, each of the short codewords including a short parity code; extracting the included code from the long codeword Short code words; calculating a plurality of short symptom codes of the short code words according to the short check codes of the short code words; checking whether the short symptom codes are all zero; when the short symptom codes are When one of the plurality of non-zero short symptom codes is not zero, the non-zero short symptom codes are used to correct the corresponding short code words; when the short symptom codes are calculated, according to the length of the long code words The check code calculates a long symptom code of the long code word; checks whether the long symptom code is zero; when the long symptom code is not zero, it is checked whether the non-zero short symptom code can be correctly corrected. The short code words; when the non-zero short symptom codes When corrects those of the corresponding short code word is correct, symptoms using short codes to correct such non-zero length of the symptom code, to obtain a post-correction code length symptoms.
本发明所述的错误修正码的解码方法, 更包括:  The method for decoding the error correction code according to the present invention further includes:
当该长症状码不为零, 且该等非零短症状码的部分无法正确更正对应的 该等短码字时, 利用该长症状码对无法正确更正的该等短码字进行修正。  When the long symptom code is not zero, and the portion of the non-zero short symptom code cannot correctly correct the corresponding short code word, the short symptom word that cannot be correctly corrected is corrected by the long symptom code.
本发明所述的错误修正码的解码方法, 其中该等短码字的该等短检查码 依据一第一产生多项式所产生,该长码字的该长检查码依据一第二产生多项式 所产生,其中该第一产生多项式为该第二产生多项式的至少一个最小多项式的 函式。  The method for decoding an error correction code according to the present invention, wherein the short check codes of the short code words are generated according to a first generating polynomial, and the long check code of the long code words is generated according to a second generating polynomial And the first generating polynomial is a function of at least one minimum polynomial of the second generating polynomial.
本发明所述的错误修正码的解码方法, 其中该第一产生多项式为该第二 产生多项式的至少一个最小多项式的最小公倍式。  The method for decoding an error correction code according to the present invention, wherein the first generator polynomial is a least common multiple of at least one minimum polynomial of the second generator polynomial.
本发明所述的错误修正码的解码方法, 其中该长码字及该等短码字为 BCH码或 RS码。  The method for decoding an error correction code according to the present invention, wherein the long codeword and the short codeword are BCH codes or RS codes.
实施本发明的技术方案, 具有以下有益效果: 减少了错误修正码的解码 时间, 降低了误判的机率, 增进了解码器的效能。 附图说明 The technical solution of the present invention has the following beneficial effects: the decoding time of the error correction code is reduced, the probability of false positives is reduced, and the performance of the decoder is improved. DRAWINGS
下面将结合附图及实施例对本发明作进一步说明, 附图中:  The present invention will be further described below in conjunction with the accompanying drawings and embodiments, in which:
图 1是错误修正码的习知解码方法的流程图;  1 is a flow chart of a conventional decoding method of an error correction code;
图 2是本发明的数据储存系统的区块图;  Figure 2 is a block diagram of a data storage system of the present invention;
图 3A是本发明的错误修正码编码器的区块图;  Figure 3A is a block diagram of an error correction code encoder of the present invention;
图 3B是本发明的错误修正码的编码方法的流程图;  3B is a flowchart of a method of encoding an error correction code of the present invention;
图 4是本发明所产生的一长码字的示意图;  Figure 4 is a schematic illustration of a long codeword produced by the present invention;
图 5是本发明的编码器的电路图, 该编码器可为图 3A的短码字编码器 或长码字编码器;  Figure 5 is a circuit diagram of an encoder of the present invention, which may be a short codeword encoder or a long codeword encoder of Figure 3A;
图 6是本发明的错误修正码解码器的区块图;  Figure 6 is a block diagram of the error correction code decoder of the present invention;
图 7是本发明的症状码计算模块的电路图;  Figure 7 is a circuit diagram of a symptom code calculation module of the present invention;
图 8是本发明的错误修正码的解码方法的流程图。  Figure 8 is a flow chart showing a decoding method of the error correction code of the present invention.
图中, 202 是主机; 204 是数据储存装置; 212 是控制器; 214 是储存媒体; 222是错误修正码编码器; 224是错误修正码解码器; 300是错误修正码编码器; 302是短码字编码器; 304是第一添附器; In the figure, 202 is the host; 204 is the data storage device; 212 is the controller; 214 is the storage medium; 222 is the error correction code encoder; 224 is the error correction code decoder; 300 is the error correction code encoder; 302 is short Codeword encoder; 304 is the first adder;
306是长码字编码器; 308是第二添附器; CL是长码字; CS1、 CS2 306 is a long codeword encoder; 308 is a second adder; CL is a long codeword; C S1 , C S2
CSN是短码字; D D2、 …、 DN是区段数据; PS PS2、 …、 PSN是 短检查码; PL是长检查码; 500是短码字编码器或长码字编码器; 530, 511-51N是缓冲器; 501-50N是加法器; 521-52N是乘法器; 600是 错误修正码解码器; 602是症状码计算模块; 604是错误多项式计算 模块; 606是秦氏搜寻模块; 608是控制电路; 700是症状码计算模 块; 701、 702、 ...、 70K是症状码产生器; 731-73K是加法器; 721-72K 是乘法器; 711-71K是缓冲器。 具体实施方式 C SN is a short code word; DD 2 , ..., D N is sector data; PS PS 2 , ..., PS N is a short check code; PL is a long check code; 500 is a short code word encoder or a long code word code 530, 511-51N is a buffer; 501-50N is an adder; 521-52N is a multiplier; 600 is an error correction code decoder; 602 is a symptom code calculation module; 604 is an error polynomial calculation module; Search module; 608 is the control circuit; 700 is the symptom code calculation module; 701, 702, ..., 70K are symptom code generators; 731-73K is the adder; 721-72K is the multiplier; 711-71K is the buffer Device. detailed description
图 2是本发明的数据储存系统 200的区块图。 于一实施例中, 数据储存 系统 200包括一主机 202以及一数据储存装置 204。该数据储存装置 204包括 一控制器 212及一储存媒体 214。 于一实施例中, 控制器 212包括一错误修正 码编码器 222以及一错误修正码解码器 224。 当主机 202欲储存数据 入数 据储存装置 204时, 控制器 212的错误修正码编码器 222先将数据 编码为 错误修正码 d, 控制器 212再将错误修正码 (^储存于储存媒体 214。 当主机 202 自数据储存装置 204读取数据 D2时, 控制器 212先自储存媒体 214读取 包含数据 D2的错误修正码 C2, 再由控制器 212的错误修正码解码器 224将错 误修正码 2解码为数据 D2, 最后控制器 212再将数据02传送至主机 202。 于 一实施例中, 数据储存装置 204为一记忆卡, 储存媒体 214为一闪存, 而错误 修正码 ^与 C2为 BCH码。 于另一实施例中, 数据储存装置 204为一光驱, 储存媒体 214为一光盘片, 而错误修正码 (^与^为!^码。 请注意到, 储存 装置与错误修正码的类型并非本发明的限制,熟悉此项技艺者在本发明的实施 例的教导下当可将其应用至任何类型的储存装置与错误修正码。 2 is a block diagram of a data storage system 200 of the present invention. In one embodiment, the data storage system 200 includes a host 202 and a data storage device 204. The data storage device 204 includes a controller 212 and a storage medium 214. In an embodiment, the controller 212 includes an error correction. A code encoder 222 and an error correction code decoder 224. When the host 202 wants to store data into the data storage device 204, the error correction code encoder 222 of the controller 212 first encodes the data into the error correction code d, and the controller 212 stores the error correction code (^ in the storage medium 214. When the host 202 reads the data D 2 from the data storage device 204, the controller 212 first reads the error correction code C 2 containing the data D 2 from the storage medium 214, and then corrects the error by the error correction code decoder 224 of the controller 212. The code 2 is decoded into the data D 2 , and finally the controller 212 transmits the data 0 2 to the host 202. In an embodiment, the data storage device 204 is a memory card, the storage medium 214 is a flash memory, and the error correction code is C 2 is a BCH code. In another embodiment, the data storage device 204 is an optical drive, the storage medium 214 is an optical disk, and the error correction code (^ and ^ is !^ code. Please note that the storage device and the error The type of correction code is not a limitation of the present invention, and those skilled in the art can apply it to any type of storage device and error correction code under the teachings of embodiments of the present invention.
图 3A是本发明的错误修正码编码器 300的区块图。 于一实施例中, 错 误修正码编码器 300包括短码字编码器 302、 第一添附器 304、 长码字编码器 306、 以及第二添附器 308。 图 3B是本发明的错误修正码的编码方法 350的流 程图。 图 3A的错误修正码编码器 300依据图 3B的编码方法 350将原始数据 D编码为错误修正码的一长码字 CL。 首先, 错误修正码编码器 300接收一原 始数据 I 步骤 352)。 接着, 错误修正码编码器 300将该原始数据 D分割为多 个区段数据 (步骤 354)。 当短码字编码器 302收到该等区段数据后, 短码字编 码器 302接着依据一第一产生多项式 (generator polynomialM衣序产生该等区段 数据的短检查码 (short parity)Ps(步骤 356)。  Figure 3A is a block diagram of the error correction code encoder 300 of the present invention. In one embodiment, the error correction code encoder 300 includes a short codeword encoder 302, a first adder 304, a long codeword encoder 306, and a second adder 308. Fig. 3B is a flow chart of the encoding method 350 of the error correction code of the present invention. The error correction code encoder 300 of Fig. 3A encodes the original data D into a long code word CL of the error correction code in accordance with the encoding method 350 of Fig. 3B. First, the error correction code encoder 300 receives an original data I step 352). Next, the error correction code encoder 300 divides the original data D into a plurality of extent data (step 354). After the short codeword encoder 302 receives the segment data, the short codeword encoder 302 then generates a short parity Ps of the segment data according to a first generator polynomial (generator polynomial M order). Step 356).
接着, 第一添附器 304附加该等短检查码 Ps于该等区段数据之后, 以分 别产生多个短码字 (short codeworc^Cs步骤 358)。 长码字编码器 306接着结合 该等短码字 Ps 以得到一编码数据 (步骤 360), 并依据一第二产生多项式 (generator polynomial)以产生该编码数据的长检查码 (long parity)PL(步骤 362)。 最后, 第二添附器 308附加该长检查码 PL于该编码数据之后, 以产生该错误 修正码的一长码字 (long codeword)CL(步骤 364)。 其中, 短码字编码器 302的 第一产生多项式为长码字编码器 306 的第二产生多项式的至少一个最小多项 式 (; minimum polynomial)的函式。 于一实施例中, 该第一产生多项式为该第二 产生多项式的至少一个最小多项式的最小公倍式(least common multiple, LCM:)。 举例来说, 假设长码字编码器 306对应的第二产生多项式 g^ 为多个 最小多项式 Ψι(χ)、 ψ2(χ)、 …、 vk(x)的最小公倍式 {ψι(Χ)Χψ2(Χ) x .. . xVk(X)}。 于 一实施例中, 短码字编码器 302 对应的第一产生多项式 为最小多项式 ψι(Χ:>。 于另一实施例中, 短码字编码器 302对应的第一产生多项式 g'(x)为最 小多项式 ΨΙ Ο 与 ψ20 的最小公倍式 [ψι0 χψ20 ]。 Next, the first adder 304 appends the short check codes Ps to the segment data to generate a plurality of short code words (short code worc^Cs step 358). The long codeword encoder 306 then combines the short codewords Ps to obtain an encoded data (step 360), and generates a long parity PL of the encoded data according to a second generator polynomial. Step 362). Finally, the second appender 308 appends the long check code PL to the encoded data to generate a long codeword CL of the error correction code (step 364). The first generator polynomial of the short codeword encoder 302 is a function of at least one minimum polynomial of the second generator polynomial of the long codeword encoder 306. In an embodiment, the first generating polynomial is the second A least common multiple (LCM:) of at least one minimum polynomial of the polynomial is generated. For example, if a second long code word encoder 306 corresponding to a plurality of polynomials g ^ minimal polynomial Ψι (χ), ψ 2 ( χ), ..., v k (x) is the smallest common multiple {ψι ( Χ)Χψ 2 (Χ) x .. . x Vk(X)}. In an embodiment, the first generator polynomial corresponding to the short codeword encoder 302 is a minimum polynomial ψι ( Χ :>. In another embodiment, the first generator polynomial g' corresponding to the short codeword encoder 302 (x) ) is the least common multiple of the minimum polynomial ΨΙ Ο and ψ 2 0 [ψι0 χ ψ 2 0 ].
图 4是本发明所产生的一长码字 CL的示意图。 长码字 CL由 N个短码字 CS 1、 CS2、 …、 CSN及一个长检查码 PL所组成。 每一个短码字 CS 1、 CS2、 …、 CSN包括一区段数据及一短检查码。举例来说,短码字 CS 1由检查码 PS1接续于 相对应的区段数据 之后而形成,短码字 CS2由检查码 PS2接续于相对应的区 段数据 D2之后而形成, 而短码字 CSN由检查码 PSN接续于相对应的区段数据Figure 4 is a schematic illustration of a long codeword CL produced by the present invention. The long codeword CL is composed of N short code words C S 1 , C S2 , ..., C SN and a long check code PL. Each of the short code words C S 1 , C S2 , ..., C SN includes a sector data and a short check code. For example, the short codeword C S 1 is formed by the check code P S1 following the corresponding segment data, and the short code word C S2 is formed by the check code P S2 following the corresponding segment data D 2 . And the short codeword C SN is connected to the corresponding sector data by the check code P SN
DN之后而形成。 原始数据被切割为多个区段数据 D D2 DN, 而原始数 据在经由图 3A的错误修正码编码器 300编码后形成图 4的长码字 CL。 D N is formed afterwards. The original data is cut into a plurality of extent data DD 2 D N , and the original data is encoded by the error correction code encoder 300 of FIG. 3A to form the long codeword CL of FIG.
图 5是本发明的编码器 500的电路图, 该编码器 500可为图 3A中的短 码字编码器 302或长码字编码器 306。假设编码器 500依据一产生多项式 g (x) 将数据 DA转换为检查码 P, 而产生多项式 ^x)的一次项系数为 gl、 二次项系 数为 g2、 ...、 N次项系数为 gN。编码器 500包括加法器 540、乘法器 521~52N、 加法器 501 ~50N、 以及缓冲器 51 1~51N及 530。 首先, 数据 DA的位依次被送 至加法器 540。加法器 540依次将数据 DA的位与缓冲器 51N储存的数据位 DDN 相加而得到数据 DB。 乘法器 521、 522 52N接着分别将数据06与产生 多项式 g(x)的系数 gl、 g2、 …、 gN相乘而分别得到数据 DC1、 DC2、 …、 DCN。 数据 DB在经过缓冲器 530的储存后, 依次由加法器 501、 502、 …、 50N分别 与数据 DC1、 DC2、 …、 DCN相加, 而得到数据 DDN。 最后, 缓冲器 51N储存数 据 DDN后, 将数据 DDN输出为检查码 P。 5 is a circuit diagram of an encoder 500 of the present invention, which may be a short codeword encoder 302 or a long codeword encoder 306 of FIG. 3A. Suppose encoder 500 according to a generating polynomial g (x) is converted into the data D A check code P, generating polynomial ^ x) primary coefficient is gl, quadratic coefficient g 2, ..., N order terms The coefficient is g N . The encoder 500 includes an adder 540, multipliers 521 to 52N, adders 501 to 50N, and buffers 51 1 to 51N and 530. First, the bits of the data D A are sequentially sent to the adder 540. The adder 540 sequentially adds the bit of the data D A to the data bit D DN stored in the buffer 51N to obtain the data D B . The multipliers 521, 522, 52N then multiply the data 0 6 by the coefficients gl , g 2 , ..., g N of the generator polynomial g(x) to obtain the data D C1 , D C2 , ..., D CN , respectively . After the data D B is stored in the buffer 530, the adders 501, 502, ..., 50N are sequentially added to the data D C1 , D C2 , ..., D CN , respectively, to obtain the data D DN . Finally, after the buffer 51N stores the data D DN , the data D DN is output as the check code P.
图 6是本发明的错误修正码解码器 600的区块图。 于一实施例中, 错误 修正码解码器 600包括症状码计算模块 602、 错误多项式计算模块 604、 秦氏 搜寻模块 606、 以及控制电路 608。 当错误修正码解码器 600收到错误修正码 的一长码字时, 错误修正码解码器 600 自该长码字取出其所包含的多个短码 字。首先, 症状码计算模块 602依据该等短码字的短检查码计算该等短码字的 多个短症状码 (short syndrome)Sla, Slb, S1N,并依据该长码字的该长检查码计 算该长码字的多个长症状码 (long syndrome)S1, S2, SK。错误多项式计算模块 604用以依据长码字的长症状码 Sh S2, SK计算该长码字的错误多项式 (error location polynomial)的系数。 秦氏搜寻模块 606用以找出该错误多项式的多个 根, 以供修正错误修正码的长码字。此外,当短码字的短症状码 sla, slb, S1N 不为 0时,错误多项式计算模块 604亦会依据不为零的短症状码计算短码字的 错误多项式,并由秦氏搜寻模块 606进行秦氏搜寻找出短码字的错误多项式的 根, 以立即更正短码字发生的错误。 与图 1 的习知方法 100类似, 控制电路 608检查长症状码 Sl5 S2, SK是否为零, 并于该等长症状码 Sl5 S2, SK皆 为零时停止错误多项式计算模块 604对错误多项式的系数的计算,并停止该秦 氏搜寻模块 606对错误多项式的根的搜寻。然而,控制电路 608尚有其它功能, 可减少解码长码字所需的时间, 而提升错误修正码解码器 600的效能。此部分 功能将以图 8说明。 Figure 6 is a block diagram of the error correction code decoder 600 of the present invention. In one embodiment, the error correction code decoder 600 includes a symptom code calculation module 602, an error polynomial calculation module 604, a Qin search module 606, and a control circuit 608. When the error correction code decoder 600 receives a long codeword of the error correction code, the error correction code decoder 600 extracts a plurality of short codes contained therein from the long codeword. Word. First, the symptom code calculation module 602 calculates a plurality of short syndromes S la , S lb , S 1N of the short code words according to the short check codes of the short code words, and according to the long code words The long check code calculates a plurality of long syndromes S 1 , S 2 , S K of the long codeword. The error polynomial calculation module 604 is configured to calculate the coefficient of the error location polynomial of the long codeword according to the long symptom code S h S 2 , S K of the long codeword. The Qin search module 606 is used to find a plurality of roots of the error polynomial for correcting the long codeword of the error correction code. In addition, when the short symptom code s la , s lb , S 1N of the short code word is not 0, the error polynomial calculation module 604 also calculates the error polynomial of the short code word according to the short symptom code that is not zero, and is determined by Qin. The search module 606 performs a Qin search to find the root of the error polynomial of the short codeword to immediately correct the error that occurred in the short codeword. Similar to the conventional method 100 of FIG. 1, the control circuit 608 checks whether the long symptom code S l5 S 2 , S K is zero, and stops the error polynomial calculation when the equal length symptom codes S l5 S 2 , S K are all zero. Module 604 calculates the coefficients of the error polynomial and stops the Qin search module 606 from searching for the root of the error polynomial. However, control circuit 608 has other functions that reduce the time required to decode long codewords and improve the performance of error correction code decoder 600. This part of the function will be illustrated in Figure 8.
于一实施例中, 由于用以编码短码字的第一产生多项式是用以编码长码 字的第二产生多项式的最小多项式的函式,因此可利用同一组症状码计算模块 602计算长码字的症状码与短码字的症状码。 图 7是本发明的症状码计算模块 700的电路图。症状码计算模块 700包括多个症状码产生器 701、 702、…、 70K, 该等症状码产生器 701、 702、 ...、 70K分别产生长症状码的长症状码 S2、 ...、 SK。 症状码产生器 701亦产生多个短码字的短症状码 Sla, Slb, · · ·, S1No 于一实 施例中, 长码字的数据位 D被依次递送至症状码产生器 702 70K, 当长 码字的数据位 D被处理完毕, 症状码产生器 702 70K便产生长码字的长 症状码 S2 S 同时, 短码字的数据位 D亦依序被递送至症状码产生器In an embodiment, since the first generator polynomial used to encode the short codeword is a function for encoding the smallest polynomial of the second generator polynomial of the long codeword, the same set of symptom code calculation module 602 can be used to calculate the long code. The symptom code of the word and the symptom code of the short code word. FIG. 7 is a circuit diagram of the symptom code calculation module 700 of the present invention. The symptom code calculation module 700 includes a plurality of symptom code generators 701, 702, ..., 70K, respectively, which generate long symptom codes S 2 of long symptom codes, ... , S K . Symptoms code generator 701 also generates a plurality of short code words symptoms short code S la, S lb, · · ·, S 1No In one embodiment, the length codeword data bits are sequentially delivered to the D code generator 702 SYMPTOMS 70K, when the data bit D of the long code word is processed, the symptom code generator 702 70K generates the long symptom code S 2 S of the long code word, and the data bit D of the short code word is also sequentially delivered to the symptom code generation. Device
701。 每当一短码字的数据位 D被处理完毕, 症状码产生器 701便产生该短码 字相应的一短症状码。例如, 当区段数据 与短检查码 PS1被输入至症状码产 生器 701 时, 症状码产生器 701 便产生短码字 CS1的短症状码; 当区段数据 D2与短检查码 PS2被输入至症状码产生器 701时,症状码产生器 701便产生短 码字 CS2的短症状码。 由于长码字由多个短码字所组成, 当症状码产生器 701 将长码字所包括的多个短码字的数据位 D均处理完毕, 症状码产生器 701便 产生长码字的长症状码 S1 Q 701. Whenever the data bit D of a short codeword is processed, the symptom code generator 701 generates a short symptom code corresponding to the short codeword. For example, when the segment data and the short check code P S1 are input to the symptom code generator 701, the symptom code generator 701 generates a short symptom code of the short code word C S1 ; when the segment data D 2 and the short check code P When S2 is input to the symptom code generator 701, the symptom code generator 701 generates a short symptom code of the short code word C S2 . Since the long code word is composed of a plurality of short code words, when the symptom code generator 701 After processing the data bits D of the plurality of short code words included in the long codeword, the symptom code generator 701 generates the long symptom code S 1 Q of the long codeword.
图 7中的每一症状码产生器 701、 702 70K包括一加法器、 一乘法 器、 以及一缓冲器。 举例来说, 于第一症状码产生器 701中, 缓冲器 71 1储存 数据 并将其输出。 加法器 731将长码字的数据位 D与缓冲器 71 1输出的数 据 相加后得到一第一症状码 Si。乘法器 721将系数 α与症状码 Si相乘后得 到数据 ,而新得到的数据 再被送至缓冲器 71 1中储存。症状码产生器 701 的系数 α 为长码字编码器的产生多项式与短码字编码器的产生多项式的共同 根,而其它症状码产生器 702、…、 70Κ的系数分别为 α2、…、 α 而 α、 α2、…、 ακ为长码字编码器的产生多项式的根。 Each symptom code generator 701, 702 70K in Fig. 7 includes an adder, a multiplier, and a buffer. For example, in the first symptom code generator 701, the buffer 71 1 stores data and outputs it. The adder 731 adds the data bit D of the long code word to the data output from the buffer 71 1 to obtain a first symptom code Si. The multiplier 721 multiplies the coefficient α by the symptom code Si to obtain data, and the newly obtained data is sent to the buffer 71 1 for storage. The coefficient α of the symptom code generator 701 is a common root of the generator polynomial of the long codeword encoder and the generator polynomial of the short codeword encoder, and the coefficients of the other symptom code generators 702, ..., 70Κ are α 2 , ..., respectively. α and α, α 2 , ..., α κ are the roots of the generator polynomial of the long codeword encoder.
图 8是本发明的错误修正码的解码方法 800的流程图。 图 6的错误修正 码解码器 600依据方法 800进行错误修正码的解码。首先,错误修正码解码器 600接收一长码字 (步骤 802)。 接着, 症状码计算模块 602循序计算该长码字 中一短码字的短症状码 (步骤 804), 例如, 错误修正码解码器 600首先对长码 字 CL中第一个短码字 CS1进行计算。 此时控制电路 608检查是否计算得到的 短症状码为零 (步骤 806)。 当短症状码为零时, 表示短码字正确无误, 因此症 状码计算模块 602继续计算该长码字中其它的短码字的短症状码 (步骤 804), 例如, 接着计算第二个短码字 CS2、 第三个短码字 CS3......直到该长码字中所 有短码字均处理完毕为止 (步骤 812)。 当短症状码不为零时, 表示短码字有错 误, 因此控制电路 608利用非零短症状码更正该短码字并纪录更正结果 (步骤 808) , 再由症状码计算模块 602 继续计算该长码字中的短码字的短症状码 (步 骤 804), 直到该长码字中所有短码字均处理完毕为止 (步骤 810)。 8 is a flow chart of a method 800 of decoding an error correction code of the present invention. The error correction code decoder 600 of FIG. 6 performs decoding of the error correction code in accordance with the method 800. First, the error correction code decoder 600 receives a long codeword (step 802). Next, the symptom code calculation module 602 sequentially calculates a short symptom code of a short code word in the long code word (step 804). For example, the error correction code decoder 600 firstly compares the first short code word C S1 in the long code word CL. Calculation. At this time, the control circuit 608 checks if the calculated short symptom code is zero (step 806). When the short symptom code is zero, indicating that the short codeword is correct, the symptom code calculation module 602 continues to calculate the short symptom code of the other short codewords in the long codeword (step 804), for example, then calculating the second short The code word C S2 , the third short code word C S3 ... until all short code words in the long code word are processed (step 812). When the short symptom code is not zero, indicating that the short code word has an error, the control circuit 608 corrects the short code word with a non-zero short symptom code and records the corrected result (step 808), and continues to calculate the symptom code calculation module 602. The short symptom code of the short codeword in the long codeword (step 804) until all short codewords in the long codeword have been processed (step 810).
接着, 症状码计算模块 602计算长码字的长症状码 (步骤 814)。若长症状 码为零 (步骤 816), 表示长码字正确无误, 则该长码字的解码结束。 若长症状 码不为零 (步骤 816), 表示长码字有错误。 此时控制电路 608继续检查是否所 有非零短症状码均可正确更正短码字 (步骤 818)。 若所有非零短症状码均可正 确更正短码字 (步骤 818), 则控制电路 608利用非零短症状码更正长症状码 (步 骤 820), 例如, 若第四短码字的^4的短症状码并非全为零, 则利用该非零短 症状码去更正非零长症状码中相对应的位置。 若更正后长症状码为零 (步骤Next, symptom code calculation module 602 calculates a long symptom code for the long codeword (step 814). If the long symptom code is zero (step 816), indicating that the long codeword is correct, the decoding of the long codeword ends. If the long symptom code is not zero (step 816), it indicates that the long code word has an error. Control circuit 608 now continues to check if all non-zero short symptom codes correctly correct the short codeword (step 818). If all of the non-zero short symptom codes correctly correct the short codeword (step 818), then control circuit 608 corrects the long symptom code using a non-zero short symptom code (step 820), for example, if the fourth short codeword is ^ 4 If the short symptom code is not all zero, then use the non-zero short The symptom code is to correct the corresponding position in the non-zero long symptom code. If corrected, the symptom code is zero (step
822) , 表示该些错误已藉由短症状码更正成功, 则可将该些利用短码字更正的 更正结果回复予主机, 无需再利用长症状码进行更正整个长码字, 可大幅节省 时间。 若更正后长症状码不为零 (步骤 822), 或部分非零短症状码无法正确更 正短码字 (步骤 818), 则控制电路 608利用原本的长症状码针对无法正确更正 的短码字进行修正 (步骤 824), 以得到正确的长码字, 而该长码字的解码结束。 822), indicating that the errors have been corrected by the short symptom code, the correction result using the short code word correction can be replied to the host, and the long symptom code can be corrected without using the long symptom code, which can save time. . If the corrected long-term symptom code is not zero (step 822), or part of the non-zero short symptom code fails to correct the short codeword correctly (step 818), then control circuit 608 utilizes the original long symptom code for a short codeword that cannot be correctly corrected. A correction is made (step 824) to obtain the correct long codeword, and the decoding of the long codeword ends.
若当所有短症状码为零时即认为该长码字正确无误, 可能会发生误判。 因为短症状码的更正能力较低, 可能仅有一个或两个位的更正能力,而当该短 码字发生的错误超过该短症状码的更正能力时,例如出现 8个位的错误, 该短 症状码亦可能被计算为零。因此需要利用更正能力较强的长症状码再度进行检 验。 长症状码的更正能力较高, 可能有 24个位的更正能力。 故若某短码字中 出现 8个位的错误, 仍可通过长症状码发现, 并进行后续更正。发生误判的机 率就可降低。  If all the short symptom codes are considered to be correct when all the short symptom codes are zero, misjudgment may occur. Because the correction ability of the short symptom code is low, there may be only one or two bits of correction ability, and when the error of the short code word exceeds the correction ability of the short symptom code, for example, an error of 8 bits occurs. Short symptom codes may also be calculated as zero. Therefore, it is necessary to re-test with a long symptom code with stronger correction ability. The long symptom code has a higher correction ability and may have a correction ability of 24 bits. Therefore, if there is an 8 bit error in a short codeword, it can still be found through the long symptom code and make subsequent corrections. The chance of a false positive can be reduced.
虽然本发明已以较佳实施例揭露如上, 然其并非用以限定本发明, 任何 熟习此项技术者,在不脱离本发明的精神和范围内,当可作些许的更动与润饰, 因此本发明的保护范围当视后附的申请专利范围所界定者为准。  Although the present invention has been disclosed in the above preferred embodiments, it is not intended to limit the invention, and it is possible to make some modifications and refinements without departing from the spirit and scope of the invention. The scope of the invention is defined by the scope of the appended claims.

Claims

权 利 要 求 Rights request
1、 一种错误修正码的编码及解码方法, 其特征在于, 包括下列步骤: 接收一原始数据; A method for encoding and decoding an error correction code, comprising the steps of: receiving a raw data;
将该原始数据分割为多个区段数据;  Dividing the raw data into a plurality of segment data;
依据一第一产生多项式分别产生该等区段数据的短检查码;  Generating a short check code for the segment data according to a first generating polynomial;
附加该等短检查码于该等区段数据之后, 以分别产生多个短码字; 结合该等短码字以得到一编码数据;  Adding the short check codes to the segment data to respectively generate a plurality of short code words; combining the short code words to obtain an encoded data;
依据一第二产生多项式以产生该编码数据的长检查码, 其中该第一产生 多项式为该第二产生多项式的至少一个最小多项式的函式;  Generating a long check code of the encoded data according to a second generating polynomial, wherein the first generating polynomial is a function of at least one minimum polynomial of the second generating polynomial;
附加该长检查码于该编码数据之后, 以产生该错误修正码的一长码字。 The long check code is appended to the encoded data to generate a long codeword of the error correction code.
2、 根据权利要求 1所述的错误修正码的编码及解码方法, 其特征在于, 其中该第一产生多项式为该第二产生多项式的至少一个最小多项式的最小公 倍式。 2. The method of encoding and decoding an error correction code according to claim 1, wherein the first generator polynomial is a least common multiple of at least one minimum polynomial of the second generator polynomial.
3、 根据权利要求 1所述的错误修正码的编码及解码方法, 其特征在于, 更包括储存该长码字于一储存媒体中。  3. The method of encoding and decoding an error correction code according to claim 1, further comprising storing the long codeword in a storage medium.
4、 根据权利要求 1所述的错误修正码的编码及解码方法, 其特征在于, 更包括:  The method for encoding and decoding an error correction code according to claim 1, further comprising:
自一储存媒体读出该长码字;  Reading the long codeword from a storage medium;
自该长码字取出其所包含的该等短码字;  Extracting the short code words contained therein from the long codeword;
依据该等短码字的该等短检查码计算该等短码字的多个短症状码; 检查是否该等短症状码皆为零; 以及  Calculating a plurality of short symptom codes of the short code words according to the short check codes of the short code words; checking whether the short symptom codes are all zero;
当该等短症状码其中的一至数个非零短症状码不为零时, 利用该等非零 短症状码更正对应的该等短码字。  When one or more non-zero short symptom codes of the short symptom codes are not zero, the corresponding short code words are corrected by the non-zero short symptom codes.
5、 根据权利要求 4所述的错误修正码的编码及解码方法, 其特征在于, 更包括:  The method for encoding and decoding an error correction code according to claim 4, further comprising:
当该等短症状码计算完毕后, 依据该长码字的该长检查码计算该长码字 的一长症状码; 检查是否该长症状码为零; After the short symptom code is calculated, calculating a long symptom code of the long codeword according to the long check code of the long codeword; Check if the long symptom code is zero;
当该长症状码不为零时, 检查是否该等非零短症状码均可正确更正对应 的该等短码字; 以及  When the long symptom code is not zero, it is checked whether the non-zero short symptom codes can correctly correct the corresponding short code words;
当该等非零短症状码均可正确更正对应的该等短码字时, 利用该等非零 短症状码更正该长症状码, 以得一更正后长症状码。  When the non-zero short symptom codes can correctly correct the corresponding short code words, the long symptom code is corrected by using the non-zero short symptom codes to obtain a corrected long symptom code.
6、 根据权利要求 5所述的错误修正码的编码及解码方法, 其特征在于, 更包括:  The method for encoding and decoding an error correction code according to claim 5, further comprising:
当该长症状码不为零, 且该等非零短症状码的部分无法正确更正对应的 该等短码字时, 利用该长症状码对无法正确更正的该等短码字进行修正。  When the long symptom code is not zero, and the portion of the non-zero short symptom code cannot correctly correct the corresponding short code word, the short symptom word that cannot be correctly corrected is corrected by the long symptom code.
7、 根据权利要求 1所述的错误修正码的编码及解码方法, 其特征在于, 其中该长码字及该等短码字为 BCH码或 RS码。  The method for encoding and decoding an error correction code according to claim 1, wherein the long codeword and the short codeword are BCH codes or RS codes.
8、 一种错误修正码的编码解码器, 其特征在于, 包括:  8. A codec for error correction code, comprising:
一错误修正码编码器, 接收一原始数据, 将该原始数据分割为多个区段 数据,产生该等区段数据的短检查码, 附加该等短检查码于该等区段数据之后 以分别产生多个短码字, 结合该等短码字以得到一编码数据,产生该编码数据 的长检查码,以及附加该长检查码于该编码数据之后以产生一长码字以供储存 于一储存媒体; 以及  An error correction code encoder receives a raw data, divides the original data into a plurality of segment data, generates a short check code of the segment data, and adds the short check codes to the segment data to respectively Generating a plurality of short codewords, combining the short codewords to obtain an encoded data, generating a long check code of the encoded data, and appending the long check code to the encoded data to generate a long codeword for storage in a Storage medium;
一错误修正码解码器, 自该储存媒体读出该长码字, 自该长码字取出其 所包含的该等短码字,依据该等短码字的该等短检查码计算该等短码字的多个 短症状码, 检查是否该等短症状码皆为零, 以及当该等短症状码其中的一至数 个非零短症状码不为零时, 利用该等非零短症状码更正对应的该等短码字。  An error correction code decoder, reading the long codeword from the storage medium, taking out the short codewords included in the long codeword, and calculating the short codes according to the short check codes of the short codewords a plurality of short symptom codes of the code word, checking whether the short symptom codes are all zero, and when one or several non-zero short symptom codes of the short symptom codes are not zero, using the non-zero short symptom codes Correct the corresponding short code words.
9、 根据权利要求 8所述的错误修正码的编码解码器, 其特征在于, 其中 该错误修正码编码器依据一第一产生多项式以产生该等区段数据的该等短检 查码, 并依据一第二产生多项式以产生该编码数据的该长检查码, 其中该第一 产生多项式为该第二产生多项式的至少一个最小多项式的函式。  The codec of the error correction code according to claim 8, wherein the error correction code encoder generates the short check codes of the segment data according to a first generation polynomial, and according to A second generating polynomial to generate the long check code of the encoded data, wherein the first generating polynomial is a function of at least one minimum polynomial of the second generating polynomial.
10、 根据权利要求 9所述的错误修正码的编码解码器, 其特征在于, 其 中该第一产生多项式为该第二产生多项式的至少一个最小多项式的最小公倍 式。 10. The codec of the error correction code according to claim 9, wherein the first generator polynomial is a least common multiple of at least one minimum polynomial of the second generator polynomial.
11、 根据权利要求 9所述的错误修正码的编码解码器, 其特征在于, 其 中该错误修正码编码器包括: The codec of the error correction code according to claim 9, wherein the error correction code encoder comprises:
一短码字编码器, 依据该第一产生多项式以产生该等区段数据的该等短 检查码;  a short codeword encoder, based on the first generating polynomial to generate the short check codes of the segment data;
一第一添附器, 附加该等短检查码于该等区段数据之后以分别产生该等 短码字;  a first adder, the short check codes are appended to the segment data to respectively generate the short code words;
一长码字编码器, 结合该等短码字以得到该编码数据, 并依据该第二产 生多项式以产生该编码数据的该长检查码; 以及  a long codeword encoder combining the short codewords to obtain the encoded data, and generating the long check code of the encoded data according to the second generated polynomial;
一第二添附器, 附加该长检查码于该编码数据之后以产生该长码字。 A second adder appends the long check code to the encoded data to generate the long codeword.
12、 根据权利要求 8所述的错误修正码的编码解码器, 其特征在于, 其 中当该等短症状码计算完毕后,该错误修正码解码器依据该长码字的该长检查 码计算该长码字的一长症状码, 检查是否该长症状码为零, 当该长症状码不为 零时检查是否该等非零短症状码均可正确更正对应的该等短码字,当该等非零 短症状码均可正确更正对应的该等短码字时,利用该等非零短症状码更正该长 症状码以得一更正后长症状码。 The codec of the error correction code according to claim 8, wherein, after the short symptom code is calculated, the error correction code decoder calculates the length according to the long check code of the long codeword A long symptom code of the long code word, check whether the long symptom code is zero, and when the long symptom code is not zero, check whether the non-zero short symptom code can correctly correct the corresponding short code word, when When the non-zero short symptom code can correctly correct the corresponding short code words, the long symptom code is corrected by using the non-zero short symptom code to obtain a corrected long symptom code.
13、 根据权利要求 8所述的错误修正码的编码解码器, 其特征在于, 其 中当该长症状码不为零,且该等非零短症状码的部分无法正确更正对应的该等 短码字时,该错误修正码解码器利用该长症状码对无法正确更正的该等短码字 进行修正。  13. The codec of the error correction code according to claim 8, wherein when the long symptom code is not zero, and the portion of the non-zero short symptom code cannot correctly correct the corresponding short code When the word is used, the error correction code decoder uses the long symptom code to correct the short code words that cannot be correctly corrected.
14、 根据权利要求 12所述的错误修正码的编码解码器, 其特征在于, 其 中该错误修正码解码器包括:  The codec of the error correction code according to claim 12, wherein the error correction code decoder comprises:
一症状码计算模块, 依据该等短码字的该等短检查码计算该等短码字的 该等短症状码, 并依据该长码字的该长检查码计算该长码字的该等长症状码; 一控制电路, 检查是否该等短症状码皆为零, 当该等短症状码其中的该 等非零短症状码不为零时利用该等非零短症状码更正对应的该等短码字,检查 是否该长症状码为零,当该长症状码不为零时检查是否该等非零短症状码均可 正确更正对应的该等短码字,以及当该等非零短症状码均可正确更正对应的该 等短码字时利用该等非零短症状码更正该长症状码。 a symptom code calculation module, calculating the short symptom codes of the short code words according to the short check codes of the short code words, and calculating the long code words according to the long check code of the long code words a long symptom code; a control circuit, checking whether the short symptom codes are zero, and correcting the non-zero short symptom code when the short symptom code among the short symptom codes is not zero Wait for a short codeword to check if the long symptom code is zero. When the long symptom code is not zero, check if the non-zero short symptom code can correctly correct the corresponding short codeword, and when the non-zero The short symptom code can correctly correct the corresponding short code words and correct the long symptom code by using the non-zero short symptom codes.
15、 根据权利要求 8所述的错误修正码的编码解码器, 其特征在于, 其 中该长码字及该等短码字为 BCH码或 RS码。 The codec of the error correction code according to claim 8, wherein the long codeword and the short codeword are BCH codes or RS codes.
16、 一种错误修正码的解码方法, 其特征在于, 包括下列步骤: 接收该错误修正码的一长码字, 其中该长码字包括多个短码字及一长检 查码, 每一该等短码字均包括一短检查码;  A method for decoding an error correction code, comprising the steps of: receiving a long codeword of the error correction code, wherein the long codeword comprises a plurality of short codewords and a long check code, each of the The short code words include a short check code;
自该长码字取出其所包含的该等短码字;  Extracting the short code words contained therein from the long codeword;
依据该等短码字的该等短检查码计算该等短码字的多个短症状码; 检查是否该等短症状码皆为零;  Calculating a plurality of short symptom codes of the short code words according to the short check codes of the short code words; checking whether the short symptom codes are all zero;
当该等短症状码其中的一至数个非零短症状码不为零时, 利用该等非零 短症状码更正对应的该等短码字;  When one or more non-zero short symptom codes of the short symptom codes are not zero, the corresponding short code words are corrected by using the non-zero short symptom codes;
当该等短症状码计算完毕后, 依据该长码字的该长检查码计算该长码字 的一长症状码;  After the short symptom code is calculated, calculating a long symptom code of the long codeword according to the long check code of the long codeword;
检查是否该长症状码为零;  Check if the long symptom code is zero;
当该长症状码不为零时, 检查是否该等非零短症状码均可正确更正对应 的该等短码字; 以及  When the long symptom code is not zero, it is checked whether the non-zero short symptom codes can correctly correct the corresponding short code words;
当该等非零短症状码均可正确更正对应的该等短码字时, 利用该等非零 短症状码更正该长症状码, 以得一更正后长症状码。  When the non-zero short symptom codes can correctly correct the corresponding short code words, the long symptom code is corrected by using the non-zero short symptom codes to obtain a corrected long symptom code.
17、 根据权利要求 16所述的错误修正码的解码方法, 其特征在于, 更包 括: 当该长症状码不为零, 且该等非零短症状码的部分无法正确更正对应的该 等短码字时, 利用该长症状码对无法正确更正的该等短码字进行修正。  The method for decoding an error correction code according to claim 16, further comprising: when the long symptom code is not zero, and the portion of the non-zero short symptom code cannot correctly correct the corresponding short When the code word is used, the long symptom code that cannot be correctly corrected is corrected by the long symptom code.
18、 根据权利要求 16所述的错误修正码的解码方法, 其特征在于, 其中 该等短码字的该等短检查码依据一第一产生多项式所产生,该长码字的该长检 查码依据一第二产生多项式所产生,其中该第一产生多项式为该第二产生多项 式的至少一个最小多项式的函式。  The method for decoding an error correction code according to claim 16, wherein the short check codes of the short code words are generated according to a first generating polynomial, and the long check code of the long code words Generating according to a second generator polynomial, wherein the first generator polynomial is a function of at least one minimum polynomial of the second generator polynomial.
19、 根据权利要求 16所述的错误修正码的解码方法, 其特征在于, 其中 该第一产生多项式为该第二产生多项式的至少一个最小多项式的最小公倍式。  The method of decoding an error correction code according to claim 16, wherein the first generating polynomial is a least common multiple of at least one minimum polynomial of the second generating polynomial.
20、 根据权利要求 16所述的错误修正码的解码方法, 其特征在于, 其中 该长码字及该等短码字为 BCH码或 RS码。  The method for decoding an error correction code according to claim 16, wherein the long codeword and the short codeword are BCH codes or RS codes.
PCT/CN2009/073148 2009-07-01 2009-08-07 Coding and decoding method and codec of error correction code WO2011000176A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020127002747A KR101314232B1 (en) 2009-07-01 2009-08-07 Coding and decoding method and codec of error correction code

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US22246809P 2009-07-01 2009-07-01
US61/222,468 2009-07-01

Publications (2)

Publication Number Publication Date
WO2011000176A1 true WO2011000176A1 (en) 2011-01-06
WO2011000176A8 WO2011000176A8 (en) 2012-12-13

Family

ID=43391438

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/073148 WO2011000176A1 (en) 2009-07-01 2009-08-07 Coding and decoding method and codec of error correction code

Country Status (4)

Country Link
KR (1) KR101314232B1 (en)
CN (1) CN101938280B (en)
TW (1) TWI397811B (en)
WO (1) WO2011000176A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8806309B2 (en) * 2011-06-13 2014-08-12 Silicon Motion Inc. Method for controlling message-passing algorithm based decoding operation by referring to statistics data of syndromes of executed iterations and related control apparatus thereof
KR101636406B1 (en) * 2015-01-30 2016-07-05 고려대학교 산학협력단 Preprocessing apparatus and method for low latency of syndrome calculation in bch decoder
TWI566091B (en) * 2015-09-10 2017-01-11 慧榮科技股份有限公司 Method for decoding an error correction code, and associated decoding circuit
WO2017222259A1 (en) 2016-06-19 2017-12-28 엘지전자 주식회사 Data transmission method and transmitter
US20180358989A1 (en) * 2017-06-09 2018-12-13 Western Digital Technologies, Inc. Non-volatile Storage Systems With Application-Aware Error-Correcting Codes
CN115278769A (en) * 2021-04-30 2022-11-01 华为技术有限公司 Data transmission method, device and system and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5782799A (en) * 1997-02-07 1998-07-21 Sarcos, Inc. Method for automatic dosing of drugs
WO2009036004A2 (en) * 2007-09-14 2009-03-19 Motorola, Inc. Multi-layer cyclic redundancy check code in wireless communication system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4630271A (en) * 1983-01-20 1986-12-16 Nippon Hoso Kyokai Error correction method and apparatus for data broadcasting system
US5642366A (en) * 1994-07-05 1997-06-24 Adaptec, Inc. Global parity symbol for interleaved reed-solomon coded data
JP2003323751A (en) * 2002-04-30 2003-11-14 Sony Corp Magneto-optical disk
CN100557715C (en) * 2006-08-11 2009-11-04 福昭科技(深圳)有限公司 Utilize one group of ECC circuit parallel to handle the method for multi-group data
US7949927B2 (en) * 2006-11-14 2011-05-24 Samsung Electronics Co., Ltd. Error correction method and apparatus for predetermined error patterns
TWI332611B (en) * 2007-05-24 2010-11-01 Realtek Semiconductor Corp Method for writing data in flash memory and error correction coding/decoding method thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5782799A (en) * 1997-02-07 1998-07-21 Sarcos, Inc. Method for automatic dosing of drugs
WO2009036004A2 (en) * 2007-09-14 2009-03-19 Motorola, Inc. Multi-layer cyclic redundancy check code in wireless communication system

Also Published As

Publication number Publication date
CN101938280B (en) 2013-09-25
KR101314232B1 (en) 2013-10-02
TWI397811B (en) 2013-06-01
KR20130014484A (en) 2013-02-07
TW201102807A (en) 2011-01-16
WO2011000176A8 (en) 2012-12-13
CN101938280A (en) 2011-01-05

Similar Documents

Publication Publication Date Title
US8468432B2 (en) Coder-decoder and method for encoding and decoding an error correction code
US7788570B1 (en) Optimized Reed-Solomon decoder
US7956772B2 (en) Methods and apparatus employing FEC codes with permanent inactivation of symbols for encoding and decoding processes
US9450615B2 (en) Multi-bit error correction method and apparatus based on a BCH code and memory system
US10992416B2 (en) Forward error correction with compression coding
CN111628780B (en) Data encoding and decoding method and data processing system
US8806295B2 (en) Mis-correction and no-correction rates for error control
WO2011000176A1 (en) Coding and decoding method and codec of error correction code
US20100199156A1 (en) Method And Circuit For Encoding An Error Correction Code
WO2008045292A2 (en) Error correction decoding methods and apparatus
US20170077962A1 (en) Method and associated decoding circuit for decoding an error correction code
CN111597072B (en) Error control coding ECC system and memory device including the same
US11101925B2 (en) Decomposable forward error correction
WO2012092902A2 (en) Decoding method and decoding device
US10387254B2 (en) Bose-chaudhuri-hocquenchem (BCH) encoding and decoding tailored for redundant array of inexpensive disks (RAID)
US8209589B2 (en) Reed-solomon decoder with a variable number of correctable errors
TWI645683B (en) Partial concatenated coding system using algebraic code and ldpc code
KR20140074600A (en) BCH decoder, memory system having the same and decoding method
Rakús et al. Erasure decoding of five times extended Reed-Solomon codes
TWI387214B (en) Method and circuit for decoding an error correction code
WO2009069087A1 (en) Apparatus and method for decoding concatenated error correction codes
CN117116329A (en) Self-adaptive error correction method, device and system suitable for optical storage
Rani et al. Recovery of [radical] n bytes of data using Backtracking Algorithm
kumar Buddha Hamming and Golay Codes

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09846705

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 20127002747

Country of ref document: KR

Kind code of ref document: A

122 Ep: pct application non-entry in european phase

Ref document number: 09846705

Country of ref document: EP

Kind code of ref document: A1