Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0381173B2 - - Google Patents
[go: Go Back, main page]

JPH0381173B2 - - Google Patents

Info

Publication number
JPH0381173B2
JPH0381173B2 JP60299341A JP29934185A JPH0381173B2 JP H0381173 B2 JPH0381173 B2 JP H0381173B2 JP 60299341 A JP60299341 A JP 60299341A JP 29934185 A JP29934185 A JP 29934185A JP H0381173 B2 JPH0381173 B2 JP H0381173B2
Authority
JP
Japan
Prior art keywords
operand
operands
exponent
microinstruction
read
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
JP60299341A
Other languages
Japanese (ja)
Other versions
JPS62157939A (en
Inventor
Juichi Hachiman
Masafumi Kubo
Harukata Nakayama
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.)
PFU Ltd
Original Assignee
PFU 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 PFU Ltd filed Critical PFU Ltd
Priority to JP60299341A priority Critical patent/JPS62157939A/en
Publication of JPS62157939A publication Critical patent/JPS62157939A/en
Publication of JPH0381173B2 publication Critical patent/JPH0381173B2/ja
Granted legal-status Critical Current

Links

Description

【発明の詳細な説明】[Detailed description of the invention]

〔概要〕 浮動小数点の加減算で、マイクロ命令にオペラ
ンド・アドレスを修飾するフイールドを設け、2
つのオペランドの指数部の大小関係に応じて読出
し順序を制御できるようにして、桁合わせ処理を
単純化する。 〔産業上の利用分野〕 本発明は、計算機の演算機構に関するものであ
り、特に浮動小数点演算時における桁合わせ処理
のためのオペランドの間接読出し方式に関する。 〔従来の技術〕 浮動小数点形式の加減算を行う場合には、まず
演算すべき2つのオペランドの桁合わせが必要と
される。 浮動小数点形式のオペランドは、第4図に示す
ように、符号、指数部、仮数部の3つの要素で構
成され、仮数部は正規化されて(頭の“0”をつ
めて)記憶されている。2つのオペランドの桁合
わせは、双方のオペランドの指数部を比較し、指
数差がある場合、小さい方の指数部をもつオペラ
ンドの仮数部を右シフトすることによつて行われ
る。 この場合実際の処理としては、2つのオペラン
ド(第1オペランドおよび第2オペランドとす
る)の指数値の大小関係に応じて加減算ルーチン
を2通り用意しておいて、第1オペランドが第2
オペランドよりも大きい場合と、その反対の場合
とで使い分けるか、あるいは、第1オペランドと
第2オペランドとを入れ替えるルーチンを付加す
る必要がある。 また減算では、被減数側のオペランドの指数が
小さいときに、オペランドの入れ替えなしでその
まま減算を実行すると、補数表現の負数となるた
め、それを絶対値表現になすために必ず再補数化
(Recomplement)のステツプが入ることになる。 次に、2通りの加減算ルーチンを切り替えて使
用する従来の浮動小数点加減算方式について、第
5図の制御フローを用いて説明する。 第5図において、第1オペランドと第2オペラ
ンドの各指数部をe1,e2とし、e1−e2の指数差を
W1とする。以下、ないしで示す各ステツプ
にしたがつて、順に説明する。 第1オペランドを読出す。 第2オペランドを読出す。 第1オペランドと第2オペランドの各指数部
e1,e2の差W1を求める。 差W1の正負を判定し、W10であれば〜
のルーチンを実行し、W1<0であれば〜
のルーチンを実行する。 でW10のため、指数部が小さい方の第
2オペランドの仮数部を右へ桁合わせシフトす
る。 第1および第2オペランドの仮数部同士で演
算する。 演算結果を格納し、終了する。 でW1<0のため、シフト量を反転し、W1
←0−W1とする。 第1オペランドの仮数部を桁合わせシフトす
る。 第1および第2オペランドの仮数部同士で演
算する。 演算結果を格納し、終了する。 〔発明が解決しようとする問題点〕 従来の浮動小数点加減算では、2つのオペラン
ドの指数部の大小に応じて加減算ルーチンを切り
分けるか、オペランドを入れ替えるステツプが必
要であり、実行速度を上げられない1つの原因と
なつていた。 〔問題点を解決するための手段〕 本発明は、オペランドを読出すマイクロ命令で
第1および第2オペランドの間接読出しアドレス
を修飾し、指数部の大小関係にしたがつて順序で
たとえば指数部の値が小さい方のオペランドが常
に先になるようにして読出すことにより、ステツ
プ数の削減を可能にしている。 第1図は本発明の原理を説明するための装置構
成図である。 図において、11は本装置のマイクロプログラ
ムを起動するための機械命令であり、たとえば本
装置の上位に位置するCPUより与えられる。OP
はオペレーシヨンコード、Rsは第1オペランド、
Rdは第2オペランドである。 12は外部メモリ空間であり、フローテイング
レジスタFR0〜FRnを含む。 フローテイングレジスタFR0〜FRnは、上位
CPUからは、メモリ空間にアドレスされている
ように見える。 また本装置からフローテイングレジスタFR0
〜FRnを見たときには、機構命令のRd,Rsで示
されたものだけが、アクセス回路17を介して内
部メモリ空間15上にRd,Rsのデータイメージ
として現れる(間接読出しとなる)。 13は本装置を制御するマイクロ命令であり、
内部アドレスフイールドおよびフラグ制御フイー
ルドを含む。 内部アドレスフイールドは、マイクロ命令のオ
ペランド指定フイールドであり、内部バス上にあ
るレジスタを指定する。またフラグ制御フイール
ドは、フラグ制御回路19を介してオペランド入
換え制御フラグを制御するフイールドである。 14は本装置内のデータ転送用の内部バスであ
る。 15は本装置の内部メモリ空間であり、Rd
Rsのデータイメージ、ワークレジスタなどを含
む。 16はデータ処理部であり、Rd,Rsのデータ
を処理する。ALUや各種レジスタを含む。 17はアクセス回路であり、オペランド入換え
制御フラグ18により第1オペランドセレクト、
第2オペランドセレクトが制御され、内部メモリ
空間15上のRsイメージおよびRdイメージのア
ドレスに現れるフローテイングレジスタFRを指
定する。 18はオペランド入換え制御フラグであり、第
1オペランドRs、第2オペランドRdの指数差に
基づく大小関係を表し、アクセス回路17に対し
てオペランドの入換えあるいは非入換えを指定す
る。 19はフラグ制御回路であり、マイクロ命令1
3のフラグ制御フイールドでオペランド入換え制
御フラグ18の更新が指定されると、データ処理
部16のALUの演算結果をみて、オペランド入
換え制御フラグ18の状態を決定し、Rsイメー
ジアドレスから指数の小さい方のオペランドが、
Rdイメージアドレスからは、指数の大きい方の
オペランドが読み出されるように、オペランド入
換え制御フラグを設定する。 〔作用〕 本発明によれば、マイクロ命令により仮数部演
算を実行するためのオペランド読出しを行う際
に、先行する指数部比較の結果をオペランド・ア
クセスに反映させて、指数差がある場合、第1オ
ペランドと第2オペランドを大きさの順、たとえ
ば小さい方を先に読出すようにされる。 このため、特別にオペランド入れ替えステツプ
を付加する必要がなく、また加減算ルーチンも単
一化することができる。 第2図に、第1図に示した本発明による浮動小
数点加減算制御の例をフローで示す。次に図中の
ないしで示される各ステツプについて順に説
明する。 指数部比較のため第1オペランドRsを読出
す。 同じく第2オペランドRdを読出す。 Rs,Rdの指数部各指数部es,edについて指数
差W1=es−edを求める。W10であれば、オ
ペランド入れ替え制御フラグ14をオフにし、
W1<0であればオンにする。 小さい方のオペランド(実効第2オペラン
ド)を読出す。 大きい方のオペランド(実効第1オペラン
ド)を読出す。 指数部演算を行い、差W1を求める。 W1に基づいて小さい方のオペランドの仮数
部を桁合わせシストする。 2つのオペランドの仮数部同士を演算する。 結果を格納する。 〔実施例〕 第3図に、本発明方式の1実施例の構成を示
す。 図において、30は内部バス、31は主記憶装
置からフエツチされた各オペランドが一時的に格
納される複数の要素レジスタFR−0〜FR−nか
らなるフローテイング・レジスタFR,32はア
クセス回路、33はEOR回路、34はオペラン
ド入れ替え制御フラグFLAG,35は2つのオペ
ランドの指数差に基づく大小関係を表すオペラン
ド入れ替え制御信号、36は第1オペランドRs
と第2オペランドRdの一方を指定するオペラン
ド選択信号Rd/Rs,37はフローテイング・レ
ジスタFR31内の要素レジスタFR−0〜FR−
nを、オペランド選択信号36と共同して選択す
るFRセレクト信号、38はフローテイング・レ
ジスタFRから読出されるオペランド出力である。 アクセス回路32は、マイクロ命令のオペラン
ド・アドレス情報に基づくFRセレクト信号でフ
ローテイング・レジスタFR31内の第1および
第2のオペランドRs,Rdが格納されている1対
の要素レジスタを選択し、オペランド選択信号
Rd/RsによりそのうちのRsあるいはRdを選択す
る。 EOR回路33は、オペランド入れ替え制御フ
ラグFLAG34に設定されている指数差の状態に
基づいて、オペランド選択信号Rd/Rsの値を反
転あるいは非反転とし、フローテイング・レジス
タFRから読出される第1オペランドと第2オペ
ランドの読出し順序を変更あるいは不変更とす
る。 オペランド入れ替え制御フラグFLAG34は、
内部バスを介して算術演算ユニツト(図示省略)
からの先行する指数部比較の結果によつて設定さ
れる。 アクセス回路32の制御論理を次表に示す。こ
の表は、オペランド選択信号Rd/Rsおよびオペ
ランド入れ替え制御フラグFLAGの値と読出され
るオペランド出力との関係を表している。
[Overview] In floating-point addition and subtraction, a field is provided in the microinstruction to modify the operand address, and 2
To simplify digit alignment processing by controlling the reading order according to the magnitude relationship of exponent parts of two operands. [Industrial Application Field] The present invention relates to an arithmetic mechanism of a computer, and in particular to an indirect readout method of operands for digit alignment processing during floating point arithmetic. [Prior Art] When performing addition and subtraction in floating point format, it is first necessary to align the digits of the two operands to be operated. As shown in Figure 4, a floating-point format operand consists of three elements: a sign, an exponent, and a mantissa, and the mantissa is normalized (with leading zeros removed) and stored. There is. The digits of the two operands are aligned by comparing the exponents of both operands, and if there is a difference in exponents, right-shifting the mantissa of the operand with the smaller exponent. In this case, the actual processing is to prepare two types of addition/subtraction routines depending on the magnitude relationship of the exponent values of the two operands (the first operand and the second operand), and
It is necessary to use it depending on whether it is larger than the operand or vice versa, or to add a routine that swaps the first and second operands. In addition, in subtraction, if the exponent of the operand on the minuend side is small, if the subtraction is performed without exchanging the operands, it will become a negative number in complement representation, so it must be recomplemented to express it as an absolute value. There will be a number of steps. Next, a conventional floating point addition/subtraction method in which two types of addition/subtraction routines are switched will be described using the control flow shown in FIG. In Figure 5, the exponent parts of the first and second operands are e 1 and e 2 , and the exponent difference of e 1 − e 2 is
Let it be W 1 . Below, each step indicated by 1 to 2 will be explained in order. Read the first operand. Read the second operand. Each exponent part of the first and second operand
Find the difference W 1 between e 1 and e 2 . Determine whether the difference W 1 is positive or negative, and if W 1 is 0 ~
Execute the routine, and if W 1 < 0, ~
Execute the routine. Since W 1 is 0, the mantissa part of the second operand with the smaller exponent part is shifted to the right. The mantissa parts of the first and second operands are operated on. Store the calculation result and exit. Since W 1 < 0, the shift amount is reversed and W 1
←0−W 1 . Shift the mantissa of the first operand to match the digits. The mantissa parts of the first and second operands are operated on. Store the calculation result and exit. [Problems to be solved by the invention] In conventional floating-point addition and subtraction, it is necessary to separate the addition and subtraction routines depending on the magnitude of the exponent parts of the two operands, or to switch operands, which makes it impossible to increase execution speed. This was one of the causes. [Means for Solving the Problems] The present invention modifies the indirect read addresses of the first and second operands with a microinstruction that reads the operands, and reads the exponent parts in order according to the magnitude relationship of the exponent parts. By always reading the operand with the smaller value first, the number of steps can be reduced. FIG. 1 is an apparatus configuration diagram for explaining the principle of the present invention. In the figure, numeral 11 is a machine instruction for activating the microprogram of this device, which is given, for example, by a CPU located above the device. OP
is the operation code, R s is the first operand,
R d is the second operand. 12 is an external memory space, which includes floating registers FR0 to FRn. Floating registers FR0 to FRn are upper
From the CPU's perspective, it appears to be addressed in memory space. Also, floating register FR0 is connected to this device.
~ When looking at FRn, only the mechanical commands indicated by R d and Rs appear as data images of R d and Rs on the internal memory space 15 via the access circuit 17 (this is indirect reading). ). 13 is a microinstruction that controls this device;
Contains internal address fields and flag control fields. The internal address field is a microinstruction operand specification field and specifies a register on the internal bus. Further, the flag control field is a field that controls the operand exchange control flag via the flag control circuit 19. 14 is an internal bus for data transfer within this device. 15 is the internal memory space of this device, R d ,
Contains R s data image, work registers, etc. 16 is a data processing unit, which processes data of R d and Rs . Includes ALU and various registers. 17 is an access circuit, which selects the first operand according to the operand exchange control flag 18;
The second operand select is controlled and specifies the floating register FR that appears at the address of the R s image and the R d image on the internal memory space 15. Reference numeral 18 denotes an operand swapping control flag, which represents a magnitude relationship based on the index difference between the first operand R s and the second operand R d , and specifies to the access circuit 17 whether or not to swap the operands. 19 is a flag control circuit, and microinstruction 1
When the update of the operand exchange control flag 18 is specified in the flag control field 3, the state of the operand exchange control flag 18 is determined by looking at the calculation result of the ALU of the data processing unit 16, and the index is updated from the R s image address. The smaller operand of
The operand exchange control flag is set so that the operand with the larger index is read from the Rd image address. [Operation] According to the present invention, when an operand is read for executing a mantissa operation by a microinstruction, the result of the preceding exponent comparison is reflected in the operand access, and if there is an exponent difference, the first The first operand and the second operand are read out in order of size, for example, the smaller one first. Therefore, there is no need to add a special operand exchange step, and the addition and subtraction routines can also be unified. FIG. 2 shows a flowchart of an example of floating point addition/subtraction control according to the present invention shown in FIG. Next, each step indicated by ˜ in the figure will be explained in order. Read the first operand R s for exponent comparison. Similarly, the second operand Rd is read. The exponent difference W 1 = e s − e d is calculated for each exponent part e s , e d of R s , R d . If W 1 is 0, turn off the operand exchange control flag 14,
Turn on if W 1 <0. Read the smaller operand (effective second operand). Read the larger operand (effective first operand). Perform exponent calculation to find the difference W 1 . Align the mantissa of the smaller operand based on W 1 . Operates the mantissas of two operands. Store the results. [Embodiment] FIG. 3 shows the configuration of one embodiment of the system of the present invention. In the figure, 30 is an internal bus, 31 is a floating register FR consisting of a plurality of element registers FR-0 to FR-n in which each operand fetched from the main memory is temporarily stored, and 32 is an access circuit. 33 is an EOR circuit, 34 is an operand swapping control flag FLAG, 35 is an operand swapping control signal representing a magnitude relationship based on the index difference between two operands, and 36 is the first operand R s
Operand selection signal R d /R s , 37 which specifies one of the second operand R d and the second operand R d is element register FR-0 to FR- in floating register FR31.
FR select signal which jointly selects n with operand select signal 36, 38 is the operand output read from floating register FR. The access circuit 32 selects a pair of element registers in which the first and second operands R s and R d are stored in the floating register FR 31 using an FR select signal based on the operand address information of the microinstruction. , operand selection signal
Select R s or R d from R d /R s . The EOR circuit 33 inverts or non-inverts the value of the operand selection signal R d /R s based on the state of the exponent difference set in the operand exchange control flag FLAG 34, and inverts or non-inverts the value of the operand selection signal R d /R s . The reading order of the first operand and the second operand is changed or left unchanged. The operand exchange control flag FLAG34 is
Arithmetic unit (not shown) via internal bus
Set by the result of the preceding exponent comparison from . The control logic of the access circuit 32 is shown in the following table. This table represents the relationship between the values of the operand selection signal R d /R s and the operand exchange control flag FLAG, and the read operand output.

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

