JPH05257821A - Check sum calculating circuit - Google Patents

Check sum calculating circuit

Info

Publication number
JPH05257821A
JPH05257821A JP4053689A JP5368992A JPH05257821A JP H05257821 A JPH05257821 A JP H05257821A JP 4053689 A JP4053689 A JP 4053689A JP 5368992 A JP5368992 A JP 5368992A JP H05257821 A JPH05257821 A JP H05257821A
Authority
JP
Japan
Prior art keywords
addition
memory card
circuit
data
register
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
Application number
JP4053689A
Other languages
Japanese (ja)
Inventor
Yasuki Ota
泰樹 太田
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.)
Mitsubishi Plastics Inc
Original Assignee
Mitsubishi Plastics Inc
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 Mitsubishi Plastics Inc filed Critical Mitsubishi Plastics Inc
Priority to JP4053689A priority Critical patent/JPH05257821A/en
Publication of JPH05257821A publication Critical patent/JPH05257821A/en
Pending legal-status Critical Current

Links

Landscapes

  • Detection And Correction Of Errors (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

PURPOSE:To prevent a check sum from being miscalculated even by a calculating circuit composed of hardware even when complicate processing is performed by selecting and supplying two addition clocks, generated at the time of only reading and only writing, from the control signal of an IC memory card. CONSTITUTION:An adder 4 cumulatively adds the data from a data line to the output data of a register 5 and inputs the result to the register 5. The register 5 latches the addition result from the adder 4 with the addition clock signal from a switching circuit 6. The card control signal for the IC memory card 2 consists of the inverse of CE, the inverse of WE, and the inverse of OE, which are combined by gate circuits 7 and 8 to generate a clock signal for reading and a clock signal for writing. Those two signals are selected by the switching circuit 6 according to a switching signal and inputted to the addition clock input of the register 5 of a cumulative adding circuit 1.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はICメモリカードとこれ
を接続する機器間のインタフェース回路に設けるチェッ
クサム計算回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a checksum calculation circuit provided in an interface circuit between an IC memory card and a device connecting the IC memory card.

【0002】[0002]

【従来の技術】ICメモリカードの信頼度をチェックす
る手段として、同カード内メモリの一部または全部のデ
ータブロックのチェックサムの値を予め調べておいた値
と比較する方法が知られている。即ち、予め、ICメモ
リカードのデータブロックのチェックサムの値を調べて
置き、そのデータブロックを読み出す時に、そのデータ
ブロックのチェックサムを計算して、予め調べておいた
値と比較することにより、その読み出されたデータブロ
ックのデータ誤り検出を行い、そのデータブロックの信
頼度を評価する方法である。また、SRAMなどの書換
可能なメモリを使用したICメモリカードでは、データ
ブロックのチェックサムがデータを書込む度に変化する
ので、書込時にもチェックサムを計算する必要がある。
チェックサムの計算は、ICメモリ関係では、通常、デ
ータブロックの各データを全て加算した値を使用する。
2. Description of the Related Art As a means for checking the reliability of an IC memory card, there is known a method of comparing the checksum value of a part or all of the data blocks of the memory in the card with a value which has been checked in advance. .. That is, by checking the value of the checksum of the data block of the IC memory card in advance, and when reading the data block, the checksum of the data block is calculated and compared with the value checked in advance. This is a method of detecting the data error of the read data block and evaluating the reliability of the data block. Further, in an IC memory card using a rewritable memory such as SRAM, the checksum of the data block changes every time data is written, so it is necessary to calculate the checksum also at the time of writing.
The checksum calculation normally uses a value obtained by adding all the respective data of the data block in relation to the IC memory.

【0003】従来、このチェックサムの計算は、機器に
組み込まれているマイクロコンピュータで、ソフト的に
処理するか、ICメモリカードのデータラインに接続さ
れたハード的な計算回路で計算していた。また、従来の
ハード的な計算回路は、ICメモリカードにアクセスす
る度にそのデータを累積加算するものであった。
Conventionally, the calculation of the checksum has been carried out by a microcomputer incorporated in the device by software or by a hardware calculation circuit connected to the data line of the IC memory card. Further, the conventional hardware-like calculation circuit cumulatively adds the data each time the IC memory card is accessed.

【0004】[0004]

【発明が解決しようとする課題】従来、チェックサムの
計算をソフト的に処理する場合は、柔軟な処理が可能だ
が、処理時間がかかりスピードが遅くなるという欠点が
あった。また、従来のハード的な計算回路は、ICメモ
リ回路にアクセスする度に、書込まれるデータまたは、
読込まれるデータを累積加算していたため、単純なデー
タブロックの書込時や読込時には、問題無く使用できた
ものの、複雑な処理が必要なときは誤計算してしまい使
えなかった。例えば、SRAMなどのように書換可能な
メモリを使用したICメモリカードに、データブロック
を書込む場合、一つのデータを書込む毎にそのデータを
読込んで、ベリファイしながらデータを書いて行くとい
うことは、通常よく行われる処理であるが、このような
場合、従来のハード的な計算回路では、一つのデータ
を、書込みの時とベリファイのための読込み時に、二回
加算してしまうので、正確な結果を得られなくなる。
Conventionally, when the checksum calculation is processed by software, flexible processing is possible, but there is a drawback that the processing takes time and the speed becomes slow. In addition, the conventional hardware-based calculation circuit writes data to be written each time the IC memory circuit is accessed, or
Since the data to be read was cumulatively added, it could be used without problems when writing or reading a simple data block, but when complicated processing was required, it was miscalculated and could not be used. For example, when writing a data block to an IC memory card that uses a rewritable memory such as SRAM, the data is read every time one data is written, and the data is written while verifying. Is a process that is usually performed, but in such a case, in a conventional hardware calculation circuit, one data is added twice at the time of writing and at the time of reading for verification, so it is accurate. It will not be possible to obtain such a result.

【0005】そこで本発明の目的は以上のような問題を
解消したチェックサム計算回路を提供することにある。
Therefore, an object of the present invention is to provide a checksum calculation circuit that solves the above problems.

【0006】[0006]

【課題を解決するための手段】上記目的を達成するため
本発明はICメモリカードと機器間のインタフェース回
路において、前記ICメモリカードのデータライン上の
データを累積加算する累積加算回路と、前記ICメモリ
カードの制御信号から、前記ICメモリカードに対する
読込時のみに発生する加算クロックと、書込時にのみに
発生する加算クロックとを作成する加算クロック作成手
段と、該加算クロック作成手段からの二つの加算クロッ
クのいずれかを選択して前記累積加算回路に加算タイミ
ングを与える加算クロックとして供給する手段とを具え
たことを特徴とする。
To achieve the above object, the present invention relates to an interface circuit between an IC memory card and a device, and a cumulative addition circuit for cumulatively adding data on a data line of the IC memory card, and the IC. From the control signal of the memory card, an addition clock generating means for generating an addition clock generated only when reading the IC memory card and an addition clock generating only when writing to the IC memory card, and two addition clock generating means Means for selecting any one of the addition clocks and supplying it as an addition clock for giving an addition timing to the cumulative addition circuit.

【0007】[0007]

【作用】本発明によれば、チェックサムの計算を行う累
積加算回路の加算タイミングを与える加算クロックとし
て、ICメモリカードの制御信号から、ICメモリカー
ドに対する読込時のみに発生する加算クロックと、書込
時にのみに発生する加算クロックとを作成し、この二つ
の加算クロックのいずれかを選択して累積加算回路に与
える。このようにすることによって、例えば、SRAM
メモリを使用した書換可能なICメモリカードに、デー
タブロックを書込む際に、一つのデータを書込む毎に、
ベリファイをしながら書込んでも、チェックサムの誤計
算は発生しない。即ち、書込時のみに発生する加算クロ
ックを累積加算回路に加えれば、ベリファイ時にデータ
を読込んでも累積加算回路に加算クロックは加わらない
ので、累積加算回路の計算結果は変化しない。従って、
累積加算はデータブロックの書込時のみに行われるの
で、チェックサムの誤計算は起きない。以上のように、
本発明によれば、ハード的な計算回路でも複雑な処理を
してもチェックサムの誤計算を防止できる。上記の例以
外のケースでも、本発明により加算クロックを切り換え
ることにより、一般的な処理の場合は正確にチェックサ
ムを計算できる。
According to the present invention, as an addition clock for giving the addition timing of the cumulative addition circuit for calculating the checksum, an addition clock generated only when the IC memory card is read from the control signal of the IC memory card is written. And an addition clock that is generated only at the time of incorporation, and one of these two addition clocks is selected and given to the cumulative addition circuit. By doing so, for example, SRAM
When writing a data block to a rewritable IC memory card using memory, each time one data is written,
Even if data is written while verifying, the checksum will not be miscalculated. That is, if the addition clock generated only at the time of writing is added to the cumulative addition circuit, the addition clock is not added to the cumulative addition circuit even if the data is read at the time of verification, so the calculation result of the cumulative addition circuit does not change. Therefore,
Since cumulative addition is performed only when writing a data block, erroneous checksum calculation does not occur. As mentioned above,
According to the present invention, erroneous calculation of a checksum can be prevented even if a hardware calculation circuit or complicated processing is performed. In cases other than the above example, the checksum can be accurately calculated in the case of general processing by switching the addition clock according to the present invention.

【0008】[0008]

【実施例】以下、本発明の実施例を図面に従って説明す
る。図1は、本発明によるチェックサム計算回路を示
す。ICメモリカード2は、カードコネクタ3に装着さ
れ、このコネクタ3を介して本体機器のインタフェース
回路20に接続される。インタフェース回路20におい
て、1は累積加算回路であって、データライン10から
のデータを入力する加算器4とレジスタ5とから構成さ
れる。加算器4はデータライン10からのデータをレジ
スタ5の出力データに累積加算し、レジスタ5に入力す
る。レジスタ5は切換回路6からの加算クロック信号に
より加算器4からの加算結果をラッチする。レジスタ5
には累積加算結果が残されるので、この値を計算結果読
込ライン12から適切な時に読込むことによりチェック
サムの計算結果を読込める。また、このレジスタ5を計
算結果クリア信号によってクリアすることにより計算結
果をクリアできる。本実施例では、ICメモリカード2
に対するカード制御信号は、反転CE信号、反転WE信
号、反転OE信号から構成され、それぞれICメモリカ
ード2のチップイネーブル信号、ライトイネーブル信
号、アウトプットイネーブル信号を示す。これらの信号
をゲート回路7,8で組み合わせて読込時クロック信号
と書込時クロック信号を作成する。この二つの信号を切
換信号に基づいて切換回路6で選択して累積加算回路1
のレジスタ5の加算クロック入力に入力する。11はカ
ードアドレスラインであって、カードアドレス信号をI
Cメモリカード2のアドレス信号入力に入力する。な
お、以上のようなチェックサム計算回路に入出力する前
記各信号は、本体機器内の処理装置に入出力される。同
処理装置は、CPUと、このCPUの制御プログラムを
格納したROMと、ワークエリアを有するRAMとを具
えており、制御プログラムに従って入出力信号を制御す
る。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 shows a checksum calculation circuit according to the present invention. The IC memory card 2 is attached to the card connector 3 and is connected to the interface circuit 20 of the main device via the connector 3. In the interface circuit 20, 1 is a cumulative addition circuit, which is composed of an adder 4 for inputting data from the data line 10 and a register 5. The adder 4 cumulatively adds the data from the data line 10 to the output data of the register 5 and inputs it to the register 5. The register 5 latches the addition result from the adder 4 by the addition clock signal from the switching circuit 6. Register 5
Since the cumulative addition result remains, the checksum calculation result can be read by reading this value from the calculation result reading line 12 at an appropriate time. Further, the calculation result can be cleared by clearing the register 5 with the calculation result clear signal. In this embodiment, the IC memory card 2
The card control signal for is composed of an inverted CE signal, an inverted WE signal, and an inverted OE signal, and indicates a chip enable signal, a write enable signal, and an output enable signal of the IC memory card 2, respectively. These signals are combined in the gate circuits 7 and 8 to create a read clock signal and a write clock signal. These two signals are selected by the switching circuit 6 based on the switching signal, and the cumulative addition circuit 1
Input to the addition clock input of the register 5. Reference numeral 11 is a card address line for transmitting a card address signal
Input to the address signal input of the C memory card 2. The signals input to and output from the checksum calculation circuit as described above are input to and output from the processing device in the main device. The processor comprises a CPU, a ROM storing a control program for the CPU, and a RAM having a work area, and controls input / output signals according to the control program.

【0009】図2によって本チェックサム計算回路の動
作例を説明する。すなわち、図2は、SRAMカードな
どの書換可能なICメモリカード2にデータブロックを
書込み、また、このデータブロックを読み出すときに、
本チェックサム計算回路によりチェックサムを計算し、
データ誤りをチェックするフローを示す。
An operation example of the checksum calculation circuit will be described with reference to FIG. That is, FIG. 2 shows that when a data block is written to and read from a rewritable IC memory card 2 such as an SRAM card,
This checksum calculation circuit calculates the checksum,
The flow which checks a data error is shown.

【0010】まずS1において、ICメモリカード2に
データブロックを書込むときには、切換回路6が書込時
クロック信号を出力するように切換信号を設定する。書
込時クロック信号は、書込時にしか出力されないので、
データブロックの書込中にデータのベリファイ(照合)
のため読込みを行なってもチェックサムの計算が間違う
ことはない。次に、S2において、データブロック書込
み直前に、チェックサム計算結果つまり累積加算回路1
のレジスタ5をクリアする。ついでS3において、デー
タブロックAにデータを書込むと、累積加算回路1のレ
ジスタ5に、データブロックのチェックサム計算結果が
残る。S4でこれを読み込んで、S5でICメモリカー
ド2の所定の場所(アドレス)に書込んでおく。これに
よってデータブロックの読込時に、書込時のチェックサ
ムがわかり、読込時のチェックサムと比較できる。つい
でS6で切換信号によって切換回路6から読込時クロッ
ク信号を出力し、S7でレジスタ5内のチェックサム計
算結果をクリアし、S8でICメモリカード2のデータ
ブロックAのデータを読込み、S9でこの読込み時にお
いてレジスタ5に得られたデータブロックのチェックサ
ム計算結果を読込み、S10でICメモリカード2から
S5で書込んだ書込時のチェックサム計算結果を読込
み、S11で書込時のチェックサム計算結果と読込時の
チェックサム計算結果とを比較し、両者が一致のときは
S12で読込んだデータブロックが正常に判断し、不一
致のときはS13で読込んだデータブロックが異常と判
断し、終了する。
First, in S1, when a data block is written in the IC memory card 2, the switching signal is set so that the switching circuit 6 outputs the clock signal during writing. Since the clock signal at the time of writing is output only at the time of writing,
Verify data while writing data block
Therefore, the checksum calculation will not be incorrect even if you read it. Next, in S2, immediately before writing the data block, the checksum calculation result, that is, the cumulative addition circuit 1
Clear register 5 of. Then, in S3, when data is written in the data block A, the checksum calculation result of the data block remains in the register 5 of the cumulative addition circuit 1. This is read in S4 and written in a predetermined location (address) of the IC memory card 2 in S5. As a result, when reading the data block, the checksum at the time of writing can be known and compared with the checksum at the time of reading. Then, in S6, the read-out clock signal is output from the switching circuit 6 by the switching signal, the checksum calculation result in the register 5 is cleared in S7, the data of the data block A of the IC memory card 2 is read in S8, and this is read in S9. At the time of reading, the checksum calculation result of the data block obtained in the register 5 is read, the checksum calculation result at the time of writing written from the IC memory card 2 to S5 at S10 is read, and the checksum at the time of writing at S11. The calculation result and the checksum calculation result at the time of reading are compared, and when the two match, it is determined that the data block read in S12 is normal, and when they do not match, it is determined that the data block read in S13 is abnormal. ,finish.

【0011】[0011]

【発明の効果】以上説明したように、本発明によるチェ
ックサム計算結果を用いれば、ICメモリカードのデー
タの複雑な処理を伴う、読込時または書込時にもチェッ
クサムの誤計算を防止できる。
As described above, by using the checksum calculation result according to the present invention, it is possible to prevent erroneous checksum calculation at the time of reading or writing, which involves complicated processing of data in the IC memory card.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明実施例のブロック図である。FIG. 1 is a block diagram of an embodiment of the present invention.

【図2】同実施例の動作を示すフローチャートである。FIG. 2 is a flowchart showing the operation of the same embodiment.

【符号の説明】[Explanation of symbols]

1 累積加算回路 2 ICメモリカード 4 加算器 5 レジスタ 6 切換回路 7,8 ゲート回路 1 Cumulative addition circuit 2 IC memory card 4 Adder 5 Register 6 Switching circuit 7, 8 Gate circuit

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 ICメモリカードと機器間のインタフェ
ース回路において、前記ICメモリカードのデータライ
ン上のデータを累積加算する累積加算回路と、前記IC
メモリカードの制御信号から、前記ICメモリカードに
対する読込時のみに発生する加算クロックと、書込時に
のみに発生する加算クロックとを作成する加算クロック
作成手段と、該加算クロック作成手段からの二つの加算
クロックのいずれかを選択して前記累積加算回路に加算
タイミングを与える加算クロックとして供給する手段と
を具えたことを特徴とするチェックサム計算回路。
1. An interface circuit between an IC memory card and a device, a cumulative addition circuit for cumulatively adding data on a data line of the IC memory card, and the IC.
From the control signal of the memory card, an addition clock generating means for generating an addition clock generated only when reading the IC memory card and an addition clock generating only when writing to the IC memory card, and two addition clock generating means A checksum calculation circuit, comprising means for selecting any one of the addition clocks and supplying it as an addition clock for giving an addition timing to the cumulative addition circuit.
JP4053689A 1992-03-12 1992-03-12 Check sum calculating circuit Pending JPH05257821A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4053689A JPH05257821A (en) 1992-03-12 1992-03-12 Check sum calculating circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4053689A JPH05257821A (en) 1992-03-12 1992-03-12 Check sum calculating circuit

Publications (1)

Publication Number Publication Date
JPH05257821A true JPH05257821A (en) 1993-10-08

Family

ID=12949785

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4053689A Pending JPH05257821A (en) 1992-03-12 1992-03-12 Check sum calculating circuit

Country Status (1)

Country Link
JP (1) JPH05257821A (en)

Similar Documents

Publication Publication Date Title
JPS60164848A (en) Modeling method and apparatus
US5428768A (en) System for checking comparison check function of information processing apparatus
JPH0212445A (en) Storage device
JPS6222199B2 (en)
JPH05257821A (en) Check sum calculating circuit
US4410988A (en) Out of cycle error correction apparatus
JPH0316655B2 (en)
US6957370B2 (en) Digital signal processor including an interface therein capable of allowing direct access to registers from an external device
US6266626B1 (en) ROM data verification circuit
JPS63753A (en) Test system for memory error checking and correcting circuit
JPS6167162A (en) Memory-checking circuit
JPH01177146A (en) Memory checking circuit
SU1524055A1 (en) Device for checking programs
JP2908117B2 (en) Vector arithmetic processing unit
SU1376121A2 (en) Device for recording and checking programmed read-only memory
JP2002150795A (en) Semiconductor integrated circuit
JPS6235703B2 (en)
JPH0289300A (en) Semiconductor memory element
JPH0954766A (en) Microcomputer
JPH02126344A (en) Program processing time measuring system
JPS63163542A (en) Test circuit
JPH04273382A (en) Logic simulation system of lsi
JPS6136258B2 (en)
JPH05334116A (en) Debugging control system
JPH05233846A (en) Microprocessor

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees