JPH0573267A - Arithmetic processor - Google Patents

Arithmetic processor

Info

Publication number
JPH0573267A
JPH0573267A JP3233100A JP23310091A JPH0573267A JP H0573267 A JPH0573267 A JP H0573267A JP 3233100 A JP3233100 A JP 3233100A JP 23310091 A JP23310091 A JP 23310091A JP H0573267 A JPH0573267 A JP H0573267A
Authority
JP
Japan
Prior art keywords
overflow
positive
negative
output
rounding
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
JP3233100A
Other languages
Japanese (ja)
Inventor
Hiroshi Kanekura
広志 金倉
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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP3233100A priority Critical patent/JPH0573267A/en
Publication of JPH0573267A publication Critical patent/JPH0573267A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To round a value to the maximum or minimum one capable of expression within the range of the operation accuracy by providing a detection means detecting the overflow and underflow due to the operation result and a rounding processing means rounding the operation result after the overflow and the underflow processing. CONSTITUTION:A detection means 2 receives a signal from an operation means 1, judging a positive or negative overflow from the combination of the highest two bits. In the case of the expression of the complement 2, the positive overflow is judged when the highest two bits are '01', and the negative overflow is judged when '10'. The detection means 2 sends a signal to a rounding processing means 3 according to the detection result. The rounding processing means 3 sets the output value to the positive maximum value at the time of overflow and to the negative maximum value at the time of underflow. Thus, the color missing at the time of a video signal processing and the sound missing at the time of a voice signal processing can be prevented by resetting the operation result.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、演算処理装置の改良に
関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to improvements in arithmetic processing units.

【0002】[0002]

【従来の技術】従来の演算処理装置では、演算の結果オ
ーバーフローまたはアンダーフローが生じた場合、その
検出は行なうが演算結果の丸め手段を有していないた
め、その時点で演算が停止したり、オーバーフローフラ
グ等の情報を出力するのみで、正しい演算結果の出力を
補償しない。
2. Description of the Related Art In a conventional arithmetic processing unit, when an overflow or underflow occurs as a result of an operation, it is detected, but since it has no means for rounding the operation result, the operation is stopped at that time, It only outputs the information such as the overflow flag and does not compensate the output of the correct operation result.

【0003】[0003]

【発明が解決しようとする課題】従来の演算処理装置で
は、たとえば、リアルタイムの画像処理に代表される応
用分野においては、オーバーフローやアンダーフローが
生じたからといって、処理を停止するわけにはいかな
い。また、従来の演算装置の利用者は、演算の結果オー
バーフローやアンダーフローが生じたかどうかを認識す
る必要があった。
In the conventional arithmetic processing unit, for example, in an application field represented by real-time image processing, the processing cannot be stopped just because an overflow or an underflow occurs. .. Moreover, the user of the conventional arithmetic device needs to recognize whether or not overflow or underflow has occurred as a result of the arithmetic operation.

【0004】正しい演算結果を得るには、外部に付加回
路を設けるか、あるいはソフト的に対処しなければなら
ず処理上負担となる。
In order to obtain a correct calculation result, it is necessary to provide an external circuit externally or deal with it by software, which is a processing burden.

【0005】適当な処理を行なわない場合は、たとえ
ば、オーバーフローした値が最大値よりも大きく離れた
小さな値として出力される場合が多く、映像データの場
合は色とび、音声データの場合は音とびとなる。
If appropriate processing is not performed, for example, the overflowed value is often output as a small value that is far from the maximum value. For image data, color skipping is performed, and for audio data, sound skipping is performed. Becomes

【0006】[0006]

【課題を解決するための手段】本発明においては、演算
の結果生じたオーバーフローおよびアンダーフローを検
出する検出手段と、オーバーフローおよびアンダーフロ
ーした演算結果を丸める丸め処理手段とを設けた。
In the present invention, there are provided detecting means for detecting overflows and underflows resulting from the operation, and rounding processing means for rounding the overflowed and underflowed operation results.

【0007】[0007]

