JP3554715B2 - Error detection device - Google Patents

Error detection device Download PDF

Info

Publication number
JP3554715B2
JP3554715B2 JP2001232463A JP2001232463A JP3554715B2 JP 3554715 B2 JP3554715 B2 JP 3554715B2 JP 2001232463 A JP2001232463 A JP 2001232463A JP 2001232463 A JP2001232463 A JP 2001232463A JP 3554715 B2 JP3554715 B2 JP 3554715B2
Authority
JP
Japan
Prior art keywords
data
detection target
bit width
error
crc calculation
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.)
Expired - Fee Related
Application number
JP2001232463A
Other languages
Japanese (ja)
Other versions
JP2003046393A (en
Inventor
尚 松本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anritsu Corp
Original Assignee
Anritsu Corp
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 Anritsu Corp filed Critical Anritsu Corp
Priority to JP2001232463A priority Critical patent/JP3554715B2/en
Publication of JP2003046393A publication Critical patent/JP2003046393A/en
Application granted granted Critical
Publication of JP3554715B2 publication Critical patent/JP3554715B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、所定ビットずつ並列に入力されるフレームデータに含まれるデータの誤りを簡単な構成で検出できるようにするための技術に関する。
【0002】
【従来の技術】
データ伝送システムでは、受信したデータに誤りがあるか否かを判定するための方式としてCRC(Cyclic Redundancy Check)方式が用いられている。
【0003】
このCRC方式では、伝送したいデータに対してCRC計算(所定次数の生成多項式による割り算)を行い、その余りまたはその反転値を示すFCS(フレームチェックシーケンス)コードを伝送したいデータの最後部に付加して送信し、受信側では、受信データに対するCRC計算をFCSコードまで行い、その計算結果が特定の値に一致すればデータに誤りがないと判定し、計算結果が特定の値と一致しない場合には、データに誤りがあると判定している。
【0004】
このようなCRC計算は、一般的には、所定次数の生成多項式に対応する段数のシフトレジスタと排他的論理和回路とで構成された帰還型シフトレジスタにデータを1ビットずつ入力して行っているが、長いデータのCRC計算を短時間に行うことが要求される場合には、並列CRC計算回路に検出対象データを並列に入力して、検出対象データのCRC計算を行っている。
【0005】
【発明が解決しようとする課題】
しかしながら、フレームデータに含まれる検出対象データの先頭位置が、Nビット幅で入力されるデータの最上位にない場合や、検出対象データの終了位置が、Nビット幅で入力されるデータの最下位にない場合には、その先頭位置の前のデータや終了位置の後のデータの影響で正しい計算結果が得られなくなってしまう。
【0006】
これを解決するために、検出対象データの先頭位置や終了位置に応じて、並列CRC計算回路のビット数を可変することも考えられるが、並列CRC計算回路の構成は、シリアル型のCRC計算回路に比べて格段に複雑であり、さらに内部のビット数を可変する構成では、その回路規模が膨大になってしまう。
【0007】
本発明は、この問題を解決し、簡単な構成で検出対象データの先頭位置や終了位置がどのような位置にあっても、検出対象データのCRC計算を正しく行える誤り検出装置を提供することを目的としている。
【0008】
【課題を解決するための手段】
前記目的を達成するために、本発明の請求項1の誤り検出装置は、
Nビット幅(Nは複数)で並列入力されるデータ列で構成されるフレームデータと、該フレームデータ内のCRC計算による誤り検出の対象となる検出対象データの先頭位置と終了位置を示す情報とを受けて、該検出対象データの誤りを検出する誤り検出装置において、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置を含むNビット幅のデータの最上位から前記先頭位置の直前位置までの範囲と、前記終了位置を含むNビット幅のデータの前記終了位置の直後から最下位までの範囲に0のデータを連続挿入するゼロデータ挿入手段(22)と、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置からCRC計算に用いる生成多項式の次数に等しいビット分のデータを反転するデータ反転手段(23)と、
前記ゼロデータ挿入手段および前記データ反転手段によって加工された前記先頭位置を含むNビット幅のデータから前記終了位置を含むNビット幅のデータまでを計算対象データとし、該計算対象データに対して前記次数の生成多項式に基づくCRC計算を初期値0の状態から行う並列CRC計算手段(24)と、
前記次数の生成多項式に基づくCRC計算上で誤りの無いデータの後に0のデータを付加して構成されるデータに対して、前記次数の生成多項式に基づくCRC計算を行ったときの計算結果を、前記付加した0のデータの数毎に予め記憶している基準データ記憶手段(27)と、
前記ゼロデータ挿入手段によって前記検出対象データの終了位置の後に挿入された0のデータ数に対応する基準データを前記基準データ記憶手段から読み出し、該読み出した基準データと前記並列CRC計算手段の計算結果とを比較して前記検出対象データに誤りがあるか否かを判定する判定手段(28)とを備えたことを特徴としている。
【0009】
また、本発明の請求項2の誤り検出装置は、
Nビット幅(Nは複数)で並列入力されるデータ列で構成されるフレームデータと、該フレームデータ内のCRC計算による誤り検出の対象となる検出対象データの先頭位置と終了位置を示す情報とを受けて、該検出対象データの誤りを検出する誤り検出装置において、
誤りの無いデータに対する前記CRC計算の生成多項式で決まる固有の計算結果を相殺するための相殺データを、前記Nビット幅で入力されるフレームデータのうちの前記検出対象データの前記終了位置の直後に挿入する相殺データ挿入手段(41)と、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置を含むNビット幅のデータの最上位から前記先頭位置の直前位置までの範囲と、前記相殺データ挿入手段が挿入する相殺データの挿入最終位置を含むNビット幅のデータの前記挿入最終位置の直後から最下位までの範囲に0のデータを連続挿入するゼロデータ挿入手段(22′)と、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置からCRC計算に用いる生成多項式の次数に等しいビット分のデータを反転加工するデータ反転手段(23)と、
前記相殺データ挿入手段、ゼロデータ挿入手段および前記データ反転手段によって加工された前記先頭位置を含むNビット幅のデータから前記相殺データの挿入最終位置を含むNビット幅のデータまでを計算対象データとし、該計算対象データに対して前記次数の生成多項式に基づくCRC計算を初期値0の状態から行う並列CRC計算手段(24)と、
前記並列CRC計算手段の計算結果が0のとき前記検出対象データに誤りが無く、0以外のとき前記検出対象データに誤りがあると判定する判定手段(28′)とを備えたことを特徴としている。
【0010】
また、本発明の請求項3の誤り検出装置は、
Nビット幅(Nは複数)で並列入力されるデータ列で構成されるフレームデータと、該フレームデータ内のCRC計算による誤り検出の対象となる検出対象データの先頭位置と終了位置を示す情報とを受けて、該検出対象データの誤りを検出する誤り検出装置において、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置を含むNビット幅のデータの最上位から前記先頭位置の直前位置までの範囲と、前記終了位置を含むNビット幅のデータの前記終了位置の直後から最下位までの範囲に0のデータを連続挿入するゼロデータ挿入手段(22)と、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置からCRC計算に用いる生成多項式の次数に等しいビット分のデータを反転するデータ反転手段(23)と、
前記ゼロデータ挿入手段および前記データ反転手段によって加工された前記先頭位置を含むNビット幅のデータから前記終了位置を含むNビット幅のデータまでを計算対象データとし、該計算対象データに対して前記次数の生成多項式に基づくCRC計算を初期値0の状態から行う並列CRC計算手段(24)と、
前記並列CRC計算手段の計算結果が0のとき前記検出対象データに誤りが無く、0以外のとき前記検出対象データに誤りがあると判定する判定手段(28′)とを備えたことを特徴としている。
【0011】
【発明の実施の形態】
以下、図面に基づいて本発明の実施の形態を説明する。
図1は、本発明を適用した誤り検出装置20の構成を示している。
【0012】
この誤り検出装置20は、例えばデータ伝送システムに対する各種の試験を行うための試験装置に用いられるものであり、その試験装置のフレームデータ検出部10から、Nビット(例えば128ビット)幅で並列に出力されるデータ列で構成されるフレームデータFと、そのフレームデータ内の検出対象データDの先頭位置を示す情報Aと終了位置を示す情報Bとを受けて、検出対象データDの誤りの有無を検出する。
【0013】
ゼロデータ挿入手段22は、Nビット幅で入力されるフレームデータのうち、先頭位置Aを含むNビット幅のデータの最上位(整数Pに対してP・N+1で表される位置)から先頭位置Aの直前位置までの範囲と、終了位置BをNビット幅のデータの終了位置Bの直後から最下位(整数Qに対してQ・Nで表される位置)までの範囲に0のデータを連続挿入して、0のデータが挿入された先頭位置Aを含むNビット幅のデーから0のデータが挿入された終了位置Bを含むNビット幅のデータまでを計算対象データDaとしてデータ反転手段23に出力する。
【0014】
なお、このゼロデータ挿入手段22は、先頭位置AがNビット幅で入力されるデータの最上位、即ち、N・P+1で表される位置にある場合には、その先頭位置Aを含むNビット幅のデータに0のデータを挿入せずにそのまま出力し、終了位置BがQ・Nで表される位置にある場合には、その終了位置Bを含むNビット幅のデータに0のデータを挿入せずにそのまま出力する。
【0015】
また、フレームデータFのビット幅Nは、一般的に8ビット(1バイト)の整数倍で、検出対象データの先頭位置Aおよび終了位置Bも1バイト(8ビット)単位で区切られているので、検出対象データの終了位置Bの後に挿入する0のデータ数は、Nビット幅のデータ内において(N/8)通りとなり、前記したように、終了位置Bが最下位(Q・Nで表される位置)にある場合を除けば(N/8)−1通りとなる。
【0016】
データ反転手段23は、ゼロデータ挿入手段22から出力される計算対象データDaのうち、先頭位置AからCRC計算の生成多項式の次数K(例えば16や32)に等しいビット分のデータを反転し、この次数K分のデータが反転された計算対象データDbを並列CRC計算手段24に出力する。
【0017】
並列CRC計算手段24は、データ反転手段23からNビット幅で出力される計算対象データDbに対してK次(例えば16次や32次)の生成多項式に基づくCRC計算を行い、その計算結果Uを判定手段28に出力する。
【0018】
この並列CRC計算手段24は、例えば図2に示すように、K個のシフトレジスタ25〜25と、入力されるNビットの並列データとK個のシフトレジスタ25〜25の出力とを、K次の生成多項式によって決まる組合せでそれぞれ受けてその排他的論理和を演算し、その演算結果を各シフトレジスタ25〜25に入力するK個の排他的論理和回路26〜26とによって構成されている。
【0019】
このように構成された並列CRC計算手段24は、各シフトレジスタ25〜25が1に初期化された状態で、誤りのないデータに、そのデータをK次の生成多項式で割ったときの余りを反転させたFCSデータが付加されたN・Mビットのデータが入力されたときに、シフトレジスタ25〜25からは、入力データの値とは無関係に、生成多項式によって決まる特定の値Zを出力する。
【0020】
なお、ここでは、先頭位置AがN・P+1で表される位置以外の位置に有る場合に対処できるように、並列CRC計算手段24は、その各シフトレジスタ25〜25が0に初期化された状態で計算を開始するものとする。
【0021】
基準データ記憶手段27には、K次の生成多項式に基づくCRC計算上で誤りがないデータの後に0のデータを付加して構成されるデータに対して、K次の生成多項式に基づくCRC計算を行ったときの計算結果が、そのデータに付加されている0の数にそれぞれ対応する基準データとして予め記憶されている。
【0022】
なお、前記したように、データを1バイト単位で扱う場合、ゼロデータ挿入手段23によって終了位置Bの後に挿入される0のデータ数は、0を含めてN/8通りであるから、これに対応して基準データ記憶手段27には、0のデータを付加しないときの基準データR(0)=Z、0のデータを1バイト分付加したときの基準データR(1)、0のデータを2バイト分付加したときの基準データR(2)、…、0のデータを(N/8)−1バイト分付加したときの基準データR(W)[W=(N/8)−1]が記憶されている。
【0023】
判定手段28は、ゼロデータ挿入手段22が終了位置Bの後に挿入した0のデータ数xに対応する基準データR(x)を基準データ記憶手段27から読出し、その基準データR(x)と並列CRC計算手段23の計算結果Uとを比較し、両者が一致したとき、検出対象データDに誤りがないと判定し、両者が不一致のとき検出対象データに誤りがあると判定する。
【0024】
上記のように構成された誤り検出装置20では、例えば図3の(a)のように、d(1)〜d(L・N)で構成される検出対象データDの先頭位置Aが、Nビット幅のデータの最上位(P・N+1で表される位置)にあり、且つ、終了位置Bが最下位(Q・Nで表される位置)にあるフレームデータFが入力された場合、ゼロデータ挿入手段22は、先頭位置Aを含むNビット幅のデータd(1)〜d(N)から終了位置Bを含むNビット幅のデータ[(L−1)・N+1]〜d(L・N)までのデータをそのまま計算対象データDaとして通過させてデータ反転手段23に入力する。
【0025】
また、データ反転手段23は、図3の(b)のように、計算対象データDaのうち、先頭位置Aから次数Kに対応するビット分のデータd(1)〜d(N)を反転し、このビット分のデータが反転された計算対象データDbを並列CRC計算手段24に出力する。
【0026】
並列CRC計算手段24は、初期値が0にセットされた状態で、この計算対象データDbに対して次数Kの生成多項式によるCRC計算を行う。
【0027】
この場合、始めに入力されるNビットのデータのうちのKビット分のデータは、元のデータd(1)〜d(N)に対して反転しているので、このKビット分の反転データに対する並列CRC計算手段24の内部状態は、初期値が1の状態で元のKビット分のデータd(1)〜d(N)を入力されたときと同一の状態となる。
【0028】
したがって、終了位置Bまでのデータの計算結果Uは、検出対象データDに対して初期値1から計算を開始したときの計算結果と等しくなる。
【0029】
そして、この場合、終了位置Bの後に0のデータは挿入されていないので、判定手段28において、その計算結果Uと基準データR(0)=Zとが比較され、両者が一致すれば、検出対象データDに誤りが無く、計算結果Uが特定値に一致しなければ検出対象データDに誤りがあると判定される。
【0030】
また、図4(a)のように、検出対象データDの先頭位置AがNビット幅のデータの最上位以外の位置、即ち、P・N+2〜(P+1)・Nのいずれかで表される位置にあり、且つ、終了位置Bが最下位、即ち、Q・Nで表される位置にあるフレームデータFが入力された場合、図4の(b)のように、ゼロデータ挿入手段22によって、先頭位置Aを含むNビット幅のデータの最上位(P・N+1で表される位置)から先頭位置Aの直前位置までに0のデータが連続的に挿入される。
【0031】
また、データ反転手段23によって、先頭位置AからKビット分のデータd(1)〜d(K)が反転されて、並列CRC計算手段24へ入力される。
【0032】
並列CRC計算手段24は、前記したように、初期値0の状態でCRC計算を開始するが、最初に入力されるNビット幅のデータのうち、ゼロデータ挿入手段22によって挿入された0のデータに対しては内部状態が変化せず、その後に続くKビットの反転されたデータによって内部状態が変化する。
【0033】
したがって、このKビットのデータが入力さたときの内部状態は、初期値1で元のKビット分のデータを入力したときと同一状態となる。
【0034】
このため、終了位置Bまでのデータの計算結果Uは、検出対象データDに対して初期値1から計算を開始したときの計算結果と等しくなる。
【0035】
そして、この場合も終了位置Bの後に0のデータは挿入されていないので、判定手段28において、その計算結果Uと基準データR(0)=Zとが比較され、両者が一致すれば、検出対象データDに誤りが無く、計算結果Uが特定値に一致しなければ検出対象データDに誤りがあると判定される。
【0036】
また、図5(a)のように、検出対象データDの先頭位置AがNビット幅で入力されるデータの最上位以外の位置、即ち、P・N+2〜(P+1)・Nのいずれかで表される位置にあり、且つ、終了位置Bが最下位以外の位置、即ち、(Q−1)・N+1〜Q・N−1で表される位置にあるフレームデータFが入力された場合、前記同様に、図5の(b)のように、ゼロデータ挿入手段22によって先頭位置Aを含むNビット幅のデータの最上位から先頭位置Aの直前位置までに0のデータが連続的に挿入され、終了位置Bの直後位置から最下位まで0のデータが連続的に挿入される。
【0037】
また、データ反転手段23により、先頭位置AからKビット分のデータd(1)〜d(K)を反転されて、並列CRC計算手段24へ入力される。
【0038】
並列CRC計算手段24は、前記同様に、初期値0の状態でCRC計算を行う。この場合、終了位置Bのデータd(Y)までのCRC計算の途中結果は、前記したように、検出対象データDに対するCRC計算結果と一致し、検出対象データDに誤りが無ければその途中結果は基準データR(0)=Zと一致するが、その後に0のデータが連続しているので、最終の計算結果Uは、たとえ検出対象データDに誤りが無い場合でも値Zには一致せず、終了位置Bに続くデータ0の数に応じた計算結果がでてくる。この場合の計算結果Uは、終了位置Bに続くデータ0の数がNより小さいため、終了位置Bに続くデータ0の数によってそれぞれ決まる固有の値となる。
【0039】
この計算結果Uを受けた判定手段28は、データ挿入手段22によって終了位置Bの後に挿入された0のデータ数に対応する基準データR(x)を読出し、この読み出した基準データR(x)と計算結果Uとを比較し、両者が一致すれば検出対象データに誤りがなく、両者が一致しなければ検出対象データに誤りがあると判定する。
【0040】
以上のように構成されているので、この誤り検出装置20は、たとえ、Nビット幅で並列に入力されるフレームデータ内の誤り検出の対象となる検出対象データの先頭位置AがNビット幅のデータの最上位にない場合や、検出対象データの終了位置BがNビット幅のデータの最下位にない場合でも、その先頭位置の前のデータや終了位置の後のデータの影響を受けずに、検出対象データに対するCRC計算を正しく行うことができる。
【0041】
また、入力されるデータに対する加工は、0のデータの挿入とデータの反転処理だけなので、簡単に構成できる。
【0042】
前記した誤り検出装置20では、終了位置Bの後に挿入する0のデータ数に応じた基準データを基準データ記憶手段27に予め記憶しておき、並列CRC計算手段24の計算結果と、基準データ記憶手段27から読み出した基準データとを比較することで、誤りの有無を判定していたが、図6に示す誤り検出装置40のように、誤りの無いデータに対するCRC計算の計算結果を相殺するための相殺データを終了位置Bの後に挿入する相殺データ挿入手段41を設けることで、基準データ記憶手段27を省略することができる。
【0043】
この誤り検出装置40では、図7の(a)のように入力されるフレームデータFに対して、図7の(b)に示すように、相殺データ挿入手段41により、終了位置Bの後に、誤りの無いデータに対するCRC計算の計算結果、即ち、特定の値Zを相殺するための相殺データZ′(=Z)を挿入し、ゼロデータ挿入手段22′により、先頭位置Aを含むNビット幅のデータの最上位から先頭位置Aの直前までの範囲と、相殺データZの最終挿入位置Cを含むNビット幅のデータの最終挿入位置Cの直後から最下位までの範囲に0のデータを連続挿入し、データ反転手段23により、先頭位置AからKビット分のデータを反転して、並列CRC計算手段28に入力する。
【0044】
この場合、前記同様に、先頭位置Aを含むNビット幅のデータから終了位置Bを含むNビット幅のデータの終了位置BまでのCRC計算の途中結果は、検出対象データDに対して初期値1の状態でCRC計算を行った場合の結果と等しく、検出対象データDに誤りが無ければ特定の値Zとなるが、その後に続く相殺データZ′までのCRC計算を行うと、特定の値Zが相殺されてその結果は0となる。
【0045】
そして、この相殺データZ′の後に0のデータが続いても、最終の演算結果Uは、検出対象データDに誤りが無ければ0のままである。
【0046】
したがって、判定手段28′は、並列CRC計算手段24の計算結果Uが0のときには、検出対象データDに誤りが無く、計算結果Uが0以外のときには、検出対象データDに誤りがあると判定することができる。
【0047】
なお、上記した誤り検出装置20、40では、入力される検出対象データDに含まれるFCSが、生成多項式でデータを割ったときの余りを反転させたデータであるプロトコル(イーサネット等)の場合について説明したが、入力される検出対象データDに含まれるFCSが、生成多項式でデータを割ったときの余りそのものを示すプロトコルの場合には、その検出対象データDに誤りがなければCRCの計算結果は0となる。
【0048】
したがって、このような場合には、図8に示す誤り検出装置50のように、ゼロデータ挿入手段22によって、先頭位置Aを含むNビット幅のデータの最上位から先頭位置Aの直前までの範囲と、終了位置Bを含むNビット幅のデータの終了位置Bの直後から最下位までの範囲に0のデータを連続挿入し、データ反転手段23により、先頭位置AからKビット分のデータを反転して、並列CRC計算手段28に入力し、判定手段28′により、その計算結果Uが0であれば検出対象データに誤りがなく、計算結果Uが0以外の値であれば、検出対象データに誤りがあると判定することができる。
【0049】
なお、前記した誤り測定装置20、40、50では、ゼロデータ挿入手段22(22′)によって0のデータが挿入されたデータに対して、データ反転手段23による反転処理を行っていたが、逆に、データ反転手段23による反転処理を行ったデータにゼロデータ挿入手段22(22′)による0のデータの挿入処理を行ってもよい。
【0050】
また、同様に、相殺データ挿入手段41による相殺データの挿入処理も0のデータの挿入処理の後や、データ反転処理の後に行ってもよい。
【0051】
【発明の効果】
以上説明したように本発明の請求項1の誤り検出装置は、
Nビット幅(Nは複数)で並列入力されるデータ列で構成されるフレームデータと、該フレームデータ内のCRC計算による誤り検出の対象となる検出対象データの先頭位置と終了位置を示す情報とを受けて、該検出対象データの誤りを検出する誤り検出装置において、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置を含むNビット幅のデータの最上位から前記先頭位置の直前位置までの範囲と、前記終了位置を含むNビット幅のデータの前記終了位置の直後から最下位までの範囲に0のデータを連続挿入するゼロデータ挿入手段(22)と、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置からCRC計算に用いる生成多項式の次数に等しいビット分のデータを反転するデータ反転手段(23)と、
前記ゼロデータ挿入手段および前記データ反転手段によって加工された前記先頭位置を含むNビット幅のデータから前記終了位置を含むNビット幅のデータまでを計算対象データとし、該計算対象データに対して前記次数の生成多項式に基づくCRC計算を初期値0の状態から行う並列CRC計算手段(24)と、
前記次数の生成多項式に基づくCRC計算上で誤りの無いデータの後に0のデータを付加して構成されるデータに対して、前記次数の生成多項式に基づくCRC計算を行ったときの計算結果を、前記付加した0のデータの数毎に予め記憶している基準データ記憶手段(27)と、
前記ゼロデータ挿入手段によって前記検出対象データの終了位置の後に挿入された0のデータ数に対応する基準データを前記基準データ記憶手段から読み出し、該読み出した基準データと前記並列CRC計算手段の計算結果とを比較して前記検出対象データに誤りがあるか否かを判定する判定手段(28)とを備えたことを特徴としている。
【0052】
このため、簡単な構成で、余り反転型のFCSを含む検出対象データの先頭位置や終了位置がどの位置にあっても、検出対象データに対するCRC計算および判定を正しく行うことができる。
【0053】
また、本発明の請求項2の誤り検出装置は、
Nビット幅(Nは複数)で並列入力されるデータ列で構成されるフレームデータと、該フレームデータ内のCRC計算による誤り検出の対象となる検出対象データの先頭位置と終了位置を示す情報とを受けて、該検出対象データの誤りを検出する誤り検出装置において、
誤りの無いデータに対する前記CRC計算の生成多項式で決まる固有の計算結果を相殺するための相殺データを、前記Nビット幅で入力されるフレームデータのうちの前記検出対象データの前記終了位置の直後に挿入する相殺データ挿入手段(41)と、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置を含むNビット幅のデータの最上位から前記先頭位置の直前位置までの範囲と、前記相殺データ挿入手段が挿入する相殺データの挿入最終位置を含むNビット幅のデータの前記挿入最終位置の直後から最下位までの範囲に0のデータを連続挿入するゼロデータ挿入手段(22′)と、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置からCRC計算に用いる生成多項式の次数に等しいビット分のデータを反転加工するデータ反転手段(23)と、
前記相殺データ挿入手段、ゼロデータ挿入手段および前記データ反転手段によって加工された前記先頭位置を含むNビット幅のデータから前記相殺データの挿入最終位置を含むNビット幅のデータまでを計算対象データとし、該計算対象データに対して前記次数の生成多項式に基づくCRC計算を初期値0の状態から行う並列CRC計算手段(24)と、
前記並列CRC計算手段の計算結果が0のとき前記検出対象データに誤りが無く、0以外のとき前記検出対象データに誤りがあると判定する判定手段(28′)とを備えたことを特徴としている。
【0054】
このため、簡単な構成で、余り反転型のFCSを含む検出対象データの先頭位置や終了位置がどの位置にあっても、検出対象データに対するCRC計算および判定を正しく行うことができる。
【0055】
また、本発明の請求項3の誤り検出装置は、
Nビット幅(Nは複数)で並列入力されるデータ列で構成されるフレームデータと、該フレームデータ内のCRC計算による誤り検出の対象となる検出対象データの先頭位置と終了位置を示す情報とを受けて、該検出対象データの誤りを検出する誤り検出装置において、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置を含むNビット幅のデータの最上位から前記先頭位置の直前位置までの範囲と、前記終了位置を含むNビット幅のデータの前記終了位置の直後から最下位までの範囲に0のデータを連続挿入するゼロデータ挿入手段(22)と、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置からCRC計算に用いる生成多項式の次数に等しいビット分のデータを反転するデータ反転手段(23)と、
前記ゼロデータ挿入手段および前記データ反転手段によって加工された前記先頭位置を含むNビット幅のデータから前記終了位置を含むNビット幅のデータまでを計算対象データとし、該計算対象データに対して前記次数の生成多項式に基づくCRC計算を初期値0の状態から行う並列CRC計算手段(24)と、
前記並列CRC計算手段の計算結果が0のとき前記検出対象データに誤りが無く、0以外のとき前記検出対象データに誤りがあると判定する判定手段(28′)とを備えたことを特徴としている。
【0056】
このため、簡単な構成で、余り非反転型のFCSを含む検出対象データの先頭位置や終了位置がどの位置にあっても、検出対象データに対するCRC計算および判定を正しく行うことができる。
【図面の簡単な説明】
【図1】本発明の実施形態の構成を示す図
【図2】実施形態の要部の構成を示す図
【図3】入力されるフレームデータと加工後のデータを示す図
【図4】入力されるフレームデータと加工後のデータを示す図
【図5】入力されるフレームデータと加工後のデータを示す図
【図6】本発明の他の実施形態の構成を示す図
【図7】入力されるフレームデータと加工後のデータを示す図
【図8】本発明の他の実施形態の構成を示す図
【符号の説明】
10 フレームデータ検出部
20、40、50 誤り検出装置
22、22′ ゼロデータ挿入手段
23 データ反転工手段
24 並列CRC計算手段
25 シフトレジスタ
26 排他的論理和回路
27 基準データ記憶手段
28、28′ 判定手段
41 相殺データ挿入手段
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a technique for enabling a simple configuration to detect an error in data included in frame data input in parallel by predetermined bits.
[0002]
[Prior art]
In a data transmission system, a CRC (Cyclic Redundancy Check) method is used as a method for determining whether or not received data has an error.
[0003]
In this CRC method, a CRC calculation (division by a generator polynomial of a predetermined order) is performed on data to be transmitted, and an FCS (frame check sequence) code indicating the remainder or an inverted value thereof is added to the last part of the data to be transmitted. The receiving side performs CRC calculation on the received data up to the FCS code. If the calculation result matches a specific value, it determines that there is no error in the data. If the calculation result does not match the specific value, Has determined that there is an error in the data.
[0004]
Such a CRC calculation is generally performed by inputting data one bit at a time to a feedback type shift register composed of a shift register of a number of stages corresponding to a generator polynomial of a predetermined order and an exclusive OR circuit. However, when it is required to perform CRC calculation of long data in a short time, the detection target data is input in parallel to the parallel CRC calculation circuit, and the CRC calculation of the detection target data is performed.
[0005]
[Problems to be solved by the invention]
However, when the head position of the detection target data included in the frame data is not at the highest position of the data input with the N-bit width, or when the end position of the detection target data is the lowest position of the data input with the N-bit width, Otherwise, a correct calculation result cannot be obtained due to the influence of data before the head position or data after the end position.
[0006]
To solve this, it is conceivable to vary the number of bits of the parallel CRC calculation circuit according to the start position and end position of the detection target data. However, the configuration of the parallel CRC calculation circuit is a serial type CRC calculation circuit. The configuration is much more complicated than that described above, and further, the configuration in which the number of internal bits is variable increases the circuit scale.
[0007]
The present invention solves this problem and provides an error detection device that can correctly perform CRC calculation of detection target data with a simple configuration, regardless of the start position or end position of the detection target data. The purpose is.
[0008]
[Means for Solving the Problems]
In order to achieve the above object, an error detection device according to claim 1 of the present invention includes:
Frame data composed of data strings input in parallel with an N-bit width (where N is a plurality); information indicating the start position and end position of detection target data to be subjected to error detection by CRC calculation in the frame data; In response, in the error detection device that detects an error of the detection target data,
Among the frame data input with the N-bit width, a range from the top of the N-bit width data including the head position of the detection target data to a position immediately before the head position, and N bits including the end position. Zero data insertion means (22) for continuously inserting 0 data in a range from immediately after the end position of the width data to the lowest position;
Data inverting means (23) for inverting data of bits equal to the degree of a generator polynomial used for CRC calculation from the head position of the detection target data in the frame data input with the N-bit width;
The data from the N-bit width including the head position processed by the zero data insertion unit and the data inversion unit to the N-bit width data including the end position are set as calculation target data. Parallel CRC calculation means (24) for performing a CRC calculation based on a generator polynomial of degree from a state of an initial value 0 ;
A calculation result obtained by performing a CRC calculation based on the generator polynomial of the degree with respect to data configured by adding 0 data after data having no error in a CRC calculation based on the generator polynomial of the degree, A reference data storage means (27) which stores in advance for each number of the added 0 data;
The reference data corresponding to the number of zero data inserted after the end position of the detection target data by the zero data insertion unit is read from the reference data storage unit, and the read reference data and the calculation result of the parallel CRC calculation unit are read. And a determining means (28) for determining whether there is an error in the detection target data by comparing
[0009]
Further, the error detecting device according to claim 2 of the present invention provides:
Frame data composed of data strings input in parallel with an N-bit width (where N is a plurality); information indicating the start position and end position of detection target data to be subjected to error detection by CRC calculation in the frame data; In response, in the error detection device that detects an error of the detection target data,
Cancel data for canceling a unique calculation result determined by the generator polynomial of the CRC calculation with respect to error-free data is provided immediately after the end position of the detection target data in the frame data input with the N-bit width. Offset data insertion means (41) to be inserted;
In the frame data input with the N-bit width, the range from the top of the N-bit width data including the head position of the detection target data to the position immediately before the head position is inserted by the offset data insertion means. Zero data insertion means (22 ') for continuously inserting zero data in a range from immediately after the last insertion position of the N-bit data including the last insertion position of the offset data to the lowest position,
Data inversion means (23) for inverting data of bits equal to the degree of a generator polynomial used for CRC calculation from the head position of the detection target data in the frame data input with the N-bit width;
The data to be calculated includes data from the N-bit width including the head position processed by the offset data insertion unit, the zero data insertion unit and the data inversion unit to the N-bit width data including the insertion end position of the offset data. A parallel CRC calculation means (24) for performing a CRC calculation on the calculation target data based on the generator polynomial of the degree from an initial value of 0 ;
Determining means (28 ') for determining that there is no error in the detection target data when the calculation result of the parallel CRC calculation means is 0, and determining that there is an error in the detection target data when the calculation result is other than 0; I have.
[0010]
Further, the error detection device according to claim 3 of the present invention provides:
Frame data composed of data strings input in parallel with an N-bit width (where N is a plurality); information indicating the start position and end position of detection target data to be subjected to error detection by CRC calculation in the frame data; In response, in the error detection device that detects an error of the detection target data,
Among the frame data input with the N-bit width, a range from the top of the N-bit width data including the head position of the detection target data to a position immediately before the head position, and N bits including the end position. Zero data insertion means (22) for continuously inserting 0 data in a range from immediately after the end position of the width data to the lowest position;
Data inverting means (23) for inverting data of bits equal to the degree of a generator polynomial used for CRC calculation from the head position of the detection target data in the frame data input with the N-bit width;
The data from the N-bit width including the head position processed by the zero data insertion unit and the data inversion unit to the N-bit width data including the end position are set as calculation target data. Parallel CRC calculation means (24) for performing a CRC calculation based on a generator polynomial of degree from a state of an initial value 0 ;
Determining means (28 ') for determining that there is no error in the detection target data when the calculation result of the parallel CRC calculation means is 0, and determining that there is an error in the detection target data when the calculation result is other than 0; I have.
[0011]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 shows a configuration of an error detection device 20 to which the present invention is applied.
[0012]
The error detection device 20 is used, for example, as a test device for performing various tests on a data transmission system. The error detection device 20 receives an N-bit (eg, 128-bit) width in parallel from the frame data detection unit 10 of the test device. Receiving frame data F composed of an output data sequence, information A indicating the start position of detection target data D in the frame data, and information B indicating the end position, the presence or absence of an error in detection target data D Is detected.
[0013]
The zero data insertion means 22 determines the start position from the highest position (the position represented by P · N + 1 with respect to the integer P) of the N-bit width data including the start position A in the frame data input with the N-bit width. A range of data up to the position immediately before A and an end position B are set to 0 data in a range from immediately after the end position B of the N-bit width data to the lowest position (a position represented by Q · N with respect to the integer Q). Data inverting means which continuously inserts data from the N-bit width including the head position A where the data of 0 is inserted to the N-bit width including the end position B where the data of 0 is inserted as the calculation target data Da. 23.
[0014]
When the head position A is located at the highest position of the data input with an N-bit width, that is, at the position represented by N · P + 1, the zero-data insertion unit 22 outputs N bits including the head position A. If the end position B is at the position represented by Q · N, zero data is inserted into the N-bit width data including the end position B when the data is output as it is without inserting zero data into the width data. Output without insertion.
[0015]
Further, the bit width N of the frame data F is generally an integral multiple of 8 bits (1 byte), and the start position A and the end position B of the detection target data are also separated in units of 1 byte (8 bits). , The number of 0 data to be inserted after the end position B of the detection target data is (N / 8) in the N-bit width data, and as described above, the end position B is the lowest order (represented by Q · N). (N / 8) -1 except when it is located at the position (the position to be performed).
[0016]
The data inverting means 23 inverts data of bits equal to the degree K (for example, 16 or 32) of the generator polynomial of the CRC calculation from the head position A in the calculation target data Da output from the zero data inserting means 22, The calculation target data Db obtained by inverting the data of the order K is output to the parallel CRC calculation means 24.
[0017]
The parallel CRC calculator 24 performs a CRC calculation on the calculation target data Db output from the data inverting unit 23 with an N-bit width based on a K-th (for example, 16th and 32nd) generator polynomial, and the calculation result U Is output to the determination means 28.
[0018]
As shown in FIG. 2, for example, the parallel CRC calculating means 24 includes K shift registers 25 1 to 25 K , N-bit parallel data to be input, and outputs from the K shift registers 25 1 to 25 K. and receiving each a combination determined by the K following generator polynomial calculates the exclusive OR, K-number of the exclusive OR circuit 26 1 to 26 for inputting the operation result to the shift register 25 1 to 25 K K.
[0019]
Thus configured parallel CRC calculation means 24, in a state in which the shift register 25 1 to 25 K is initialized to 1, the error-free data, when the data is divided by K following generator polynomial when N · M bits of data FCS data obtained by inverting is added the remainder is inputted from the shift register 25 1 to 25 K, regardless of the value of the input data, the specific value determined by the generator polynomial Output Z.
[0020]
Here, in order to cope with the case where the head position A is located at a position other than the position represented by N · P + 1, the parallel CRC calculating means 24 initializes each of the shift registers 25 1 to 25 K to 0. It is assumed that the calculation is started in the state that has been set.
[0021]
The reference data storage means 27 stores a CRC calculation based on the K-th generation polynomial on data constituted by adding 0 data after data having no error in the CRC calculation based on the K-th generation polynomial. The calculation result at the time of execution is stored in advance as reference data corresponding to the number of 0s added to the data.
[0022]
As described above, when data is handled in units of 1 byte, the number of zeros inserted after the end position B by the zero data insertion means 23 is N / 8, including zero. Correspondingly, the reference data storage means 27 stores the reference data R (0) = Z when no 0 data is added and the reference data R (1) and 0 data when 1 byte of data is added. Reference data R (2),..., 0 when 2 bytes are added, reference data R (W) [W = (N / 8) −1] when (N / 8) -1 bytes are added. Is stored.
[0023]
The judging means 28 reads the reference data R (x) corresponding to the number x of 0 data inserted after the end position B by the zero data inserting means 22 from the reference data storage means 27, and reads in parallel with the reference data R (x). The calculation result U of the CRC calculation means 23 is compared, and when they match, it is determined that there is no error in the detection target data D, and when they do not match, it is determined that there is an error in the detection target data.
[0024]
In the error detection device 20 configured as described above, for example, as shown in FIG. 3A, the head position A of the detection target data D including d (1) to d (L · N) is N If the frame data F at the highest position (position represented by P · N + 1) and the end position B at the lowest position (position represented by Q · N) of the bit width data is input, zero is set. The data insertion means 22 converts the N-bit width data d (1) to d (N) including the head position A to the N-bit width data [(L−1) · N + 1] to d (L·L) including the end position B. The data up to N) is passed as it is as the calculation target data Da and input to the data inversion means 23.
[0025]
The data inversion means 23 inverts data d (1) to d (N) of bits corresponding to the order K from the head position A in the calculation target data Da as shown in FIG. 3B. The calculation target data Db obtained by inverting the data of the bits is output to the parallel CRC calculation means 24.
[0026]
The parallel CRC calculation means 24 performs a CRC calculation on the calculation target data Db using a generator polynomial of degree K with the initial value set to 0.
[0027]
In this case, among the N-bit data input first, K-bit data is inverted with respect to the original data d (1) to d (N). The internal state of the parallel CRC calculation means 24 is the same state as when the original data d (1) to d (N) for K bits are input with the initial value being 1.
[0028]
Therefore, the calculation result U of the data up to the end position B is equal to the calculation result when the calculation is started from the initial value 1 for the detection target data D.
[0029]
In this case, since the data of 0 is not inserted after the end position B, the calculation result U is compared with the reference data R (0) = Z in the judgment means 28. If there is no error in the target data D and the calculation result U does not match the specific value, it is determined that the detection target data D has an error.
[0030]
Further, as shown in FIG. 4A, the head position A of the detection target data D is represented by a position other than the highest position of the N-bit width data, that is, any one of P · N + 2 to (P + 1) · N. When the frame data F at the position and the end position B is at the lowest position, that is, at the position represented by QN, as shown in FIG. 0 data is continuously inserted from the uppermost position (the position represented by P · N + 1) of the N-bit width data including the head position A to the position immediately before the head position A.
[0031]
The data inverting means 23 inverts data d (1) to d (K) for K bits from the head position A and inputs the inverted data to the parallel CRC calculating means 24.
[0032]
As described above, the parallel CRC calculation means 24 starts the CRC calculation in the state of the initial value 0. Of the N-bit width data input first, the zero data inserted by the zero data insertion means 22 is used. , The internal state does not change, and the internal state changes with the subsequent K-bit inverted data.
[0033]
Therefore, the internal state when this K-bit data is input becomes the same state as when the original K-bit data is input with an initial value of 1.
[0034]
Therefore, the calculation result U of the data up to the end position B is equal to the calculation result when the calculation is started from the initial value 1 for the detection target data D.
[0035]
Also in this case, since the data of 0 is not inserted after the end position B, the calculation result U is compared with the reference data R (0) = Z by the determination means 28. If there is no error in the target data D and the calculation result U does not match the specific value, it is determined that the detection target data D has an error.
[0036]
Also, as shown in FIG. 5A, the head position A of the detection target data D is a position other than the highest position of the data input with an N-bit width, that is, any one of P · N + 2 to (P + 1) · N. When the frame data F at the position indicated by the frame data and the end position B is at a position other than the lowest position, that is, at the position indicated by (Q−1) · N + 1 to Q · N−1, Similarly, as shown in FIG. 5B, zero data is continuously inserted from the uppermost position of the N-bit data including the head position A to the position immediately before the head position A by the zero data insertion means 22 as shown in FIG. Then, data of 0 is continuously inserted from the position immediately after the end position B to the lowest position.
[0037]
The data inverting means 23 inverts data d (1) to d (K) for K bits from the head position A and inputs the inverted data to the parallel CRC calculating means 24.
[0038]
The parallel CRC calculation means 24 performs the CRC calculation with the initial value being 0 as described above. In this case, the intermediate result of the CRC calculation up to the data d (Y) at the end position B matches the CRC calculation result for the detection target data D as described above, and if there is no error in the detection target data D, the intermediate result is obtained. Coincides with the reference data R (0) = Z, but since data of 0 continues thereafter, the final calculation result U does not coincide with the value Z even if the detection target data D has no error. Instead, a calculation result corresponding to the number of data 0 following the end position B is obtained. Since the number of data 0 following the end position B is smaller than N, the calculation result U in this case is a unique value determined by the number of data 0 following the end position B.
[0039]
Upon receiving the calculation result U, the determination unit 28 reads the reference data R (x) corresponding to the number of 0 data inserted after the end position B by the data insertion unit 22, and reads the read reference data R (x). Is compared with the calculation result U, and if they match, it is determined that there is no error in the data to be detected, and if they do not match, it is determined that there is an error in the data to be detected.
[0040]
With the above-described configuration, the error detection device 20 is configured such that, for example, the head position A of the detection target data to be subjected to the error detection in the frame data input in parallel with the N-bit width has the N-bit width. Even if it is not at the top of the data or the end position B of the detection target data is not at the bottom of the N-bit width data, it is not affected by data before the start position or data after the end position. In addition, the CRC calculation for the detection target data can be performed correctly.
[0041]
Further, since the processing for the input data is only insertion of 0 data and inversion processing of the data, it can be easily configured.
[0042]
In the error detection device 20, the reference data according to the number of 0 data inserted after the end position B is stored in the reference data storage unit 27 in advance, and the calculation result of the parallel CRC calculation unit 24 and the reference data storage The presence / absence of an error is determined by comparing the reference data read from the unit 27. However, as in the error detection device 40 shown in FIG. Is provided after the end position B, the reference data storage unit 27 can be omitted.
[0043]
In this error detection device 40, as shown in FIG. 7B, the offset data insertion means 41 adds the frame data F input as shown in FIG. The calculation result of the CRC calculation for the error-free data, that is, the offset data Z '(= Z) for offsetting the specific value Z is inserted, and the N-bit width including the head position A is inserted by the zero data insertion means 22'. 0 data continuously from the top of the data to the position immediately before the head position A and from the position immediately after the last insertion position C of the N-bit width data including the last insertion position C of the offset data Z to the bottom. The data is inserted, the data for K bits is inverted from the head position A by the data inversion means 23, and is input to the parallel CRC calculation means 28.
[0044]
In this case, as described above, the intermediate result of the CRC calculation from the N-bit width data including the start position A to the end position B of the N-bit width data including the end position B is the initial value of the detection target data D. The result is equal to the result when the CRC calculation is performed in the state of 1. When the detection target data D has no error, the specific value Z is obtained. When the CRC calculation up to the subsequent offset data Z 'is performed, the specific value Z is obtained. Z cancels out and the result is zero.
[0045]
Then, even if data of 0 follows this offset data Z ', the final calculation result U remains 0 if there is no error in the detection target data D.
[0046]
Therefore, when the calculation result U of the parallel CRC calculation means 24 is 0, the determination means 28 'determines that there is no error in the detection target data D, and when the calculation result U is other than 0, it determines that the detection target data D has an error. can do.
[0047]
In the above error detection devices 20 and 40, the case where the FCS included in the input detection target data D is a protocol (Ethernet or the like) in which the remainder when data is divided by a generator polynomial is inverted. As described above, in the case where the FCS included in the input detection target data D is a protocol indicating the remainder itself when the data is divided by the generator polynomial, if there is no error in the detection target data D, the CRC calculation result Becomes 0.
[0048]
Therefore, in such a case, as in the error detection device 50 shown in FIG. 8, the zero data insertion means 22 causes the range from the top of the N-bit data including the start position A to the position immediately before the start position A. And data of 0 are continuously inserted in the range from immediately after the end position B of the N-bit data including the end position B to the lowest position, and the data inversion means 23 inverts data of K bits from the start position A. Then, it is input to the parallel CRC calculation means 28, and if the calculation result U is 0, there is no error in the detection target data if the calculation result U is 0, and if the calculation result U is a value other than 0, the detection target data is Can be determined to be incorrect.
[0049]
In the error measuring devices 20, 40, and 50, the data in which the zero data is inserted by the zero data insertion unit 22 (22 ') is subjected to the inversion processing by the data inversion unit 23. Alternatively, zero data insertion processing by the zero data insertion means 22 (22 ') may be performed on the data subjected to the inversion processing by the data inversion means 23.
[0050]
Similarly, the process of inserting offset data by the offset data inserting means 41 may be performed after the process of inserting 0 data or after the process of inverting data.
[0051]
【The invention's effect】
As described above, the error detection device according to claim 1 of the present invention
Frame data composed of data strings input in parallel with an N-bit width (where N is a plurality); information indicating the start position and end position of detection target data to be subjected to error detection by CRC calculation in the frame data; In response, in the error detection device that detects an error of the detection target data,
Among the frame data input with the N-bit width, a range from the top of the N-bit width data including the head position of the detection target data to a position immediately before the head position, and N bits including the end position. Zero data insertion means (22) for continuously inserting 0 data in a range from immediately after the end position of the width data to the lowest position;
Data inverting means (23) for inverting data of bits equal to the degree of a generator polynomial used for CRC calculation from the head position of the detection target data in the frame data input with the N-bit width;
The data from the N-bit width including the head position processed by the zero data insertion unit and the data inversion unit to the N-bit width data including the end position are set as calculation target data. Parallel CRC calculation means (24) for performing a CRC calculation based on a generator polynomial of degree from a state of an initial value 0 ;
A calculation result obtained by performing a CRC calculation based on the generator polynomial of the degree with respect to data configured by adding 0 data after data having no error in a CRC calculation based on the generator polynomial of the degree, A reference data storage means (27) which stores in advance for each number of the added 0 data;
The reference data corresponding to the number of zero data inserted after the end position of the detection target data by the zero data insertion unit is read from the reference data storage unit, and the read reference data and the calculation result of the parallel CRC calculation unit are read. And a determining means (28) for determining whether there is an error in the detection target data by comparing
[0052]
Therefore, with a simple configuration, the CRC calculation and determination for the detection target data can be correctly performed regardless of the start position or the end position of the detection target data including the FCS of the remainder inversion.
[0053]
Further, the error detection device of claim 2 of the present invention
Frame data composed of data strings input in parallel with an N-bit width (where N is a plurality); information indicating the start position and end position of detection target data to be subjected to error detection by CRC calculation in the frame data; In response, in the error detection device that detects an error of the detection target data,
Cancel data for canceling a unique calculation result determined by the generator polynomial of the CRC calculation with respect to error-free data is provided immediately after the end position of the detection target data in the frame data input with the N-bit width. Offset data insertion means (41) to be inserted;
In the frame data input with the N-bit width, the range from the top of the N-bit width data including the head position of the detection target data to the position immediately before the head position is inserted by the offset data insertion means. Zero data insertion means (22 ') for continuously inserting zero data in a range from immediately after the last insertion position of the N-bit data including the last insertion position of the offset data to the lowest position,
Data inversion means (23) for inverting data of bits equal to the degree of a generator polynomial used for CRC calculation from the head position of the detection target data in the frame data input with the N-bit width;
The data to be calculated includes data from the N-bit width including the head position processed by the offset data insertion unit, the zero data insertion unit and the data inversion unit to the N-bit width data including the insertion end position of the offset data. A parallel CRC calculation means (24) for performing a CRC calculation on the calculation target data based on the generator polynomial of the degree from an initial value of 0 ;
Determining means (28 ') for determining that there is no error in the detection target data when the calculation result of the parallel CRC calculation means is 0, and determining that there is an error in the detection target data when the calculation result is other than 0; I have.
[0054]
Therefore, with a simple configuration, the CRC calculation and determination for the detection target data can be correctly performed regardless of the start position or the end position of the detection target data including the FCS of the remainder inversion.
[0055]
Further, the error detection device of claim 3 of the present invention
Frame data composed of data strings input in parallel with an N-bit width (where N is a plurality); information indicating the start position and end position of detection target data to be subjected to error detection by CRC calculation in the frame data; In response, in the error detection device that detects an error of the detection target data,
Among the frame data input with the N-bit width, a range from the top of the N-bit width data including the head position of the detection target data to a position immediately before the head position, and N bits including the end position. Zero data insertion means (22) for continuously inserting 0 data in a range from immediately after the end position of the width data to the lowest position;
Data inverting means (23) for inverting data of bits equal to the degree of a generator polynomial used for CRC calculation from the head position of the detection target data in the frame data input with the N-bit width;
The data from the N-bit width including the head position processed by the zero data insertion unit and the data inversion unit to the N-bit width data including the end position are set as calculation target data. Parallel CRC calculation means (24) for performing a CRC calculation based on a generator polynomial of degree from a state of an initial value 0 ;
Determining means (28 ') for determining that there is no error in the detection target data when the calculation result of the parallel CRC calculation means is 0, and determining that there is an error in the detection target data when the calculation result is other than 0; I have.
[0056]
For this reason, with a simple configuration, CRC calculation and determination can be correctly performed on the detection target data regardless of the start position or the end position of the detection target data including the non-inverted FCS.
[Brief description of the drawings]
FIG. 1 is a diagram showing a configuration of an embodiment of the present invention; FIG. 2 is a diagram showing a configuration of a main part of the embodiment; FIG. 3 is a diagram showing input frame data and processed data; FIG. FIG. 5 shows input frame data and processed data. FIG. 6 shows input frame data and processed data. FIG. 6 shows a configuration of another embodiment of the present invention. FIG. 8 shows frame data to be processed and data after processing. FIG. 8 shows a configuration of another embodiment of the present invention.
10 Frame data detector 20, 40, 50 Error detector 22, 22 'Zero data insertion means 23 Data inversion means 24 Parallel CRC calculation means 25 Shift register 26 Exclusive OR circuit 27 Reference data storage means 28, 28' Judgment Means 41 Offset data insertion means

Claims (3)

Nビット幅(Nは複数)で並列入力されるデータ列で構成されるフレームデータと、該フレームデータ内のCRC計算による誤り検出の対象となる検出対象データの先頭位置と終了位置を示す情報とを受けて、該検出対象データの誤りを検出する誤り検出装置において、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置を含むNビット幅のデータの最上位から前記先頭位置の直前位置までの範囲と、前記終了位置を含むNビット幅のデータの前記終了位置の直後から最下位までの範囲に0のデータを連続挿入するゼロデータ挿入手段(22)と、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置からCRC計算に用いる生成多項式の次数に等しいビット分のデータを反転するデータ反転手段(23)と、
前記ゼロデータ挿入手段および前記データ反転手段によって加工された前記先頭位置を含むNビット幅のデータから前記終了位置を含むNビット幅のデータまでを計算対象データとし、該計算対象データに対して前記次数の生成多項式に基づくCRC計算を初期値0の状態から行う並列CRC計算手段(24)と、
前記次数の生成多項式に基づくCRC計算上で誤りの無いデータの後に0のデータを付加して構成されるデータに対して、前記次数の生成多項式に基づくCRC計算を行ったときの計算結果を、前記付加した0のデータの数毎に予め記憶している基準データ記憶手段(27)と、
前記ゼロデータ挿入手段によって前記検出対象データの終了位置の後に挿入された0のデータ数に対応する基準データを前記基準データ記憶手段から読み出し、該読み出した基準データと前記並列CRC計算手段の計算結果とを比較して前記検出対象データに誤りがあるか否かを判定する判定手段(28)とを備えたことを特徴とする誤り検出装置。
Frame data composed of data strings input in parallel with an N-bit width (where N is a plurality); information indicating the start position and end position of detection target data to be subjected to error detection by CRC calculation in the frame data; In response, in the error detection device that detects an error of the detection target data,
Among the frame data input with the N-bit width, a range from the top of the N-bit width data including the head position of the detection target data to a position immediately before the head position, and N bits including the end position. Zero data insertion means (22) for continuously inserting 0 data in a range from immediately after the end position of the width data to the lowest position;
Data inverting means (23) for inverting data of bits equal to the degree of a generator polynomial used for CRC calculation from the head position of the detection target data in the frame data input with the N-bit width;
The data from the N-bit width including the head position processed by the zero data insertion unit and the data inversion unit to the N-bit width data including the end position are set as calculation target data. Parallel CRC calculation means (24) for performing a CRC calculation based on a generator polynomial of degree from a state of an initial value 0 ;
A calculation result obtained by performing a CRC calculation based on the generator polynomial of the degree with respect to data configured by adding 0 data after data having no error in a CRC calculation based on the generator polynomial of the degree, A reference data storage means (27) which stores in advance for each number of the added 0 data;
The reference data corresponding to the number of zero data inserted after the end position of the detection target data by the zero data insertion unit is read from the reference data storage unit, and the read reference data and the calculation result of the parallel CRC calculation unit are read. A determination unit (28) for determining whether or not the detection target data has an error by comparing the data with the error detection data.
Nビット幅(Nは複数)で並列入力されるデータ列で構成されるフレームデータと、該フレームデータ内のCRC計算による誤り検出の対象となる検出対象データの先頭位置と終了位置を示す情報とを受けて、該検出対象データの誤りを検出する誤り検出装置において、
誤りの無いデータに対する前記CRC計算の生成多項式で決まる固有の計算結果を相殺するための相殺データを、前記Nビット幅で入力されるフレームデータのうちの前記検出対象データの前記終了位置の直後に挿入する相殺データ挿入手段(41)と、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置を含むNビット幅のデータの最上位から前記先頭位置の直前位置までの範囲と、前記相殺データ挿入手段が挿入する相殺データの挿入最終位置を含むNビット幅のデータの前記挿入最終位置の直後から最下位までの範囲に0のデータを連続挿入するゼロデータ挿入手段(22′)と、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置からCRC計算に用いる生成多項式の次数に等しいビット分のデータを反転加工するデータ反転手段(23)と、
前記相殺データ挿入手段、ゼロデータ挿入手段および前記データ反転手段によって加工された前記先頭位置を含むNビット幅のデータから前記相殺データの挿入最終位置を含むNビット幅のデータまでを計算対象データとし、該計算対象データに対して前記次数の生成多項式に基づくCRC計算を初期値0の状態から行う並列CRC計算手段(24)と、
前記並列CRC計算手段の計算結果が0のとき前記検出対象データに誤りが無く、0以外のとき前記検出対象データに誤りがあると判定する判定手段(28′)とを備えたことを特徴とする誤り検出装置。
Frame data composed of data strings input in parallel with an N-bit width (where N is a plurality); information indicating the start position and end position of detection target data to be subjected to error detection by CRC calculation in the frame data; In response, in the error detection device that detects an error of the detection target data,
Cancel data for canceling a unique calculation result determined by the generator polynomial of the CRC calculation with respect to error-free data is provided immediately after the end position of the detection target data in the frame data input with the N-bit width. Offset data insertion means (41) to be inserted;
In the frame data input with the N-bit width, the range from the top of the N-bit width data including the head position of the detection target data to the position immediately before the head position is inserted by the offset data insertion means. Zero data insertion means (22 ') for continuously inserting zero data in a range from immediately after the last insertion position of the N-bit data including the last insertion position of the offset data to the lowest position,
Data inversion means (23) for inverting data of bits equal to the degree of a generator polynomial used for CRC calculation from the head position of the detection target data in the frame data input with the N-bit width;
The data to be calculated includes data from the N-bit width including the head position processed by the offset data insertion unit, the zero data insertion unit and the data inversion unit to the N-bit width data including the insertion end position of the offset data. A parallel CRC calculation means (24) for performing a CRC calculation on the calculation target data based on the generator polynomial of the degree from an initial value of 0 ;
Determining means (28 ') for determining that there is no error in the detection target data when the calculation result of the parallel CRC calculation means is 0, and determining that there is an error in the detection target data when the calculation result is other than 0; Error detection device.
Nビット幅(Nは複数)で並列入力されるデータ列で構成されるフレームデータと、該フレームデータ内のCRC計算による誤り検出の対象となる検出対象データの先頭位置と終了位置を示す情報とを受けて、該検出対象データの誤りを検出する誤り検出装置において、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置を含むNビット幅のデータの最上位から前記先頭位置の直前位置までの範囲と、前記終了位置を含むNビット幅のデータの前記終了位置の直後から最下位までの範囲に0のデータを連続挿入するゼロデータ挿入手段(22)と、
前記Nビット幅で入力されるフレームデータのうち、前記検出対象データの前記先頭位置からCRC計算に用いる生成多項式の次数に等しいビット分のデータを反転するデータ反転手段(23)と、
前記ゼロデータ挿入手段および前記データ反転手段によって加工された前記先頭位置を含むNビット幅のデータから前記終了位置を含むNビット幅のデータまでを計算対象データとし、該計算対象データに対して前記次数の生成多項式に基づくCRC計算を初期値0の状態から行う並列CRC計算手段(24)と、
前記並列CRC計算手段の計算結果が0のとき前記検出対象データに誤りが無く、0以外のとき前記検出対象データに誤りがあると判定する判定手段(28′)とを備えたことを特徴とする誤り検出装置。
Frame data composed of data strings input in parallel with an N-bit width (where N is a plurality); information indicating the start position and end position of detection target data to be subjected to error detection by CRC calculation in the frame data; In response, in the error detection device that detects an error of the detection target data,
Among the frame data input with the N-bit width, a range from the top of the N-bit width data including the head position of the detection target data to a position immediately before the head position, and N bits including the end position. Zero data insertion means (22) for continuously inserting 0 data in a range from immediately after the end position of the width data to the lowest position;
Data inverting means (23) for inverting data of bits equal to the degree of a generator polynomial used for CRC calculation from the head position of the detection target data in the frame data input with the N-bit width;
The data from the N-bit width including the head position processed by the zero data insertion unit and the data inversion unit to the N-bit width data including the end position are set as calculation target data. Parallel CRC calculation means (24) for performing a CRC calculation based on a generator polynomial of degree from a state of an initial value 0 ;
Determining means (28 ') for determining that there is no error in the detection target data when the calculation result of the parallel CRC calculation means is 0, and determining that there is an error in the detection target data when the calculation result is other than 0; Error detection device.
JP2001232463A 2001-07-31 2001-07-31 Error detection device Expired - Fee Related JP3554715B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001232463A JP3554715B2 (en) 2001-07-31 2001-07-31 Error detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001232463A JP3554715B2 (en) 2001-07-31 2001-07-31 Error detection device

Publications (2)

Publication Number Publication Date
JP2003046393A JP2003046393A (en) 2003-02-14
JP3554715B2 true JP3554715B2 (en) 2004-08-18

Family

ID=19064387

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001232463A Expired - Fee Related JP3554715B2 (en) 2001-07-31 2001-07-31 Error detection device

Country Status (1)

Country Link
JP (1) JP3554715B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016518750A (en) * 2013-03-15 2016-06-23 ザイリンクス インコーポレイテッドXilinx Incorporated Modular and scalable cyclic redundancy check calculation circuit

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100645388B1 (en) 2005-11-30 2006-11-14 한국전자통신연구원 Parallel cyclic redundancy check generator and method capable of parallel processing of arbitrary size
JP2009094605A (en) * 2007-10-04 2009-04-30 Oki Semiconductor Co Ltd Code error detector and error detecting code generator
US8892983B2 (en) * 2008-11-04 2014-11-18 Alcatel Lucent Method and apparatus for error detection in a communication system
JP6354489B2 (en) * 2014-09-22 2018-07-11 富士通株式会社 Debug circuit, semiconductor device, and debugging method
JP6477134B2 (en) 2015-03-27 2019-03-06 富士通株式会社 Debug circuit, semiconductor device, and debugging method
JP6648412B2 (en) * 2015-04-14 2020-02-14 富士通株式会社 CRC code operation circuit, method therefor, and semiconductor device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016518750A (en) * 2013-03-15 2016-06-23 ザイリンクス インコーポレイテッドXilinx Incorporated Modular and scalable cyclic redundancy check calculation circuit

Also Published As

Publication number Publication date
JP2003046393A (en) 2003-02-14

Similar Documents

Publication Publication Date Title
US4809273A (en) Device for verifying operation of a checking code generator
JP4028575B2 (en) Apparatus and method for error detection in multiple word communication
JP3554715B2 (en) Error detection device
US7168024B2 (en) Data processing system and method
US6938201B2 (en) Error detection system for a FIFO memory
US7373525B2 (en) Data processing method and data checking method
US6795946B1 (en) Fast frame error checker for multiple byte digital data frames
JP2006254429A (en) Method and means for checking fault-free transmission data
JP3263671B2 (en) Error detection device
JP2004120675A (en) Test packet generating apparatus
US5745510A (en) System for detecting frame/burst synchronization and channel error using cyclic code
JPH09246995A (en) Code error detection circuit
JP5322433B2 (en) Error detection method and control system during data processing in processing system
JPH04302242A (en) Method and apparatus for signal transmission
JP3661089B2 (en) Error correction apparatus, error correction method, and recording medium
KR100397095B1 (en) Error-detecting device and method thereof
JP3071482B2 (en) Error correction circuit of packet receiver
JP2004173199A (en) Error correction circuit using cyclic code
JPH03272224A (en) Information signal processing method
JPH08340342A (en) Method for verifying checksum in received data block and implementing method therefor
JP3398560B2 (en) Shortened error correction decoding device
JP2003087224A (en) Error detection circuit and its method
CN117785782A (en) Data detection method, device, equipment and medium based on NVMe 2.0 protocol
JPH0629865A (en) Decoder of double-length signal error corrected double error detection reed-solomon code
JP2000232448A (en) Test device and test method

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040427

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040510

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313532

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090514

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090514

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100514

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110514

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110514

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120514

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130514

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140514

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees