JPH10290167A - Method and circuit for detecting error - Google Patents
Method and circuit for detecting errorInfo
- Publication number
- JPH10290167A JPH10290167A JP9098758A JP9875897A JPH10290167A JP H10290167 A JPH10290167 A JP H10290167A JP 9098758 A JP9098758 A JP 9098758A JP 9875897 A JP9875897 A JP 9875897A JP H10290167 A JPH10290167 A JP H10290167A
- Authority
- JP
- Japan
- Prior art keywords
- parallel
- bit
- polynomial
- data
- circuit
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title description 15
- 125000004122 cyclic group Chemical group 0.000 claims abstract description 10
- 238000001514 detection method Methods 0.000 claims description 28
- 238000012545 processing Methods 0.000 claims description 15
- 238000012937 correction Methods 0.000 description 10
- 238000004891 communication Methods 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000011161 development Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 230000020169 heat generation Effects 0.000 description 1
Landscapes
- Detection And Correction Of Errors (AREA)
- Error Detection And Correction (AREA)
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明は、データ転送におけ
る誤り訂正符号の算出に関するもので、所定のビット長
のデータ単位で転送されるパラレルデータをパラレル演
算することによって転送データの誤りを検出する誤り検
出方法に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to the calculation of an error correction code in data transfer, and more particularly, to an error detecting a transfer data error by performing a parallel operation on parallel data transferred in data units of a predetermined bit length. It relates to a detection method.
【0002】[0002]
【従来の技術】デジタル・データ通信において、送信さ
れたデータが受信されるまでの伝送路間で、ノイズ等の
外部要因でデータが壊れてしまうことがある。しかし、
受信側では、受信されたデータが正常なデータであるの
か、壊れたデータなのか区別がつかない。そこで、送信
側では送信するデータに誤り訂正符号という符号ビット
を付加し、受信側では受信したデータから訂正符号ビッ
トによって正しいデータを区別する方法が用いられてい
る。巡回冗長符号演算(CRC)はその例であって、伝
送ブロックの情報ビット列に、複数の冗長ビットを付加
する方式である。この巡回冗長符号演算は、コンピュー
タ間などでのデータ通信の誤り検出に使用されており、
復号化は主にソフトウエア処理によって行われている。
ソフトウエア処理ではリアルタイムに処理ができず、処
理に時間を要するが、これらのデータ通信にはシリアル
データの通信が多いため、従来の技術で十分対応するこ
とができる。また、データ通信のフォーマットが規格化
されている場合、巡回冗長符号演算を行うハードウエア
化されたLSIなどがあるが、汎用性はない。2. Description of the Related Art In digital data communication, data may be corrupted between transmission lines until transmitted data is received due to external factors such as noise. But,
On the receiving side, it is indistinguishable whether the received data is normal data or corrupted data. Therefore, a method is used in which a code bit called an error correction code is added to data to be transmitted on a transmission side, and correct data is distinguished from received data by a correction code bit. Cyclic redundancy code calculation (CRC) is an example of this, and is a method of adding a plurality of redundant bits to an information bit string of a transmission block. This cyclic redundancy code operation is used for error detection of data communication between computers and the like.
Decoding is mainly performed by software processing.
In software processing, real-time processing cannot be performed and processing takes time. However, since such data communication is often performed by serial data, conventional techniques can sufficiently cope with such data communication. When the format of data communication is standardized, there is a hardware LSI for performing a cyclic redundancy code operation, but there is no general versatility.
【0003】上に、データの誤りを検出するために符号
ビットを付加し転送すると述べた。この概念を簡単な数
字の例を挙げて数学的に説明する。まず、送信するデー
タ・パケットすなわちビット列多項式を「11」とし、
符号ビットを取り出すためのキーすなわち生成多項式と
なるデータを「3」とする。符号ビットを取り出すこと
は、データ・パケットをキーで割り、割り切れる数値に
なるための余りを取り出すことである。この場合、デー
タ・パケット「11」に「1」を足せば、ちょうど
「3」で割り切れる「12」となる。このときのデータ
・パケット「11」に対しての符号ビットは「1」とな
る。そこで転送するデータすなわち符号化多項式は「1
1+1」とする。受信側では、割るデータである生成多
項式となるデータ「3」がわかっているので、受信した
データ(符号化多項式)を生成多項式の「3」で割る。
このとき、でてくる答えが割り切れるかまたは割り切れ
ないかで、受信したデータの誤りを検出するのである。
このように、送信側と受信側で予め多項式を決めてお
き、受信側で受信データを上記多項式で割れば、符号ビ
ットを算出することができ、または誤りの有無を検出す
ることができるため、データの誤りを検出する方法は至
って簡単である。It has been described above that a code bit is added and transferred to detect a data error. This concept is explained mathematically with simple numerical examples. First, let the data packet to be transmitted, that is, the bit string polynomial be “11”,
A key for extracting a sign bit, that is, data serving as a generator polynomial is set to “3”. Retrieving the sign bit is dividing the data packet by the key and retrieving the remainder to be a divisible number. In this case, if "1" is added to the data packet "11", it becomes "12" which is exactly divisible by "3". The code bit for the data packet “11” at this time is “1”. The data to be transferred, that is, the encoding polynomial is "1
1 + 1 ". Since the receiving side knows the data "3" which is the generating polynomial which is the data to be divided, it divides the received data (coding polynomial) by "3" of the generating polynomial.
At this time, an error in the received data is detected depending on whether the answer that is obtained is divisible or not.
In this way, the transmitting side and the receiving side determine a polynomial in advance, and if the receiving side divides the received data by the above polynomial, the code bit can be calculated or the presence or absence of an error can be detected. The method of detecting data errors is very simple.
【0004】次に、従来知られている誤り訂正符号の例
について説明する。図4に示すように、従来の誤り訂正
符号は、生成多項式を基礎としたハードウエア構成で、
エクスクルーシブオア回路からなるm個のmod2法に
よる加算器100、101、……、10mと、m個のシ
フトレジスタ200、201、……、20mを有し、加
算器100、シフトレジスタ200、加算器101、シ
フトレジスタ201、……、加算器10m、シフトレジ
スタ20mの順にシリアルに接続されている。この回路
に多項式F(x)で表されるビット列データを代入して
いく。左端の端子から入力された多項式F(x)は、m
次の生成多項式G(x)で割り算され、商は右端から出
力される。F(x)の最後のビットが入力された時点で
演算が完了する。このとき、上記回路内のシフトレジス
タ200、201、……、20mに残っているmビット
がm−1次の剰余多項式を表していて、このmビットが
符号ビットとして使用され、また、この剰余多項式によ
ってデータの正否を判断することができる。ここで、ビ
ット列データとは、データ自体がシリアル・データすな
わち入力されるデータが「1」か「0」かの連続データ
のことをいう。Next, an example of a conventionally known error correction code will be described. As shown in FIG. 4, the conventional error correcting code has a hardware configuration based on a generator polynomial,
.., 10m and m shift registers 200, 201,..., 20m formed by an exclusive OR circuit using the mod2 method, and the adder 100, the shift register 200, and the adder ., A shift register 201,..., An adder 10m, and a shift register 20m in this order. The bit string data represented by the polynomial F (x) is substituted into this circuit. The polynomial F (x) input from the left terminal is m
It is divided by the next generator polynomial G (x), and the quotient is output from the right end. The operation is completed when the last bit of F (x) is input. At this time, the m bits remaining in the shift registers 200, 201,..., 20m in the circuit represent an m-1 order remainder polynomial, and the m bits are used as sign bits. Whether the data is correct or not can be determined by the polynomial. Here, the bit string data refers to continuous data in which the data itself is serial data, that is, the input data is “1” or “0”.
【0005】[0005]
【発明が解決しようとする課題】上記従来例は、巡回冗
長符号(CRC)を演算する方法である。CRC演算は
ビット列の多項式を生成多項式で演算(除算)し、その
ときの剰余を求め、これを訂正符号とするものである。
この訂正符号で、受信側が受信したデータに誤りがある
かどうか判断がつく。上記のようなビット列データの場
合は、最後のビットが入力された時点で各シフトレジス
タに訂正符号が現れている。この場合、即座に結果がで
るので特に問題はない。しかし、従来のCRC演算は、
ビット列データがシリアルデータの場合に対応できるも
のであって、ビット列データが、例えば16ビットのパ
ラレルデータの場合には対応することができない。デー
タを受け取る側では、パラレルデータをその場で判断し
なければならないリアルタイム処理が要求されるシステ
ムが存在しており、かかるシステムには従来のCRC演
算は対応できない。The above prior art is a method for calculating a cyclic redundancy code (CRC). In the CRC calculation, a polynomial of a bit string is calculated (divided) by a generator polynomial, a remainder at that time is obtained, and the remainder is used as a correction code.
With this correction code, the receiving side determines whether or not the received data has an error. In the case of the bit string data as described above, a correction code appears in each shift register when the last bit is input. In this case, there is no problem because the result is obtained immediately. However, the conventional CRC operation is
This can deal with the case where the bit string data is serial data, and cannot deal with the case where the bit string data is, for example, 16-bit parallel data. On the data receiving side, there are systems that require real-time processing in which parallel data must be determined on the spot, and such systems cannot handle conventional CRC calculations.
【0006】これを具体的に示すと、例えば、パラレル
で入力されるデータの周波数が40MHzで周期が25
nsの場合、これを図4に示す従来の回路で処理するも
のとすれば、パラレルデータが入力された時点から2n
sのシフトレジスタを用いて処理しても、32ns+α
という時間がかかってしまう。すなわち、16ビットの
データをシリアルに変換し、640MHzという極めて
高い周波数により非現実的な時間で処理しなければなら
ない。従って、復号化をソフトウエアで行おうとする
と、リアルタイムに処理することができず、処理に多く
の時間を要する難点がある。一方、上記のような処理回
路を作ったとしても、装置全体に占める上記処理回路の
割合が高くなり、処理速度、発熱等の問題で使い方が繊
細になり、小型化の要求にも逆行する。More specifically, for example, the frequency of data input in parallel is 40 MHz and the cycle is 25.
In the case of ns, if this is processed by the conventional circuit shown in FIG.
32 ns + α even if processing is performed using a shift register of s
It takes time. That is, 16-bit data must be converted into serial data and processed at an extremely high frequency of 640 MHz in an unrealistic time. Therefore, if the decoding is performed by software, the decoding cannot be performed in real time, and there is a disadvantage that the processing requires a lot of time. On the other hand, even if such a processing circuit is made, the proportion of the processing circuit in the entire apparatus becomes high, the usage becomes delicate due to problems such as processing speed and heat generation, and it goes against the demand for miniaturization.
【0007】また、CRC演算専用のLSIが用いられ
ることもあるが、生成多項式の違いによってLSIが専
用化され、汎用性のないものとなっており、専用のLS
Iを開発するにも費用が嵩む難点がある。Although an LSI dedicated to CRC calculation may be used, the LSI is specialized due to the difference between generator polynomials and has no versatility.
Developing I also has the disadvantage of being expensive.
【0008】いま、データ列が所定のビット長のパラレ
ルデータをパラレルに演算処理できるとすれば、16ビ
ットパラレルデータを周波数が40MHzで25nsの
間隔で一度に処理することが可能になり、上記のような
シリアル演算処理の問題点を解消することができる。本
発明は、かかる点に鑑みてなされたもので、データ列が
所定のビット長のパラレルデータをパラレルに演算処理
することにより、誤り訂正符号を必要とするシステムの
高速化とハードウエアの低廉化を図ることができる誤り
検出方法および誤り検出回路を提供することを目的とす
る。Assuming that parallel processing of parallel data having a predetermined bit length can be performed in a data sequence, 16-bit parallel data can be processed at once at a frequency of 40 MHz and at intervals of 25 ns. Such a problem of the serial operation processing can be solved. SUMMARY OF THE INVENTION The present invention has been made in view of the above circumstances, and performs parallel arithmetic processing on parallel data having a predetermined bit length in a data string, thereby increasing the speed of a system requiring an error correction code and reducing the cost of hardware. It is an object of the present invention to provide an error detection method and an error detection circuit that can achieve the above.
【0009】[0009]
【課題を解決するための手段】請求項1記載の誤り検出
方法は、データ列が所定のビット長のパラレルデータ、
またはビット列のある多項式を分割して得られる所定の
ビット長のパラレルデータを、ビット列多項式としてパ
ラレルデータ単位ごとに巡回冗長符号演算することによ
りデータの誤りの有無を検出することを特徴とする。According to a first aspect of the present invention, there is provided an error detection method, wherein a data string is parallel data having a predetermined bit length;
Alternatively, it is characterized in that the presence or absence of data error is detected by performing a cyclic redundancy code operation for each parallel data unit on parallel data of a predetermined bit length obtained by dividing a polynomial having a bit string as a bit string polynomial.
【0010】請求項2記載の発明は、請求項1記載の誤
り検出方法におけるパラレルデータ単位ごとの演算にお
いて、パラレルデータ長をnビットとしたとき、n個の
係数を用いてリアルタイムで演算することを特徴とす
る。According to a second aspect of the present invention, in the operation for each parallel data unit in the error detection method according to the first aspect, when the parallel data length is n bits, the operation is performed in real time using n coefficients. It is characterized by.
【0011】請求項3記載の発明は、請求項2記載の誤
り検出方法において、m次のパラレルデータの長さと生
成多項式の長さに違いがある場合に、演算後の余りの処
理を、m−1次のパラレルデータをリアルタイムで演算
することによって行うことを特徴とする。According to a third aspect of the present invention, in the error detection method of the second aspect, when there is a difference between the length of the m-th order parallel data and the length of the generator polynomial, the remaining processing after the operation is performed by m It is characterized in that the calculation is performed by calculating the -1st-order parallel data in real time.
【0012】請求項4記載の誤り検出回路は、パラレル
データからなるビット列多項式を受け入れるnビットの
パラレルレジスタと、このパラレルレジスタからのmビ
ットの出力をパラレルに加算してm次の生成多項式を得
る係数加算回路と、この係数加算回路から出力されるm
次の生成多項式を剰余多項式として形成するmビットの
パラレルレジスタと、上記係数加算回路からフィードバ
ックされる生成多項式を上記ビット列多項式に加算して
上記パラレルレジスタに入力するパラレル加算回路とを
有してなる。According to a fourth aspect of the present invention, an error detection circuit obtains an m-th order generating polynomial by adding an n-bit parallel register that receives a bit string polynomial composed of parallel data and an m-bit output from the parallel register in parallel. A coefficient adding circuit, and m output from the coefficient adding circuit.
An m-bit parallel register that forms the next generator polynomial as a remainder polynomial; and a parallel addition circuit that adds the generator polynomial fed back from the coefficient addition circuit to the bit string polynomial and inputs the result to the parallel register. .
【0013】請求項5記載の発明は、請求項4記載の発
明において、nビットのパラレルレジスタ、mビットの
パラレルレジスタ、パラレル加算回路、係数加算回路
が、プログラマブル・ロジック・デバイスからなること
を特徴とする。According to a fifth aspect of the present invention, in the fourth aspect, the n-bit parallel register, the m-bit parallel register, the parallel addition circuit, and the coefficient addition circuit are composed of a programmable logic device. And
【0014】[0014]
【発明の実施の形態】以下、図面を参照しながら本発明
にかかる誤り検出方法および誤り検出回路の実施の形態
について説明する。図1において、符号1はエクスクル
ーシブオア回路からなるmod2法によるパラレル加算
回路を示しており、ここでは、左端の入力端子からnビ
ットのバスラインを通じて入力されるnビットのパラレ
ルデータからなるビット列多項式I(xa)を受け入れ
るために、パラレルに配列されたn個の加算回路からな
る。上記ビット列多項式I(xa)は、ビット列のある
多項式を分割して得られる所定のビット長のパラレルデ
ータであってもよい。パラレル加算回路1の出力はnビ
ットのバスラインを介してnビットのパラレルレジスタ
2に入力されるようになっている。パラレルレジスタ2
は、入力された多項式I(x)と、各次数すなわちn
次、n−1次、……1次に与えられた各係数kn、kn
−1、……k1とアンドをとり、各次数ごとに係数K
(x)を取り出すようになっている。パラレルレジスタ
2の出力はパラレルに配列されたm個の係数加算回路3
に入力される。係数加算回路3はエクスクルーシブオア
回路からなるmod2法による加算回路で、その出力は
m次の生成多項式G(x)として表される。係数加算回
路3から出力されるmビットの生成多項式G(x)は、
mビットのパラレルレジスタ4に剰余多項式として入力
されると共に、フィードバックされて上記パラレル加算
回路1に入力されるようになっている。BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing an embodiment of an error detecting method and an error detecting circuit according to the present invention; In FIG. 1, reference numeral 1 denotes a parallel addition circuit based on a mod2 method comprising an exclusive OR circuit. Here, a bit string polynomial I comprising n-bit parallel data input from an input terminal at the left end through an n-bit bus line is shown. In order to accept (xa), it is composed of n adders arranged in parallel. The bit string polynomial I (xa) may be parallel data of a predetermined bit length obtained by dividing a certain polynomial in the bit string. The output of the parallel addition circuit 1 is input to an n-bit parallel register 2 via an n-bit bus line. Parallel register 2
Is the input polynomial I (x) and each order, ie, n
Next, n−1 order,..., First order given coefficients kn, kn
-1,... K1 and AND, and coefficient K for each order
(X) is taken out. The output of the parallel register 2 is m coefficient adding circuits 3 arranged in parallel.
Is input to The coefficient adding circuit 3 is an adding circuit based on a mod2 method comprising an exclusive OR circuit, and its output is represented as an m-th order generating polynomial G (x). The m-bit generator polynomial G (x) output from the coefficient adder 3 is
The data is input to the m-bit parallel register 4 as a remainder polynomial, and is fed back to the parallel addition circuit 1.
【0015】次に、図1に示す回路の動作を説明する。
図1において、左端から入力されるビット列多項式I
(xa)はnビットのパラレルデータであり、高次から
低次側へと順に並べられたデータ配列である。パラレル
演算の場合、生成多項式G(x)は回路上では判別しに
くいが、nビットのデータに対応する各n個のmビット
の係数として存在する。このmビットの係数が剰余多項
式R(x)mビットのパラレルデータとしてパラレルレ
ジスタ4に形成される。ここでは剰余のみを求めている
ため、商は出力されない。入力された多項式I(x)
は、nビットのパラレルレジスタ2においてn次、n−
1次、……1次に与えられた各係数kn、kn−1、…
…k1とアンドをとられ、各次数ごとに係数が取り出さ
れる。この複数の係数K(x)は係数加算回路3におい
てmod2法で加算され、m次の生成多項式G(x)と
して表される。さらに、パラレル加算回路1において、
入力データI(x)の低次側のnビットのパラレルデー
タの入力に対して、一つ前に得られた生成多項式G
(x)とmod2法の加算によりパラレルに加算され
る。そして、係数加算回路3に入力され、次の低次のn
ビットまでの生成多項式を求める。また、係数加算回路
3で得られたm次の生成多項式G(x)はmビットのパ
ラレルレジスタ4に入力され、このmビットの係数が剰
余多項式R(x)として形成される。このような演算を
最後のnビットのデータを入力するまで繰り返す。上記
「a」は全体のビット列の長さを表す。Next, the operation of the circuit shown in FIG. 1 will be described.
In FIG. 1, a bit string polynomial I input from the left end
(Xa) is n-bit parallel data, and is a data array arranged in order from the higher order to the lower order. In the case of the parallel operation, the generator polynomial G (x) is difficult to discriminate on a circuit, but exists as n m-bit coefficients corresponding to n-bit data. The m-bit coefficient is formed in the parallel register 4 as m-bit parallel data of the remainder polynomial R (x). Here, since only the remainder is obtained, no quotient is output. Input polynomial I (x)
Are n-th order, n−
..,...,...,.
.. And k1 are ANDed, and coefficients are extracted for each order. The plurality of coefficients K (x) are added in the coefficient adding circuit 3 by the mod2 method, and are represented as an m-th order generating polynomial G (x). Further, in the parallel addition circuit 1,
For the input of n-bit parallel data on the lower order side of the input data I (x), the generator polynomial G obtained immediately before
They are added in parallel by the addition of (x) and the mod2 method. Then, it is inputted to the coefficient adding circuit 3 and the next lower order n
Find the generator polynomial up to bits. The m-th generation polynomial G (x) obtained by the coefficient adding circuit 3 is input to an m-bit parallel register 4, and the m-bit coefficient is formed as a remainder polynomial R (x). Such an operation is repeated until the last n-bit data is input. The above “a” represents the length of the entire bit string.
【0016】上記nビットのパラレルレジスタ2は、各
次数K(x)に対して係数K(n)(x)=km+km
−1+……+k1+1をもっており、それぞれのm次の
加算結果が生成多項式Gx(gm+gm−1+……g1
+1)や剰余多項式Rx(rm+rm−1+……r1+
1)となる。この剰余多項式R(x)によって前記従来
例と同様にデータの正否を判断することができる。この
ように、図2に示す実施の形態によれば、加算器の数が
n+m個となり、従来よりも多くの加算器を必要とする
が、パラレル演算をするため、一度に多くの演算を行う
ことができる。図2に示す実施の形態は、入力データI
(x)のビット長nと生成多項式G(x)のビット長m
が同じ場合である。The n-bit parallel register 2 has a coefficient K (n) (x) = km + km for each order K (x).
+1+... + K1 + 1, and the respective m-th addition results are generated polynomials Gx (gm + gm-1 +... G1
+1) and the remainder polynomial Rx (rm + rm-1 +... R1 +
1). Based on the remainder polynomial R (x), the correctness of data can be determined in the same manner as in the conventional example. As described above, according to the embodiment shown in FIG. 2, the number of adders is n + m, and more adders are required than in the related art. However, since a parallel operation is performed, many operations are performed at once. be able to. The embodiment shown in FIG.
The bit length n of (x) and the bit length m of the generator polynomial G (x)
Are the same.
【0017】次に、係数加算について説明する。nビッ
トのパラレル多項式は、リアルタイムに剰余を算出する
ことができない。そこで、入力されるデータを、係数を
用いることによってリアルタイムに処理するものであ
る。次の式(2−1)は代表的な符号多項式である。I
(x)をx4+x3+x2+1、G(x)をx2+1とした
とき、 f(x)=x2I(x)+r(x)=Q(x)G(x) (2−1) =x2(x4+x3+x2+1)+r(x) =x6+x5+x4+x2+x+1 (2−2) となる。ここで、Q(x)は送信データf(x)を生成
多項式G(x)で割ったときの商であり、r(x)は剰
余である。Next, the coefficient addition will be described. For an n-bit parallel polynomial, the remainder cannot be calculated in real time. Therefore, input data is processed in real time by using coefficients. The following equation (2-1) is a representative code polynomial. I
When (x) is x 4 + x 3 + x 2 +1 and G (x) is x 2 +1, f (x) = x 2 I (x) + r (x) = Q (x) G (x) (2 -1) = x 2 and becomes (x 4 + x 3 + x 2 +1) + r (x) = x 6 + x 5 + x 4 + x 2 + x + 1 (2-2). Here, Q (x) is a quotient when the transmission data f (x) is divided by the generator polynomial G (x), and r (x) is a remainder.
【0018】さらに、目的のために、I(4x)として
x4、I(3x)としてx3、I(2x)としてx2+1
とした場合、次のようになる。 f(4x)=x2(x4)+r(x)=x6+1 f(3x)=x2(x3)+r(x)=x5+x f(2x)=x2(x2+1)+r(x)=x4+x2 f(x)は、f(4x)とf(3x)とf(2x)を加
算したものと仮定すると、次の式(2−3)のようにな
る。 f(x)=f(4x)+f(3x)+f(2x) (2−3) さらに、f(4x)、f(3x)、f(2x)のときの
それぞれの商と剰余をq(4x)、q(3x)、q(2
x)、r(4x)、r(3x)、r(2x)としたと
き、 f(x)=G(x)q(4x)+G(x)q(3x)+G(x)q(2x) =x2I(4x)+r(4x)+x2I(3x)+r(3x) +x2I(2x)+r(2x) =x6+1+x5+x+x4+x2 =x6+x5+x4+x2+x+1 となり、式(2−2)と等しいことがわかる。Furthermore, for the purpose, I (4x) as x 4, I (3x) as x 3, I (2x) as x 2 +1
Is as follows. f (4x) = x 2 ( x 4) + r (x) = x 6 +1 f (3x) = x 2 (x 3) + r (x) = x 5 + x f (2x) = x 2 (x 2 +1) + R (x) = x 4 + x 2 f (x) is given by the following equation (2-3), assuming that f (4x), f (3x) and f (2x) are added. f (x) = f (4x) + f (3x) + f (2x) (2-3) Further, the quotient and remainder at the time of f (4x), f (3x) and f (2x) are represented by q (4x ), Q (3x), q (2
x (x), r (4x), r (3x), r (2x), f (x) = G (x) q (4x) + G (x) q (3x) + G (x) q (2x) = x 2 I (4x) + r (4x) + x 2 I (3x) + r (3x) + x 2 I (2x) + r (2x) = x 6 + 1 + x 5 + x + x 4 + x 2 = x 6 + x 5 + x 4 + x 2 + x + 1 Which is equal to the expression (2-2).
【0019】すなわち、商も剰余も、それぞれの次数で
得られた結果をmod2の加算法で計算することによ
り、nビットのパラレル多項式を割り算した結果と同じ
結果がでることがわかる。これを次の式(2−4)、
(2−5)に挙げる。 r(x)=r(n)+r(n−1)+……+r(1)+r(0) (2−4) r(n)=cmxm+cm-1xm-1+……+x+1 (2−5) 上記r(x)はそれぞれの次数で得られた剰余の多項式
の演算結果である。上記r(n)は生成多項式で得られ
るm−1次の剰余多項式を表す。このm−1次の剰余多
項式をパラレル演算するための係数として扱う。係数
は、生成多項式により変わってくるが、常に変化するも
のではないため、予め各n次の係数を求めておくことが
できる。こうすることにより、リアルタイムにnビット
のパラレルデータを演算することができる。That is, it can be seen that the same result as the result obtained by dividing the n-bit parallel polynomial can be obtained by calculating the result obtained in each order by the addition method of mod2 for both the quotient and the remainder. This is represented by the following equation (2-4):
(2-5). r (x) = r (n ) + r (n-1) + ...... + r (1) + r (0) (2-4) r (n) = c m x m + c m-1 x m-1 + ... ... + x + 1 (2-5) The above r (x) is the result of operation of the remainder polynomial obtained in each order. The above r (n) represents an m-1 order remainder polynomial obtained by the generator polynomial. The m-1 order remainder polynomial is treated as a coefficient for performing a parallel operation. The coefficient changes depending on the generator polynomial, but does not always change, so that each n-order coefficient can be obtained in advance. In this way, n-bit parallel data can be calculated in real time.
【0020】これまでの説明は、入力データであるnビ
ット長のビット列と、mビット長の生成多項式が同じ長
さであることが条件である。しかし、実際にはm次の剰
余多項式がnビット長のビット列よりも長いため、m−
nのビットの余りをどうするかについて工夫を要する。
これを解決したものが図3に示す実施の形態であり、そ
の剰余演算フローを図2に示す。図2に示すように、ま
ず最初のビット列多項式Iaは、フィードバックされた
剰余多項式G(x)がないため、nビットのデータがそ
のまま演算され剰余多項式Ga(m)となる。The above description is based on the condition that the n-bit bit string, which is input data, and the m-bit length generating polynomial have the same length. However, since the mth-order remainder polynomial is actually longer than the n-bit long bit string,
It is necessary to devise what to do with the remainder of the n bits.
The solution to this problem is the embodiment shown in FIG. 3, and the remainder calculation flow is shown in FIG. As shown in FIG. 2, since the first bit string polynomial Ia does not have the remainder polynomial G (x) fed back, the n-bit data is directly calculated and becomes the remainder polynomial Ga (m).
【0021】次の次数であるビット列I(a−1)のデ
ータが入力されると、最初に得られた剰余多項式Ga
(m)の高い次数のnビット分と上記ビット列I(a−
1)がmod2の加算法で演算され、I(a−1)’と
して取り出される。しかし、剰余多項式Ga(m)のデ
ータとしては、m−nビットの情報が残っているため、
さらに次の次数であるビット列の次数I(a−2)と演
算しなければならない。そのために、遅延させて次のデ
ータを待つことになるが、2番目に得られた剰余データ
Ga−1(m)と、上記Ga(m)のm−nビットのデ
ータと、上記次数I(a−2)の三つのデータを演算し
なければならず面倒である。しかし、図2を見ればわか
るように、残りのm−nビットの頭の次数と、2番目に
得られた剰余Ga−1(m)の頭の次数が同じため、前
述の剰余演算理論により、残りのm−nビットの剰余と
2番目に得られたmビットの演算を行うことができる。
後は同じ演算を繰り替えし行う。When the data of the bit sequence I (a-1) which is the next order is input, the remainder polynomial Ga obtained first is obtained.
(M) and n bits of a higher order and the bit string I (a-
1) is calculated by the mod2 addition method, and is taken out as I (a-1) ′. However, since mn bits of information remain as data of the remainder polynomial Ga (m),
Further, it must be calculated with the order I (a-2) of the bit string which is the next order. For this purpose, the next data is delayed and the next data is waited. However, the remainder data Ga-1 (m) obtained second, the mn-bit data of Ga (m), and the order I ( The three data of a-2) must be calculated, which is troublesome. However, as can be seen from FIG. 2, since the order of the head of the remaining mn bits and the order of the head of the residue Ga-1 (m) obtained second are the same, the above-mentioned residue arithmetic theory , The remainder of the remaining mn bits and the operation of the second obtained m bits can be performed.
Thereafter, the same operation is repeated.
【0022】このような演算を行う回路の例を図3に示
す。図3に示す回路が図1に示す回路と異なる点は、係
数加算回路3で形成される生成多項式をパラレル加算回
路1にフィードバックするに当たり、上記生成多項式に
mビットのパラレルレジスタ4の残りのm−nビットの
剰余Gx(m−n)を加算してフィードバックするため
に、加算回路5が付加されている点である。この加算回
路5もmod2法による加算回路であって、mビット構
成になっている。FIG. 3 shows an example of a circuit for performing such an operation. The circuit shown in FIG. 3 is different from the circuit shown in FIG. 1 in that when the generator polynomial formed by the coefficient adder 3 is fed back to the parallel adder 1, the remaining polynomial of the m-bit parallel register 4 is added to the generator polynomial. The point is that an addition circuit 5 is added to add and feed back a −n-bit remainder Gx (mn). This addition circuit 5 is also an addition circuit based on the mod2 method, and has an m-bit configuration.
【0023】図4に示す従来例は、ビット列の巡回冗長
符号型の誤り訂正である。これに対し、図1〜図3に示
す本発明の実施の形態では、パラレル型の巡回冗長符号
による誤り訂正になっている。従って、入力データの周
波数が同一であるかまたは同一周波数で動作させた場
合、本発明のようなパラレル型の方が扱うことができる
データの量が多いため、リアルタイムに処理することが
できることがわかる。The conventional example shown in FIG. 4 is an error correction of a cyclic redundancy code type of a bit string. On the other hand, in the embodiment of the present invention shown in FIGS. 1 to 3, error correction is performed using a parallel cyclic redundancy code. Therefore, when the frequency of the input data is the same or when the input data is operated at the same frequency, the parallel type as in the present invention can handle a larger amount of data, so that it can be processed in real time. .
【0024】このように、本発明の目的を達成すること
ができるようになった背景には、プログラマブル・ロジ
ック・デバイス(PLD)という、ユーザーがロジック
回路を自由にプログラミングすることができる素子の存
在がある。このPLDは、各種のロジック回路が組み込
まれたLSI素子で、コンピュータの支援のもとにロジ
ック制御プログラムを組み、所期の機能をもたせた回路
を自由に設計することを可能にしたものである。本発明
の目的を達成するために、例えば特定用途向け集積回路
(ASIC)を用いて回路を構成することも不可能では
ないと考えられる。しかし、ASICは、ASICのメ
ーカーとユーザーとが協力しながら開発しなければなら
ず、多くの開発期間と開発費を必要とする難点がある。
その点、上記PLDは、ユーザーにおいてシステムに合
致した任意のロジック回路を簡単かつ安価に組み立てる
ことができるため、これを本発明に用いることによっ
て、所期の目的を達成することができる誤り検出回路を
簡単かつ安価に得ることができる。As described above, the object of the present invention can be achieved by the existence of an element called a programmable logic device (PLD) which allows a user to freely program a logic circuit. There is. The PLD is an LSI element in which various logic circuits are incorporated. A logic control program is assembled with the support of a computer, and a circuit having an intended function can be freely designed. . It is believed that it is not impossible to configure the circuit using, for example, an application specific integrated circuit (ASIC) to achieve the objects of the present invention. However, the ASIC must be developed in cooperation with the ASIC manufacturer and the user, and has a drawback that it requires many development periods and development costs.
In this regard, the PLD allows a user to easily and inexpensively assemble any logic circuit that matches the system, and by using this in the present invention, an error detection circuit that can achieve the intended purpose. Can be obtained easily and inexpensively.
【0025】[0025]
【発明の効果】請求項1記載の誤り検出方法によれば、
データ列が所定のビット長のパラレルデータ、またはビ
ット列のある多項式を分割して得られる所定のビット長
のパラレルデータを、ビット列多項式としてパラレルデ
ータ単位ごとに巡回冗長符号演算することによりデータ
の誤りの有無を検出するようにしたため、所定のビット
長のパラレルデータをリアルタイムに演算することがで
きると共に、この演算によってデータ列のデータの誤り
の有無を検出することができる。According to the error detecting method of the first aspect,
The data string is subjected to a cyclic redundancy code operation for each parallel data unit as parallel data having a predetermined bit length or parallel data having a predetermined bit length obtained by dividing a polynomial having a bit string as a bit string polynomial. Since the presence / absence is detected, parallel data of a predetermined bit length can be calculated in real time, and the presence / absence of an error in the data string can be detected by this calculation.
【0026】請求項2記載の発明によれば、請求項1記
載の誤り検出方法において、パラレルデータ単位ごとの
演算において、パラレルデータ長をnビットとしたと
き、n個の係数を用いてリアルタイムで演算するように
したため、nビットのパラレルデータのリアルタイム演
算を実効あらしめることができる。According to the second aspect of the present invention, in the error detection method according to the first aspect, in the calculation for each parallel data unit, when the parallel data length is n bits, n coefficients are used in real time. Since calculation is performed, real-time calculation of n-bit parallel data can be effectively performed.
【0027】請求項3記載の発明によれば、請求項2記
載の誤り検出方法において、m次のパラレルデータの長
さと生成多項式の長さに違いがある場合に、演算後の余
りの処理を、m−1次のパラレルデータをリアルタイム
で演算することによって行うようにしたため、パラレル
データの長さと生成多項式の長さに違いがある場合であ
っても、余りの処理を繰り返し行うことによって誤りの
有無の検出を行うことができる。According to the third aspect of the present invention, in the error detection method according to the second aspect, if there is a difference between the length of the m-th parallel data and the length of the generator polynomial, the remaining processing after the operation is performed. , M-1 order parallel data in real time, so that even if there is a difference between the length of the parallel data and the length of the generator polynomial, an error is obtained by repeating the remaining processing. The presence or absence can be detected.
【0028】請求項4記載の発明によれば、パラレルデ
ータからなるビット列多項式を受け入れるnビットのパ
ラレルレジスタと、このパラレルレジスタからのmビッ
トの出力をパラレルに加算してm次の生成多項式を得る
係数加算回路と、この係数加算回路から出力されるm次
の生成多項式を剰余多項式として形成するmビットのパ
ラレルレジスタと、上記係数加算回路からフィードバッ
クされる生成多項式を上記ビット列多項式に加算して上
記パラレルレジスタに入力するパラレル加算回路とを設
けることによって、所定のビット長のパラレルデータを
リアルタイムに演算することができると共に、この演算
によってデータ列のデータの誤りの有無を検出すること
が可能な誤り検出回路を得ることができる。According to the present invention, an n-bit parallel register that accepts a bit string polynomial composed of parallel data and an m-bit output from the parallel register are added in parallel to obtain an m-th order generator polynomial. A coefficient adding circuit, an m-bit parallel register that forms an m-th order generating polynomial output from the coefficient adding circuit as a remainder polynomial, and a generator polynomial fed back from the coefficient adding circuit is added to the bit string polynomial. By providing a parallel addition circuit for inputting data to a parallel register, it is possible to calculate parallel data of a predetermined bit length in real time, and to use this calculation to detect the presence or absence of a data string data error. A detection circuit can be obtained.
【0029】請求項5記載の発明によれば、請求項4記
載の発明において、nビットのパラレルレジスタ、mビ
ットのパラレルレジスタ、パラレル加算回路、係数加算
回路を、プログラマブル・ロジック・デバイスで構成し
たため、誤り検出回路を簡単かつ安価に得ることができ
る。According to the fifth aspect of the present invention, in the fourth aspect of the present invention, the n-bit parallel register, the m-bit parallel register, the parallel addition circuit, and the coefficient addition circuit are constituted by programmable logic devices. And an error detection circuit can be obtained simply and inexpensively.
【図1】本発明にかかる誤り検出方法および誤り検出回
路の実施の形態を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of an error detection method and an error detection circuit according to the present invention.
【図2】本発明にかかる誤り検出方法および誤り検出回
路の別の実施の形態による動作を示すフローチャートで
ある。FIG. 2 is a flowchart showing an operation of another embodiment of the error detection method and the error detection circuit according to the present invention.
【図3】本発明にかかる誤り検出方法および誤り検出回
路の別の実施の形態を示すブロック図である。FIG. 3 is a block diagram showing another embodiment of the error detection method and the error detection circuit according to the present invention.
【図4】従来の誤り検出方法および誤り検出回路の例を
示すブロック図である。FIG. 4 is a block diagram showing an example of a conventional error detection method and an error detection circuit.
1 パラレル加算回路 2 nビットのパラレルレジスタ 3 係数加算回路 4 mビットのパラレルレジスタ Reference Signs List 1 parallel addition circuit 2 n-bit parallel register 3 coefficient addition circuit 4 m-bit parallel register
Claims (5)
ータ、またはビット列のある多項式を分割して得られる
所定のビット長のパラレルデータを、ビット列多項式と
してパラレルデータ単位ごとに巡回冗長符号演算するこ
とによりデータの誤りの有無を検出する誤り検出方法。1. A cyclic redundancy code operation is performed for each parallel data unit as parallel data having a predetermined bit length as a data sequence or parallel data having a predetermined bit length obtained by dividing a polynomial having a bit sequence as a bit sequence polynomial. An error detection method that detects the presence or absence of a data error by using.
て、パラレルデータ長をnビットとしたとき、n個の係
数を用いてリアルタイムで演算する請求項1記載の誤り
検出方法。2. The error detection method according to claim 1, wherein, in the operation for each parallel data unit, when the parallel data length is n bits, the error detection method is performed in real time using n coefficients.
式の長さに違いがある場合に、演算後の余りの処理を、
m−1次のパラレルデータをリアルタイムで演算するこ
とによって行う請求項2記載の誤り検出方法。3. When there is a difference between the length of the m-th parallel data and the length of the generator polynomial, the remaining processing after the operation is
3. The error detection method according to claim 2, wherein the error detection is performed by calculating m-1 order parallel data in real time.
を受け入れるnビットのパラレルレジスタと、 上記パラレルレジスタからのmビットの出力をパラレル
に加算してm次の生成多項式を得る係数加算回路と、 上記係数加算回路から出力されるm次の生成多項式を剰
余多項式として形成するmビットのパラレルレジスタ
と、 上記係数加算回路からフィードバックされる生成多項式
を上記ビット列多項式に加算して上記パラレルレジスタ
に入力するパラレル加算回路とを有してなる誤り検出回
路。4. An n-bit parallel register that accepts a bit string polynomial composed of parallel data, a coefficient addition circuit that adds an m-bit output from the parallel register in parallel to obtain an m-th order generator polynomial, An m-bit parallel register that forms an m-th generation polynomial output from the circuit as a remainder polynomial; and a parallel addition circuit that adds the generation polynomial fed back from the coefficient addition circuit to the bit string polynomial and inputs the result to the parallel register. An error detection circuit comprising:
のパラレルレジスタ、パラレル加算回路、係数加算回路
が、プログラマブル・ロジック・デバイスからなる請求
項4記載の誤り検出回路。5. The error detection circuit according to claim 4, wherein the n-bit parallel register, the m-bit parallel register, the parallel addition circuit, and the coefficient addition circuit are composed of a programmable logic device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP9098758A JPH10290167A (en) | 1997-04-16 | 1997-04-16 | Method and circuit for detecting error |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP9098758A JPH10290167A (en) | 1997-04-16 | 1997-04-16 | Method and circuit for detecting error |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH10290167A true JPH10290167A (en) | 1998-10-27 |
Family
ID=14228334
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP9098758A Pending JPH10290167A (en) | 1997-04-16 | 1997-04-16 | Method and circuit for detecting error |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH10290167A (en) |
-
1997
- 1997-04-16 JP JP9098758A patent/JPH10290167A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Sprachmann | Automatic generation of parallel CRC circuits | |
CN101527615A (en) | Implementation method of cyclic redundancy check (CRC) codes and device | |
JPH0452556B2 (en) | ||
JPH02148225A (en) | Data processing method and apparatus for calculating multipicative inverse element of finite field | |
JPH0728227B2 (en) | Decoding device for BCH code | |
JP2001524274A (en) | Method and apparatus for shortened fire code error trapping decoding | |
JPS5846741A (en) | Decoder | |
Wang et al. | Reliable and secure memories based on algebraic manipulation correction codes | |
JP3245290B2 (en) | Decoding method and device | |
JP2005086683A (en) | Error decoding circuit, data bus control method, and data bus system | |
EP0723342B1 (en) | Error correction apparatus | |
JP2810397B2 (en) | Error correction device | |
US8015478B2 (en) | Data processing | |
JPH10290167A (en) | Method and circuit for detecting error | |
JP2662472B2 (en) | Syndrome operation circuit for error correction processing | |
CN114942861A (en) | CRC calculation method, device, computer equipment and storage medium | |
JPH08149017A (en) | CRC code generation method | |
JP5248300B2 (en) | Error correction decoding apparatus and error correction decoding method | |
RU2115231C1 (en) | Data coding-decoding device | |
US10623018B2 (en) | Method of arrangement of an algorithm in cyclic redundancy check | |
JP3071482B2 (en) | Error correction circuit of packet receiver | |
JP2004173199A (en) | Error correction circuit using cyclic code | |
JP2822928B2 (en) | CRC code calculation method and circuit | |
JPS6217256B2 (en) | ||
JP3239866B2 (en) | Data inspection method and apparatus based on CRC and recording medium |