JPH02189026A - Detector for overflow and underflow of counter - Google Patents

Detector for overflow and underflow of counter

Info

Publication number
JPH02189026A
JPH02189026A JP836089A JP836089A JPH02189026A JP H02189026 A JPH02189026 A JP H02189026A JP 836089 A JP836089 A JP 836089A JP 836089 A JP836089 A JP 836089A JP H02189026 A JPH02189026 A JP H02189026A
Authority
JP
Japan
Prior art keywords
counter
gate
sign bit
count value
overflow
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
JP836089A
Other languages
Japanese (ja)
Inventor
Ryosaku Obo
於保 良策
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP836089A priority Critical patent/JPH02189026A/en
Publication of JPH02189026A publication Critical patent/JPH02189026A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To simplify the circuit constitution by having only to supervise the state of two bits being a sign bit and the most significant bit(MSB) of a count of a counter to detect overflow and underflow of the counter. CONSTITUTION:With a pulse signal 2 fed to a counter 1, a count 4 is incremented by 1 to be '1000' and both a sign bit 10 and the MSB 11 are changed. Since level '0' of the sign bit 10 before the change and level '1' of the sign bit 10 after the change are applied to an exclusive OR gate 13 in this case, its output is inverted to a level 1. Since two inputs '10' after the change are fed to an exclusive OR gate 14, its output goes to the level '1'. Thus, a detection signal of level 1 being the result of detecting overflow is outputted from an AND gate 15. Thus, the circuit constitution is simplified.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、パルス信号を計数するカウンタのオーバフ
ロー及びアンダフロー検出装置に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an overflow and underflow detection device for a counter that counts pulse signals.

〔従来の技術〕[Conventional technology]

