JPH03186936A - Parity circuit - Google Patents

Parity circuit

Info

Publication number
JPH03186936A
JPH03186936A JP1325230A JP32523089A JPH03186936A JP H03186936 A JPH03186936 A JP H03186936A JP 1325230 A JP1325230 A JP 1325230A JP 32523089 A JP32523089 A JP 32523089A JP H03186936 A JPH03186936 A JP H03186936A
Authority
JP
Japan
Prior art keywords
parity
data
circuit
area
signal
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.)
Granted
Application number
JP1325230A
Other languages
Japanese (ja)
Other versions
JP2546002B2 (en
Inventor
Yasushi Suzuki
恭 鈴木
Nobuaki Takahachi
高蜂 宣明
Koji Kakimoto
浩二 柿本
Masaaki Saito
正明 斎藤
Toru Iwano
岩野 徹
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.)
Fujitsu General Ltd
Original Assignee
Fujitsu General Ltd
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 Fujitsu General Ltd filed Critical Fujitsu General Ltd
Priority to JP1325230A priority Critical patent/JP2546002B2/en
Publication of JPH03186936A publication Critical patent/JPH03186936A/en
Application granted granted Critical
Publication of JP2546002B2 publication Critical patent/JP2546002B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To eliminate a parity check memory by judging whether a non- coincidence bit is one or not at the time of comparison. CONSTITUTION:When a data area is abnormal, not '11(H)' but '10(H)' is written and a parity area is normal, '11(H)' of parity data 2 in the parity area is latched by a latch circuit 9 as it is. Then, data '10(H)' in the data area is read, and the data and latched parity data are compared. Since a non- coincidence signal is outputted to an interruption F/F circuit 12, an interruption signal is outputted to CPU 1. Consequently, an interruption processing is executed in CPU 1 and inversion whether data or parity data is different or not based on judgement whether the number of non-coincident bits is one or not is executed by a comparison part 10. Thus, the parity check memory is eliminated.

Description

【発明の詳細な説明】 [産業上の利用分野] この発明はデータに基づいてパリティを求め、このパリ
ティとデータとによりパリティチェックを行なう新規な
パリティ回路に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a novel parity circuit that determines parity based on data and performs a parity check using this parity and data.

[従 来 例] 従来、コンピュータ等におけるデータの書き込み、読み
出しに際し、例えばそのデータの最上位ビットにパリテ
ィピットを付加するが、このパリティピッ1〜はそのデ
ータの′l″の総数を常に偶数あるいは奇数にするよう
に決められ、この偶数あるいは奇数によりデータチェッ
クを行なっている。
[Conventional example] Conventionally, when writing or reading data in a computer or the like, a parity pit is added to the most significant bit of the data. Data is checked using this even or odd number.

そこで、第11図に示されるように、コンピュータ等の
CPUIにてデータがデータバス2を介してメモリ部(
例えばRAM)3に書き込まれる場合、パリティ生成・
検査回路4にてそのデータのLL I TTの総数を偶
数あるいは奇数とするパリティが生成され、このパリテ
ィがパリティRAM部5に記憶される。そして、CPU
1にてデータ転送が行なわれると、つまりメモリ部3の
データがデータバス2を介して読み吊されると、上記パ
リティ生成・検査回路4にてそのデータに基づいて求め
た値とパリティ部5から読み出した値とが比較され、不
一・致のときにはエラーが発生され、割り込み信号がC
PUIに出力される。これにより、その割込みにより、
CPUIにてデータ転送を停Jに処理することができる
Therefore, as shown in FIG. 11, data is transferred to the memory section (
For example, when written to RAM) 3, parity generation and
The test circuit 4 generates a parity that makes the total number of LL I TT of the data an even or odd number, and this parity is stored in the parity RAM section 5 . And the CPU
When data is transferred in step 1, that is, when the data in the memory section 3 is read out via the data bus 2, the parity generation/check circuit 4 generates a value calculated based on the data and the parity section 5. The value read from C is compared with the value read from C.
Output to PUI. This causes that interrupt to
Data transfer can be stopped and processed using the CPUI.

[発明が解決しようとする課題] しかしならが、上記パリティ回路にあっては、メモリ部
3以外に新たなパリティRAM部5が必要であり、つま
り少なくとも一つのメモリを増加しなければならず、そ
の分コストアップになっていた。
[Problems to be Solved by the Invention] However, in the parity circuit described above, a new parity RAM section 5 is required in addition to the memory section 3, which means that at least one memory must be added. The cost increased accordingly.

また、最近の記憶素子、例えばDRAMは大宮3− 量化の傾1r+lにあり、小容胤のl) RA Mを手
に入れることが困難になっている。そのため、小システ
ムの場合でも、大宮址の1) RA Mをメモリ部3や
パリティ部5に用いることになり、D RA、 Mが有
効に利用されないだけでなく、不経済な而が生じるよう
になった。
Furthermore, recent memory elements, such as DRAM, are at a low quantification rate of 1r+l, making it difficult to obtain RAM. Therefore, even in the case of a small system, 1) RAM of the Omiya site is used for the memory section 3 and parity section 5, which not only does not effectively utilize the DRA and M, but also causes an uneconomical situation. became.

さらに、割込みによるエラー発生に際し、パリティ部5
に記憶されたパリティヒツトに誤りがあるのか、メモリ
部3に記憶されたデータに誤りかあるのか判断すること
ができなかった。
Furthermore, when an error occurs due to an interrupt, the parity section 5
It was not possible to determine whether there was an error in the parity hit stored in the memory section 3 or whether there was an error in the data stored in the memory section 3.

この発明は上記問題点に鉱みなされたものであり、その
目的はコストの低下を図り、かつ、メモリを有効に利用
することができるようにしたバリティロ路を提供するこ
とにある。
The present invention has been made in view of the above-mentioned problems, and its purpose is to provide a varitillo path that can reduce costs and make effective use of memory.

[課題を解決するための手段] 上記目的を達成するために、この発明は、メモリのデー
タを読み/Ji シ、上記データを転送するに際し、パ
リティをチェックし、このパリティチェックに基づいて
CPUに割込みをかけるパリティ回路において、上記メ
モリに設けられるデータエイ− リアおよびパリティエリアと、上記データあるいは上記
パリティエリアから読み出したパリティデータに基づい
てパリティを生成するパリティ生成手段と、このパリテ
ィに応じて上記データをパリティデータとして一ヒ記パ
リティエリアに書き込む際、若しくは上記パリティエリ
アのパリティデータを読み出した際、上記パリティデー
タを反転あるいは非反転とする排他的論理和手段と、こ
の排他的論理和手段を介したパリティデータと現に上記
データエリアから読み出されているデータとを比較し、
一致あるいは不一致信号を出力し、かつ、少なくとも不
一致ビットが一つであるか否かを判断する比較手段と、
この不一致信号により上記CPUに割込み信号を出力す
る割込み信号発生手段とを備えていることを要旨とする
[Means for Solving the Problems] In order to achieve the above object, the present invention checks parity when reading/transferring data in a memory and transmits data to a CPU based on this parity check. The parity circuit for generating an interrupt includes a data area and a parity area provided in the memory, a parity generating means for generating parity based on the data or parity data read from the parity area, and a parity generating means for generating parity based on the data or parity data read from the parity area. Exclusive OR means for inverting or non-inverting the parity data when writing data as parity data into the above parity area or reading parity data from the parity area; Compare the parity data sent through and the data actually read from the above data area,
Comparing means for outputting a match or mismatch signal and determining whether there is at least one mismatch bit;
The gist of the present invention is to include an interrupt signal generating means for outputting an interrupt signal to the CPU in response to the mismatch signal.

[作  用] 上記構成としたので、データをデータバスを介してメモ
リに書き込むに際しくライトサイクルによるデータの書
き込みに際し)、そのデータに基づいてパリティが生成
され、そのデータのtry”の数か求められる。そのパ
リティは、例えば奇数であれば工”にされ、偶数であれ
ばO′″にされ、このパリティが一時記憶される。その
パリティに基づいて十記データが反転あるいは非反転に
され、この反転あるいは非反転データがパリティデータ
とされ、このパリティデータによりパリティエリアの所
定領域(書き込みデータに対応するアドレス)が書き替
えられる。その後、−1−記パリティの一時記憶がクリ
アされ、−上記データがそのままデータエリアに書き込
まれる。
[Operation] With the above configuration, when data is written to the memory via the data bus (when data is written by a write cycle), parity is generated based on the data, and the number of tries for that data is calculated. For example, if the number is odd, the parity is set to "0", and if the number is even, it is set to O'", and this parity is temporarily stored. Based on the parity, the data is inverted or non-inverted, This inverted or non-inverted data is used as parity data, and a predetermined area of the parity area (address corresponding to the write data) is rewritten with this parity data.Then, the temporary storage of the parity described in -1- is cleared, and - The data is written to the data area as is.

このように、データエリアには通常通りにデータが書き
込まれ、またそのパリティエリアの所定領域は上記反転
あるいは非反転データのパリティデータで書き替えられ
る。
In this way, data is written in the data area as usual, and a predetermined area of the parity area is rewritten with the above-mentioned inverted or non-inverted parity data.

そして、1;記メモリのデータを読み出すに際しくリー
ドサイクルによるデータの読み出しに際し)、まずパリ
ティエリアのパリティデータが読み出され、このパリテ
ィデータに基づいてパリティが生成される。この場合、
パリティエリアのパリティデータが異常であれば、LL
 I I+の数が奇数になることから、そのパリティデ
ータによりパリティ11 ]−TIが得られ、またパリ
ティエリアか正常であれば、そのパリティ“0″が得ら
れ、このパリティが一時記憶される。続いて、読み出さ
れたパリティデータはそのパリティに基づいて反転、あ
るいは非反転されてラッチされる。その後、現に読み出
されているデータとラッチされたパリティデータとが比
較され、一致あるいは不一致信号が出力される。
Then, in (1) when reading data from the memory by a read cycle), parity data in the parity area is first read, and parity is generated based on this parity data. in this case,
If the parity data in the parity area is abnormal, LL
Since the number of I I+ is odd, the parity 11 ]-TI is obtained from the parity data, and if the parity area is normal, the parity "0" is obtained and this parity is temporarily stored. Subsequently, the read parity data is inverted or non-inverted based on the parity and latched. Thereafter, the currently read data and the latched parity data are compared, and a match or mismatch signal is output.

また、その比較に際し、不一致ピッ1−の数が−っであ
るか否かの判断が行われる。
Further, during the comparison, it is determined whether the number of unmatched pins is -.

[実 施 例] 以下、この発明の実施例を第工図乃至第10図に基づい
て説明する。なお、第1図中、第11図と同一部分およ
び相当部分には同一符号を付し、重複説明を省略する。
[Example] Hereinafter, an example of the present invention will be described based on the drawings 1 to 10. In FIG. 1, the same parts and corresponding parts as in FIG. 11 are denoted by the same reference numerals, and redundant explanation will be omitted.