【作用】検出手段は、オーバーフロー,アンダーフロー
の検出に必要なビット幅を持つ演算結果によりオーバー
フローおよびアンダーフローを検出し、その結果によ
り、オーバーフローが生じた場合は、出力データビット
数で表現できる最大の数値に、アンダーフローが生じた
場合には、同じく表現できる最小の数値に、丸め処理手
段により丸めることができる。
The detecting means detects the overflow and the underflow by the operation result having the bit width necessary for detecting the overflow and the underflow, and when the overflow occurs, the maximum value that can be expressed by the number of output data bits is obtained. When an underflow occurs in the numerical value of, it can be rounded to the minimum numerical value that can be expressed by the rounding processing means.

【0008】[0008]

【実施例】図1は、本発明の一実施例のブロック図であ
る。
FIG. 1 is a block diagram of an embodiment of the present invention.

【0009】演算手段1は、通常の演算手段であるが、
本発明においては、最上位の1ビットは、その次のビッ
トとの組合せによりオーバーフローの判定のために使用
されるので、演算精度が12ビットを必要とするとき
は、これに1ビットを加え合計13ビットの演算手段を
使用する。以下、演算精度が12ビットの整数演算結果
のオーバーフロー時の丸め処理を例にとって説明する。
The calculation means 1 is a normal calculation means,
In the present invention, the most significant 1 bit is used for overflow determination in combination with the next bit. Therefore, when the arithmetic precision requires 12 bits, 1 bit is added to this and the sum is added. A 13-bit arithmetic means is used. Hereinafter, a rounding process at the time of overflow of an integer calculation result having a calculation precision of 12 bits will be described as an example.

【0010】演算手段1の出力は、オーバーフローを検
出するための検出手段2および丸め処理手段3に送られ
る。検出手段2の出力は、さらに丸め処理手段3に送ら
れる。
The output of the computing means 1 is sent to a detecting means 2 and a rounding processing means 3 for detecting an overflow. The output of the detection means 2 is further sent to the rounding processing means 3.

【0011】検出手段2は、演算手段1から13ビット
の信号を受取り、その最上位2ビットの組合せから、正
のオーバーフローか負のオーバーフローかを判断する。
2の補数表現の場合、最上位の2ビットが“01”なら
正のオーバーフロー、“10”なら負のオーバーフロー
と判断できる。検出手段2は、検出結果により信号を丸
め処理手段3に送る。
The detecting means 2 receives the 13-bit signal from the computing means 1 and judges from the combination of the most significant 2 bits whether it is a positive overflow or a negative overflow.
In the case of the two's complement representation, it can be determined that the most significant two bits are "01" and the overflow is negative, and the overflow is negative. The detection means 2 sends a signal to the rounding processing means 3 according to the detection result.

【0012】正負のオーバーフローがない場合、丸め処
理手段3は動作せず、演算手段1の演算結果は丸め処理
手段3を素通りして出力される。
When there is no positive or negative overflow, the rounding processing means 3 does not operate, and the calculation result of the calculating means 1 is output through the rounding processing means 3 as it is.

【0013】丸め処理手段3は、検出手段2からの信号
により、正のオーバーフロー時には正の最大値0111
11111111に、負のオーバーフロー時には負の最
大値100000000000に出力値を設定する。
The rounding processing means 3 receives the signal from the detection means 2 and outputs a positive maximum value 0111 at the time of positive overflow.
The output value is set to 11111111 at the maximum negative value 100000000000000 at the time of negative overflow.

【0014】図2は、正,負のオーバーフローの検出手
段2と丸め処理手段3の論理回路構成の一例である。入
力部10には、演算手段より13ビットの演算結果DI
0〜DI12が入力される。この信号中の最上位の2ビ
ットDI12およびDI11から正または負のオーバー
フローを検出し、出力部21から12ビットの出力信号
DO0〜DO11が得られる。
FIG. 2 shows an example of the logic circuit configuration of the positive and negative overflow detecting means 2 and the rounding processing means 3. The input unit 10 receives a 13-bit operation result DI from the operation means.
0 to DI12 are input. Positive or negative overflow is detected from the most significant 2 bits DI12 and DI11 in this signal, and 12-bit output signals DO0 to DO11 are obtained from the output section 21.

【0015】最上位のビットの入力DI12は、EXN
OR回路11およびNOR回路12に送られる。EXN
OR回路11の出力は、NOR回路12およびインバー
タ18に送られ、インバータ18の出力はセレクタ20
の端子Sおよびフラグ端子19に送られる。
The most significant bit input DI12 is EXN
It is sent to the OR circuit 11 and the NOR circuit 12. EXN
The output of the OR circuit 11 is sent to the NOR circuit 12 and the inverter 18, and the output of the inverter 18 is the selector 20.
Is sent to the terminal S and the flag terminal 19.

【0016】最上位の次の入力DI11は、EXNOR
回路11に送られる。EXNOR回路11の出力はま
た、NOR回路12に送られ、さらにインバータ13お
よび14を介して、正負最大値生成部15に送られる。
インバータ14の出力は、正のオーバーフローすなわち
DI12およびDI11が“01”のとき、“1”の信
号となる。
The next highest input DI11 is EXNOR.
It is sent to the circuit 11. The output of the EXNOR circuit 11 is also sent to the NOR circuit 12 and further sent to the positive / negative maximum value generation unit 15 via the inverters 13 and 14.
The output of the inverter 14 becomes a signal of "1" when positive overflow, that is, when DI12 and DI11 are "01".

【0017】EXNOR回路11の出力は、正または負
のオーバーフローのとき“0”となる。したがって、正
または負のオーバーフローのとき、インバータ18に接
続されるフラグ端子19から“1”の信号が出力され、
後述の丸め処理手段が動作していることを表示できる。
The output of the EXNOR circuit 11 becomes "0" at the time of positive or negative overflow. Therefore, at the time of positive or negative overflow, the signal of “1” is output from the flag terminal 19 connected to the inverter 18,
It can be displayed that the rounding processing means described later is operating.

【0018】正負最大値生成部15は、たとえば、4個
のEXOR3回路により構成され、最も上の端子A3
は、“1”を与える入力端子17に接続されている。最
上部のEXOR3回路の端子A1およびA2ならびにそ
の他のEXOR3回路の端子A1,A2,およびA3端
子は、“0”を与える入力端子16に接続されている。
各EXOR3回路の端子Bは、インバータ14の出力に
接続されている。
The positive / negative maximum value generator 15 is composed of, for example, four EXOR3 circuits, and has the uppermost terminal A3.
Are connected to the input terminal 17 which supplies "1". The terminals A1 and A2 of the uppermost EXOR3 circuit and the terminals A1, A2 and A3 of the other EXOR3 circuits are connected to the input terminal 16 which gives "0".
The terminal B of each EXOR3 circuit is connected to the output of the inverter 14.

【0019】各EXOR3回路は、端子Bに“0”が入
力される場合には、端子A1,A2およびA3の入力を
そのまま、対応する端子Y1,Y2およびY3に出力す
る。端子Bに“1”が入力される場合には、端子A1,
A2およびA3の入力を反転して、対応する端子Y1,
Y2およびY3に、それぞれ出力する。
When "0" is input to the terminal B, each EXOR3 circuit outputs the inputs of the terminals A1, A2 and A3 as they are to the corresponding terminals Y1, Y2 and Y3. When "1" is input to the terminal B, the terminal A1,
The inputs of A2 and A3 are inverted and the corresponding terminals Y1,
Output to Y2 and Y3 respectively.

【0020】下の3個のEXOR3回路のそれぞれの端
子A1,A2およびA3と上の1個のEXOR3回路の
端子A1およびA2が入力端子16から“0”を与えら
れ、上の1個の端子A3が入力端子17から“1”を与
えられているのは、12ビットデータ10000000
0000を定数として与えるためである。この値は、1
2ビットの2の補数表現で負の最大値である。インバー
タ14の出力が“1”のときは、12ビットが反転され
正の最大値011111111111となり、セレクタ
20に入力される。
The respective terminals A1, A2 and A3 of the lower three EXOR3 circuits and the terminals A1 and A2 of the upper one EXOR3 circuit are given "0" from the input terminal 16 and the upper one terminal. A3 is given "1" from the input terminal 17 because it is 12-bit data 10000000.
This is because 0000 is given as a constant. This value is 1
It is the maximum negative value in 2-bit two's complement representation. When the output of the inverter 14 is “1”, 12 bits are inverted and the positive maximum value 0111111111111 is obtained, which is input to the selector 20.

