JPH01228020A - Comparing device - Google Patents

Comparing device

Info

Publication number
JPH01228020A
JPH01228020A JP5406888A JP5406888A JPH01228020A JP H01228020 A JPH01228020 A JP H01228020A JP 5406888 A JP5406888 A JP 5406888A JP 5406888 A JP5406888 A JP 5406888A JP H01228020 A JPH01228020 A JP H01228020A
Authority
JP
Japan
Prior art keywords
operand
operands
pair
register
registers
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
JP5406888A
Other languages
Japanese (ja)
Inventor
Shoji Tashiro
田代 章二
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP5406888A priority Critical patent/JPH01228020A/en
Publication of JPH01228020A publication Critical patent/JPH01228020A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To attain arithmetic processing speed at high speed by eliminating the subtraction of mutual operands only when the size of a pair of operands can be decided from the number of the effective digits of a pair of the operands. CONSTITUTION:When an operand 1 is stored into a register file 111 and an operand 2 is stored into a register file 112, the number of effective digits is set to registers 104 and 105, compared with mutual registers and the sizes of operands 1 and 2 are compared. In this case, for the larger number of the effective digits, the operand also becomes large. Only when the number of the effective digits is equal, so that the size of the operands 1 and 2 is decided, registers 111 and 112 are subtracted. When the number of the effective digits of the operands 1 and 2 is different and subtraction is not executed by the comparing processing, since the size of the operands 1 and 2 can be discriminated, the processing can be speeded up.

Description

【発明の詳細な説明】 [発明の目的] (産業上の利用分野) 本発明は主記憶装置内の一対のオペランドの絶対値の大
小を比較判定する比較装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Field of Industrial Application) The present invention relates to a comparison device that compares and determines the magnitude of the absolute values of a pair of operands in a main storage device.

(従来の技術) 主記憶装置内のオペランド1とオペランド2の十進数の
絶対値を比較する場合、従来では第3図に示すように、
オペランド1とオペランド2の減算を行ない(ステップ
531)、その結果、得られる情報(ボローの有無、減
算結果がゼロか否か)を用いてオペランド1とオペラン
ド2の大小を判別していた(ステップ532)。
(Prior Art) When comparing the absolute values of the decimal numbers of operand 1 and operand 2 in the main memory, conventionally, as shown in FIG.
Operand 1 and operand 2 are subtracted (step 531), and the resulting information (presence or absence of borrow, whether the subtraction result is zero or not) is used to determine the magnitude of operand 1 and operand 2 (step 531). 532).

(発明が解決しようする課題) したがって、従来ではオペランド1とオペランド2の十
進数の絶対値を比較するとき、必ずオペランド1とオペ
ランド2の減算処理を実行する必要があり、処理速度の
低下と処理の繁雑化を招いていた。
(Problem to be Solved by the Invention) Therefore, in the past, when comparing the absolute values of the decimal numbers of operand 1 and operand 2, it was necessary to always perform subtraction processing between operand 1 and operand 2, which resulted in a reduction in processing speed and This led to an increase in traffic congestion.

本発明は、オペランド1とオペランド2の絶対値を比較
する場合に、プライオリティ算出回路を有効に利用して
、オペランド1とオペランド2の減算をしなくても大小
の判別ができるときには、減算を省略し、処理の高速化
を計った比較装置を提供することを目的とする。
In the present invention, when comparing the absolute values of operand 1 and operand 2, the priority calculation circuit is effectively used to omit subtraction when the magnitude can be determined without subtracting operand 1 and operand 2. The purpose of the present invention is to provide a comparison device that speeds up processing.

[発明の構成] (問題点を解決するための手段及び作用)本発明は、主
記憶装置から読出した一対のオペランドの有効桁数を算
出する手段と、同手段で算出された各オペランドの有効
桁数を格納するための一対のレジスタと、同レジスタ相
互の内容を比較し、大小および一致を判別する比較器と
、同比較器で得られた大小および一致の判定結果を記憶
するフリップフロップと、同フリップフロップの内容を
もとに主記憶装置より読出した一対のオペランドの絶対
値の大小を判定する手段とを有して、一対のオペランド
の有効桁数から一対のオペランドの大小判定が可能な場
合にのみ、オペランド相互の減算を省略する構成とした
もので、これにより演算処理速度を高速化できる。
[Structure of the Invention] (Means and Effects for Solving the Problems) The present invention provides a means for calculating the number of significant digits of a pair of operands read from a main storage device, and a means for calculating the number of significant digits of each operand calculated by the means. A pair of registers for storing the number of digits, a comparator that compares the contents of the registers and determines whether they are large or small and match, and a flip-flop that stores the results of the judgment of size and match obtained by the comparator. , means for determining the magnitude of the absolute value of the pair of operands read from the main memory based on the contents of the flip-flop, and it is possible to determine the magnitude of the pair of operands from the number of significant digits of the pair of operands. The structure is such that subtraction between operands is omitted only in such cases, thereby increasing the speed of arithmetic processing.