第2図は「基礎電子計算機 改訂版」 (実数出版、P
P74−75.1981年3月5日発行)に示された従
来のカウンタのオーバフロー及びアンダフロー検出装置
を示すブロック図であり、図において、1は入力パルス
信号をカウントアツプ又はカウントダウンする例えば4
ビツトのカウンタ、2はカウンタ1でカウントアツプさ
れるパルス信1号、3はカウンタ1でカウントダウンさ
れるパルス信号、4はカウンタ1の4ビツトで表わされ
る計数値、5はカウンタ1の計数値4と上記パルス信号
2とが加えられるアンドゲートで、計数値4のうちの最
上位の符号ビットのみが負論理で加えられる。6はカウ
ンタ1の計数値4と上記パルス信号3とが加えられるア
ンドゲートで、計数値4のうちの符号ビット以外の3ビ
ツトが負論理で加えられる。7はアンドゲート5,6の
出力信号が加えられるオアゲート、8はアンドゲート5
.6及びオアゲート7で構成されるオーバフロー アン
ダフローの検出装置、9はオアゲート7から出力される
オーバフロー アンダフローを検出した検出信号である
Figure 2 is “Basic Computers Revised Edition” (Jitsuzai Publishing, p.
74-75 (issued March 5, 1981) is a block diagram showing a conventional counter overflow and underflow detection device, in which 1 indicates 4, for example, which counts up or counts down an input pulse signal.
Bit counter, 2 is the pulse signal 1 counted up by counter 1, 3 is the pulse signal counted down by counter 1, 4 is the count value expressed by 4 bits of counter 1, 5 is the count value 4 of counter 1 and the above pulse signal 2 are added to the AND gate, and only the most significant sign bit of the count value 4 is added in negative logic. 6 is an AND gate to which the count value 4 of the counter 1 and the above-mentioned pulse signal 3 are added, and 3 bits of the count value 4 other than the sign bit are added in negative logic. 7 is an OR gate to which the output signals of AND gates 5 and 6 are added; 8 is an AND gate 5
.. An overflow/underflow detection device includes an overflow/underflow detection device 6 and an OR gate 7, and 9 is a detection signal output from the OR gate 7 for detecting an overflow/underflow.

次に動作について説明する。カウンタ1は、パルス信号
2.3の入力回数に応じた2進数の計数値4を出力する
ものであり、パルス信号2が加えられれば、計数値4は
「1」加算され、パルス信号3が加えられれば、計数値
4は「1」減算される。ここで、計数値4はその最上位
ビットを符号ビットとして、正負両特性を表現するため
、検出装置8はオーバフロー及びアンダフロー検出に際
しては、符号ビットを含む計数値4の4ビツトとパルス
信号2又はパルス信号3とのすべての信号を入力させて
、状態を監視し、それらの組み合せ論理により、オーバ
フロー アンダフローを検出する構成となっている。即
ち、検出装置8においては、計数値4がrolllJ 
 (2進数)の状態にあるとき、パルス信号2が加えら
れると、アンドゲート5が信号を出力し、この信号がオ
アゲート7を通じてオーバフローの検出信号9として出
力される。また計数値4がrl 0OOJ  (2進数
)の状態にあるとき、パルス信号3が加えられると、ア
ンドゲート6が信号を出力し、この信号がオアゲート7
を通じてアンダフローの検出信号9として出力される。
Next, the operation will be explained. Counter 1 outputs a binary count value 4 according to the number of inputs of pulse signal 2.3, and when pulse signal 2 is added, count value 4 is incremented by 1, and pulse signal 3 is If added, the count value 4 is subtracted by "1". Here, since the count value 4 expresses both positive and negative characteristics by using its most significant bit as a sign bit, the detection device 8 uses the 4 bits of the count value 4 including the sign bit and the pulse signal 2 when detecting overflow and underflow. Alternatively, all the signals including the pulse signal 3 are inputted, the status is monitored, and overflow and underflow are detected by their combination logic. That is, in the detection device 8, the count value 4 is rollJ
(binary number), when the pulse signal 2 is applied, the AND gate 5 outputs a signal, and this signal is output through the OR gate 7 as an overflow detection signal 9. Further, when the count value 4 is in the state of rl 0OOJ (binary number), when the pulse signal 3 is added, the AND gate 6 outputs a signal, and this signal is transmitted to the OR gate 7.
The underflow detection signal 9 is outputted as an underflow detection signal 9.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

従来のカウンタのオーバフロー及びアンダフロー検出装
置は、以上のように構成されているので、計数値4のす
べての出力ビットとパルス信号2.3とを入力しなけれ
ばならないため、装置内のゲート数が計数値4の出力ビ
ットに比例して増加し、このため回路構成が複雑となり
、その分コストの増加を招くなどの問題点があった。
Since the conventional counter overflow and underflow detection device is configured as described above, all the output bits of the count value 4 and the pulse signal 2.3 must be input, so the number of gates in the device is limited. increases in proportion to the output bit of count value 4, which causes problems such as a complicated circuit configuration and a corresponding increase in cost.

この発明は、上記のような問題点を解消するためになさ
れたもので、計数値の出力ビツト数に影響を受けないカ
ウンタのオーバフロー及びアンダフロー検出装置を得る
ことを目的とする。
The present invention has been made to solve the above-mentioned problems, and it is an object of the present invention to provide a counter overflow and underflow detection device that is not affected by the number of output bits of a count value.

〔課題を解決するための手段〕[Means to solve the problem]

この発明に係るカウンタのオーバフロー及びアンダフロ
ー検出装置は、計数値の符号ビットとMSB(最上位ビ
ット)の状態だけを監視し、それらの状態変化と組み合
せ論理とにより、オーバフロー及びアンダフロー検出を
可能としたものである。
The counter overflow and underflow detection device according to the present invention monitors only the sign bit and MSB (most significant bit) of the count value, and can detect overflow and underflow by using changes in these states and combinatorial logic. That is.

(作用) この発明における、カウンタのオーバフロー及びアンダ
フロー検出装置は、計数値の符号ビットとMSBとを入
力して、それが互いに異る状態から変化したことを検出
するように成される。
(Operation) The counter overflow and underflow detection device of the present invention is configured to input the sign bit and MSB of a count value and detect that they have changed from mutually different states.

〔実施例〕〔Example〕

以下、この発明の一実施例を図について説明する。第1
図においては、第2図と対応する部分には同一符号を付
して説明を省略する。
An embodiment of the present invention will be described below with reference to the drawings. 1st
In the figure, parts corresponding to those in FIG. 2 are designated by the same reference numerals, and their explanation will be omitted.

10は4ビツトの計数値4のうちの最上位の符号ビット
、11は符号ビットの次のビットで、ここではこのビッ
トを最上位ビット(以下MSBIIと称する)とする。
10 is the most significant sign bit of the 4-bit count value 4, and 11 is the next bit after the sign bit. Here, this bit is referred to as the most significant bit (hereinafter referred to as MSBII).

12は符号ビット10の変化する前の状態を記憶する記
憶手段で、この実施例ではフリップフロップ12が用い
られている。13はフリップフロップ12の出力と符号
ビット10とが加えられる第1の比較回路で、この実施
例では排他的オアゲート13が用いられている。14は
符号ビット10とMSBIIとが加えられる第2の比較
回路で、この実施例では排他的オアゲート14が用いら
れている。15は排他的オアゲート13.14の出力が
加えられ、検出信号9を出力する論理積回路で、この実
施例ではアンドゲート15が用いられている。
Reference numeral 12 denotes a storage means for storing the state of the sign bit 10 before it changes, and a flip-flop 12 is used in this embodiment. 13 is a first comparison circuit to which the output of the flip-flop 12 and the sign bit 10 are added; in this embodiment, an exclusive OR gate 13 is used. 14 is a second comparison circuit to which sign bit 10 and MSBII are added; in this embodiment, exclusive OR gate 14 is used. 15 is an AND circuit to which the outputs of exclusive OR gates 13 and 14 are added and outputs a detection signal 9; in this embodiment, AND gate 15 is used.

次に動作について説明する。カウンタ1の計数値4がr
olllJの状態にあるとき、その符号ビット10のr
□、がフリップフロップ12で保持されている。従って
排他的オアゲート13の2人力は「00」となり、その
出力は「O」となっている。また排他的オアゲート14
の2人力は「01」となり、その出力は「1」となって
いる。従って、アンドゲート15の出力は「0」となっ
ている。
Next, the operation will be explained. The count value 4 of counter 1 is r
When in the state olllJ, its sign bit 10 r
□ is held by the flip-flop 12. Therefore, the two-man power of the exclusive OR gate 13 is "00", and its output is "O". Also exclusive or gate 14
The two-man power is "01", and the output is "1". Therefore, the output of the AND gate 15 is "0".

この状態において、パルス信号2がカウンタ1に加えら
れると、計数値4は「1」が加算されて「1000」と
なり、符号ビット10及びMSBIIは共に変化する。
In this state, when pulse signal 2 is applied to counter 1, "1" is added to count value 4 to become "1000", and sign bit 10 and MSBII both change.

このとぎ排他的オアゲート13は変化する前の符号ビッ
ト10の「0」と変化後の符号ビット10の「1」とが
加えられるため、その出力は「1」に反転する。また排
他的オアゲート14は変化した後の2人力「10」が加
えられるため、その出力は「1」となる。従フて、アン
ドゲート15より、オーバフローを検出した「1」の検
出信号が出力される。
In this exclusive OR gate 13, the "0" of the sign bit 10 before the change and the "1" of the sign bit 10 after the change are added, so its output is inverted to "1". Furthermore, since the changed two-man power "10" is added to the exclusive OR gate 14, its output becomes "1". Therefore, the AND gate 15 outputs a detection signal of "1" indicating that an overflow has been detected.

次に、カウンタ1の計数値4がrl 0OOJの状態に
あるときは、フリップフロップ12の出力が「1」とな
っている。従って、排他的オアゲート13の2人力は「
11」で、その出力は「0」となっている。また排他的
オアゲート14の2人力は「10」で、その出力は「1
」となっている。従って、アンドゲート15の出力は「
0」となっている。
Next, when the count value 4 of the counter 1 is in the state of rl 0OOJ, the output of the flip-flop 12 is "1". Therefore, the two-man power of Exclusive OR Gate 13 is “
11" and its output is "0". Also, the two-person power of exclusive OR gate 14 is "10", and its output is "1".
”. Therefore, the output of the AND gate 15 is "
0".

この状態で、カウンタ1にパルス信号3が加えられると
、計数値4は「1」が減算されて、rolllJとなる
。従って、排他的オアゲート13.14の2人力は夫々
riot。
In this state, when pulse signal 3 is applied to counter 1, "1" is subtracted from count value 4, resulting in rollJ. Therefore, the two members of Exclusive OR Gate 13 and 14 are each riot.

「01」に変化して、それらの出力は共に「1」となる
。この結果、アンドゲート15より、アンダフローを検
出した検出信号9が出力される。
The output changes to "01" and both outputs become "1". As a result, the AND gate 15 outputs a detection signal 9 that detects underflow.

〔発明の効果〕〔Effect of the invention〕

以上のように、この発明によれば、カウンタのオーバフ
ロー及びアンダフローの検出を、カウンタの計数値の符
号ビット及びMSBの2ビツトの状態を監視するのみで
行うように構成したので、回路構成が簡略化され、装置
が安価にできる効果がある。
As described above, according to the present invention, overflow and underflow of the counter are detected by only monitoring the sign bit and the MSB 2 bits of the count value of the counter, so that the circuit configuration is simplified. This has the effect of being simplified and making the device cheaper.

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

第1図は、この発明の一実施例によるカウンタのオーバ
フロー及びアンダフロー検出装置を示すブロック図、第
2図は、従来のカウンタのオーバフロー及びアンダフロ
ー検出装置を示すブロック図である。 1はカウンタ、2はカウントアツプされるパルス信号、
3はカウントダウンされるパルス信号、4は計数値、8
はオーバフロー及びアンダフローの検出装置、9は検出
信号、1oは計数値内の符号ビット、11は計数値内の
MSB、12は符号ビット保持用のフリップフロップ、
13.14は排他的オアゲート、15はアンドゲート。 なお、図中、同一符号は同一、又は相当部分を示す。 第1図
FIG. 1 is a block diagram showing a counter overflow and underflow detection device according to an embodiment of the present invention, and FIG. 2 is a block diagram showing a conventional counter overflow and underflow detection device. 1 is a counter, 2 is a pulse signal that is counted up,
3 is a pulse signal to be counted down, 4 is a count value, 8
is an overflow and underflow detection device, 9 is a detection signal, 1o is a sign bit in the count value, 11 is the MSB in the count value, 12 is a flip-flop for holding the sign bit,
13.14 is an exclusive or gate, 15 is an and gate. In addition, in the figures, the same reference numerals indicate the same or equivalent parts. Figure 1

Claims (1)

【特許請求の範囲】[Claims] パルス信号を計数するカウンタの計数値の符号ビットを
記憶する記憶手段と、上記記憶手段の出力と上記計数値
の現在の符号ビットとが加えられる第1の比較回路と、
上記現在の符号ビットと上記計数値の最上位ビットとが
加えられる第2の比較回路と、上記第1及び第2の比較
回路の出力が加えられる論理積回路とをそなえたカウン
タのオーバフロー及びアンダフロー検出装置。
a storage means for storing a sign bit of a count value of a counter for counting pulse signals; a first comparator circuit to which the output of the storage means and the current sign bit of the count value are added;
Overflow and underflow of a counter comprising a second comparator circuit to which the current sign bit and the most significant bit of the count value are added, and an AND circuit to which the outputs of the first and second comparator circuits are added. Flow detection device.
JP836089A 1989-01-17 1989-01-17 Detector for overflow and underflow of counter Pending JPH02189026A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP836089A JPH02189026A (en) 1989-01-17 1989-01-17 Detector for overflow and underflow of counter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP836089A JPH02189026A (en) 1989-01-17 1989-01-17 Detector for overflow and underflow of counter

Publications (1)

Publication Number Publication Date
JPH02189026A true JPH02189026A (en) 1990-07-25

Family

ID=11691065

Family Applications (1)

Application Number Title Priority Date Filing Date
JP836089A Pending JPH02189026A (en) 1989-01-17 1989-01-17 Detector for overflow and underflow of counter

Country Status (1)

Country Link
JP (1) JPH02189026A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0438137U (en) * 1990-07-27 1992-03-31
EP0613251A1 (en) * 1993-02-26 1994-08-31 Thomson-Csf Semiconducteurs Specifiques Frequency divider
US7738621B2 (en) * 2007-09-28 2010-06-15 Hynix Semiconductor Inc. Counter with overflow prevention capability

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56114071A (en) * 1980-02-13 1981-09-08 Nec Corp Arithmetic circuit
JPS59156049A (en) * 1983-02-25 1984-09-05 Fujitsu Ltd Signal detecting circuit
JPS61131654A (en) * 1984-11-30 1986-06-19 Fujitsu Ltd Tri-state signal decoding system
JPH0269823A (en) * 1988-09-06 1990-03-08 Fujitsu Ltd Overflow detection circuit

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56114071A (en) * 1980-02-13 1981-09-08 Nec Corp Arithmetic circuit
JPS59156049A (en) * 1983-02-25 1984-09-05 Fujitsu Ltd Signal detecting circuit
JPS61131654A (en) * 1984-11-30 1986-06-19 Fujitsu Ltd Tri-state signal decoding system
JPH0269823A (en) * 1988-09-06 1990-03-08 Fujitsu Ltd Overflow detection circuit

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0438137U (en) * 1990-07-27 1992-03-31
EP0613251A1 (en) * 1993-02-26 1994-08-31 Thomson-Csf Semiconducteurs Specifiques Frequency divider
FR2702106A1 (en) * 1993-02-26 1994-09-02 Thomson Csf Semiconducteurs Frequency divider.
US5469485A (en) * 1993-02-26 1995-11-21 Thomson-Csf Semiconducteurs Specifiques Frequency divider
US7738621B2 (en) * 2007-09-28 2010-06-15 Hynix Semiconductor Inc. Counter with overflow prevention capability

Similar Documents

Publication Publication Date Title
JPH02189026A (en) Detector for overflow and underflow of counter
JPH06188872A (en) Synchronization protective circuit
KR100463846B1 (en) Clock Monitoring Apparatus of Switching System
JPH0554289A (en) Alarm signal detecting circuit
KR100366800B1 (en) Apparatus for detecting error of external clock in transmission system
JPH04239842A (en) Data interrupt detection circuit
KR0127331Y1 (en) Retry apparatus of ticom bus
JP2606425B2 (en) Fault condition detection circuit
JPH01154239A (en) Parity detecting device
JPH0364213A (en) Counter checking circuit
JPH01212917A (en) Counter circuit
JPH029251A (en) Framing error status circuit
JPH0212427A (en) Minimum value detecting circuit for television signal
JPH02260728A (en) Ais detecting system
KR970019598A (en) Video encoder's abnormal status detection and automatic recovery circuit
JPH03256421A (en) Slip detection circuit
JP2001111517A (en) Ais-detecting circuit
JPH04302523A (en) Pulse generator
JPH05233216A (en) Comparing device
JPH04172715A (en) Coincidence detection circuit
JPS60187813A (en) Detecting system on abnormality of absolute signal of absolute encoder
JPH03277029A (en) Ais detection circuit
JPS63145541A (en) Modulo-w circuit
JPH01192217A (en) Clock signal disconnection detecting circuit
JPS6335038A (en) Communication line state detection circuit