本発明によれば、2つのオペランドの指数差の
方向によるオペランドの入れ替えは、マイクロ命
令によるハードウエア回路上で実行されるため、
付加的なステツプは不要となり、また減算時に指
数差がある場合の再補数化(Recomplement)も
不要となるため、実行速度の向上が可能となる。
According to the present invention, operand swapping according to the direction of the exponent difference between two operands is executed on a hardware circuit using microinstructions.
Since no additional steps are required, and no recomplementation is required when there is an exponent difference during subtraction, execution speed can be improved.

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

第1図は本発明の原理的構成図、第2図は本発
明による浮動小数点加減算の制御フロー図、第3
図は本発明の1実施例の構成図、第4図は浮動小
数点形式のオペランドの構成図、第5図は従来の
浮動小数点加減算の制御フロー図である。 第1図中、11……機械命令、12……外部メ
モリ空間、13……マイクロ命令、14……内部
バス、15……内部メモリ空間、16……データ
処理部、17……アクセス回路、18……オペラ
ンド入換え制御フラグ、19……フラグ制御回
路、FR0〜FRn……フローテイングレジスタ、
Rs……第1オペランド、Rd……第2オペランド。
FIG. 1 is a basic configuration diagram of the present invention, FIG. 2 is a control flow diagram of floating-point addition/subtraction according to the present invention, and FIG.
FIG. 4 is a block diagram of an embodiment of the present invention, FIG. 4 is a block diagram of operands in floating point format, and FIG. 5 is a control flow diagram of conventional floating point addition/subtraction. In FIG. 1, 11...machine instruction, 12...external memory space, 13...microinstruction, 14...internal bus, 15...internal memory space, 16...data processing section, 17...access circuit, 18... Operand exchange control flag, 19... Flag control circuit, FR0 to FRn... Floating register,
R s ...first operand, R d ...second operand.