第1図において、パリティ回路には、データエリアおよ
びパリティエリアを備えたメモリ部3と、書ぎ込むデー
タをメモリ部3に出力し、読み出したデータをデータバ
ス2に出力し、かつ、後述するパリティデータを反転、
あるいは非反転して出7− カする排他的論理和回路6と、書き込むデータあるいは
読み出したパリティデータに基づいてパリティを生成す
るパリティ生成回路7と、この生成パリティを一時記憶
し、この記憶したパリティに応じて、1記排弛的論理和
回路6を反転、あるいは非反転出力動作とするパリティ
F/F回路8と、♂lみ出したパリティデータをラッチ
するラッチ回路9と、ラッチしたパリティデータと現に
データバス2上に読み出されているデータとを比較し、
一致あるいは不一致信号を出力し、かつ、不一致ピッ1
〜数が一つであるか否かを判断する比較部10と、ラッ
チしたパリティデータをデータバス2」二にのせるスリ
ーステート回路11と、比較部IOからの不一致信号に
より割込み信号をCPU 1に出力する割込みF / 
F回路12と、CPU工のクロック(φ)信号、メモリ
部3、パリティF/F回路8、ラッチ回路9、比較部1
0および割込みF/F回路12のタイミング信号を発生
するタイミング回1%13と、アドレスバス上のアドレ
スをデコードし、メモリ部3のチップセレクト(CS)
信号およびスリースチー1−回路11のイネーブル信号
を出力するデコーダ14とが備えられている。
In FIG. 1, the parity circuit includes a memory section 3 having a data area and a parity area, outputting data to be written to the memory section 3, outputting read data to a data bus 2, and outputting data to be written to the memory section 3, as will be described later. Invert parity data,
Alternatively, an exclusive OR circuit 6 that outputs the non-inverted data, a parity generation circuit 7 that generates parity based on write data or read parity data, and a parity generation circuit 7 that temporarily stores the generated parity and stores the stored parity. A parity F/F circuit 8 that makes the exclusive OR circuit 6 perform an inverting or non-inverting output operation according to Compare the data currently being read out on data bus 2,
Outputs a match or mismatch signal, and also outputs a match or mismatch signal.
A comparison unit 10 that determines whether the number is one, a three-state circuit 11 that puts the latched parity data on the data bus 2, and an interrupt signal sent to the CPU 1 by a mismatch signal from the comparison unit IO. Interrupt F/
F circuit 12, CPU clock (φ) signal, memory section 3, parity F/F circuit 8, latch circuit 9, comparison section 1
0 and the timing 1% 13 that generates the timing signal of the interrupt F/F circuit 12 and the chip select (CS) of the memory section 3 that decodes the address on the address bus.
A decoder 14 that outputs a signal and an enable signal for the three-chip circuit 11 is provided.

なお、排他的論理和回路6には、例えば第2図に示され
ているように、二つのFOR回路6a、6bおよびスリ
ースチー1〜バツフア回路6 c、 6 dとによる回
路がデータバス2のビット数だけ設けられ、パリティF
/F回路8の状態(II l 71 、11 Q 11
)に応じ、書き込みあるいは読み出したパリティデータ
を反転、非反転とする。
Note that, as shown in FIG. 2, for example, the exclusive OR circuit 6 includes a circuit including two FOR circuits 6a and 6b and three-chip 1 to buffer circuits 6c and 6d. Parity F
/F circuit 8 state (II l 71 , 11 Q 11
), the written or read parity data is inverted or non-inverted.

次に、上記構成のパリティ回路の動作を第3図および第
4図のタイムチャート図、第5図乃至第10図のデータ
およびパリティデータの模式図に基づいて説明する。
Next, the operation of the parity circuit having the above configuration will be explained based on the time charts of FIGS. 3 and 4 and the data and parity data schematic diagrams of FIGS. 5 to 10.

ます、第3図に示すライトサイクルに基づいてデータの
書き込みが実行されているものとすると、CPLj 1
にてアドレスが出力され(同図(b)に示す)、このア
ドレスによりデコーダ14からはメモリ部3にチップセ
レクト信号が出力される(同図(d)に示す)。このと
き、タイミング回路13からはタイミング信号aがクロ
ック(φ)のT□がらTtiタイミングまで“H”レベ
ルにされ、つまりアドレスの最上位ビットがII HI
Iにされ(同図(i)に示す)、その“H”の間、アド
レスはメモリ部3のパリティエリアを指示することにな
る。一方、パリティ生成回路7にて、書き込むデータに
基づいて′1″の数が奇数であるか偶数であるかの判断
が行われ、例えばその数が奇数である場合“1”のパリ
ティが生成され、偶数である場合II OIIのパリテ
ィが生成され、パリティF’ / F回路8に出力され
る。
Assuming that data writing is executed based on the write cycle shown in FIG. 3, CPLj 1
An address is outputted at (shown in FIG. 3(b)), and a chip select signal is outputted from the decoder 14 to the memory section 3 based on this address (as shown in FIG. 2(d)). At this time, the timing signal a from the timing circuit 13 is set to "H" level from T□ of the clock (φ) to Tti timing, that is, the most significant bit of the address is set to II HI.
The address is set to I (shown in (i) of the same figure), and while it is at "H", the address indicates the parity area of the memory section 3. On the other hand, the parity generation circuit 7 determines whether the number of ``1'' is odd or even based on the data to be written. For example, if the number is odd, a parity of ``1'' is generated. , if the number is even, a parity of II OII is generated and output to the parity F'/F circuit 8.