【0021】なお、4個のEXOR3回路を使用する代
りに、12個のEXOR回路を使用することもできる。
すなわち、12個のEXOR回路のすべての一方の端子
にインバータ14の出力を接続し、他方のそれぞれの端
子に“0”または“1”の入力を与えることにより、4
個のEXOR3回路の端子Y1,Y2およびY3に対応
する12個の出力端子から“0”または“1”の出力が
得られる。
Note that, instead of using four EXOR3 circuits, twelve EXOR circuits can be used.
That is, by connecting the output of the inverter 14 to one of the terminals of all 12 EXOR circuits and inputting "0" or "1" to each of the other terminals, 4
The output of "0" or "1" is obtained from the 12 output terminals corresponding to the terminals Y1, Y2 and Y3 of the EXOR3 circuits.

【0022】2入力のセレクタ20は、その左側の端子
B0〜B11に入力DI0〜DI11が入力され、それ
らに隣接する端子A0〜A11に、正負最大値生成部1
5のEXOR3回路のそれぞれの端子Y1,Y2および
Y3が順次接続されている。またインバータ18の出力
もセレクタ20の端子Sに加えられているから、端子S
に与えられる電位によって、セレクタ20の右側の出力
端子Y0〜Y11に出力すべきデータの入力が、A0〜
A11またはB0〜B11のいずれかより選択される。
In the 2-input selector 20, the inputs DI0 to DI11 are input to the terminals B0 to B11 on the left side, and the positive and negative maximum value generator 1 is connected to the terminals A0 to A11 adjacent to them.
The respective terminals Y1, Y2 and Y3 of the EXOR3 circuit of No. 5 are sequentially connected. Further, since the output of the inverter 18 is also added to the terminal S of the selector 20, the terminal S
The data to be output to the output terminals Y0 to Y11 on the right side of the selector 20, depending on the potential applied to
It is selected from any of A11 or B0 to B11.

【0023】各部の構成は、以上のようになっている
が、これらは以下のような動作をする。
The configuration of each section is as described above, but these operate as follows.

【0024】正,負オーバーフロー検出手段を構成する
EXNOR回路11およびNOR回路12等により、入
力DI12およびDI11の信号を処理し、これらが
“01”のときは正のオーバーフローであるからインバ
ータ14から“1”を出力し、“10”のときは負のオ
ーバーフローであるからインバータ14から“0”を出
力する。また“01”かまたは“10”のときは、イン
バータ18から“1”、どちらでもないときは“0”を
セレクタ20の端子Sに出力する。
The EXNOR circuit 11 and the NOR circuit 12 which constitute the positive and negative overflow detecting means process the signals of the inputs DI12 and DI11. 1 "is output, and when it is" 10 ", the inverter 14 outputs" 0 "because it is a negative overflow. Further, when it is “01” or “10”, the inverter 18 outputs “1” to the terminal S of the selector 20, and when it is neither, it outputs “0” to the terminal S of the selector 20.

【0025】正負最大値生成部15と2入力のセレクタ
20により丸め処理手段が構成されている。
The positive / negative maximum value generator 15 and the 2-input selector 20 constitute a rounding processing means.

【0026】正負最大値生成部15は、インバータ14
の出力が“0”のときは、負の最大値10000000
0000を出力する。インバータ14の出力が“1”の
ときは、EXOR3回路のそれぞれの端子Bに“1”が
入力されるから、負の最大値が論理反転されて、正の最
大値011111111111を出力する。
The positive / negative maximum value generator 15 includes an inverter 14
When the output of is 0, the maximum negative value is 10000000
0000 is output. When the output of the inverter 14 is "1", since "1" is input to each terminal B of the EXOR3 circuit, the negative maximum value is logically inverted and the positive maximum value 011111111111 is output.

【0027】2入力のセレクタ20は、端子Sに“0”
が入力されると、演算結果DI0〜DI11を選択して
下位12ビットをそのまま出力する。反対に、端子Sに
“1”が入力されると、正または負のオーバーフローで
あるので、前述の正の最大値または負の最大値を選択
し、出力部21の12個の出力端子から、12ビットの
出力信号DO0〜DO11として出力する。
The 2-input selector 20 has a terminal S of "0".
Is input, the operation results DI0 to DI11 are selected and the lower 12 bits are output as they are. On the contrary, if "1" is input to the terminal S, it means that the overflow is positive or negative, so the above-mentioned positive maximum value or negative maximum value is selected, and the 12 output terminals of the output unit 21 It is output as 12-bit output signals DO0 to DO11.

