JP2546002B2 - Parity circuit - Google Patents

Parity circuit

Info

Publication number
JP2546002B2
JP2546002B2 JP1325230A JP32523089A JP2546002B2 JP 2546002 B2 JP2546002 B2 JP 2546002B2 JP 1325230 A JP1325230 A JP 1325230A JP 32523089 A JP32523089 A JP 32523089A JP 2546002 B2 JP2546002 B2 JP 2546002B2
Authority
JP
Japan
Prior art keywords
parity
data
area
circuit
cpu
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
JP1325230A
Other languages
Japanese (ja)
Other versions
JPH03186936A (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.)
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

Landscapes

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

Description

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

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

そこで、第11図に示されるように、コンピュータ等の
CPU1にてデータがデータバス2を介してメモリ部(例え
ばRAM)3に書き込まれる場合、パリティ生成・検査回
路4にてそのデータの“1"の総数を偶数あるいは奇数と
するパリティが生成され、このパリティがパリティRAM
部5に記憶される。そして、CPU1にてデータ転送が行な
われると、つまりメモリ部3のデータがデータバス2を
介して読み出されると、上記パリティ生成・検査回路4
にてそのデータに基づいて求めた値とパリティ部5から
読み出した値とが比較され、不一致のときにはエラーが
発生され、割り込み信号がCPU1に出力される。これによ
り、その割込みにより、CPU1にてデータ転送を停止処理
することができる。
Therefore, as shown in FIG.
When data is written in the memory unit (for example, RAM) 3 via the data bus 2 in the CPU 1, the parity generation / check circuit 4 generates parity in which the total number of “1” s of the data is even or odd, This parity is parity RAM
It is stored in the unit 5. When data is transferred by the CPU 1, that is, when the data in the memory unit 3 is read out via the data bus 2, the parity generation / check circuit 4
Then, the value obtained based on the data is compared with the value read from the parity section 5, and if they do not match, an error is generated and an interrupt signal is output to the CPU 1. As a result, the CPU 1 can stop the data transfer due to the interrupt.

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

また、最近の記憶素子、例えばDRAMは大容量化の傾向
にあり、小容量のDRAMを手に入れることが困難になって
いる。そのため、小システムの場合でも、大容量のDRAM
をメモリ部3やパリティ部5に用いることになり、DRAM
が有効に利用されないだけでなく、不経済な面が生じる
ようになった。
In addition, recent storage elements, such as DRAMs, tend to have a large capacity, and it is difficult to obtain a small capacity DRAM. Therefore, even in a small system, a large capacity DRAM
Will be used for the memory unit 3 and the parity unit 5, and the DRAM
Not only is not used effectively, but also the uneconomic side has come to occur.

さらに、割込みによるエラー発生に際し、パリティ部
5に記憶されたパリティビットに誤りがあるのか、メモ
リ部3に記憶されたデータに誤りがあるのか判断するこ
とができなかった。
Furthermore, when an error occurs due to an interrupt, it is impossible to determine whether the parity bit stored in the parity unit 5 has an error or the data stored in the memory unit 3 has an error.

この発明は上記問題点に鑑みなされたものであり、そ
の目的はコストの低下を図り、かつ、メモリを有効に利
用することができるようにしたパリティ回路を提供する
ことにある。
The present invention has been made in view of the above problems, and an object thereof is to provide a parity circuit capable of reducing the cost and effectively using a memory.

[課題を解決するための手段] 上記目的を達成するため、この発明は、CPUからの指
示に基づいてメモリからデータを読み出す際にそのパリ
ティをチェックし、正常な場合そのデータを所定のデー
タバスに転送するパリティ回路において、内部のメモリ
領域が2分され、その一方が原データ用データエリアと
され、他方がそのパリティデータ用のパリティエリアと
されたメモリ部と、同メモリ部に対するデータ書き込み
時およびデータ読み出し時に、上記データエリアと上記
パリティエリアを交代的に指定するタイミング回路と、
上記パリティデータの上記パリティエリアへの書き込み
時および同パリティエリアからの読み出し時にそのパリ
ティデータに含まれている「1」もしくは「0」の総数
が偶数か奇数かに応じて異なる2つのパリティビットを
生成するパリティ生成部と、上記パリティエリアへ書き
込むパリティデータおよび同パリティエリアから読み出
されたパリティデータを上記パリティ生成部からの上記
パリティビットに基づいて反転もしくは非反転とする排
他的論理和回路と、上記パリエィエリアから上記排他的
論理和回路を介して読み出されたパリティデータを一時
的に保持するラッチ回路と、同ラッチ回路に保持されて
いる上記パリティデータと上記データエリアから読み出
された原データとを比較してその一致、不一致信号を送
出するとともに、不一致である場合にはその不一致ビッ
ト数を検出する比較部と、同比較部からの不一致信号に
より上記CPUに割込み信号とその不一致ビット数を出力
する割込み信号発生手段とを備え、上記原データと上記
パリティデータとが不一致のとき、上記CPUはその不一
致ビット数により上記パリティデータ側が正しいと判断
した場合には、上記ラッチ回路に保持されているパリテ
ィデータを上記データバスに転送することを特徴として
いる。
[Means for Solving the Problems] In order to achieve the above object, the present invention checks the parity when reading data from a memory based on an instruction from a CPU, and if the data is normal, transfers the data to a predetermined data bus. In the parity circuit that transfers data to the memory circuit, the internal memory area is divided into two, one of which is the original data data area and the other is the parity area for the parity data, and when data is written to the memory area. And a timing circuit for alternately designating the data area and the parity area when reading data,
When writing the parity data to the parity area and reading the parity data from the parity area, two parity bits that differ depending on whether the total number of “1” or “0” included in the parity data is an even number or an odd number is set. A parity generation unit for generating, and an exclusive OR circuit for inverting or non-inverting the parity data written to the parity area and the parity data read from the parity area based on the parity bit from the parity generation unit. , A latch circuit for temporarily holding the parity data read from the parity area via the exclusive OR circuit, the parity data held in the latch circuit and the original read from the data area. While comparing with the data and sending out the match and mismatch signals, In the case of a match, a comparison unit that detects the number of mismatch bits, and an interrupt signal generation unit that outputs an interrupt signal and the number of mismatch bits to the CPU in response to a mismatch signal from the comparison unit are provided. When the parity data does not match, the CPU transfers the parity data held in the latch circuit to the data bus when the CPU determines that the parity data side is correct due to the number of mismatch bits. There is.

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

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

そして、上記メモリのデータを読み出すに際し(リー
ドサイクルによるデータの読み出しに際し)、まずパリ
ティエリアのパリティデータが読み出され、このパリテ
ィデータに基づいてパリティが生成される。この場合、
パリティエリアのパリティデータが異常であれば、“1"
の数が奇数になることから、そのパリティデータにより
パリティ“1"が得られ、またパリティエリアが正常であ
れば、そのパリティ“0"が得られ、このパリティが一時
記憶される。続いて、読み出されたパリティデータはそ
のパリティに基づいて反転、あるいは非反転されてラッ
チされる。その後、現に読み出されているデータとラッ
チされたパリティデータとが比較され、一致あるいは不
一致信号が出力される。また、その比較に際し、不一致
ビットの数が一つであるか否かの判断が行われる。そし
て、その不一致ビットが一つであれば、パリティデータ
側が正しいと判断し、ラッチされているパリティデータ
をデータバスに転送する。
Then, when reading the data in the memory (when reading the data in the read cycle), first, the parity data in the parity area is read, and the parity is generated based on the parity data. in this case,
"1" if the parity data in the parity area is abnormal
Since the number is odd, parity "1" 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 and latched based on the parity. After that, the currently read data is compared with the latched parity data, and a match or mismatch signal is output. Further, in the comparison, it is determined whether or not the number of mismatched bits is one. If the number of the mismatched bits is one, it is determined that the parity data side is correct, and the latched parity data is transferred to the data bus.

[実 施 例] 以下、この発明の実施例を第1図乃至第10図に基づい
て説明する。なお、第1図中、第11図と同一部分および
相当部分には同一符号を付し、重複説明を省略する。
[Examples] Examples of the present invention will be described below with reference to FIGS. 1 to 10. In FIG. 1, the same parts and corresponding parts as those in FIG. 11 are designated by the same reference numerals, and the duplicated description will be omitted.

第1図において、パリティ回路には、データエリアお
よびパリティエリアを備えたメモリ部3と、書き込むデ
ータをメモリ部3に出力し、読み出したデータをデータ
バス2に出力し、かつ、後述するパリティデータを反
転、あるいは非反転して出力する排他的論理和回路6
と、書き込むデータあるいは読み出したパリティデータ
に基づいてパリティを生成するパリティ生成回路7と、
この生成パリティを一時記憶し、この記憶したパリティ
に応じて上記排他的論理和回路6を反転、あるいは非反
転出力動作とするパリティF/F回路8と、読み出したパ
リティデータをラッチするラッチ回路9と、ラッチした
パリティデータと現にデータバス2上に読み出されてい
るデータとを比較し、一致あるいは不一致信号を出力
し、かつ、不一致ビット数が一つであるか否かを判断す
る比較部10と、ラッチしたパリティデータをデータバス
2上にのせるスリーステート回路11と、比較部10からの
不一致信号により割込み信号をCPU1に出力する割込みF/
F回路12と、CPU1のクロック(φ)信号、メモリ部3、
パリティF/F回路8、ラッチ回路9、比較部10および割
込みF/F回路12のタイミング信号を発生するタイミング
回路13と、アドレスバス上のアドレスをデコードし、メ
モリ部3のチップセレクト(CS)信号およびスリーステ
ート回路11のイネーブル信号を出力するデコーダ14とが
備えられている。
In FIG. 1, the parity circuit includes a memory unit 3 having a data area and a parity area, write data is output to the memory unit 3, read data is output to the data bus 2, and parity data described below is output. Exclusive OR circuit 6 for inverting or non-inverting and outputting
And a parity generation circuit 7 that generates a parity based on the written data or the read parity data,
The generated parity is temporarily stored, and the parity F / F circuit 8 for inverting or non-inverting the exclusive OR circuit 6 according to the stored parity and the latch circuit 9 for latching the read parity data. And a comparison unit that compares the latched parity data with the data currently read out on the data bus 2, outputs a match or mismatch signal, and determines whether or not the number of mismatch bits is one. 10, a three-state circuit 11 that places the latched parity data on the data bus 2, and an interrupt F / that outputs an interrupt signal to the CPU 1 due to a mismatch signal from the comparison unit 10.
F circuit 12, CPU 1 clock (φ) signal, memory unit 3,
A timing circuit 13 that generates timing signals for the parity F / F circuit 8, the latch circuit 9, the comparison unit 10, and the interrupt F / F circuit 12, and an address on the address bus is decoded to select the chip select (CS) of the memory unit 3. A decoder 14 that outputs a signal and an enable signal for the three-state circuit 11 is provided.