続いて、タイミング回路13からはクロック(φ)の′
■゛2タイミングでタイミング信号Cが出力されるため
、上記パリティF / I”回路8にはその′1″ある
いはII Orrが一時記憶され(同図(e)および(
f)に示す)、このラッチデータにより排他的論理和回
路6は人力データを反転、あるいは非反転して出力する
ことになる。また、タイミング回路13からはクロック
(φ)のTwのタイミングでタイミング信号b、つまり
ライト・イネーブル信号が゛′L″レベルにされるため
(同図(g)に示す)、メモリ部3が書き込み可能状態
にされ、データバス2上にあるデータが排他的論理和回
路6を介してパリティデータにされ、このパリティデー
タによりパリティエリアの所定領域(書き込みデータに
対応するアドレス)が書き替えられる。この場合、パリ
ティ生成部7にてパリティ“王”が生成されていると、
排他的論理和回路6にてデータバス2上のデータが反転
されてパリティエリアに書き込まれ、またパリティ“0
”が生成されていると、データバス2上のデータがその
ままパリティデータにされ、このパリティデータにより
パリティエリアの所定領域が書き替えられる。
Next, the timing circuit 13 outputs the clock (φ)'
■ Since the timing signal C is output at 2 timings, the parity F/I" circuit 8 temporarily stores its 1" or II Orr ((e) and () in the same figure).
f)), this latch data causes the exclusive OR circuit 6 to invert or non-invert the manual data and output it. Furthermore, since the timing signal b, that is, the write enable signal, is set to the "L" level from the timing circuit 13 at the timing Tw of the clock (φ) (as shown in FIG. The data on the data bus 2 that is enabled is converted into parity data via the exclusive OR circuit 6, and a predetermined area of the parity area (address corresponding to the write data) is rewritten with this parity data. In this case, if the parity “king” is generated in the parity generation unit 7,
The data on the data bus 2 is inverted by the exclusive OR circuit 6 and written to the parity area, and the parity is "0".
” is generated, the data on the data bus 2 is directly converted into parity data, and a predetermined area of the parity area is rewritten with this parity data.

続いて、クロック(φ)の1゛wタイミング以後、タイ
ミング回路13からはタイミング信号a、つまりアドレ
スの最」二値ビットがIL L I+レベルにされ、タ
イミング信号b、つまりライ1−・イネーブル信号がク
ロック(φ)のT、タイミングで11 L IIレベル
にされ(同図(g)に示す)、またタイミング信号すの
最初のパルスの立上りタイミングでパリティF/F回路
8がクリアされるため(同図(f)に示す)。
Subsequently, after the 1゛w timing of the clock (φ), the timing signal a from the timing circuit 13, that is, the highest binary bit of the address, is set to the ILL L I+ level, and the timing signal b, that is, the write 1- enable signal. is set to the 11L II level at the T timing of the clock (φ) (as shown in (g) in the figure), and the parity F/F circuit 8 is cleared at the rising timing of the first pulse of the timing signal ( (shown in figure (f)).

排他的論理和回路6は非反転動作となり、かつ、11− アドレスはメモリ部3のデータエリアを指示することに
なる。このとき、排他的論理和回路6はデータバス2上
のデータをそのままメモリ部3に出力することから、書
き込みデータがデータエリアの所定領域に書き込まれる
The exclusive OR circuit 6 operates in a non-inverting manner, and the 11- address indicates the data area of the memory section 3. At this time, the exclusive OR circuit 6 directly outputs the data on the data bus 2 to the memory section 3, so that the write data is written to a predetermined area of the data area.

すなわち、ライl−サイクルにおいては、クロック(φ
)のT、、T、、Tωタイミンクでパリティが生成され
、反転あるいは非反転のパリティデータがパリティエリ
アに書き込まれ、タロツク(φ)のTW以後に、非反転
データがデータエリアに書き込まれる。
That is, in the life l-cycle, the clock (φ
Parity is generated at T, , T, , Tω timing of ), inverted or non-inverted parity data is written to the parity area, and non-inverted data is written to the data area after TW of tarok (φ).

一方、データエリアのデータを読みX1シシて転送する
ため、第4同に示すリードサイクルに基づいてデータの
読み出しが実行されるものとする。なお、データの“1
″の数が偶数になるように決められており、書き込みデ
ータが例えば1′11(H)”である場合、つまりデー
タの′1”の数が偶数である場合、第5図に示されてい
るように、メモリ部3が正常であり、データエリアおよ
びパリティエリアの所定アドレスに、同しデータ“土1
(+1)”が書12 き込まれているものとする。
On the other hand, in order to read the data in the data area and transfer it by X1, it is assumed that data reading is executed based on the fourth read cycle shown in the same figure. In addition, “1” of the data
If the write data is, for example, 1'11 (H)'', that is, if the number of '1's in the data is an even number, as shown in Figure 5. As shown in the figure, the memory unit 3 is normal and the same data “Sat1” is stored at the specified address in the data area and parity area.
(+1)” has been written in writing 12.

まず、cpu iにてアドレスが出力され(同図(b)
に示す)、そのアドレスによりデコーダ14からはメモ
リ部3のチップセレクト信号が出力される(同図(d)
に示す)。このとき、タイミング回路13からのタイミ
ング信号aはCPU 1のクロック(ψ)のTx、 r
 T 21 T wまでII HIIレベルにされ、つ
まりアドレスの最上位ピッ1〜がu I IIにされ(
同図(i)に示す)、またタイミング信号すはこのリー
ドサイクルの間LL HIIレベルにされるため(同図
(g)に示す)、そのタイミング信号aがLL HI+
レベルの間、アドレスはメモリ部3のパリティエリアを
指示することになる。したがって、上記アドレスにより
パリティエリアのパリティデータ1が読み出されるが、
メモリ部3が正常であるため、そのパリティデータ1は
’J l (H)”ということになる(同図(c)に示
す)。
First, the address is output from CPU i ((b) in the same figure).
), and the chip select signal for the memory unit 3 is output from the decoder 14 according to the address (see (d) in the same figure).
). At this time, the timing signal a from the timing circuit 13 is Tx of the clock (ψ) of the CPU 1, r
It is set to II HII level up to T 21 T w, that is, the most significant bits 1 to 1 of the address are set to u I II (
(shown in (i) of the same figure), and since the timing signal a is set to the LL HII level during this read cycle (as shown in (g) of the same figure), the timing signal a becomes LL HI+.
During the level, the address will point to the parity area of the memory section 3. Therefore, parity data 1 in the parity area is read by the above address, but
Since the memory unit 3 is normal, its parity data 1 is 'J l (H)' (as shown in FIG. 2(c)).

続いて、パリティ生成部7にてその読み出されたパリテ
ィデータ″1工(H)”の1′工〃の数が奇数であるか
偶数であるかが検出されるが、この場合偶数であること
から、バ°リティ]” / l=’回路8にはIf O
++が記憶され、排他的論理和回路6は非反転出力動作
にされる。すると、排他的論理和回路6を介したパリテ
ィデータ↓はそのまま”11(H)”(パリティデータ
2)ということになる(同図(c)に示す)。
Subsequently, the parity generation unit 7 detects whether the number of 1' steps of the read parity data "1 step (H)" is an odd number or an even number. In this case, it is an even number. Therefore, if O in circuit 8,
++ is stored, and the exclusive OR circuit 6 is set to non-inverting output operation. Then, the parity data ↓ passed through the exclusive OR circuit 6 becomes "11 (H)" (parity data 2) as it is (as shown in FIG. 3(c)).

