JPH0445856B2 - - Google Patents

Info

Publication number
JPH0445856B2
JPH0445856B2 JP62045881A JP4588187A JPH0445856B2 JP H0445856 B2 JPH0445856 B2 JP H0445856B2 JP 62045881 A JP62045881 A JP 62045881A JP 4588187 A JP4588187 A JP 4588187A JP H0445856 B2 JPH0445856 B2 JP H0445856B2
Authority
JP
Japan
Prior art keywords
output
bit
circuit
adder
adder circuit
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 - Lifetime
Application number
JP62045881A
Other languages
Japanese (ja)
Other versions
JPS63211431A (en
Inventor
Akira Sawamura
Yasuyuki Oonishi
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.)
Rohm Co Ltd
Original Assignee
Rohm 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 Rohm Co Ltd filed Critical Rohm Co Ltd
Priority to JP62045881A priority Critical patent/JPS63211431A/en
Publication of JPS63211431A publication Critical patent/JPS63211431A/en
Publication of JPH0445856B2 publication Critical patent/JPH0445856B2/ja
Granted legal-status Critical Current

Links

Description

【発明の詳細な説明】 (a) 産業上の利用分野 この発明は符号(正または負)の特定しない2
つの2進データを加算する加算回路に関し、時に
巡回形のデジタルフイルタなどに好適な加算回路
に関する。
[Detailed description of the invention] (a) Industrial application field This invention does not specify a sign (positive or negative).
The present invention relates to an adder circuit that adds two binary data, and sometimes relates to an adder circuit suitable for a cyclic digital filter or the like.

(b) 従来の技術および発明が解決しようとする問
題点 従来の加算回路では入力された2つの2進デー
タを単に加算していただけであつたために、加算
出力がオーバーフローしたりアンダーフローした
場合に加算出力の符号(正または負)が反転し、
加算結果が大きく変化するという問題があつた。
たとえば4ビツト加算器では、“0111”(+7)と
“1100”(−4)を加算器に与えると加算出力が
“0011”(+3)となつて加算結果に問題を生じる
ことがないが、“0111”(+7)と“0001”(+1)
とを加算すると加算出力が“1000”(−8)とな
り加算結果にオーバーフローを生じてしまう。ま
た、“1001”(−7)と“1110”(−2)とを加算
すると“0111”(+7)となりアンダーフローを
生じてしまう。すなわち4ビツトの加算回路では
第5図に示すような特性となり、図のq1およびq2
点おいて加算結果が大きく変化するために加算回
路として望ましいものではなかつた。またこのよ
うな問題を解決するために加算回路のビツト数を
入力データのビツト数よりも1ビツト分増やし、
加算結果にオーバーフローやアンダーフローが生
じないようにする方法も提案されているが、加算
回路を巡回形のデジタルフイルタなどに使用する
場合には回路内で加算結果の積算が生じるため
に、加算回路の余分なビツト数を相当に大きくし
ない限りいずれオーバーフローやアンダーフロー
の生じる可能性があつた。
(b) Problems to be Solved by the Prior Art and the Invention Since conventional adder circuits simply added two input binary data, when the addition output overflows or underflows, The sign (positive or negative) of the addition output is reversed,
There was a problem that the addition result changed significantly.
For example, in a 4-bit adder, if you feed "0111" (+7) and "1100" (-4) to the adder, the addition output will be "0011" (+3) and there will be no problem with the addition result. “0111” (+7) and “0001” (+1)
When these are added, the addition output becomes "1000" (-8) and an overflow occurs in the addition result. Furthermore, adding "1001" (-7) and "1110" (-2) results in "0111" (+7), which causes an underflow. In other words, a 4-bit adder circuit has characteristics as shown in Figure 5, and q 1 and q 2 in the figure
This is not desirable as an adder circuit because the addition result changes greatly in some respects. In addition, to solve this problem, the number of bits in the adder circuit is increased by one bit compared to the number of bits in the input data.
Methods have been proposed to prevent overflow or underflow from occurring in the addition results, but when an addition circuit is used in a cyclic digital filter, etc., the addition results are accumulated within the circuit, so the addition circuit Unless the number of extra bits is increased considerably, there is a possibility that overflow or underflow will occur.

この発明の目的は、オーバーフローやアンダー
フローが生じるのを防ぎ、加算出力が極端に変化
することのない加算回路を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide an adder circuit that prevents overflows and underflows from occurring and does not cause extreme changes in the addition output.

