JPH11282650A - Hazard prevention circuit for fifo memory - Google Patents

Hazard prevention circuit for fifo memory

Info

Publication number
JPH11282650A
JPH11282650A JP10087611A JP8761198A JPH11282650A JP H11282650 A JPH11282650 A JP H11282650A JP 10087611 A JP10087611 A JP 10087611A JP 8761198 A JP8761198 A JP 8761198A JP H11282650 A JPH11282650 A JP H11282650A
Authority
JP
Japan
Prior art keywords
address
signal
flag
data
read
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
JP10087611A
Other languages
Japanese (ja)
Inventor
Masaki Arima
馬 正 木 有
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP10087611A priority Critical patent/JPH11282650A/en
Publication of JPH11282650A publication Critical patent/JPH11282650A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To generate a full signal and an empty signal without generating hazard. SOLUTION: Flags are set up correspondingly to respective addresses in a first in first out(FIFO) memory 11. When data are written in a certain address, tire flag corresponding to the address is set up to '1', and at the time of reading out data from a certain address, the flag corresponding to the address is set up to '0'. All outputs from the FIFO memory 11 are inputted to an AND circuit 14 and a NAND circuit 15, and a full signal and an empty signal are respectively outputted from the outputs of these, circuits 14, 15.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、FIFOメモリの
ハザード防止回路に関する。
The present invention relates to a hazard prevention circuit for a FIFO memory.

【0002】[0002]

【従来の技術】FIFO(First In First Out)メモリ
とは、データを書き込まれた順番に読み出す、先入れ先
出し方式のメモリのことである。図3はこのようなメモ
リにおけるデータの読み書き制御の方法を示している。
図3において、FIFOメモリ1には、ライトカウンタ
2およびリードカウンタ3が接続されており、図示され
にないメモリ制御部により制御される。データを書き込
む際には、ライトカウンタ2が指し示しているアドレス
にデータが書き込まれる。いま、データ0がアドレス0
に書き込まれ、データ1がアドレス1に書き込まれ、デ
ータ2がアドレス2に書き込まれると、その都度ライト
カウンタ2の値が1ずつ増加し、最後のアドレスNにデ
ータNが書き込まれると、FIFOメモリ1はフル状態
となる。一方、データを読み出す際には、リードカウン
タ3が指し示しているアドレスからデータが読み出され
る。いま、リードカウンタ3の値が0の場合は、アドレ
ス0に書き込まれたデータ0が読み出され、リードカウ
ンタ3の値が1の場合は、アドレス1に書き込まれたデ
ータ1が読み出され、リードカウンタ3の値が2の場合
は、アドレス2に書き込まれたデータ2が読み出され、
その都度リードカウンタ3の値が1ずつ増加し、最後の
アドレスNのデータNが読み出されると、FIFOメモ
リ1はエンプティ状態となる。
2. Description of the Related Art A FIFO (First In First Out) memory is a first-in, first-out type memory in which data is read out in a written order. FIG. 3 shows a method of controlling reading and writing of data in such a memory.
In FIG. 3, a write counter 2 and a read counter 3 are connected to the FIFO memory 1 and controlled by a memory control unit (not shown). When writing data, the data is written to the address indicated by the write counter 2. Now, data 0 is address 0
When data 1 is written to address 1 and data 2 is written to address 2, the value of write counter 2 is incremented by one each time. When data N is written to last address N, the FIFO memory 1 is full. On the other hand, when reading data, the data is read from the address indicated by the read counter 3. When the value of the read counter 3 is 0, data 0 written at the address 0 is read, and when the value of the read counter 3 is 1, data 1 written at the address 1 is read. When the value of the read counter 3 is 2, the data 2 written at the address 2 is read,
Each time the value of the read counter 3 increases by one, and when the data N of the last address N is read, the FIFO memory 1 enters an empty state.

【0003】このようなFIFOメモリ1のフル状態お
よびエンプティ状態の判定は、ライトカウンタ2および
リードカウンタ3のそれぞれの出力を比較器4で比較す
ることにより行われる。すなわち、最後に書き込みを行
ったアドレスを示すライトカウンタ2の値と、最後に読
み出しを行ったアドレスを示すリードカウンタ3の値と
を比較器4で比較し、ライトカウンタ2の値がX+N+
1でリードカウンタ3の値がXの場合はフルと判定し、
ライトカウンタ2の値がXでリードカウンタ3の値もX
の場合はエンプティと判定する。このようなフルおよび
エンプティの信号は、次のデータ入力の制御に用いられ
る。
The determination of the full state and the empty state of the FIFO memory 1 is performed by comparing the respective outputs of the write counter 2 and the read counter 3 with the comparator 4. That is, the comparator 4 compares the value of the write counter 2 indicating the address at which the last write was performed with the value of the read counter 3 indicating the address at which the last read was performed, and found that the value of the write counter 2 was X + N +
When the value of the read counter 3 is X at 1, it is determined that the value is full,
The value of the write counter 2 is X and the value of the read counter 3 is also X
Is determined to be empty. These full and empty signals are used to control the next data input.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、上記従
来のFIFOメモリにおいては、ライトカウンタ2とリ
ードカウンタ3の値が一致するエンプティ状態を判定す
る際に、ハザードと呼ばれる誤った信号が発生する場合
があった。これは、ライトカウンタ2のライトアドレス
信号とリードカウンタ3のリードアドレス信号とを比較
器4のAND回路で比較する場合、例えば図4に示すよ
うに、ライトアドレス信号とリードアドレス信号とが同
時に変化した場合に、一方のリードアドレス信号に遅延
が生じた時は、その遅延時にライトアドレス信号とリー
ドアドレス信号とがともにハイ状態となり、エンプティ
信号が一時的にハイ状態になって、これがハザードとな
って誤った情報を伝えることになる。ライトカウンタ2
からのライトアドレス信号およびリードカウンタ3から
のリードアドレス信号は、それぞれのカウンタが完全に
同一であれば遅延を生じることはないが、実際問題とし
て完全に同一は有り得ないので、このような問題が生じ
ることになる。
However, in the above-mentioned conventional FIFO memory, when judging an empty state in which the values of the write counter 2 and the read counter 3 match, an erroneous signal called a hazard may occur. there were. This is because when the write address signal of the write counter 2 and the read address signal of the read counter 3 are compared by the AND circuit of the comparator 4, for example, as shown in FIG. 4, the write address signal and the read address signal change simultaneously. When a delay occurs in one of the read address signals, both the write address signal and the read address signal become high at the time of the delay, and the empty signal becomes high temporarily, which becomes a hazard. And convey incorrect information. Light counter 2
The write address signal from the read counter 3 and the read address signal from the read counter 3 do not cause a delay if the respective counters are completely the same, but in practice, they cannot be completely the same. Will happen.

【0005】本発明は、上記のように従来の問題を解決
するものであり、ハザードが発生しのないフル信号およ
びエンプティ信号を生成することのできるFIFOメモ
リのハザード防止回路を提供することを目的とする。
An object of the present invention is to solve the conventional problems as described above, and an object of the present invention is to provide a hazard prevention circuit for a FIFO memory which can generate a full signal and an empty signal without causing a hazard. And

【0006】[0006]

【課題を解決するための手段】本発明は、上記目的を達
成するために、FIFOメモリの各アドレスに対応して
それぞれフラグを設け、あるアドレスに書き込みが行わ
れた時にはそのアドレスに対応するフラグを「1」に
し、そのアドレスから読み出しが行われた時にはそのア
ドレスに対応するフラグを「0」にし、これら各フラグ
の値を監視することによりフル信号およびエンプティ信
号を生成するようにしたものである。これにより、すべ
てのフラグが「1」であればフル状態と判定し、すべて
のフラグが「0」であればエンプティ状態と判定するこ
とができ、ハザードが発生しないフル信号およびエンプ
ティ信号を生成することができる。
According to the present invention, in order to achieve the above object, a flag is provided for each address of a FIFO memory, and when writing is performed at a certain address, a flag corresponding to the address is provided. Is set to "1", when reading is performed from the address, the flag corresponding to the address is set to "0", and the values of these flags are monitored to generate a full signal and an empty signal. is there. Thus, if all the flags are “1”, it is determined that the state is the full state, and if all the flags are “0”, it is possible to determine that the state is the empty state, and a full signal and an empty signal that do not generate a hazard are generated. be able to.

【0007】[0007]

【発明の実施の形態】本発明の請求項1に記載の発明
は、FIFOメモリの各アドレスに対応してそれぞれフ
ラグを設け、前記アドレスに書き込みが行われた時には
そのアドレスに対応するフラグを「1」にし、前記アド
レスから読み出しが行われた時にはそのアドレスに対応
するフラグを「0」にし、前記各フラグの値を基にエン
プティ信号およびフル信号を生成することを特徴とする
ものであり、すべてのフラグが「1」であればフル状態
と判定し、すべてのフラグが「0」であればエンプティ
状態と判定することにより、ハザードが発生しないフル
信号およびエンプティ信号を生成できるという作用を有
する。
According to the first aspect of the present invention, a flag is provided for each address of a FIFO memory, and when writing is performed on the address, the flag corresponding to the address is set to " 1), and when reading is performed from the address, a flag corresponding to the address is set to “0”, and an empty signal and a full signal are generated based on the value of each flag. When all the flags are "1", it is determined that the signal is in the full state, and when all the flags are "0", it is determined that the signal is in the empty state. Thus, a full signal and an empty signal that do not cause a hazard can be generated. .

【0008】本発明の請求項2に記載の発明は、FIF
Oメモリの各アドレスに対応してそれぞれフラグを設
け、前記アドレスに書き込みが行われた時にはそのアド
レスに対応するフラグを「1」にし、前記アドレスから
読み出しが行われた時にはそのアドレスに対応するフラ
グを「0」にし、前記各フラグのすべての出力をAND
回路およびNAND回路にそれぞれ入力させて、それら
の出力からフル信号およびエンプティ信号を生成するこ
とを特徴とするものであり、すべてのフラグが「1」で
あればフル状態と判定し、すべてのフラグが「0」であ
ればエンプティ状態と判定することにより、ハザードが
発生しないフル信号およびエンプティ信号を生成できる
という作用を有する。
According to a second aspect of the present invention, an FIF
A flag is provided in correspondence with each address of the O memory, and when writing to the address is performed, the flag corresponding to the address is set to “1”, and when reading from the address is performed, the flag corresponding to the address is set. Is set to “0”, and all outputs of the flags are ANDed.
A full signal and an empty signal are generated from their outputs, and if all the flags are "1", it is determined that the signals are in a full state. If “0” is “0”, it is possible to generate a full signal and an empty signal that do not cause a hazard by determining that the signal is in the empty state.

【0009】(実施の形態)以下、本発明の実施の形態
を図面を参照して説明する。図1は本実施の形態におけ
るデータの読み書き制御の方法を示している。図1にお
いて、FIFOメモリ11には、ライトカウンタ12お
よびリードカウンタ13が接続されており、図示されな
いメモリ制御部により制御される。データを書き込む際
には、ライトカウンタ12が指し示しているアドレスに
データが書き込まれる。FIFOメモリ11には、同じ
アドレスにデータ領域11aとフラグ領域11bとが設
けられている。いま、アドレス0のデータ領域11aに
データ0が書き込まれると、フラグ領域11bの対応す
るフラグ0には「1」が書き込まれる。また、アドレス
1のデータ領域11aにデータ1が書き込まれると、フ
ラグ領域11bの対応するフラグ1には「1」が書き込
まれる。データが書き込まれると、その都度ライトカウ
ンタ12の値が1ずつ増加し、最後のアドレスNにデー
タNが書き込まれると、すべてのフラグが「1」にな
り、FIFOメモリ11はフル状態となる。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 shows a data read / write control method according to the present embodiment. In FIG. 1, a write counter 12 and a read counter 13 are connected to a FIFO memory 11, and are controlled by a memory control unit (not shown). When writing data, the data is written to the address indicated by the write counter 12. In the FIFO memory 11, a data area 11a and a flag area 11b are provided at the same address. Now, when data 0 is written to the data area 11a at the address 0, "1" is written to the corresponding flag 0 in the flag area 11b. When data 1 is written to the data area 11a at the address 1, "1" is written to the corresponding flag 1 in the flag area 11b. Each time data is written, the value of the write counter 12 increases by one each time. When data N is written to the last address N, all flags are set to "1", and the FIFO memory 11 becomes full.

【0010】一方、データを読み出す際には、リードカ
ウンタ13が指し示しているアドレスからデータが読み
出される。いま、リードカウンタ13の値が0の場合
は、アドレス0に書き込まれたデータ0が読み出され、
それに対応するフラグ0の値が「0」になる。また、リ
ードカウンタ13の値が1の場合は、アドレス1に書き
込まれたデータ1が読み出され、それに対応するフラグ
1の値が「0」になる。書き込まれたデータが読み出さ
れると、その都度リードカウンタ13の値が1ずつ増加
し、最後のアドレスNのデータNが読み出されると、す
べてのフラグが「0」になり、FIFOメモリ11はエ
ンプティ状態となる。
On the other hand, when reading data, the data is read from the address indicated by the read counter 13. Now, when the value of the read counter 13 is 0, the data 0 written at the address 0 is read,
The value of the flag 0 corresponding thereto becomes “0”. When the value of the read counter 13 is 1, the data 1 written at the address 1 is read, and the value of the flag 1 corresponding to the data 1 becomes “0”. Whenever the written data is read, the value of the read counter 13 increases by one each time. When the data N of the last address N is read, all the flags are set to "0", and the FIFO memory 11 is in the empty state. Becomes

【0011】FIFOメモリ11のフル状態およびエン
プティ状態は、AND回路14およびNAND回路15
により判定される。すなわち、フル状態の場合は、すべ
てのフラグが「1」であるので、すべてのフラグの出力
を入力とするAND回路14は「1」を出力し、フル信
号を出力する。どれか1つのフラグが「0」であれば
「0」が出力され、フル信号は出力されない。また、エ
ンプティ状態の場合は、すべてのフラグが「0」である
ので、すべてのフラグの出力を入力とするNAND回路
15は「1」を出力し、エンプティ信号を出力する。ど
れか1つのフラグが「1」であれば「0」が出力され、
エンプティ信号は出力されない。その際、例えば図2に
示すように、アドレス0のデータ0が読み出されてフラ
グ0が「0」になった後、アドレス1のデータ1が読み
出されてフラグ1が「0」に変化しても、このような変
化は逐次的であり、従来例のように同時に2つの信号が
変化することがないので、AND回路14やNAND回
路15を使用しても、フル信号やエンプティ信号にハザ
ードが生じることがない。
The full state and the empty state of the FIFO memory 11 are determined by an AND circuit 14 and a NAND circuit 15.
Is determined by That is, in the full state, all the flags are “1”, and the AND circuit 14 that receives the outputs of all the flags outputs “1” and outputs a full signal. If any one flag is "0", "0" is output and no full signal is output. In the case of the empty state, all the flags are "0", so that the NAND circuit 15 which receives the outputs of all the flags outputs "1" and outputs the empty signal. If any one flag is "1", "0" is output,
No empty signal is output. At this time, for example, as shown in FIG. 2, after data 0 at address 0 is read and flag 0 becomes “0”, data 1 at address 1 is read and flag 1 changes to “0”. However, such a change is sequential, and two signals do not change at the same time as in the conventional example. Therefore, even if the AND circuit 14 or the NAND circuit 15 is used, a full signal or an empty signal is generated. Hazard does not occur.

【0012】このように、本実施の形態によれば、FI
FOメモリ11の各アドレスに対応してそれぞれフラグ
を設け、あるアドレスに書き込みが行われた時にはその
アドレスに対応するフラグを「1」にし、アドレスから
読み出しが行われた時にはそのアドレスに対応するフラ
グを「0」にし、各フラグのすべての出力をAND回路
14およびNAND回路15にそれぞれ入力させて、そ
れらの出力からフル信号およびエンプティ信号を生成す
るようにしたので、フル信号およびエンプティ信号にお
けるハザードの発生を防止することができる。
As described above, according to the present embodiment, the FI
A flag is provided corresponding to each address of the FO memory 11, and when writing is performed at a certain address, the flag corresponding to the address is set to “1”, and when reading is performed from the address, the flag corresponding to the address is set. Is set to "0", and all outputs of each flag are input to the AND circuit 14 and the NAND circuit 15, respectively, to generate a full signal and an empty signal from those outputs. Can be prevented from occurring.

【0013】[0013]

【発明の効果】本発明は、上記実施の形態から明らかな
ように、FIFOメモリの各アドレスに対応してそれぞ
れフラグを設け、あるアドレスに書き込みが行われた時
にはそのアドレスに対応するフラグを「1」にし、その
アドレスから読み出しが行われた時にはそのアドレスに
対応するフラグを「0」にし、これら各フラグの値を基
にフル信号およびエンプティ信号を生成するようにした
ので、ハザードが発生しないフル信号およびエンプティ
信号を生成することができる。
According to the present invention, as is apparent from the above embodiment, a flag is provided for each address of the FIFO memory, and when writing is performed at a certain address, the flag corresponding to that address is set to " When reading is performed from the address, the flag corresponding to the address is set to "0", and a full signal and an empty signal are generated based on the values of these flags, so that no hazard occurs. A full signal and an empty signal can be generated.

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

【図1】本発明の実施の形態におけるFIFOメモリ制
御方法を示す概略ブロック図
FIG. 1 is a schematic block diagram illustrating a FIFO memory control method according to an embodiment of the present invention.

【図2】本発明の実施の形態における動作を示すタイミ
ング図
FIG. 2 is a timing chart showing an operation in the embodiment of the present invention;

【図3】従来例におけるFIFOメモリ制御方法を示す
概略ブロック図
FIG. 3 is a schematic block diagram showing a FIFO memory control method in a conventional example.

【図4】従来例における動作を示すタイミング図FIG. 4 is a timing chart showing an operation in a conventional example.

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

11 FIFOメモリ 12 ライトカウンタ 13 リードカウンタ 14 AND回路 15 NAND回路 Reference Signs List 11 FIFO memory 12 Write counter 13 Read counter 14 AND circuit 15 NAND circuit

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 FIFOメモリの各アドレスに対応して
それぞれフラグを設け、前記アドレスに書き込みが行わ
れた時にはそのアドレスに対応するフラグを「1」に
し、前記アドレスから読み出しが行われた時にはそのア
ドレスに対応するフラグを「0」にし、前記各フラグの
値を基にエンプティ信号およびフル信号を生成すること
を特徴とするFIFOメモリのハザード防止回路。
1. A flag is provided for each address of a FIFO memory, and when writing to the address is performed, the flag corresponding to the address is set to “1”, and when reading is performed from the address, the flag is set to “1”. A hazard prevention circuit for a FIFO memory, wherein a flag corresponding to an address is set to "0", and an empty signal and a full signal are generated based on the value of each flag.
【請求項2】 FIFOメモリの各アドレスに対応して
それぞれフラグを設け、前記アドレスに書き込みが行わ
れた時にはそのアドレスに対応するフラグを「1」に
し、前記アドレスから読み出しが行われた時にはそのア
ドレスに対応するフラグを「0」にし、前記各フラグの
すべての出力をAND回路およびNAND回路にそれぞ
れ入力させて、それらの出力からフル信号およびエンプ
ティ信号を生成することを特徴とするFIFOメモリの
ハザード防止回路。
2. A flag is provided corresponding to each address of the FIFO memory. When writing is performed on the address, the flag corresponding to the address is set to “1”, and when reading is performed from the address, the flag is set. A flag corresponding to an address is set to "0", all outputs of the flags are input to an AND circuit and a NAND circuit, respectively, and a full signal and an empty signal are generated from those outputs. Hazard prevention circuit.
JP10087611A 1998-03-31 1998-03-31 Hazard prevention circuit for fifo memory Pending JPH11282650A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10087611A JPH11282650A (en) 1998-03-31 1998-03-31 Hazard prevention circuit for fifo memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10087611A JPH11282650A (en) 1998-03-31 1998-03-31 Hazard prevention circuit for fifo memory

Publications (1)

Publication Number Publication Date
JPH11282650A true JPH11282650A (en) 1999-10-15

Family

ID=13919779

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10087611A Pending JPH11282650A (en) 1998-03-31 1998-03-31 Hazard prevention circuit for fifo memory

Country Status (1)

Country Link
JP (1) JPH11282650A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014505407A (en) * 2010-12-21 2014-02-27 コニンクリーケ・ケイピーエヌ・ナムローゼ・フェンノートシャップ A method and system for handling service requests in a telecommunications network.

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014505407A (en) * 2010-12-21 2014-02-27 コニンクリーケ・ケイピーエヌ・ナムローゼ・フェンノートシャップ A method and system for handling service requests in a telecommunications network.

Similar Documents

Publication Publication Date Title
KR0123239B1 (en) Fifo memory
US5781802A (en) First-in-first-out (FIFO) controller for buffering data between systems which are asynchronous and free of false flags and internal metastability
JPS607812B2 (en) Data buffering device
JPH0136146B2 (en)
US5825204A (en) Apparatus and method for a party check logic circuit in a dynamic random access memory
JPH11282650A (en) Hazard prevention circuit for fifo memory
JP2002109874A (en) Method and device for deciding number of empty memory position in fifo memory device
JPH1049444A (en) Storage device and its control method
JP2723843B2 (en) Dual port memory control circuit
JPS607529A (en) Buffer memory device
JP2979918B2 (en) Interrupt detection circuit
US20080024421A1 (en) Liquid crystal display driver and liquid crystal display device mounting the same
KR100338402B1 (en) Memory device and method of controlling the same
JPH07271553A (en) Memory control method for fifo memory device
JPH09274599A (en) Buffer memory device
KR100186298B1 (en) Address transition detecting circuit of memory device
US5953349A (en) Data variation detecting system
JPH05165735A (en) Identification system for parity error occured memory element
JPS62219390A (en) Fifo memory
JPH04152426A (en) Elastic store memory control circuit
JPH02302855A (en) Memory control system
JPH04137135A (en) Program memory control circuit
JPH0619742A (en) Tracer circuit
JPH02209010A (en) Timing pulse generating circuit
JPH06290581A (en) Control system for writing first-in first-out memory