このとき、タイミング回路13からはクロック(φ)の
Tt++でタイミング信号dが出力され(同図(j)に
示す)、この信号dによりその非反転パリティデータ2
の“11 (H)”がラッチ回路9にラッチされる(同
図(k)に示す)。その後、つまりクロック(φ)の1
゛す以後、タイミング信号dが“L”レベルにされ、パ
リティF/F回路8の出力が“O+ルーベルのままであ
るため、CPU 1からのアドレスにしたがってメモリ
部3のデータエリアのデータ” 11 (H)”が読み
出される。読み出されたデータは排他的論理和回路6を
介してそのままデータバス2上にのせられる(同図(h
)に万くす)。
At this time, the timing signal d is output from the timing circuit 13 at Tt++ of the clock (φ) (as shown in FIG.
"11 (H)" is latched by the latch circuit 9 (shown in (k) of the figure). After that, 1 of the clock (φ)
After that, the timing signal d is set to the "L" level, and the output of the parity F/F circuit 8 remains at "O+ level, so the data in the data area of the memory unit 3 is changed according to the address from the CPU 1." 11 (H)" is read out. The read data is directly placed on the data bus 2 via the exclusive OR circuit 6 ((h)
).

続いて、データバス2上に現にあるデータの“」−王(
H) ”とラッチ回路9にラッチされているパリティデ
ータ2の” 11 (H)”とが比較部10にて比較さ
れ、一致、あるいは不一致信号が割込みF/F回路12
に出力され、比較部10からは一致信号が出力される。
Next, the data currently on data bus 2 “” - Wang (
H)” and “11 (H)” of the parity data 2 latched in the latch circuit 9 are compared in the comparator 10, and a match or mismatch signal is sent to the interrupt F/F circuit 12.
The comparison unit 10 outputs a match signal.

このとき、タイミング回路13からはクロック(φ)の
T3でタイミング信号dがBI力されるが(同図(1)
に示す)、一致していることから、割込みF/F回路1
2がセットされず、割込み信号は発生されない(同図(
m)の破線に示す)。
At this time, the timing signal d is input BI from the timing circuit 13 at T3 of the clock (φ) ((1) in the same figure).
), and since they match, interrupt F/F circuit 1
2 is not set and no interrupt signal is generated (see the same figure (
(indicated by the dashed line in m)).

ところで、例えば第6図に示されているように、データ
エリアが異常であり、” 11 (H)”でなく“10
(H)”が書き込まれているものとし、パリティエリア
はJE常であるものとすると、上記同様に、パリティエ
リアのパリティデータ2の“11 (H)”はそのまま
ラッチ回路9にラッチされる。そして、データエリアの
データ″工0 (H)”が読み出され、このデータとラ
ッチされているパリティデータとが比較されるが、この
場合不一致信号が割込みF/F回路12に出力されるた
め、割込み信号がCPU土に出力される。これにより、
CPU 1にて割込み処理が行われ、また比較部10に
よる不一致ピッ1〜数が一つであるか否かの判断に基づ
いてデータある15 いはバ′リティデータが違っているかの反転が実行され
る。すなわち、不一致ビット数が−っである場合、デー
タに誤りがありことから、データ″10(H)”が違っ
ている、つまりデータエリアが異常であり、パリティエ
リアはiE常であると判断することができる。このとき
、テコーダ14からのイネーブル信号により、スリース
チー1〜回路11のフローテインク状態が解除され、デ
ータバス2上にはラッチ+01M9のパリティデータ゛
’1 ] (+1)”がデータ(正しいデータ)として
出力されるため、次のリードサイクルを続けて実行する
ことが可能である。
By the way, as shown in Fig. 6, for example, the data area is abnormal, and it is not "11 (H)" but "10".
(H)" has been written and the parity area is JE normal. Similarly to the above, the parity data 2 "11 (H)" in the parity area is latched into the latch circuit 9 as is. Then, the data "0 (H)" in the data area is read out and this data is compared with the latched parity data, but in this case a mismatch signal is output to the interrupt F/F circuit 12. , an interrupt signal is output to the CPU.
Interrupt processing is performed by the CPU 1, and based on the comparison unit 10's judgment as to whether or not the number of mismatched pins is one or not, reversal is performed to determine whether the data is different or the validity data is different. be done. In other words, if the number of mismatched bits is -, there is an error in the data, so it is determined that the data "10 (H)" is incorrect, that is, the data area is abnormal, and the parity area is iE normal. be able to. At this time, the enable signal from the decoder 14 releases the floating state of the three-chip 1 to circuit 11, and the parity data ``'1''(+1)'' of the latch +01M9 is output as data (correct data) on the data bus 2. Therefore, it is possible to continue executing the next read cycle.