(c) 問題点を解決するための手段 この発明は、最上位ビツトを符号ビツトとする
2つの2進データを加算する加算回路において、 それぞれn(nは2以上の整数)ビツトの2つ
のデイジタルデータの同一ビツト目の2つのビツ
ト信号と下位ビツトからのキヤリーを入力し、加
算結果を出力するn個の加算回路と、 最上位ビツトの加算回路の出力を反転するイン
バータと、最上位ビツトの加算回路に入力される
2つのビツト信号と前記インバータの出力信号を
それぞれ入力するオアゲートおよび第1のナンド
ゲート、さらに前記オアゲートと第1のナンドゲ
ートを入力する第2のナンドゲートからなる判定
回路と、 前記判定回路の出力が論理0であるとき、前記
n個の加算回路の出力レベルを1〜nビツト目の
出力部にそのまま導き、前記判定回路の出力が論
理1であるとき、最上位ビツトの加算回路の出力
を反転して、nビツト目の出力部に導くととも
に、最上位ビツトの加算回路の出力レベルを1〜
(n−1)ビツト目の出力部に導く出力ゲート回
路からなる。
(c) Means for Solving the Problems This invention provides an adder circuit that adds two binary data whose most significant bit is a sign bit. n adder circuits that input the two bit signals of the same bit of data and the carry from the lower bit and output the addition results; an inverter that inverts the output of the adder circuit for the most significant bit; a determination circuit comprising an OR gate and a first NAND gate that input the two bit signals input to the adder circuit and the output signal of the inverter, respectively, and a second NAND gate that inputs the OR gate and the first NAND gate; When the output of the circuit is logic 0, the output level of the n adder circuits is directly led to the output section of the 1st to nth bits, and when the output of the judgment circuit is logic 1, the output level of the n adder circuits is led as is to the output section of the most significant bit. The output of the adder circuit is inverted and guided to the n-th bit output section, and the output level of the adder circuit of the most significant bit is set to 1 to 1.
It consists of an output gate circuit leading to the (n-1)th bit output section.

(d) 作用 この発明に係る加算回路では、最上位ビツトの
入力データを加算し、さらにその加算結果と最上
位ビツトへの入力データに基づいて加算出力がオ
ーバーフローするかアンダーフローするかを判定
する。2つの2進データを加算してオーバーフロ
ーまたはアンダーフローする場合は、2つのデー
タの符号ビツトが同一である場合に限る。2つの
データの符号が異なつている場合にはオーバーフ
ローやアンダーフローを生じることがない。さら
に2つのデータの符号が同一であつても最上位ビ
ツト(符号ビツト)の加算結果によつてはオーバ
ーフローやアンダーフローの生じないことがあ
る。たとえば、2つの入力データが共に負である
場合、最上位ビツトの加算結果が負を表す“1”
となつたときには、アンダーフローを生じない。
また2つのデータが共に正である場合、最上位ビ
ツトが正を表す“0”となつたときにはオーバー
フローを生じない。すなわちオーバーフローは第
2図のCASE1の場合にのみ生じ、アンダーフロ
ーは同図のCASE2の場合にのみ生じる。
(d) Effect The adder circuit according to the present invention adds the input data of the most significant bit, and further determines whether the addition output overflows or underflows based on the addition result and the input data to the most significant bit. . When two pieces of binary data are added together and an overflow or underflow occurs, only when the sign bits of the two pieces of data are the same. If the two data have different signs, no overflow or underflow will occur. Furthermore, even if two pieces of data have the same sign, overflow or underflow may not occur depending on the result of addition of the most significant bit (sign bit). For example, if two input data are both negative, the addition result of the most significant bit will be “1” indicating negative.
When , no underflow occurs.
Further, if both data are positive, no overflow occurs when the most significant bit becomes "0" indicating positive. That is, overflow occurs only in case 1 of FIG. 2, and underflow occurs only in case 2 of FIG.