なお、排他的論理和回路6には、例えば第2図に示さ
れているように、二つのEOR回路6a,6bおよびスリーステ
ートバッファ回路6c,6dとによる回路がデータバス2の
ビット数だけ設けられ、パリティF/F回路8の状態
(“1",“0")に応じ、書き込みあるいは読み出したパ
リティデータを反転、非反転とする。
The exclusive OR circuit 6 is provided with a circuit including two EOR circuits 6a and 6b and three-state buffer circuits 6c and 6d as many as the number of bits of the data bus 2, as shown in FIG. Then, the written or read parity data is inverted or non-inverted according to the state (“1”, “0”) of the parity F / F circuit 8.

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

まず、第3図に示すライトサイクルに基づいてデータ
の書き込みが実行されているものとすると、CPU1にてア
ドレスが出力され(同図(b)に示す)、このアドレス
によりデコーダ14からはメモリ部3にチップセレクト信
号が出力される(同図(d)に示す)。このとき、タイ
ミング回路13からはタイミング信号aがクロック(φ)
のT1からTWタイミングまで“H"レベルにされ、つまりア
ドレスの最上位ビットが“H"にされ(同図(i)に示
す)、その“H"の間、アドレスはメモリ部3のパリティ
エリアを指示することになる。一方、パリティ生成回路
7にて、書き込むデータに基づいて“1"の数が奇数であ
るか偶数であるかの判断が行われ、例えばその数が奇数
である場合“1"のパリティが生成され、偶数である場合
“0"のパリティが生成され、パリティF/F回路8に出力
される。
First, assuming that data writing is being executed based on the write cycle shown in FIG. 3, an address is output from the CPU 1 (shown in FIG. 3B), and this address causes the decoder 14 to output the memory section. A chip select signal is output to 3 (shown in FIG. At this time, the timing circuit 13 outputs the timing signal a to the clock (φ).
From T 1 to T W timing, that is, the most significant bit of the address is set to “H” (shown in (i) of the same figure), and during the “H”, the address is stored in the memory unit 3. It will indicate the parity area. 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, when the number is odd, the parity of “1” is generated. If the number is even, a parity of “0” is generated and output to the parity F / F circuit 8.

続いて、タイミング回路13からはクロック(φ)のT2
タイミングでタイミング信号cが出力されるため、上記
パリティF/F回路8にはその“1"あるいは“0"が一時記
憶され(同図(e)および(f)に示す)、このラッチ
データにより排他的論理和回路6は入力データを反転、
あるいは非反転して出力することになる。また、タイミ
ング回路13からはクロック(φ)のTWのタイミングでタ
イミング信号b、つまりライト・イネーブル信号が“L"
レベルにされるため(同図(g)に示す)、メモリ部3
が書き込み可能状態にされ、データバス2上にあるデー
タが排他的論理和回路6を介してパリティデータにさ
れ、このパリティデータによりパリティエリアの所定領
域(書き込みデータに対応するアドレス)が書き替えら
れる。この場合、パリティ生成部7にてパリティ“1"が
生成されていると、排他的論理和回路6にてデータバス
2上のデータが反転されてパリティエリアに書き込ま
れ、またパリティ“0"が生成されていると、データバス
2上のデータがそのままパリティデータにされ、このパ
リティデータによりパリティエリアの所定領域が書き替
えられる。
Then, from the timing circuit 13, the clock (φ) T 2
Since the timing signal c is output at the timing, "1" or "0" is temporarily stored in the parity F / F circuit 8 (shown in (e) and (f) of the same figure). The exclusive OR circuit 6 inverts the input data,
Alternatively, it will be non-inverted and output. Further, from the timing circuit 13, the timing signal b, that is, the write enable signal is "L" at the timing of T W of the clock (φ).
Since it is set to the level (shown in (g) of the same figure), the memory unit 3
Is set to a writable state, data on the data bus 2 is converted into parity data via the exclusive OR circuit 6, and a predetermined area (address corresponding to the write data) of the parity area is rewritten by this parity data. . In this case, when the parity "1" is generated by the parity generator 7, the data on the data bus 2 is inverted and written in the parity area by the exclusive OR circuit 6, and the parity "0" is also generated. When it is generated, the data on the data bus 2 is directly converted to parity data, and a predetermined area of the parity area is rewritten by this parity data.

続いて、クロック(φ)のTWタイミング以後、タイミ
ング回路13からはタイミング信号a、つまりアドレスの
最上位ビットが“L"レベルにされ、タイミング信号b、
つまりライト・イネーブル信号がクロック(φ)のT3
イミングで“L"レベルにされ(同図(g)に示す)、ま
たタイミング信号bの最初のパルスの立上りタイミング
でパリティF/F回路8がクリアされるため(同図(f)
に示す)、排他的論理和回路6は非反転動作となり、か
つ、アドレスはメモリ部3のデータエリアを指示するこ
とになる。このとき、排他的論理和回路6はデータバス
2上のデータをそのままメモリ部3に出力することか
ら、書き込みデータがデータエリアの所定領域に書き込
まれる。
Subsequently, after the T W timing of the clock (φ), the timing circuit 13 sets the timing signal a, that is, the most significant bit of the address to the “L” level, and the timing signal b,
That is, the write enable signal is set to the “L” level at the T 3 timing of the clock (φ) (shown in (g) of the same figure), and the parity F / F circuit 8 is set at the rising timing of the first pulse of the timing signal b. Because it is cleared ((f) in the figure)
(Shown in FIG. 3), the exclusive OR circuit 6 is non-inverted, and the address indicates the data area of the memory unit 3. At this time, the exclusive OR circuit 6 outputs the data on the data bus 2 to the memory section 3 as it is, so that the write data is written in a predetermined area of the data area.

すなわち、ライトサイクルにおいては、クロック
(φ)のT1,T2,TWタイミングでパリティが生成され、反
転あるいは非反転のパリティデータがパリティエリアに
書き込まれ、クロック(φ)のTW以後に、非反転データ
すなわち原データがデータエリアに書き込まれる。
That is, in the write cycle, the parity is generated at the timing of T 1 , T 2 , and T W of the clock (φ), the inverted or non-inverted parity data is written in the parity area, and after T W of the clock (φ). , Non-inverted data, that is, original data is written in the data area.

一方、データエリアのデータを読み出して転送するた
め、第4図に示すリードサイクルに基づいてデータの読
み出しが実行されるものとする。なお、データの“1"の
数が偶数になるように決められており、書き込みデータ
が例えば“11(H)”である場合、つまりデータの“1"
の数が偶数である場合、第5図に示されているように、
メモリ部3が正常であり、データエリアおよびパリティ
エリアの所定アドレスに、同じデータ“11(H)”が書
き込まれているものとする。
On the other hand, since the data in the data area is read and transferred, the data read is executed based on the read cycle shown in FIG. The number of data "1" s is determined to be an even number, and the write data is, for example, "11 (H)", that is, the data "1" s.
If the number of is even, as shown in FIG.
It is assumed that the memory unit 3 is normal and that the same data "11 (H)" is written at a predetermined address in the data area and the parity area.

まず、CPU1にてアドレスが出力され(同図(b)に示
す)、そのアドレスによりデコーダ14からはメモリ部3
のチップセレクト信号が出力される(同図(d)に示
す)。このとき、タイミング回路13からのタイミング信
号aはCPU1のクロック(φ)のT1,T2,TWまで“H"レベル
にされ、つまりアドレスの最上位ビットが“1"にされ
(同図(i)に示す)、またタイミング信号bはこのリ
ードサイクルの間“H"レベルにされるため(同図(g)
に示す)、そのタイミング信号aが“H"レベルの間、ア
ドレスはメモリ部3のパリティエリアを指示することに
なる。したがって、上記アドレスによりパリティエリア
のパリティデータ1が読み出されるが、メモリ部3が正
常であるため、そのパリティデータ1は“11(H)”と
いうことになる(同図(c)に示す)。
First, the CPU 1 outputs an address (shown in FIG. 2B), and the address is output from the decoder 14 to the memory unit 3.
The chip select signal is output (as shown in FIG. In this case, the timing signal a from the timing circuit 13 is in "H" level to T 1, T 2, T W of CPU1 clock (phi), that is the most significant bit of the address is "1" (FIG. (Shown in (i)), and since the timing signal b is set to "H" level during this read cycle ((g) in the figure).
Address) indicates that the address indicates the parity area of the memory section 3 while the timing signal a is at "H" level. Therefore, the parity data 1 in the parity area is read by the above address, but since the memory unit 3 is normal, the parity data 1 is "11 (H)" (shown in FIG. 7C).

続いて、パリティ生成部7にてその読み出されたパリ
ティデータ“11(H)”の“1"の数が奇数であるか偶数
であるかが検出されるが、この場合偶数であることか
ら、パリティF/F回路8には“0"が記憶され、排他的論
理和回路6は非反転出力動作にされる。すると、排他的
論理和回路6を介したパリティデータ1はそのまま“11
(H)”(パリティデータ2)ということになる(同図
(c)に示す)。
Subsequently, the parity generation unit 7 detects whether the number of "1" s of the read parity data "11 (H)" is odd or even. In this case, it is even. , "0" is stored in the parity F / F circuit 8 and the exclusive OR circuit 6 is set to the non-inverting output operation. Then, the parity data 1 via the exclusive OR circuit 6 remains “11”.
(H) ”(parity data 2) (shown in (c) of the figure).

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

続いて、データバス2上に現にあるデータの“11
(H)”とラッチ回路9にラッチされているパリティデ
ータ2の“11(H)”とが比較部10にて比較され、一
致、あるいは不一致信号が割込みF/F回路12に出力さ
れ、比較部10からは一致信号が出力される。このとき、
タイミング回路13からはクロック(φ)のT3でタイミン
グ信号dが出力されるが(同図(1)に示す)、一致し
ていることから、割込みF/F回路12がセットされず、割
込み信号は発生されない(同図(m)の破線に示す)。
Next, "11" of the data currently on the data bus 2
(H) "and" 11 (H) "of the parity data 2 latched in the latch circuit 9 are compared in the comparison unit 10, and a match or mismatch signal is output to the interrupt F / F circuit 12 for comparison. A match signal is output from the part 10. At this time,
Although the timing signal d is output from the timing circuit 13 at T 3 of the clock (φ) (shown in (1) of the same figure), the interrupt signal is not set in the interrupt F / F circuit 12 and the interrupt signal is generated. No signal is generated (indicated by the broken line in FIG. 6 (m)).

ところで、例えば第6図に示されているように、デー
タエリアが異常であり、“11(H)”でなく“10
(H)”が書き込まれているものとし、パリティエリア
は正常であるものとすると、上記同様に、パリティエリ
アのパリティデータ2の“11(H)”はそのままラッチ
回路9にラッチされる。そして、データエリアのデータ
“10(H)”が読み出され、このデータとラッチされて
いるパリティデータとが比較されるが、この場合不一致
信号が割込みF/F回路12に出力されるため、割込み信号
がCPU1に出力される。これにより、CPU1にて割込み処理
が行われ、また比較部10による不一致ビット数が一つで
あるか否かの判断に基づいてデータあるいはパリティデ
ータが違っているかの反転が実行される。すなわち、不
一致ビット数が一つである場合、データに誤りがあるこ
とから、データ“10(H)”が違っている、つまりデー
タエリアが異常であり、パリティエリアは正常であると
判断することができる。このとき、デコーダ14からのイ
ネーブル信号により、スリーステート回路11のフローテ
ィング状態が解除され、データバス2上にはラッチ回路
9のパリティデータ“11(H)”がデータ(正しいデー
タ)として出力されるため、次のリードサイクルを続け
て実行することが可能である。
By the way, as shown in FIG. 6, for example, the data area is abnormal, and "10" is not "11 (H)".
Assuming that (H) ”is written and the parity area is normal,“ 11 (H) ”of the parity data 2 in the parity area is latched by the latch circuit 9 as it is, as described above. , The data "10 (H)" in the data area is read and this data is compared with the latched parity data. In this case, since the mismatch signal is output to the interrupt F / F circuit 12, the interrupt is generated. A signal is output to the CPU 1. Thereby, the CPU 1 performs interrupt processing, and whether the data or parity data is different based on the judgment by the comparison unit 10 whether the number of mismatch bits is one or not. Inversion is executed, that is, if the number of mismatch bits is 1, the data “10 (H)” is different, that is, the data area is abnormal, because there is an error in the data. It is possible to determine that the tier area is normal.At this time, the floating signal of the three-state circuit 11 is released by the enable signal from the decoder 14, and the parity data “11 ( Since "H)" is output as data (correct data), the next read cycle can be continuously executed.

また、例えば第7図に示されているように、メモリ部
3のパリティエリアが異常であり、“11(H)”でなく
“01(H)”が書き込まれているものとすると、そのパ
リティデータ1“01(H)”の読み出しが行われる。す
ると、そのデータの“1"の数が奇数であることから、パ
リティ生成回路7にてパリティ“1"が生成される、した
がって、パリティF/F回路8にはその“1"が記憶される
ため(同図(f)の破線に示す)、排他的論理和回路6
は反転出力動作にされ、つまり排他的論理和回路6を介
したパリティデータ1は“FE(H)”(パリティデータ
2)となり、このパリティデータ2(“FE(H)”)が
ラッチ回路9にラッチされる。
If the parity area of the memory unit 3 is abnormal and "01 (H)" is written instead of "11 (H)" as shown in FIG. Data 1 “01 (H)” is read. Then, since the number of "1" s of the data is odd, the parity "1" is generated by the parity generation circuit 7, and therefore the parity F / F circuit 8 stores the "1". Therefore, the exclusive OR circuit 6 is shown (indicated by the broken line in FIG.
Is inverted output operation, that is, the parity data 1 via the exclusive OR circuit 6 becomes "FE (H)" (parity data 2), and this parity data 2 ("FE (H)") is latched by the latch circuit 9. Latched on.

続いて、上記同様に、データエリアのデータ“11
(H)”が読み出され、このデータとラッチ回路9のパ
リティデータ2“FE(H)”とが比較される。この場
合、不一致信号が得られるため、CPU1には割込みがかけ
られる(同図(m)の実線に示す)。これにより、CPU1
にて割込み処理が行われ、また比較部10による不一致ビ
ット数が一つであるか否かの判断に基づいてデータある
いはパリティデータが違っているかの反転が実行され
る。すなわち、不一致ビット数が七つである場合、パリ
ティデータに誤りがあることから、パリティエリアが異
常であり、データエリアは正常であると判断することが
できる。
Then, in the same way as above, the data in the data area "11
(H) "is read and this data is compared with the parity data 2" FE (H) "of the latch circuit 9. In this case, since a mismatch signal is obtained, the CPU 1 is interrupted (the same). This is indicated by the solid line in the figure (m).
Then, the interrupt processing is performed, and the comparison unit 10 inverts whether the data or the parity data is different based on the determination as to whether the number of mismatch bits is one or not. That is, when the number of mismatched bits is 7, it can be determined that the parity area is abnormal and the data area is normal because the parity data has an error.

なお、上記実施例では書き込みデータの“1"の数が偶
数である場合について説明したが、その数が奇数であっ
ても同じである。
In the above embodiment, the case where the number of “1” s of the write data is an even number has been described, but the same is true even if the number is an odd number.

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

そして、上記同様に、パリティエリアのパリティデー
タが読み出されるが、このパリティデータ1“FE
(H)”の“1"の数が奇数であることから、パリティ生
成部7にてパリティ“1"が生成される。すると、そのパ
リティデータ1“FE(H)”は排他的論理和回路6にて
反転されパリティデータ2“01(H)”にされ、このパ
リティデータ2“01(H)”がラッチ回路9にラッチさ
れる。
Then, in the same manner as above, the parity data in the parity area is read out.
Since the number of "1" s in (H) "is odd, parity" 1 "is generated in the parity generation unit 7. Then, the parity data 1" FE (H) "is the exclusive OR circuit. The parity data 2 “01 (H)” is inverted at 6 and the parity data 2 “01 (H)” is latched by the latch circuit 9.

続いて、上記同様にデータエリアのデータ“01
(H)”が読み出され、このデータとラッチされている
パリティデータとが比較される。この場合、一致信号が
得られるため、CPU1には割込みがかからず(同図(m)
の破線に示す)、リードサイクルが続行される。
Then, the data "01
(H) "is read out and this data is compared with the latched parity data. In this case, since a coincidence signal is obtained, the CPU 1 is not interrupted ((m) in the figure).
The read cycle is continued.

また、例えば第9図に示されているように、データエ
リアが異常であり、このデータエリアに“01(H)”で
なく“00(H)”が書き込まれているものとし、パリテ
ィエリアは正常であるものとすると、上記同様に、パリ
ティエリアのパリティデータ1“FE(H)”は反転され
てパリティデータ2“01(H)”とされ、このパリティ
データ2“01(H)”がラッチ回路9にラッチされる。
そして、データエリアのデータ“00(H)”が読み出さ
れ、このデータとラッチされているパリティデータとが
比較される。この場合、不一致信号が得られ、CPU1には
割込みがかけられる(同図(m)の実線に示す)。これ
により、CPU1にて割込み処理が行われ、比較部10による
不一致ビット数が一つであるか否かの判断に基づいてデ
ータあるいはパリティデータが違っているかの判断が実
行される。この場合、不一致ビット数が一つであるた
め、データエリアが異常であり、パリティエリアは正常
であると判断することができる。
Also, as shown in FIG. 9, for example, assume that the data area is abnormal and "00 (H)" is written in this data area instead of "01 (H)", and the parity area is Assuming that the data is normal, the parity data 1 “FE (H)” in the parity area is inverted to parity data 2 “01 (H)”, and this parity data 2 “01 (H)” is obtained. It is latched by the latch circuit 9.
Then, the data "00 (H)" in the data area is read and this data is compared with the latched parity data. In this case, a disagreement signal is obtained, and the CPU 1 is interrupted (shown by the solid line in (m) of the figure). As a result, the CPU 1 performs the interrupt process, and the comparison unit 10 determines whether or not the data or parity data is different based on whether or not the number of mismatch bits is one. In this case, since the number of mismatch bits is one, it can be determined that the data area is abnormal and the parity area is normal.

また、例えば第10図に示されているように、パリティ
エリアが異常であり、そのパリティエリアに“01
(H)”でなく“FF(H)”が書き込まれているものと
する。そして、パリティデータ1“FF(H)”が読み出
され、そのパリティデータ1の“1"の数が偶数であるこ
とから、パリティ生成部7にてパリティ“0"が生成され
る。したがって、パリティF/F回路8にはその“0"が記
憶されるため、排他的論理和回路6は非反転出力動作と
なり、その排他的論理和回路6を介したパリティデータ
1はそのままのパリティデータ2“FF(H)”とされ、
ラッチ回路9にラッチされる。
Also, for example, as shown in FIG. 10, the parity area is abnormal and "01
It is assumed that “FF (H)” is written instead of (H). Then, the parity data 1 “FF (H)” is read and the number of “1” of the parity data 1 is even. Because of this, the parity “0” is generated in the parity generation unit 7. Therefore, the “0” is stored in the parity F / F circuit 8, and the exclusive OR circuit 6 performs the non-inverted output operation. Therefore, the parity data 1 that has passed through the exclusive OR circuit 6 becomes the parity data 2 "FF (H)" as it is,
It is latched by the latch circuit 9.

続いて、上記同様に、データエリアのデータ“01
(H)”が読み出され、このデータと上記ラッチされて
いるパリエィデータ2とが比較される。この場合、不一
致信号が得られ、CPU1には割込みがかけられる(同図
(m)の実線に示す)。これにより、CPU1にて割込み処
理が行われ、また比較部10における不一致ビット数が一
つであるかの判断に基づいてデータあるいはパリティデ
ータが違っているかの判断が実行される。この場合、不
一致ビットが七つであるため、パリティデータに誤りが
あり、つまりパリティエリアが異常であり、データエリ
アが正常であると判断することができる。
Then, in the same manner as above, the data in the data area "01
(H) "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 FIG. As a result, the CPU 1 performs the interrupt process, and the comparison unit 10 determines whether the data or the parity data is different based on the determination whether the number of mismatch bits is one. In this case, since there are seven mismatch bits, it can be determined that the parity data has an error, that is, the parity area is abnormal and the data area is normal.

なお、第3図のライトサイクルおよび第4図のリード
サイクルはマイクロプロセッサZ80によるものである
が、他のものであっても同じである。
The write cycle in FIG. 3 and the read cycle in FIG. 4 are performed by the microprocessor Z80, but the same applies to other ones.

[発明の効果] 以上説明したように、この発明のパリティ回路によれ
ば、データエリアおよびパリティエリアを有するメモリ
と、パリティデータを書き込む際あるいは読み出した
際、そのパリティデータを反転あるいは非反転する排他
的論理和回路と、上記データエリアに書き込むデータあ
るいは読み出したパリティデータに基づいてパリティビ
ットを生成するパリティ生成回路と、この生成パリティ
ビットにより排他論理和回路の反転、非反転出力を制御
するパリティF/F回路と、その排他的論理和回路を介し
て読み出されたパリティデータをラッチするラッチ回路
と、このラッチしたパリティデータと現にメモリから読
み出しているデータとを比較し、一致あるいは不一致信
号を出力する比較部と、その不一致信号により割込み信
号をCPUに出力する割込みF/F回路とを備え、上記比較に
際し、不一致ビットが一つであるか否かを判断可能とし
たので、パリティチェック用メモリ(記憶素子;IC)を
省くことができ、その分コストの低減が図れる。また、
不一致の場合にしてもその不一致ビット数によりパリテ
ィデータ側が正しいと判断された場合には、ラッチされ
ているパリティデータがデータバスに転送されるため、
リードサイクルが中断されることもない、などの効果が
奏される。
[Effects of the Invention] As described above, according to the parity circuit of the present invention, a memory having a data area and a parity area, and an exclusive arrangement for inverting or non-inverting the parity data when writing or reading the parity data. Logical OR circuit, a parity generation circuit that generates a parity bit based on the data written in the data area or the read parity data, and a parity F that controls the inversion and non-inversion output of the exclusive OR circuit by the generated parity bit. The / F circuit and the latch circuit that latches the parity data read via the exclusive OR circuit and the latched parity data are compared with the data currently read from the memory, and a match or mismatch signal is output. An interrupt signal is sent to the CPU by the output comparison unit and its mismatch signal. Since it has an output interrupt F / F circuit and can judge whether there is only one mismatch bit in the above comparison, it is possible to omit the parity check memory (memory element; IC). The cost can be reduced. Also,
Even if there is a mismatch, if the parity data side is determined to be correct by the number of mismatch bits, the latched parity data is transferred to the data bus.
The read cycle is not interrupted.

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

第1図はこの発明の一実施例を示すパリティ回路の概略
的ブロック図、第2図は上記パリティ回路の具体的部分
回路図、第3図および第4図は上記パリティ回路の動作
を説明するためのタイムチャート図、第5図乃至第10図
は上記パリティ回路に用いられるメモリの内容を説明す
るための模式図、第11図は従来のパリティ回路の概略的
ブロック図である。 図中、1はCPU、2はデータバス、3はメモリ部(RA
M)、6は排他的論理和回路、7はパリティ生成回路、
8はパリティF/F回路、9はラッチ回路、11は比較部、1
2は割込みF/F回路、13はタイミング回路、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, and FIGS. 3 and 4 explain the operation of the parity circuit. 5 to 10 are schematic diagrams for explaining the contents of the memory used in the parity circuit, and FIG. 11 is a schematic block diagram of a conventional parity circuit. In the figure, 1 is a CPU, 2 is a data bus, 3 is a memory unit (RA
M), 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 unit, 1
2 is an interrupt F / F circuit, 13 is a timing circuit, and 14 is a decoder.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 斎藤 正明 神奈川県川崎市高津区末長1116番地 株 式会社富士通ゼネラル内 (72)発明者 岩野 徹 神奈川県川崎市高津区末長1116番地 株 式会社富士通ゼネラル内 (56)参考文献 特開 昭55−4757(JP,A) ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Masaaki Saito, 1116 Suenaga, Takatsu-ku, Kawasaki-shi, Kanagawa, Fujitsu General Co., Ltd. (72) Toru Iwano, 1116 Suenaga, Takatsu-ku, Kawasaki, Kanagawa (56) Reference JP-A-55-4757 (JP, A)

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】CPUからの指示に基づいてメモリからデー
タを読み出す際にそのパリティをチェックし、正常な場
合そのデータを所定のデータバスに転送するパリティ回
路において、 内部のメモリ領域が2分され、その一方が原データ用デ
ータエリアとされ、他方がそのパリティデータ用のパリ
ティエリアとされたメモリ部と、 同メモリ部に対するデータ書き込み時およびデータ読み
出し時に、上記データエリアと上記パリティエリアを交
代的に指定するタイミング回路と、 上記パリティデータの上記パリティエリアへの書き込み
時および同パリティエリアからの読み出し時にそのパリ
ティデータに含まれている「1」もしくは「0」の総数
が偶数が奇数かに応じて異なる2つのパリティビットを
生成するパリティ生成部と、 上記パリティエリアへ書き込むパリティデータおよび同
パリティエリアから読み出されたパリティデータを上記
パリティ生成部からの上記パリティビットに基づいて反
転もしくは非反転とする排他的論理和回路と、 上記パリティエリアから上記排他的論理和回路を介して
読み出されたパリティデータを一時的に保持するラッチ
回路と、 同ラッチ回路に保持されている上記パリティデータと上
記データエリアから読み出された原データとを比較して
その一致、不一致信号を送出するとともに、不一致であ
る場合にはその不一致ビット数を検出する比較部と、 同比較部からの不一致信号により上記CPUに割込み信号
とその不一致ビット数を出力する割込み信号発生手段と
を備え、 上記原データと上記パリティデータとが不一致のとき、
上記CPUはその不一致ビット数により上記パリティデー
タ側が正しいと判断した場合には、上記ラッチ回路に保
持されているパリティデータを上記データバスに転送す
ることを特徴とするパリティ回路。
1. A parity circuit that checks the parity when reading data from a memory based on an instruction from a CPU and transfers the data to a predetermined data bus when normal, divides an internal memory area into two parts. , One of which is the data area for the original data and the other of which is the parity area for the parity data, and the data area and the parity area alternate when data is written to and read from the memory section. And the timing circuit specified in the above, depending on whether the total number of "1" or "0" contained in the parity data at the time of writing the parity data to the parity area and at the time of reading from the parity area is an even number. And a parity generation unit that generates two different parity bits according to An exclusive OR circuit that inverts or does not invert the parity data to be written to the parity data and the parity data read from the parity area based on the parity bit from the parity generation unit; and the exclusive logic from the parity area. A latch circuit that temporarily holds the parity data read out via the sum circuit and the parity data held in the latch circuit and the original data read out from the data area are compared and the results match. , A non-coincidence signal is sent, and in the case of non-coincidence, a comparison unit that detects the non-coincidence bit number, and an interruption signal generation means that outputs the non-coincidence signal to the CPU by the non-coincidence signal from the comparison unit And when the original data and the parity data do not match,
The parity circuit, wherein the CPU transfers the parity data held in the latch circuit to the data bus when the CPU determines that the parity data side is correct based on the number of mismatch bits.
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 JPH03186936A (en) 1991-08-14
JP2546002B2 true 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)

Family Cites Families (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
JPH03186936A (en) 1991-08-14

Similar Documents

Publication Publication Date Title
KR900004006B1 (en) Micro processor system
KR920001100B1 (en) Logical arithmetic unit
JP2546002B2 (en) Parity circuit
US5673419A (en) Parity bit emulator with write parity bit checking
JPH1011348A (en) Controller for dram, and the dram
EP0462622B1 (en) Microprocessor capable of ensuring flexible recovery time for I/O device
US5515506A (en) Encoding and decoding of dual-ported RAM parity using one shared parity tree and within one clock cycle
JPS60181851A (en) Partial writing control system
JP3078000B2 (en) Information processing device
JPH0212358A (en) Data transfer system
JPH086905A (en) Access arbitration circuit for multi-port ram
JPH0743668B2 (en) Access control device
SU1580442A1 (en) On-line memory
JP3242474B2 (en) Data processing device
JPH05120211A (en) Data bus width controller
EP0341061B1 (en) Data processing system with memory-access priority control
JPH0746495B2 (en) DRAM parity generation / check method
JPS60263246A (en) Memory system
JPH0895801A (en) Interruption requesting circuit and processing method for interruption request
JPH0330899B2 (en)
JPH0253169A (en) Trouble detecting device for multi-microprocessor system
JPH01258054A (en) Access control system for storage device
JPH07160594A (en) Information processor
JPS63278156A (en) Memory writing control circuit
JPS6318454A (en) Multiprocessor system

Legal Events

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