また、例えば第7図に示されているように、メモリ部3
のパリティエリアが異常であり、11(H)”でなく“
01 (H)”が書き込まれているものとすると、その
パリティデータ1“01 (H)”の読み出しが行われ
る。すると、そのデータの“↓5′の数が奇数であるこ
とから、パリティ生成回路7にてパリティ“土”が生成
される、したがって、バリティド/ド回路8にはその′
l″が記憶されるため(同図(f)の破線に示す)、排
他的論理和回路6は反6 転出力動作にされ、つまり排他的論理和回路6を介した
パリティデータエは” F E (H)″(パリティデ
ータ2)となり、このパリティデータ2(’ F E 
()l)”)がラッチ回路9にラッチされる。
Furthermore, as shown in FIG. 7, for example, the memory section 3
The parity area is abnormal, and the parity area is “11(H)” instead of “11(H)”.
Assuming that "01 (H)" has been written, the parity data 1 "01 (H)" is read out. Then, since the number of "↓5'" of that data is an odd number, parity generation is performed. The parity "earth" is generated in the circuit 7, so the parity "earth" is generated in the parity/de circuit 8.
Since "F" is stored (as shown by the broken line in FIG. 6(f)), the exclusive OR circuit 6 is set to an inverse output operation, that is, the parity data passing through the exclusive OR circuit 6 is "F". E (H)'' (parity data 2), and this parity data 2 (' F E
()l)”) is latched by the latch circuit 9.

続いて、−に記聞様に、データエリアのデータパ11 
(H)”が読み出され、このデータとラッチ回路9のパ
リティデータ2 ” FE (II)”とが比較される
Next, data area data area 11 as shown in -
(H)" is read out, and this data is compared with parity data 2 "FE (II)" of the latch circuit 9.

この場合、不一致信号が得られるため、CPLI 1に
は割込みがかけられる(同図(m)の実線に示す)。
In this case, since a mismatch signal is obtained, an interrupt is applied to CPLI 1 (as shown by the solid line in FIG. 3(m)).

これにより、CPU1にて割込み処理が行われ、また比
較部■0による不一致ビット数が−っであるか否かの判
断に基づいてデータあるいはパリティデ〜りが違ってい
るかの反転が実行される。すなわち、不一致ビット数が
七つである場合、パリティデータに誤りがあることから
、パリティエリアが異常であり、データエリアは正常で
あると判断することができる。
As a result, the CPU 1 performs an interrupt process, and based on the judgment made by the comparator section (2) 0 as to whether the number of mismatched bits is -, inversion is performed to determine whether the data or parity difference is different. That is, when the number of mismatched bits is seven, it can be determined that the parity area is abnormal and the data area is normal because there is an error in the parity data.

なお、上記実施例では書き込みデータのII I II
の数が偶数である場合について説明したが、その数が奇
数であっても同じである。
Note that in the above embodiment, the write data II
Although we have explained the case where the number is an even number, the same applies even if the number is an odd number.

まず、書き込みデータが例えば”01 (H)”である
場合、つまりデータのrr 1 nの数が奇数である場
合、第8図に示されているように、メモリ部3が正常で
あると、そのパリティエリアには反転したFE()1)
″およびデータエリアにはデータ170↓()l)”が
書き込まれる。
First, when the write data is, for example, "01 (H)", that is, when the number of rr 1 n of the data is an odd number, as shown in FIG. 8, if the memory section 3 is normal, The parity area has an inverted FE()1)
” and data 170↓()l)” is written in the data area.

そして、上記同様に、パリティエリアのパリティデータ
が読み出されるが、このパリティデータ1 ” l−”
 E ()Iン″の“1″の数が奇数であることから。
Then, in the same way as above, the parity data in the parity area is read out, but this parity data 1 "l-"
Because the number of "1"s in "E()Iin" is an odd number.

パリティ生成部7にてパリティLL I IIが生成さ
れる。
Parity generation section 7 generates parity LL I II.

すると、そのパリティデータ1 ” F’ E (II
)”は排他的論理和回路6にて反転されパリティデータ
2パQ 1 (H)”ニされ、コノパリティデータ2”
O工(H)〃がラッチ回路9にラッチされる。
Then, the parity data 1 ” F' E (II
)” is inverted by the exclusive OR circuit 6 and converted to parity data 2 (Q 1 (H)), which then converts the parity data 2 to cono parity data 2.
O (H) is latched by the latch circuit 9.

続いて、上記同様にデータエリアのデータ1101(H
)”が読みI’J’lされ、このデータとラッチされて
いるパリティデータとが比較される。この場合、一致信
号が得られるため、CPU上には割込みがかからず(同
図(m)の破線に示す)、リードサイクルが続行される
Next, data 1101 (H
)" is read and compared with the latched parity data. In this case, a match signal is obtained, so no interrupt is generated on the CPU (see figure (m) ), the read cycle continues.