したがつて本発明の加算回路では、入力Aデー
タと入力Bデータおよび最上位ビツト加算結果に
基づいて同図のCASE1に該当するかCASE2に該
当するかを判定する。そしてCASE1に該当する
場合には図のように加算出力を“0111…1”に設
定する。すなわち正の最大値に設定する。また
CASE2に該当する場合には加算出力を“1000…
0”に設定する。すなわち負の最大値に設定す
る。この結果この加算回路の特性は第3図に示す
ようになる。すなわち第5図に示すq1、q2を越
える領域では正または負の最大値に固定される。
このため加算出力の誤差が極端に大きくなるのを
防止することができる。
Therefore, the adder circuit of the present invention determines whether CASE1 or CASE2 in the figure applies based on the input A data, input B data, and the most significant bit addition result. If CASE1 applies, the addition output is set to "0111...1" as shown in the figure. In other words, set it to the maximum positive value. Also
If CASE2 applies, the addition output is set to “1000…”
0", that is, set it to the maximum negative value. As a result, the characteristics of this adder circuit become as shown in Figure 3. In other words, in the region exceeding q1 and q2 shown in Figure 5, the maximum positive or negative value Fixed to a value.
Therefore, it is possible to prevent the error in the addition output from becoming extremely large.

(e) 実施例 第1図はこの発明の実施例であるnビツトの加
算回路を示している。
(e) Embodiment FIG. 1 shows an n-bit adder circuit as an embodiment of the present invention.

入力されるnビツトの2進データA、Bはビツ
トごとに加算器1に入力されここで加算される。
各ビツトの加算結果にキヤリー(桁上げ信号)が
発生すれば、そのキヤリーが一つ上位の桁の加算
器1に対して加算すべきデータとして入力され
る。最上位ビツト(nビツト)の加算結果に生じ
たキヤリーは無視される。各加算器1の加算結果
は第1の出力ゲート2を介して出力される。最上
位ビツトの加算結果および最上位ビツトへの入力
データAn、Bnは判定回路3に出力される。この
判定回路3では、上記第2図に示すCASE1およ
びCASE2の状態が発生したかどうかを判定する。
CASE1またはCASE2のいずれかの状態(オーバ
ーフロー状態またはアンダーフロー状態)が発生
した場合には、ナンドゲートNANDを“H”に
設定し、それ以外は“L”に設定する。NAND
の出力はインバータINV1を介して第2の出力
ゲート4のゲート制御端子に供給される。また最
上位ビツトの加算結果は、最上位ビツトに関して
はインバータINV2で反転されて出力ゲート4
に導かれ、それ以外のビツトについては直接出力
ゲート4に導かれる。上記インバータINV1,
INV2および出力ゲート3は、第2図のCASE1
およびCASE2の場合に、同図に示す加算出力す
なわち正の最大値または負の最大値を出力する
正、負最大値設定回路5を構成する。
The input n-bit binary data A and B are input bit by bit to an adder 1 and added there.
If a carry (carry signal) is generated in the addition result of each bit, the carry is inputted as data to be added to the adder 1 of the next higher digit. A carry occurring in the addition result of the most significant bit (n bits) is ignored. The addition result of each adder 1 is outputted via a first output gate 2. The addition result of the most significant bit and the input data An, Bn to the most significant bit are output to the determination circuit 3. This determination circuit 3 determines whether the states CASE1 and CASE2 shown in FIG. 2 have occurred.
If either CASE1 or CASE2 (overflow state or underflow state) occurs, the NAND gate NAND is set to "H", and otherwise set to "L". NAND
The output of is supplied to the gate control terminal of the second output gate 4 via the inverter INV1. The addition result of the most significant bit is inverted by inverter INV2 and sent to output gate 4.
The other bits are directly guided to the output gate 4. Above inverter INV1,
INV2 and output gate 3 are CASE1 in Figure 2.
In the case of CASE2, a positive and negative maximum value setting circuit 5 is configured to output the addition output shown in the figure, that is, the positive maximum value or the negative maximum value.

上記の構成で第2図のCASE1およびCASE2に
該当しない場合には判定回路3のNAND出力が
“L”となり、出力ゲート2が選択される。これ
によつて各ビツトの加算器出力はそのまま出力ゲ
ート2を通過して出力端子SAに現れる。一方判
定回路3が第2図のCASE1またはCASE2に該
当することを判定した場合にはNAND出力が
“H”となるために出力ゲート4が選択される。
この場合には出力ゲート4の手前にINV2が存
在するのは最終ビツトだけであるために、結局第
2図に示したように出力端子SAに現れる加算結
果は、SASE1の場合“0111…1”となり
CASE2の場合には“1000…0”となる。すなわ
ち第3図に示す特性となる。
With the above configuration, if CASE1 and CASE2 in FIG. 2 do not apply, the NAND output of the determination circuit 3 becomes "L" and the output gate 2 is selected. As a result, the adder output of each bit passes through the output gate 2 as it is and appears at the output terminal SA. On the other hand, when the determination circuit 3 determines that CASE1 or CASE2 in FIG. 2 applies, the NAND output becomes "H" and the output gate 4 is selected.
In this case, INV2 exists before the output gate 4 only for the last bit, so the addition result that appears at the output terminal SA as shown in FIG. 2 is "0111...1" in the case of SASE1. next door
In case of CASE2, it is “1000…0”. That is, the characteristics shown in FIG. 3 are obtained.