【0028】以上は整数表現の場合の回路構成である
が、浮動小数点表現などの場合もオーバーフロー検出手
段や正負最大値の表現が異なるだけで、同様の機能が容
易に実現できる。
The above is the circuit configuration in the case of the integer representation, but in the case of the floating point representation etc., the same function can be easily realized by only the overflow detecting means and the representation of the positive and negative maximum values being different.

【0029】[0029]

【発明の効果】本発明によれば、演算結果を正または負
の最大値に丸めることができるので、正のオーバーフロ
ーを検出した場合は正の最大値に、負のオーバーフロー
を検出した場合は負の最大値に、演算結果を設定しなお
すことにより、映像信号処理時の色とびや、音声信号処
理時の音とびを回避することができる。
According to the present invention, since the operation result can be rounded to the maximum positive or negative value, the positive maximum value is detected when the positive overflow is detected, and the negative value is detected when the negative overflow is detected. By resetting the calculation result to the maximum value of, it is possible to avoid color skips during video signal processing and sound skips during audio signal processing.

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

【図1】本発明の一実施例のブロック図である。FIG. 1 is a block diagram of an embodiment of the present invention.

【図2】本発明のオーバーフロー検出手段と丸め処理手
段の論理回路の一例である。
FIG. 2 is an example of a logic circuit of overflow detection means and rounding processing means of the present invention.

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

1 演算手段 2 検出手段 3 丸め処理手段 10 入力部 11 EXNOR回路 12 NOR回路 13,14,18 インバータ 15 正負最大値生成部 20 セレクタ 1 computing means 2 detecting means 3 rounding processing means 10 input section 11 EXNOR circuit 12 NOR circuit 13, 14, 18 inverter 15 positive / negative maximum value generating section 20 selector

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 演算の結果生じたオーバーフローおよび
アンダーフローを検出する検出手段と、オーバーフロー
およびアンダーフローした演算結果を丸める丸め処理手
段とを有する演算処理装置。
1. An arithmetic processing device comprising: detection means for detecting overflow and underflow resulting from arithmetic operations; and rounding processing means for rounding the arithmetic results of overflow and underflow.
JP3233100A 1991-09-12 1991-09-12 Arithmetic processor Pending JPH0573267A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3233100A JPH0573267A (en) 1991-09-12 1991-09-12 Arithmetic processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3233100A JPH0573267A (en) 1991-09-12 1991-09-12 Arithmetic processor

Publications (1)

Publication Number Publication Date
JPH0573267A true JPH0573267A (en) 1993-03-26

Family

ID=16949783

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3233100A Pending JPH0573267A (en) 1991-09-12 1991-09-12 Arithmetic processor

Country Status (1)

Country Link
JP (1) JPH0573267A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6072022A (en) * 1983-09-28 1985-04-24 Toshiba Corp Arithmetic unit

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6072022A (en) * 1983-09-28 1985-04-24 Toshiba Corp Arithmetic unit

Similar Documents

Publication Publication Date Title
JPH01311320A (en) Overflow correcting circuit
US20050060359A1 (en) Arithmetic unit for addition or subtraction with preliminary saturation detection
JPH1091397A (en) Arithmetic circuit
JPH0573267A (en) Arithmetic processor
JPH0511980A (en) Overflow detecting method and circuit
JPH1091396A (en) Floating-point number detection device and circuit
JP3482102B2 (en) Absolute distance calculation circuit
JPH0736149B2 (en) Shift flag generation circuit
JP2980341B2 (en) Floating point alignment circuit
JP2959303B2 (en) Arithmetic circuit
KR0175357B1 (en) Overflow Detection Circuit of Operator for High Speed
JP2901463B2 (en) Addition device
JP2000283750A (en) Method for correcting detected-angle data
JPH10333885A (en) Multiplying circuit
JPH04165423A (en) Digital comparing circuit
JP2000293359A (en) Method and device for comparing largeness/smallness
JP2984606B2 (en) 3-input addition / subtraction circuit
JPH05119969A (en) Product sum computing element
JPH1021054A (en) Arithmetic processor
JPS63623A (en) Multiplier
JPS6041772B2 (en) Parity creation circuit
JPS62206642A (en) Trouble detecting circuit for adder
JPH0764768A (en) Absolute value accumulator
JPH03176733A (en) Overflow detecting circuit for adder/subtractor
JPH04157527A (en) Mathematical computing element with fault detecting function

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19980421