また、例えば第9図に示されているように、データエリ
アが異常であり、このデータエリアに01 (H)”で
なく“OO(H)”が書き込まれているものとし、パリ
ティエリアはJ、E常であるものとすると、手記同様に
、パリティエリアのパリティデータ1“F E (H)
”は反転されてパリティデータ2″01 (+()”と
され、このパリティデータ2″’01 (H)”がラッ
チ回路9にラッチされる。そして、データエリアのデー
タ“OO(H)”が読み出され、このデータとラッチさ
れているパリティデータとが比較される。この場合、不
一致信号が得られ、CPLI ]には割込みがかけられ
る(同図(m)の実線に示す)。
Further, as shown in FIG. 9, for example, it is assumed that the data area is abnormal and "OO(H)" is written in this data area instead of "01(H)", and the parity area is J , E, parity data 1"F E (H) in the parity area, as in the notebook.
" is inverted and becomes parity data 2"01 (+()", and this parity data 2"'01 (H)" is latched into the latch circuit 9. Then, the data in the data area is "OO(H)". is read out, and this data is compared with the latched parity data.In this case, a mismatch signal is obtained, and an interrupt is applied to CPLI (as shown by the solid line in FIG. 3(m)).

これにより、CPU 1にて割込み処理が行われ、比較
部lOによる不一致ビット数が一つであるか否かの判断
に基づいてデータあるいはパリティデータが違っている
かの判断が実行される。この場合、不一致ビット数が一
つであるため、データエリアが異常であり、パリティエ
リアは正常であると判断することができる。
As a result, the CPU 1 performs an interrupt process, and it is determined whether the data or parity data is different based on the determination by the comparison unit 1O as to whether the number of mismatched bits is one. In this case, since the number of mismatched bits is one, it can be determined that the data area is abnormal and the parity area is normal.

また、例えば第10図に示されているように、パ9 リティエリアか異常であり、そのパリティエリアに0王
(+1)’″でなく’ FF(H)”が書き込まれてし
)るものとする。そして、パリティデータ1 ” I−
’ F(+1)”が読み出され、そのバ°リテイデータ
王の111 IIの数が偶数であることから、パリティ
生成部7にてパノティ“O”が生成される。したがって
、パリティF/ド回路8にはそのII O++が記憶さ
れるため、排他的論理和回路6は非反転出力動作となり
、その排他的論理和回路6を介したパリティデータ1は
そのままのパリティデータ2 ” ト” F (H)”
とされ、ラッチ回路9にラッチされる。
Also, as shown in Figure 10, for example, there is an abnormality in the parity area, and 'FF(H)' is written in the parity area instead of '0 (+1)'''). shall be. Then, parity data 1 ” I-
``F(+1)'' is read out, and since the number of 111 IIs of the validity data king is an even number, the parity generation unit 7 generates the parity ``O''. Since the IIO++ is stored in the circuit 8, the exclusive OR circuit 6 performs a non-inverting output operation, and the parity data 1 passed through the exclusive OR circuit 6 is converted into the same parity data 2 "to" F ( H)”
and is latched by the latch circuit 9.

続いて、上記同様に、データエリアのデータ″01 (
)l)”が読み出され、このデータと上記ラッチされて
いるパリティデータ2とが比較される。この場合、不一
致信号が得られ、CPU 1には割込みがかけられる(
同図(m)の実線に示す)。これにより、CPU lに
て割込み処理が行われ、また比較部10における不一致
ビット数が一つであるかの判断に基づいてデータあるい
はパリティデータが違っているかの判断が実行される。
Next, in the same way as above, data “01 (
)l)" is read out and this data is compared with the latched parity data 2. In this case, a mismatch signal is obtained and an interrupt is issued to the CPU 1 (
(Indicated by the solid line in Figure (m)). As a result, an interrupt process is performed in the CPU 1, and a determination as to whether the data or parity data is different is executed based on the determination in the comparator 10 as to whether the number of mismatched bits is one.

この場合、不一致2〇− ピッ1−が七つであるため、パリティデータに誤りがあ
り、つまりパリティエリアが異常あり、データエリアが
正常であると判断することができる。
In this case, since there are seven mismatches 20-pi1-, it can be determined that there is an error in the parity data, that is, the parity area is abnormal and the data area is normal.

なお、第3図のライ1〜サイクルおよび第4図のリード
サイクルはマイクロプロセッサz80によるものである
が、他のものであっても同じである。
It should be noted that, although the write cycle 1 to cycle in FIG. 3 and the read cycle in FIG. 4 are performed by the microprocessor Z80, the same applies to other systems as well.

