JPS61294582A - Arithmetic unit - Google Patents

Arithmetic unit

Info

Publication number
JPS61294582A
JPS61294582A JP60135259A JP13525985A JPS61294582A JP S61294582 A JPS61294582 A JP S61294582A JP 60135259 A JP60135259 A JP 60135259A JP 13525985 A JP13525985 A JP 13525985A JP S61294582 A JPS61294582 A JP S61294582A
Authority
JP
Japan
Prior art keywords
circuit
arithmetic
operands
comparison
output
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
JP60135259A
Other languages
Japanese (ja)
Inventor
Yoshihisa Soda
曾田 善久
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP60135259A priority Critical patent/JPS61294582A/en
Publication of JPS61294582A publication Critical patent/JPS61294582A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/02Comparing digital values

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Complex Calculations (AREA)

Abstract

PURPOSE:To decrease the quantity of hardware and also to facilitate a comparison operation by using a fixed decimal point addition/subtraction circuit and a positive/negative deciding circuit to perform comparison operation between operands. CONSTITUTION:When a comparison operation is carried out between operands Ai and Bi, these operands are held by operand holding registers 21 and 22 of a fixed decimal point addition/subtraction device. Then an arithmetic mode signal is supplied to an arithmetic circuit 234 and an arithmetic exception detecting circuit 24 respectively from an input device to suppress the report of an arithmetic exception state. The circuit 23 uses both operands Ai and Bi for execution of an arithmetic operation and this arithmetic result is applied to a selection circuit 26 as well as to a selection circuit 26 via an inverting circuit 25. The circuit 26 selects an input according to the output given from the circuit 24 and applies it to an output holding register 27. The output of the register 27 is supplied to a positive/negative deciding circuit for comparison with zero.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明はオペランド間の比較演算を行う機能を有する演
算装置に関し、特に2つの固定小数点形式のオペランド
間の比較演算処理機能を備えた演算装置に関する。
Detailed Description of the Invention (Field of Industrial Application) The present invention relates to an arithmetic device having a function of performing a comparison operation between operands, and particularly to an arithmetic device having a function of performing a comparison operation between two fixed-point operands. Regarding.

(従来の技術) 一般に、従来のオペランド間の比較演算処理機能を備え
た演算装置ではオペランド間の比較演算を実行するため
の専用回路を備えている。
(Prior Art) Generally, a conventional arithmetic unit having a function of processing a comparison operation between operands includes a dedicated circuit for executing a comparison operation between operands.

ここで、第5図を参照して、上述の専用回路の一例を説
明すると、第1オペランドA(SA:符号。
Here, an example of the above-mentioned dedicated circuit will be described with reference to FIG. 5. First operand A (SA: code).

A6  r AI  + A2  + A3 芒→:数
値部)が第1ガニ数値部)が第2人力レジスタ52に保
持される。この第1オペランドA及びBは図示のように
演算回路53及び54に入力される。演算回路53では
第(1)式に示す論理式によって第1オペラ 。
A6 r AI + A2 + A3 Awn →: Numerical part) is held in the second manual register 52. The first operands A and B are input to arithmetic circuits 53 and 54 as shown. The arithmetic circuit 53 calculates the first opera using the logical formula shown in equation (1).

ンドAと第2オペランドBとの大小関係が求められる。The magnitude relationship between the second operand A and the second operand B is determined.