Claims (1)

【特許請求の範囲】 1 マイクロ命令に設定されたオペランド・アド
レス情報に基づいて、演算を行うべき第1および
第2のオペランドを順に読出すアクセス回路17
をそなえた計算機において、 浮動小数点演算時に、第1および第2のオペラ
ンドの指数部比較の結果の大小関係を表す情報を
設定されるオペランド入れ替え制御フラグ18を
設け、 上記アクセス回路17は、仮数部演算のために
第1および第2のオペランドを読出す際、マイク
ロ命令のオペランド・アドレス情報を上記オペラ
ンド入れ替え制御フラグ18の情報にしたがつて
変更し、第1および第2のオペランドを、それぞ
れの指数部の大小関係に応じた順序で読出すこと
を特徴とする浮動小数点演算におけるオペランド
の間接読出し方式。
[Claims] 1. An access circuit 17 that sequentially reads first and second operands to be operated on based on operand address information set in a microinstruction.
In a computer equipped with a floating point arithmetic operation, an operand switching control flag 18 is provided which is set with information representing the magnitude relationship of the result of comparing the exponent parts of the first and second operands, and the access circuit 17 controls the mantissa part. When reading the first and second operands for an operation, the operand address information of the microinstruction is changed according to the information of the operand swapping control flag 18, and the first and second operands are An indirect read method of operands in floating point arithmetic, characterized in that the operands are read in an order according to the magnitude relationship of exponent parts.
JP60299341A 1985-12-28 1985-12-28 Indirect reading system for operand in floating point calculation Granted JPS62157939A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60299341A JPS62157939A (en) 1985-12-28 1985-12-28 Indirect reading system for operand in floating point calculation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60299341A JPS62157939A (en) 1985-12-28 1985-12-28 Indirect reading system for operand in floating point calculation