[発明の効果コ 以上説明したように、この発明のパリティ回路によれば
、データエリアおよびパリティエリアを有するメモリと
、パリティデータを書き込む際あるいは読み出した際、
そのパリティデータを反転あるいは非反転する排他的論
理和回路と、上記データエリアに書き込むデータあるい
は読み出したパリティデータに基づいてパリティビット
を生成するパリティ生成回路と、この生成パリティビッ
トにより排他論理和回路の反転、非反転出力を制御する
パリティF / F”回路と、その排他的論理和回路を
介して読み出されたパリティデータをラッチするラッチ
回路と、このラッチしたパリティデータと現にメモリか
ら読み出しているデータとを比較し、一致あるいは不一
致信号を出力する比較部と、その不一致信号により割込
み信号をCPUに出力する割込みF / F ++−1
路とを備え、上記比較に際し、不一致ピッ1〜が一つで
あるか否かを判断°可能としたので、パリティチェック
用メモリ(記憶素子:IC)を省くことができ、コスト
の低減を図ることができ、またデータエリアあるいはパ
リティエリアに異常があるか、つまりデータが間違って
いるか、パリティデータが間違っているを判断すること
ができるという効果がある。
[Effects of the Invention] As explained above, according to the parity circuit of the present invention, when writing or reading parity data to a memory having a data area and a parity area,
An exclusive OR circuit that inverts or non-inverts the parity data, a parity generation circuit that generates a parity bit based on the data written to the data area or the read parity data, and an exclusive OR circuit that uses the generated parity bit. A parity F/F" circuit that controls inverted and non-inverted outputs, a latch circuit that latches the parity data read out via its exclusive OR circuit, and a latch circuit that latches the parity data read out through the exclusive OR circuit, and the latched parity data that is currently being read out from the memory. A comparison unit that compares the data and outputs a match or mismatch signal, and an interrupt F/F ++-1 that outputs an interrupt signal to the CPU based on the mismatch signal.
Since it is possible to judge whether or not there is only one unmatched pin 1 through the above comparison, it is possible to omit the parity check memory (storage element: IC) and reduce costs. It is also possible to determine whether there is an abnormality in the data area or parity area, that is, whether the data or parity data is incorrect.

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

第1図はこの発明の一実施例を示すパリティ回路の概略
的ブロック図、第2図は一ヒ記パリティ回路の具体的部
分回路図、第3図および第4図は上記パリティ回路の動
作を説明するためのタイムチャート図、第5図乃至第1
0図は上記パリティ回路に用いられるメモリの内容を説
明するための模式図、第11図は従来のパリティ回路の
概略的ブロック図である。 図中、1はCPU、2はデータバス、3はメモリ部(R
AM)、6は排他的論理和回路、7はパリティ生成回路
、8はパリティF/F回路、9はラッチ回路、11は比
較部、12は割込みF/F回路、I3はタイミング回路
、14ばデコーダである。
Fig. 1 is a schematic block diagram of a parity circuit showing an embodiment of the present invention, Fig. 2 is a specific partial circuit diagram of the parity circuit described above, and Figs. 3 and 4 show the operation of the above parity circuit. Time chart diagrams for explanation, Figures 5 to 1
FIG. 0 is a schematic diagram for explaining the contents of a memory used in the parity circuit, and FIG. 11 is a schematic block diagram of a conventional parity circuit. In the figure, 1 is the CPU, 2 is the data bus, and 3 is the memory section (R
AM), 6 is an exclusive OR circuit, 7 is a parity generation circuit, 8 is a parity F/F circuit, 9 is a latch circuit, 11 is a comparison section, 12 is an interrupt F/F circuit, I3 is a timing circuit, 14 is a It is a decoder.

Claims (1)

【特許請求の範囲】[Claims] (1)メモリのデータを読み出し、前記データを転送す
るに際し、パリテイをチェックし、該パリテイチェック
に基づいてCPUに割込みをかけるパリテイ回路におい
て、 前記メモリに設けられるデータエリアおよびパリテイエ
リアと、 前記データあるいは前記パリテイエリアから読み出した
パリテイデータに基づいてパリテイを生成するパリテイ
生成手段と、 該パリテイに応じて前記データをパリテイデータとして
前記パリテイエリアに書き込む際、若しくは前記パリテ
イエリアのパリテイデータを読み出した際、前記パリテ
イデータを反転あるいは非反転とする排他的論理和手段
と、 該排他的論理和手段を介したパリテイデータと現に前記
データエリアから読み出されているデータとを比較し、
一致あるいは不一致信号を出力し、かつ、少なくとも不
一致ビットが一つであるか否かを判断する比較手段と、 該不一致信号により前記CPUに割込み信号を出力する
割込み信号発生手段とを備えていることを特徴とするパ
リテイ回路。
(1) A parity circuit that checks parity when reading memory data and transferring the data, and interrupts the CPU based on the parity check, a data area and a parity area provided in the memory; parity generating means for generating parity based on the data or parity data read from the parity area; and when writing the data as parity data in the parity area according to the parity; Exclusive OR means for inverting or non-inverting the parity data when parity data is read out, and parity data currently read from the data area through the exclusive OR means. Compare with the data,
Comparing means for outputting a match or mismatch signal and determining whether there is at least one mismatch bit, and interrupt signal generating means for outputting an interrupt signal to the CPU based on the mismatch signal. A parity circuit featuring:
JP1325230A 1989-12-15 1989-12-15 Parity circuit Expired - Fee Related JP2546002B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1325230A JP2546002B2 (en) 1989-12-15 1989-12-15 Parity circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1325230A JP2546002B2 (en) 1989-12-15 1989-12-15 Parity circuit

Publications (2)

Publication Number Publication Date
JPH03186936A true JPH03186936A (en) 1991-08-14
JP2546002B2 JP2546002B2 (en) 1996-10-23

Family

ID=18174480

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1325230A Expired - Fee Related JP2546002B2 (en) 1989-12-15 1989-12-15 Parity circuit

Country Status (1)

Country Link
JP (1) JP2546002B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS554757A (en) * 1978-06-27 1980-01-14 Hitachi Ltd Error control system of memory unit

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS554757A (en) * 1978-06-27 1980-01-14 Hitachi Ltd Error control system of memory unit

Also Published As

Publication number Publication date
JP2546002B2 (en) 1996-10-23

Similar Documents

Publication Publication Date Title
US11922994B2 (en) Semiconductor device verifying signal supplied from outside
US4005405A (en) Error detection and correction in data processing systems
US5379304A (en) Method and structure for providing error correction code and parity for each byte on SIMM's
US5450422A (en) Method and structure for providing error correction code for each byte on SIMM'S
US10725880B2 (en) Semiconductor device
JPH03186936A (en) Parity circuit
US11550681B2 (en) System and method for error injection in system-on-chip
JPS60181851A (en) Partial writing control system
CN116543804B (en) Drive control circuit and memory
JPS63257854A (en) Lru memory fault detecting circuit
JPH01194046A (en) Memory access system
KR20070036615A (en) Decoding device
KR0172503B1 (en) Dram emulation chip memorizing system parity
JP2005044386A (en) Semiconductor storage device and microcomputer
JPH0474400A (en) Integrated circuit
JPS62245453A (en) Substituting method for alternative memory
JPS61201363A (en) Single-chip microcomputer
JPS61288243A (en) Processing system for compare and swap instruction
JPH01309421A (en) Error correction system
US20050204116A1 (en) Method and apparatus of controlling memory device
JPH11194975A (en) Memory system
JPH04127241A (en) Parity generation/check circuit
JPS61210441A (en) Bug detecting method for program
JPH01140356A (en) System for checking ecc circuit
JPH02143351A (en) Parity inspection circuit

Legal Events

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