(実施例) 以下図面を参照して本発明の一実施例を説明する。(Example) An embodiment of the present invention will be described below with reference to the drawings.

第1図は本発明に係る装置の一実施例を示すブロック図
である。
FIG. 1 is a block diagram showing an embodiment of the apparatus according to the present invention.

図中、 100は主記憶装置、101は主記憶装置10
0内のオペランドを読出してレジスタファイルill 
、 +12へ格納できるようにバイト位置合わせを行な
うためのンフタである。
In the figure, 100 is the main storage device, 101 is the main storage device 10
Read the operand in 0 and write the register file ill
, +12.

102はレジスタファイル111 、112へ入力する
データとして、主記憶装置100からの読出しデータ(
RD) 、又は減算器113の出力データ(SD)の何
れか一方を選択するセレクタである。
Reference numeral 102 indicates read data (
RD) or the output data (SD) of the subtracter 113.

103は主記憶装置100内のオペランドをレジスタフ
ァイル111 、112へ格納するときにオペランドの
プライオリティ (有効桁数)を算出するプライオリテ
ィ算出回路である。
Reference numeral 103 denotes a priority calculation circuit that calculates the priority (number of significant digits) of an operand when storing the operand in the main storage device 100 into the register files 111 and 112.

104はプライオリティ算出回路103で得られたプラ
イオリティでレジスタファイル(RU)111へ格納し
たオペランドのプライオリティを格納するためのレジス
タ(RPU)、105はプライオリティ算出回路103
で得られたプライオリティでレジスタファイル(RV)
112へ格納したオペランドのプライオリティを格納す
るだめのレジスタ(RP V)である。
104 is a register (RPU) for storing the priority of the operand stored in the register file (RU) 111 with the priority obtained by the priority calculation circuit 103; 105 is the priority calculation circuit 103;
Register file (RV) with the priority obtained in
This register (RPV) is used to store the priority of the operand stored in the register 112.

10Bはレジスタ(RPU)104とレジスタ(RPV
)105の内容を比較する比較器である。
10B is a register (RPU) 104 and a register (RPV
) 105.