第4図は上記の加算回路を使用して巡回形デジ
タルフイルタを構成した例を示している。この例
では3個の加算回路10,11,12を使用し、
一つのラツチ回路13を使用している。加算回路
10の一方の入力端子には加算回路11の出力を
ラツチするラツチ回路13の10ビツト分の出力が
帰還し、また加算回路11にはラツチ回路13の
すべての出力が帰還している。
FIG. 4 shows an example of a cyclic digital filter constructed using the above adder circuit. In this example, three adder circuits 10, 11, and 12 are used,
One latch circuit 13 is used. The 10-bit output of a latch circuit 13 that latches the output of the adder circuit 11 is fed back to one input terminal of the adder circuit 10, and all outputs of the latch circuit 13 are fed back to the adder circuit 11.

上記の加算回路を使用したこのデジタルフイル
タでは、各加算回路の加算結果が第3図のq1、
q2を越えた場合であつてもその時の加算回路の
誤差は第5図に示す場合と比較してかなり小さ
い。しかもある瞬間には加算結果がq1、q2を越
えたとしても、次の加算タイミングには再びq1
q2の間のリニアー領域に戻るかもしれない。すな
わち巡回形のデジタルフイルタでは加算結果が常
に変動するために、フイルタ全体の特性を考えた
場合第1図に示す加算回路を使用する場合に比べ
て大幅な特性改善を図ることができる。
In this digital filter using the above adder circuit, the addition result of each adder circuit is q1 in Figure 3,
Even if q2 is exceeded, the error in the adder circuit at that time is considerably smaller than in the case shown in FIG. Moreover, even if the addition result exceeds q1 and q2 at a certain moment, it will be q 1 again at the next addition timing.
It may return to the linear region between q 2 . That is, in a cyclic digital filter, since the addition result always fluctuates, when the characteristics of the entire filter are considered, the characteristics can be significantly improved compared to the case where the addition circuit shown in FIG. 1 is used.

(f) 発明の効果 以上のようにこの発明によれば、オーバーフロ
ー状態やアンダーフロー状態を判定する手段と、
それらの状態を判定した場合に加算出力を正の最
大値または負の最大値に設定する手段を設けるだ
けで加算結果が入力データによつて大きく変化す
るという問題をなくすことができる。
(f) Effects of the invention As described above, according to the present invention, there is provided a means for determining an overflow state or an underflow state;
By simply providing means for setting the addition output to the maximum positive value or the maximum negative value when these states are determined, it is possible to eliminate the problem that the addition result changes greatly depending on the input data.

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

第1図はこの発明の実施例である加算回路の回
路図を示す。第2図は同加算回路の動作を説明す
る図であり、第3図は同加算回路の特性図を示
す。第4図はこの発明に係る加算回路を使用した
巡回形のデジタルフイルタの構成図を示す。また
第5図は従来の加算回路(4ビツト加算回路)の
特性図を示している。 3……判定回路、5……正、負最大値設定回
路。
FIG. 1 shows a circuit diagram of an adder circuit according to an embodiment of the present invention. FIG. 2 is a diagram for explaining the operation of the adder circuit, and FIG. 3 is a characteristic diagram of the adder circuit. FIG. 4 shows a configuration diagram of a cyclic digital filter using an adder circuit according to the present invention. Further, FIG. 5 shows a characteristic diagram of a conventional adder circuit (4-bit adder circuit). 3... Judgment circuit, 5... Positive and negative maximum value setting circuit.

Claims (1)