以下余日 x=(3,△S、)V(SA=SR)△((AOABO
)■(AO=BO)△(A1へ虱)(AO=BQ)へ(
At =Bt )△(AZAB2 )(AO=BO)△
(At =Bt )△(A2=B2)△(A3AB3 
) )・・・(1) 一方、演算回路54では第(2)式に示す論理式によっ
て第1オペランドAと第2オペランドBとが等しいかど
うかが比べられる。
The remaining days x = (3, △S,) V (SA = SR) △ ((AOABO
)■(AO=BO)△(Lice to A1)(AO=BQ)(
At =Bt)△(AZAB2)(AO=BO)△
(At = Bt)△(A2=B2)△(A3AB3
)...(1) On the other hand, the arithmetic circuit 54 compares whether the first operand A and the second operand B are equal using the logical expression shown in equation (2).

y=(SA=SB)△(AO〜、−B0〜3)    
   ・・・(2)演算回路53及び54の出力はそれ
ぞれ出力レノスタ55及び56に格納される。このよう
にしてオペランドA、Hの比較演算が行われる。
y=(SA=SB)△(AO~, -B0~3)
(2) The outputs of the arithmetic circuits 53 and 54 are stored in the output renosters 55 and 56, respectively. In this way, a comparison operation between operands A and H is performed.

(発明が解決しようとする問題点) このように、従来のオペランド間の比較演算を行う機能
を備えた演算装置では、新たにオペランド間の比較演算
を行うための専用回路(比較演算回路)を備えているの
で、金物量が多くなるという問題点がある。
(Problems to be Solved by the Invention) As described above, the conventional arithmetic device equipped with the function of performing comparison operations between operands has a new dedicated circuit (comparison operation circuit) for performing comparison operations between operands. Because of this, there is a problem that the amount of hardware increases.

本発明の目的は従来の演算装置に比べて金物量の少ない
演算装置を提供することにある。
An object of the present invention is to provide an arithmetic device that requires less hardware than conventional arithmetic devices.

以下金白 (問題点を解決するための手段) 一般に、演算装置においては、固定小数点データの加減
算を実行する固定小数点加減算回路と。
Hereinafter, Kanpaku (means for solving the problem) Generally, in an arithmetic device, there is a fixed-point addition/subtraction circuit that performs addition/subtraction of fixed-point data.

入力され之オペランドと零との大小関係を判定する正、
負、あるいは零判定回路は最小限必要である。
A positive value that determines the magnitude relationship between the input operand and zero.
A negative or zero judgment circuit is minimally required.

本発明の演算装置では1通常の演算の場合には。In the arithmetic device of the present invention, in the case of 1 normal arithmetic operation.

演算例外状態の報告を行う演算結果を出力し、一方、オ
ペランド間の比較演算を行う場合には演算例外状態の報
告を行わず、しかも演算例外となる場合には演算結果を
反転して出力する固定小数点加減算回路と、上記の比較
演算の場合に固定小数点加減算回路の演算結果が入力さ
れ、該演算結果の正、負あるいは零の判定を行う判定回
路とを備えており、この判定回路の判定結果によりオペ
ランド間の比較演算を行っている。
Outputs the operation result that reports the operation exception state, but does not report the operation exception state when performing a comparison operation between operands, and inverts and outputs the operation result when the operation exception occurs. It is equipped with a fixed-point addition/subtraction circuit, and a judgment circuit to which the calculation result of the fixed-point addition/subtraction circuit is input in the case of the above-mentioned comparison operation, and which judges whether the calculation result is positive, negative, or zero. Comparison operations between operands are performed based on the results.

(実施例) 以下本発明について実施例によって説明する。(Example) The present invention will be explained below with reference to Examples.

第1図は本発明による演算装置のオペランド間の比較演
算を説明するための図であシ、第2図及び第3図はそれ
ぞれ固定小数点加減算回路及び正。
FIG. 1 is a diagram for explaining a comparison operation between operands of an arithmetic device according to the present invention, and FIGS. 2 and 3 are diagrams showing a fixed-point addition/subtraction circuit and a fixed-point addition/subtraction circuit, respectively.

負、及び零の判定回路を示すブロック図である。FIG. 2 is a block diagram showing a negative and zero determination circuit.

第1図〜第3図を参照して、ベクトルレジスタ1に格納
されている第1オペランドAi及び第2オペランドBi
(7tだし、i=l、2,3.、、、、n)が固定小数
点加減算器2へ入力される。この第1オペランドA1及
び第2オペランドBiはそれぞれ固定小数点加減算器2
の第1オペランド保持レジスタ21及び第2オペランド
保持レジスタ22に保持される。
With reference to FIGS. 1 to 3, the first operand Ai and the second operand Bi stored in vector register 1
(7t, i=l, 2, 3, . . . , n) is input to the fixed-point adder/subtracter 2. The first operand A1 and the second operand Bi are fixed point adders and subtracters 2, respectively.
is held in the first operand holding register 21 and second operand holding register 22.

通常の演算(比較演算以外の演爲例えば減算)を行う場
合には、演算例外状態の報告を行う通常演算モード信号
201が演算回路23及び演算例外検出回路24に入力
される。演算回路23は第1オペランド保持レヅスタ2
1及び第2オペランド保持レノスタ22からそれぞれ第
1オペランドAi及び第2オペランドBi’(j入力し
1通常の演算(減算)を行う。演算回路23の演算結果
(出力)は演算例外検出回路24によって監視され、演
算例外状態が発生した場合には上位ユニット(図示せず
)K演算例外状態を報告する。通常の演算の場合には演
算例外検出回路24からの指令により選択回路26は常
に信号線203を選択し、演算回路23の演算結果は出
力格納レジスタ27に格納される。また、演算例外状態
が発生しない場合には演算例外状態を報告せず、演算結
果は出力格納レジスタ27に格納される。出力格納レジ
スタ27に格納された演算結果は選択回路11を介して
ベクトルレジスタ1に格納される(C1の部分)その後
さらに処理が行なわれるか、あるいは出力装置(図示せ
ず)に出力される。
When performing normal operations (operations other than comparison operations, such as subtraction), a normal operation mode signal 201 for reporting an operation exception state is input to the operation circuit 23 and the operation exception detection circuit 24. The arithmetic circuit 23 is the first operand holding register 2
The first operand Ai and the second operand Bi' (j) are input from the first and second operand holding renostars 22, respectively, and a normal operation (subtraction) is performed.The operation result (output) of the operation circuit 23 is output by the operation exception detection circuit 24. is monitored, and when an arithmetic exception state occurs, the host unit (not shown) reports the K arithmetic exception state.In the case of normal arithmetic operations, the selection circuit 26 always uses the signal line in response to a command from the arithmetic exception detection circuit 24. 203 is selected, and the operation result of the arithmetic circuit 23 is stored in the output storage register 27. In addition, when an operation exception state does not occur, the operation exception state is not reported and the operation result is stored in the output storage register 27. The operation result stored in the output storage register 27 is stored in the vector register 1 via the selection circuit 11 (portion C1), after which it is further processed or output to an output device (not shown). Ru.

オペランドAiと81との比較演算を行う場合はベクト
ルレジスタ1から第1オペランドAi及び第2オRラン
ドB、カそれぞれ固定小数点加減算器2の第1のオペラ
ンド保持レジスタ21及び第2のオペランド保持レジス
タ22に保持される。入力装置4から演算例外状態の報
告を抑止(行なわない)する減算を示す演算モード信号
202が演算回路23及び演算例外検出回路24に入力
される。
When performing a comparison operation between operands Ai and 81, vector register 1 to first operand Ai and second operand B are transferred to first operand holding register 21 and second operand holding register of fixed-point adder/subtractor 2, respectively. It is held at 22. An arithmetic mode signal 202 indicating subtraction that suppresses (does not perform) reporting of an arithmetic exception state is input from the input device 4 to the arithmetic circuit 23 and the arithmetic exception detection circuit 24 .

演算回路23は第1オペランド保持レヅスタ21及び第
2オにランド保持レジスタ22からそれぞれ第1オ被ラ
ンドAi及び第2オペランドBiを入力し、Ai+Bi
+1で示す演算で行い、その演算結果を出力する。
The arithmetic circuit 23 inputs the land held by the first operand Ai and the second operand Bi from the land holding register 22 into the first operand holding register 21 and the second operand holding register 21, respectively, and Ai+Bi.
Perform the calculation indicated by +1 and output the calculation result.

演算例外検出回路24は信号線203によって演算結果
を入力し、演算例外状態の検出を行う。
The arithmetic exception detection circuit 24 receives the arithmetic result through the signal line 203 and detects an arithmetic exception state.

一方、演算回路23の演算結果は反転回路25に入力さ
れ2反転されて(以下反転演算結果という。)。
On the other hand, the calculation result of the calculation circuit 23 is input to the inversion circuit 25 and inverted by 2 (hereinafter referred to as the inversion calculation result).

信号線204に出力される。It is output to the signal line 204.

演算モード信号202が演算例外状態報告を抑止する減
算を示している場合に、演算例外検出回路24が演算例
外状態を検出すると、上部ユニットに対する報告は行わ
ずに信号線205に論理” 1 ”i出力する。選択回
路26に論理“1″が入力されると2選択回路26は信
号線204を選択して2反転演算結果を出力保持レジス
タ27に格納する。一方、演算例外検出回路24が演算
例外状態を検出しないとき、即ち演算例外状態がない場
合には、信号線205に論理パ0#が出力され、これに
よって選択回路26は信号線203を選択して、演算結
果を出力保持レジスタ27に保持する。
When the arithmetic mode signal 202 indicates subtraction that suppresses arithmetic exception state reporting, when the arithmetic exception detection circuit 24 detects an arithmetic exception state, a logic "1"i is sent to the signal line 205 without reporting to the upper unit. Output. When logic "1" is input to the selection circuit 26, the 2 selection circuit 26 selects the signal line 204 and stores the 2 inversion operation result in the output holding register 27. On the other hand, when the arithmetic exception detection circuit 24 does not detect an arithmetic exception state, that is, when there is no arithmetic exception state, a logic pass 0# is output to the signal line 205, and the selection circuit 26 selects the signal line 203. Then, the calculation result is held in the output holding register 27.

なお、演算例外状態報告を抑止する減算命令において、
固定小数点加減算で演算例外状態となる場合には必ず演
算結果の符号が反転している。また例えば、符号が論理
”1″で数値部が全て論理“0″において演算例外状態
となる場合には、符号のみを反転すると符号及び数値部
がすべて論理゛0”となってしまい、2つのオ被ランド
が等しい場合と同様の結果になる。従って演算結果の符
号及び数値部の反転が必要である。
Note that in the subtraction instruction that suppresses operation exception status reporting,
When an operation exception occurs during fixed-point addition or subtraction, the sign of the operation result is always inverted. For example, if the sign is a logic "1" and the numerical part is all logic "0" and an operation exception occurs, if only the sign is inverted, both the sign and the numerical part become logic "0", resulting in two The result is the same as when the two lands are equal.Therefore, it is necessary to invert the sign and numerical part of the operation result.

出力保持レジスタ27に保持された演算結果あるいは反
転演算結果は選択回路11によりベクトルレベスタのC
1の部分に格納される(以下演算結果C,という。)。
The operation result or the inversion operation result held in the output holding register 27 is sent to the vector level vector C by the selection circuit 11.
1 (hereinafter referred to as operation result C).

その後、この演算結果C,は正負零判定回路3に入力さ
れる。
Thereafter, this calculation result C is input to the positive/negative/zero determination circuit 3.

第3図に示すように、この演算結果Ciは入力レジスタ
31を介して比較回路32に入力される。
As shown in FIG. 3, this calculation result Ci is input to a comparison circuit 32 via an input register 31.

またこの比較回路32には0(ゼロ)が入力され。Further, 0 (zero) is input to this comparison circuit 32.

第4図に示す比較条件によって、演算結果ciとゼロと
の比較演算を行う。即ち、第4図に示すように2例えば
比較条件C,〉0に対しては、検出条件として、演算結
果C1の符号がO(零)、数値部がO(零)でない数(
少なくとも1ビツトが1)であることが必要である。そ
して、各比較条件に対応する検出条件が検出されて、そ
の結果が書き込みアドレス制御回路33で指定される結
果格納レジスタ34のビット位置に格納される。
A comparison operation is performed between the operation result ci and zero according to the comparison conditions shown in FIG. That is, as shown in FIG. 4, for 2, for example, the comparison condition C, >0, the detection condition is that the sign of the calculation result C1 is O (zero) and the numerical part is not a number (
At least one bit must be 1). Then, the detection condition corresponding to each comparison condition is detected, and the result is stored in the bit position of the result storage register 34 designated by the write address control circuit 33.

このようにして、第1オペランドAiと第2オペランド
B、との比較演算が行われる。
In this way, a comparison operation between the first operand Ai and the second operand B is performed.

(発明の効果) 以上の説明から明らかなように本発明の演算装置によれ
ば、演算装置が備えている固定小数点加減算回路及び正
負零判定回路を用いてオペランド間の比較演算を行って
いるから、従来の演算装置に比べて金物量が少なくなる
という効果がある。また従来の演算装置に比べて比較演
算が容易であるという利点もある。
(Effects of the Invention) As is clear from the above description, according to the arithmetic device of the present invention, comparison operations between operands are performed using the fixed-point addition/subtraction circuit and the sign/minus/zero determination circuit included in the arithmetic device. This has the effect of reducing the amount of hardware compared to conventional arithmetic devices. It also has the advantage that comparison operations are easier than conventional arithmetic devices.

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

第1図は本発明の一実施例の要部を示すブロック図、第
2図は第1図の固定小数点加減算回路を示すブロック図
、第3図は第1図の正負零判定回路に示すブロック図、
第4図は正負零判定回路の比較条件及び検出条件を示す
図、第5図は従来の演算装置に用いられる比較演算の専
用回路を示す図である。 1・・・ベクトルレジスタ、2・・・固定小数点加減算
回路、3・・・正負零判定回路、4・・・入力装置、1
1・・・選択回路、21・・・第1のオペランド保持レ
ジスタ、22・・・第2のオペランド保持レジスタ、2
3・・・演算回路、24・・・演算例外検出回路、25
・・・反転回路、26・・・選択回路、27・・・出力
保持レジスタ、31・・・入力レジスタ、32・・・比
較回路、33・・・書込みアドレス制回路、34・・・
出力レジスタ。 51.52・・・入力レジスタ、53.54・・・演算
回路、55.56・・・出力レジスタ。 第1図 第2図 第3図 i 第4図 A             B x         y (A>B)    (A=B)
FIG. 1 is a block diagram showing the main part of an embodiment of the present invention, FIG. 2 is a block diagram showing the fixed-point addition/subtraction circuit shown in FIG. 1, and FIG. 3 is a block diagram showing the positive/negative zero determination circuit shown in FIG. 1. figure,
FIG. 4 is a diagram showing the comparison conditions and detection conditions of the positive/negative zero determination circuit, and FIG. 5 is a diagram showing a dedicated circuit for comparison calculation used in a conventional calculation device. DESCRIPTION OF SYMBOLS 1... Vector register, 2... Fixed-point addition/subtraction circuit, 3... Positive/negative zero determination circuit, 4... Input device, 1
DESCRIPTION OF SYMBOLS 1... Selection circuit, 21... First operand holding register, 22... Second operand holding register, 2
3... Arithmetic circuit, 24... Arithmetic exception detection circuit, 25
... Inversion circuit, 26 ... Selection circuit, 27 ... Output holding register, 31 ... Input register, 32 ... Comparison circuit, 33 ... Write address control circuit, 34 ...
Output register. 51.52...Input register, 53.54...Arithmetic circuit, 55.56...Output register. Figure 1 Figure 2 Figure 3 i Figure 4 A B x y (A>B) (A=B)

Claims (1)

【特許請求の範囲】[Claims] 1、オペランド間の比較演算を行う機能を備えた演算装
置において、通常の演算の場合には、演算例外状態の報
告を行う演算結果を出力し、一方、比較演算の場合には
、演算例外状態の報告を行わずしかも演算例外状態とな
る場合には演算結果を反転して出力する固定小数点加減
算回路と、前記比較演算の場合に該固定小数点加減算回
路の演算結果が入力され、該演算結果の正、負あるいは
零の判定を行う判定回路とを有し、該判定回路の判定結
果によりオペランド間の比較演算を行うようにしたこと
を特徴とする演算装置。
1. In an arithmetic unit equipped with the function of performing a comparison operation between operands, in the case of a normal operation, an operation result that reports an operation exception state is output, whereas in the case of a comparison operation, an operation result that reports an operation exception state is output. A fixed-point addition/subtraction circuit that inverts and outputs the operation result if the operation result is not reported and an operation exception state occurs, and in the case of the comparison operation, the operation result of the fixed-point addition/subtraction circuit is input and 1. An arithmetic device comprising: a determination circuit that determines whether the operand is positive, negative, or zero; and a comparison operation between operands is performed based on the determination result of the determination circuit.
JP60135259A 1985-06-22 1985-06-22 Arithmetic unit Pending JPS61294582A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60135259A JPS61294582A (en) 1985-06-22 1985-06-22 Arithmetic unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60135259A JPS61294582A (en) 1985-06-22 1985-06-22 Arithmetic unit

Publications (1)

Publication Number Publication Date
JPS61294582A true JPS61294582A (en) 1986-12-25

Family

ID=15147517

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60135259A Pending JPS61294582A (en) 1985-06-22 1985-06-22 Arithmetic unit

Country Status (1)

Country Link
JP (1) JPS61294582A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63118835A (en) * 1986-11-06 1988-05-23 Nec Corp Arithmetic unit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63118835A (en) * 1986-11-06 1988-05-23 Nec Corp Arithmetic unit
JPH07122845B2 (en) * 1986-11-06 1995-12-25 日本電気株式会社 Arithmetic unit

Similar Documents

Publication Publication Date Title
US4961161A (en) Arithmetic processor performing mask and trap operations for exceptions
EP0298418B1 (en) Virtual computer system
JPS6227412B2 (en)
JPS61294582A (en) Arithmetic unit
JPS6051728B2 (en) High-speed calculation processing method
JPS61173358A (en) Register recovery device
JPH0528431B2 (en)
JPS63111535A (en) Data processor
JPS6376028A (en) Method for controlling execution of instruction step in virtual computer system
KR970004474B1 (en) Method and apparatus for explicitly evaluating conditions in a data processor
JPS60163134A (en) Virtual computer system
JPS62267869A (en) Processing system at time of arithmetic exception of vector processor
JPS595356A (en) General-purpose register controlling system
JP2021144426A (en) Processor and error detection method
JPS623345A (en) Interruption system
JPS63279321A (en) Microprogram controller
JPS59188900A (en) Data processor
JPS61123930A (en) Overflow detection system of variable length data arithmetic
JPS6259341B2 (en)
JPS63118835A (en) Arithmetic unit
JPS63120336A (en) Switching system for memory access mode
JPS61177536A (en) Arithmetic device
JPH0588893A (en) Parallel operation processor
JPS59212955A (en) Information processor
JPH0651955A (en) Information processor with floating point arithmetic function