107は比較器10Bの比較結果を記憶し、レジスタ(
RPU)104がレジスタ(RPV)105よりも大き
いときに°1′になり、それ以外では“O″になるフリ
ップフロップである。
107 stores the comparison result of the comparator 10B, and registers (
It is a flip-flop which becomes 1' when RPU) 104 is larger than the register (RPV) 105, and becomes "O" otherwise.

108は比較器10Bの結果を記憶し、レジスタ(RP
U)104とレジスタ(RPV)105が等しいときに
°1”になり、それ以外では°0′になるフリップフロ
ップである。
108 stores the result of the comparator 10B and registers (RP
It is a flip-flop that becomes 0' when U) 104 and register (RPV) 105 are equal, and 0' otherwise.

109はレジスタファイル(RU)111のアドレスを
指定するレジスタ(RUCNT)、 110はレジスタ
ファイル(RV)112のアドレスを指定するレジスタ
(RVCNT)である。
109 is a register (RUCNT) that specifies the address of the register file (RU) 111, and 110 is a register (RVCNT) that specifies the address of the register file (RV) 112.

111は主記憶装置1[1[1内のオペランド1を格納
するためのレジスタファイル(RV)である。
111 is a register file (RV) for storing operand 1 in main memory 1[1[1].

113はレジスタファイル(RU)111とレジスタフ
ァイル(RV)112を入力する減算器である。
A subtracter 113 inputs the register file (RU) 111 and the register file (RV) 112.

114は減算器113のボローを格納するフリップフロ
ップ(F B)、115は減算器113からの出力を調
べてレジスタファイル(RU)111とレジスタファイ
ル(RV)112内のオペランド1とオペランド2の減
算結果がゼロであるか否かを検出するゼロ検出回路であ
る。11Bはゼロ検出回路115の出力を保持するフリ
ップフロップであり、減算器113の減算結果がゼロの
ときに”1”となり、それ以外では“0“となる。
114 is a flip-flop (F B) that stores the borrow of the subtracter 113; 115 is a flip-flop that examines the output from the subtracter 113 and subtracts operand 1 and operand 2 in the register file (RU) 111 and register file (RV) 112; This is a zero detection circuit that detects whether the result is zero. A flip-flop 11B holds the output of the zero detection circuit 115, and becomes "1" when the subtraction result of the subtracter 113 is zero, and becomes "0" otherwise.

第2図は1−記実施例の比較ルーチンを示すフローチャ
ー1・である。
FIG. 2 is a flowchart 1. showing a comparison routine of the embodiment 1.

ここで、第1図及び第2図を参照して本発明の一実施例
を説明する。
An embodiment of the present invention will now be described with reference to FIGS. 1 and 2.

先ず、オペランド1をレジスタファイル(RU)Ill
へ格納し、オペランド2をレジスタファイル(RV)1
12へ格納する時点で、それぞれのプライオリティ (
有効桁数)をレジスタ(RP U)104、レジスタ(
RPV)105へそれぞれ設定し、コルレジスタ(RP
U)104とレジスタ(RP V)105の大小を比較
することで、オペランド1とオペランド2の大小を判別
する(第2図ステップ521−825)。
First, operand 1 is stored in the register file (RU).
and store operand 2 in register file (RV) 1.
12, each priority (
number of significant digits) in register (RPU) 104 and register (
RPV) 105, and cor register (RPV) 105.
U) 104 and the register (RP V) 105 to determine the magnitude of operand 1 and operand 2 (steps 521-825 in FIG. 2).

この場合、プライオリティ (有効桁数)の大きい方が
オペランドも大きくなる。そして、プライオリティ (
有効桁数)が等しいときにのみ、オペランド1とオペラ
ンド2の大小を判別するために、レジスタファイル(R
U)illとレジスタファイル(RV)112の減算を
行なう。
In this case, the larger the priority (number of significant digits), the larger the operand. And the priority (
The register file (R
U) Subtract ill and register file (RV) 112.

この際のレジスタファイル(RU) ill 。The register file (RU) ill at this time.

(RV)112の減算処理、及び同レジスタファイル(
RU) 111 、  (RV) 112 ヘf)オヘ
ラ>ドの格納処理は従来と同様であるのマ、ここではそ
の説明を省略する。
(RV) 112 subtraction processing and the same register file (
RU) 111, (RV) 112 (f) The storage process of the OHERA> code is the same as the conventional one, and its explanation will be omitted here.

上記した実施例の比較処理により、オペランド1とオペ
ランド2の絶対値を比較することにより、オペランド1
とオペランド2のプライオリティ(有効桁数)が異なる
場合には、減算を行なわなくてもオペランド1とオペラ
ンド2の大小が判別できるので、処理の高速化が計れる
By comparing the absolute values of operand 1 and operand 2 through the comparison process of the embodiment described above, operand 1
If the priority (number of effective digits) of operand 1 and operand 2 are different, the magnitude of operand 1 and operand 2 can be determined without subtraction, so that processing speed can be increased.

[発明の効果] 以上詳記したように本発明の比較装置によれば、主記憶
装置から読出した一対のオペランドの有効桁数を算出す
る手段と、同手段で算出された各オペランドの有効桁数
を格納するための一対のレジスタと、同レジスタ相互の
内容を比較し、大小および等号を判別する比較器と、同
比較器で得られた大小および等号を記憶するフリップフ
ロップと、同フリップフロップの内容をもとに主記憶装
置より読出した一対のオペランドの絶対値の大小を判定
する手段とを有して、一対のオペランドの有効桁数から
一対のオペランドの大小判定が可能な場合にのみ、オペ
ランド相互の減算を省略する構成としたことにより、演
算処理速度を高速化できる。
[Effects of the Invention] As detailed above, according to the comparison device of the present invention, there is a means for calculating the number of significant digits of a pair of operands read from the main storage device, and a means for calculating the number of significant digits of each operand calculated by the means. A pair of registers for storing numbers, a comparator that compares the contents of the registers and determines the magnitude and equality, and a flip-flop that stores the magnitude and equality obtained by the comparator. A case where it is possible to determine the magnitude of a pair of operands based on the number of significant digits of the pair of operands, with means for determining the magnitude of the absolute value of the pair of operands read from the main memory based on the contents of the flip-flop. By adopting a configuration in which subtraction between operands is omitted only in this case, the calculation processing speed can be increased.

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

第1図は本発明の一実施例を示す回路ブロック図、第2
図は上記実施例の比較処理ルーチンを示すフローチャー
ト、第3図は従来の比較処理手順を示すフローチャート
である。 100・・・主記憶装置、101・・・シフタ、102
・・・セレクタ、103・・・プライオリティ算出回路
、104・・・レジスタ(RPU)、105・・・レジ
スタ(RP V)、ioe・・・比較器、107・・・
フリップフロップ(FUGV)、10B・・・フリップ
フロップ(FUEV)、109・L/ジス9 (RUC
NT)、110・・・レジスタ(RVCNT)、lll
・・・レジスタファイル(RU)、112・・・レジス
タファイル(RV)、113・・・減算器、114・・
・フリップフロップ(FB)、115・・・ゼロ検出回
路、llB・・・フリップフロップ(F Z)。 出願人代理人 弁理士 鈴江武彦 第1図
FIG. 1 is a circuit block diagram showing one embodiment of the present invention, and FIG.
The figure is a flowchart showing the comparison processing routine of the above embodiment, and FIG. 3 is a flowchart showing the conventional comparison processing procedure. 100... Main storage device, 101... Shifter, 102
...Selector, 103...Priority calculation circuit, 104...Register (RPU), 105...Register (RPV), ioe...Comparator, 107...
Flip-flop (FUGV), 10B...Flip-flop (FUEV), 109 L/JIS 9 (RUC
NT), 110...Register (RVCNT), lll
...Register file (RU), 112...Register file (RV), 113...Subtractor, 114...
- Flip-flop (FB), 115...Zero detection circuit, llB...Flip-flop (FZ). Applicant's agent Patent attorney Takehiko Suzue Figure 1

Claims (1)

【特許請求の範囲】[Claims] 主記憶装置から読出した一対のオペランドの有効桁数を
算出する手段と、同手段で算出された各オペランドの有
効桁数を格納するための一対のレジスタと、同レジスタ
相互の内容を比較し、大小および一致を判別する比較器
と、同比較器て得られた大小および一致の判定結果を記
憶するフリップフロップと、同フリップフロップの内容
をもとに主記憶装置より読出した一対のオペランドの絶
対値の大小を判定する手段とを具備してなることを特徴
とする比較装置。
A means for calculating the number of significant digits of a pair of operands read from the main storage device, a pair of registers for storing the number of significant digits of each operand calculated by the means, and comparing the contents of the registers with each other, A comparator that determines size and match, a flip-flop that stores the size and match judgment results obtained by the comparator, and a pair of operands read from the main memory based on the contents of the flip-flop. 1. A comparison device comprising means for determining the magnitude of a value.
JP5406888A 1988-03-08 1988-03-08 Comparing device Pending JPH01228020A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5406888A JPH01228020A (en) 1988-03-08 1988-03-08 Comparing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5406888A JPH01228020A (en) 1988-03-08 1988-03-08 Comparing device

Publications (1)

Publication Number Publication Date
JPH01228020A true JPH01228020A (en) 1989-09-12

Family

ID=12960303

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5406888A Pending JPH01228020A (en) 1988-03-08 1988-03-08 Comparing device

Country Status (1)

Country Link
JP (1) JPH01228020A (en)

Similar Documents

Publication Publication Date Title
US5530663A (en) Floating point unit for calculating a compound instruction A+B×C in two cycles
JPH0786826B2 (en) Integer division circuit
USH1222H (en) Apparatus for determining sticky bit value in arithmetic operations
JPH01228020A (en) Comparing device
JPH04350724A (en) Shift extent detecting circuit
US4951238A (en) Processor for executing arithmetic operations on input data and constant data with a small error
KR960012354B1 (en) Microprocessor
US5715187A (en) Method and apparatus for integer multiplication
US11797300B1 (en) Apparatus for calculating and retaining a bound on error during floating-point operations and methods thereof
JPS5933551A (en) Operand duplication detecting circuit
JP3530418B2 (en) Multiplier
JPS63279321A (en) Microprogram controller
JPS63165931A (en) Storing system for information on discontinuous instruction fetch address
KR100198783B1 (en) How to drive a serial processing divider
JPH01205340A (en) Data processor
JP3110072B2 (en) Pre-normalization circuit
JPH02239349A (en) Circuit for detecting exception of virtual computer
JPS6224814B2 (en)
JPH02287820A (en) Data comparing device
JPH07261984A (en) Calculation method and device
JPH037971B2 (en)
EP0401745A2 (en) Data processor for high-speed access to stack area data
JPS61256437A (en) Arithmetic unit
JPS5839336B2 (en) Digital processing method for automatic control system
JPS59201144A (en) Decimal arithmetic circuit