【特許請求の範囲】 1 最上位ビツトを符号ビツトとする2つの2進
データを加算する加算回路において、 それぞれn(nは2以上の整数)ビツトの2つ
のデイジタルデータの同一ビツト目の2つのビツ
ト信号と下位ビツトからのキヤリーを入力し、加
算結果を出力するn個の加算回路と、 最上位ビツトの加算回路の出力を反転するイン
バータと、最上位ビツトの加算回路に入力される
2つのビツト信号と前記インバータの出力信号を
それぞれ入力するオアゲートおよび第1のナンド
ゲート、さらに前記オアゲートと第1のナンドゲ
ートを入力する第2のナンドゲートからなる判定
回路と、 前記判定回路の出力が論理0であるとき、前記
n個の加算回路の出力レベルを1〜nビツト目の
出力部にそのまま導き、前記判定回路の出力が論
理1であるとき、最上位ビツトの加算回路の出力
を反転して、nビツト目の出力部に導くととも
に、最上位ビツトの加算回路の出力レベルを1〜
(n−1)ビツト目の出力部に導く出力ゲート回
路からなる加算回路。
[Claims] 1. In an adder circuit that adds two pieces of binary data whose most significant bit is a sign bit, two bits of the same bit of two pieces of digital data each having n bits (n is an integer of 2 or more) are added. There are n adder circuits that input the bit signal and the carry from the lower bit and output the addition result, an inverter that inverts the output of the adder circuit for the most significant bit, and two adder circuits that input the adder circuit for the most significant bit. a determination circuit comprising an OR gate and a first NAND gate to which the bit signal and the output signal of the inverter are respectively input, and a second NAND gate to which the OR gate and the first NAND gate are input; the output of the determination circuit is logic 0; When the output level of the n adder circuits is directly led to the output section of the 1st to nth bits, and when the output of the determination circuit is logic 1, the output level of the adder circuit of the most significant bit is inverted and In addition to guiding the bit to the output section, the output level of the adder circuit for the most significant bit is set to 1 to 1.
An adder circuit consisting of an output gate circuit leading to the (n-1)th bit output section.
JP62045881A 1987-02-27 1987-02-27 Adding circuit Granted JPS63211431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62045881A JPS63211431A (en) 1987-02-27 1987-02-27 Adding circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62045881A JPS63211431A (en) 1987-02-27 1987-02-27 Adding circuit

Publications (2)

Publication Number Publication Date
JPS63211431A JPS63211431A (en) 1988-09-02
JPH0445856B2 true JPH0445856B2 (en) 1992-07-28

Family

ID=12731572

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62045881A Granted JPS63211431A (en) 1987-02-27 1987-02-27 Adding circuit

Country Status (1)

Country Link
JP (1) JPS63211431A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5038314A (en) * 1989-11-17 1991-08-06 Digital Equipment Corporation Method and apparatus for correction of underflow and overflow

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61262925A (en) * 1985-05-17 1986-11-20 Nec Corp Arithmetic circuit

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61262925A (en) * 1985-05-17 1986-11-20 Nec Corp Arithmetic circuit

Also Published As

Publication number Publication date
JPS63211431A (en) 1988-09-02

Similar Documents

Publication Publication Date Title
US4667337A (en) Integrated circuit having outputs configured for reduced state changes
EP0209308B1 (en) Circuitry for complementing binary numbers
US4761760A (en) Digital adder-subtracter with tentative result correction circuit
JPH0650462B2 (en) Shift number control circuit
JPH0215088B2 (en)
US4383304A (en) Programmable bit shift circuit
US3932734A (en) Binary parallel adder employing high speed gating circuitry
US4618849A (en) Gray code counter
JPH0421889B2 (en)
JP3248743B2 (en) High-speed overflow / underflow limiter for signed adders
US5319347A (en) Parallelized magnitude comparator for comparing a binary number to a fixed value
US4899305A (en) Manchester carry adder circuit
US4092522A (en) 5-Bit counter/shift register utilizing current mode logic
JPH0445856B2 (en)
US6434588B1 (en) Binary counter with low power consumption
GB2184579A (en) A multi-stage parallel binary adder
US5357235A (en) Parallelized magnitude comparator
JPH09222991A (en) Adding method and adder
US5777906A (en) Left shift overflow detection
JPH0578104B2 (en)
JPS6244727B2 (en)
JPH0661871A (en) Parallel serial data conversion circuit
JP4354648B2 (en) Method and apparatus for compressing a signal to a fixed-point format without incurring bias
US5386377A (en) Parallelized borrow look ahead subtractor
JP2552028B2 (en) Adder