Publications (2)

Publication Number Publication Date
JPS62157939A JPS62157939A (en) 1987-07-13
JPH0381173B2 true JPH0381173B2 (en) 1991-12-27

Family

ID=17871297

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60299341A Granted JPS62157939A (en) 1985-12-28 1985-12-28 Indirect reading system for operand in floating point calculation

Country Status (1)

Country Link
JP (1) JPS62157939A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5735923A (en) * 1993-07-30 1998-04-07 Asahi Glass Company Ltd. Method of and apparatus for cooling and tempering a glass plate

Also Published As

Publication number Publication date
JPS62157939A (en) 1987-07-13

Similar Documents

Publication Publication Date Title
JP7616757B2 (en) Apparatus, method and system for matrix operation accelerator instructions - Patents.com
US4823260A (en) Mixed-precision floating point operations from a single instruction opcode
US4740893A (en) Method for reducing the time for switching between programs
US20200097799A1 (en) Heterogeneous multiplier
US5132898A (en) System for processing data having different formats
CN117724763A (en) Apparatus, method and system for instructions for matrix operation accelerator
TWI506539B (en) Method and apparatus for decimal floating-point data logical extraction
US4713750A (en) Microprocessor with compact mapped programmable logic array
US5440702A (en) Data processing system with condition code architecture for executing single instruction range checking and limiting operations
JPH06332792A (en) Data processor, data reading control circuit thereof and data writing control circuit
JPS6313215B2 (en)
JPH0792739B2 (en) Floating point data normalization method
JPS5811652B2 (en) Arithmetic unit
JPH0546383A (en) Data processing device
JPS6014338A (en) Branch mechanism for computer system
US4631672A (en) Arithmetic control apparatus for a pipeline processing system
US4373182A (en) Indirect address computation circuit
EP0447101B1 (en) Processor with data format-independent instructions
JPH0381173B2 (en)
US6275925B1 (en) Program execution method and program execution device
JP2520882B2 (en) Data processing device and data processing method
JPS6161416B2 (en)
US6253312B1 (en) Method and apparatus for double operand load
JPS6217773B2 (en)
JPH0222413B2 (en)