JPH02125331A - Dividing and multiplying square root extractor - Google Patents

Dividing and multiplying square root extractor

Info

Publication number
JPH02125331A
JPH02125331A JP63277242A JP27724288A JPH02125331A JP H02125331 A JPH02125331 A JP H02125331A JP 63277242 A JP63277242 A JP 63277242A JP 27724288 A JP27724288 A JP 27724288A JP H02125331 A JPH02125331 A JP H02125331A
Authority
JP
Japan
Prior art keywords
multiplication
division
subtraction
output
multiplier
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
JP63277242A
Other languages
Japanese (ja)
Inventor
Tetsuaki Nakamigawa
哲明 中三川
Hiroyuki Kida
博之 木田
Mitsuru Watabe
満 渡部
Shigeki Morinaga
茂樹 森永
Hisashi Kajiwara
久志 梶原
Takeshi Asai
剛 浅井
Masahisa Narita
正久 成田
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.)
Hitachi Engineering Co Ltd
Hitachi Ltd
Original Assignee
Hitachi Engineering Co Ltd
Hitachi 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 Hitachi Engineering Co Ltd, Hitachi Ltd filed Critical Hitachi Engineering Co Ltd
Priority to JP63277242A priority Critical patent/JPH02125331A/en
Priority to US07/536,565 priority patent/US5293558A/en
Priority to EP89912134A priority patent/EP0394499B1/en
Priority to DE68928376T priority patent/DE68928376T2/en
Priority to PCT/JP1989/001134 priority patent/WO1990005335A1/en
Publication of JPH02125331A publication Critical patent/JPH02125331A/en
Priority to KR1019900701428A priority patent/KR100198472B1/en
Priority to US08/089,103 priority patent/US5631858A/en
Priority to US08/797,653 priority patent/US5956263A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To increase the approximating calculation speed in the Newton- Raphson's method by eliminating the difference in the number of transfer machine cycles from the output stage to the input stage of a multiplier between execution and non-execution of operation of the output of the multiplier in an adder/subtractor or a shifter. CONSTITUTION:A subtracting and shifting circuit is inserted between the output stage and the input stage of a multiplier 10, and the output of the multiplier 10 is directly inputted to a subtracting and shifting circuit 11, and the output result of this circuit 11 is inputted to the multiplier 10 through a bus 14 or a private local bus. That is, the multiplier 10 calculates a multiplication term in a recurrence formula, and the subtracting and shifting circuit 11 subtracts '2' or '3' from the output of the multiplier 10 and shifts the result as required, and the result is transferred to the multiplier 10 through the bus 14. Consequently, the recurrence formula is calculated. Thus, multiplication and division processings in the approximating calculation of the Newton-Raphson's method are continuously performed to increase the calculation speed.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は乗算器を有する演算装置に係り、特に除算また
は開平器を乗算器を用いて演算する乗除算開平器に関す
る。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an arithmetic device having a multiplier, and more particularly to a multiplication/division squarer that performs a division or square rooter operation using a multiplier.

〔従来の技術〕[Conventional technology]

従来、演算装置において乗算を高速化するために加算器
の他に乗算器を用いることが行われている、一方、除算
及び開平算を高速化するために近似計算を使用すること
が行われるが、近似計算には乗算器を用いることが一般
的である。乗算器を用い近似計算によって除算を行う方
式には1例えば特開昭49−96647号等に記載があ
る。
Conventionally, multipliers have been used in addition to adders to speed up multiplication in arithmetic devices, while approximation calculations have been used to speed up division and square root operations. , multipliers are generally used for approximate calculations. A method of performing division by approximate calculation using a multiplier is described in, for example, Japanese Patent Laid-Open No. 49-96647.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

一方、Newton−Raphson法と呼ばれる近似
計算法は、関数の接線の方程式を利用して関数値を計算
する方式であり、関数f (x)について次の漸化式を
計算することで関数の値を求めるものである。
On the other hand, the approximate calculation method called Newton-Raphson method is a method of calculating the function value using the equation of the tangent line of the function, and the value of the function is calculated by calculating the following recurrence formula for the function f (x). This is what we seek.

この方法でA÷Bの除算を行う場合、−=A・f(x)
=B−−=Oとすると漸化式は次のようになる。
When dividing A÷B using this method, -=A・f(x)
If =B--=O, the recurrence formula becomes as follows.

Xt+1=Xi @ (2B xt) ・・・(2) このように、この方法を使用すれば除算は乗算と減算の
みで実現できる。
Xt+1=Xi @ (2B xt) (2) In this way, if this method is used, division can be realized only by multiplication and subtraction.

また、開平算においては、f (x)=A −xz=0
とすると漸化式は 漸化式は Xi”1=Xt  。
In addition, in square root arithmetic, f (x)=A −xz=0
Then, the recurrence formula is Xi"1=Xt.

・(3A−xt”) ・・・(4) となり。・(3A-xt”) ...(4) Next door.

乗算と減算及び−倍の演算のみで開平算を実現できる。Square root calculation can be realized using only multiplication, subtraction, and -times operations.

一倍演算は2進計算機においては シフト操作のみで実現できる。In a binary calculator, the 1x operation is This can be achieved by simply shifting.

しかし、従来例では減算を行う加減算器は乗算器とは別
にあり1乗算結果を加減算器に転送し、演算し、演算結
果を再び乗算器に転送する必要があった。
However, in the conventional example, the adder/subtracter that performs subtraction is separate from the multiplier, and it is necessary to transfer the result of one multiplication to the adder/subtracter, perform the operation, and transfer the result of the operation to the multiplier again.

本発明の目的はこの減算によるオーバヘッドを低減し、
Newton−Raphson法による近似計算を高速
化することにある。
The purpose of the present invention is to reduce the overhead caused by this subtraction,
The objective is to speed up approximate calculation using the Newton-Raphson method.

〔課題を解決するための手段〕[Means to solve the problem]

上記目的は、乗算器の出力段と入力段の間に減算シフト
回転を付加し、乗算器の出力を直接減算シフト回路に入
力し、減算シフト回路の出力結果をバスまたは専用ロー
カルバスを介して乗算器に入力することにより達成され
る。さらに、減算の種類を特定し、減算回路を簡略化す
れば一段と処理の高速化が図れる。
The above purpose is to add a subtractive shift rotation between the output stage and the input stage of the multiplier, input the output of the multiplier directly to the subtractive shift circuit, and send the output result of the subtractive shift circuit via a bus or a dedicated local bus. This is achieved by inputting to a multiplier. Furthermore, by specifying the type of subtraction and simplifying the subtraction circuit, processing speed can be further increased.

〔作用〕[Effect]

乗算器は漸化式中の乗算項を計算し、減算シフト回路は
2または3を乗算器の出力より減じ、必要に応じてシフ
ト操作を行い、結果をバスを介して乗算器に転送する。
The multiplier calculates the multiplication term in the recurrence formula, and the subtraction shift circuit subtracts 2 or 3 from the output of the multiplier, performs shift operations as necessary, and transfers the result to the multiplier via the bus.

これにより漸化式が計算される。This allows the recurrence formula to be calculated.

C実施例〕 以下、本発明の一実施例を第1図〜第6図により説明す
る。
C Embodiment] An embodiment of the present invention will be described below with reference to FIGS. 1 to 6.

第1図は本乗除去開平器の基本構成を示す図である0乗
除算開平器は乗算器(MULT)10゜減算シフト回路
(SBSF)11、乗算器ソースレジスタX (MSR
X)12、乗算器ソースレジスタY (MSRY)13
及びバス(BUS)14を基本構成要素とする。
Figure 1 is a diagram showing the basic configuration of the present multiplier-removal squarer.
X) 12, Multiplier source register Y (MSRY) 13
and a bus (BUS) 14 as basic components.

MULTIOはnビット掛けるnビットの乗算を行い2
0ピツトの結果を出力する。5BSFIIは減算及びシ
フト操作を行うが、詳細は後述する。
MULTIO performs multiplication of n bits by n bits and 2
Outputs the result of 0 pits. 5BSFII performs subtraction and shift operations, details of which will be described later.

MSRX12及びMSRY13は、MULTIOの入力
となる値を保持するnビットのレジスタである。BUS
14は5BSF11とMSRX12及びMSRY13の
間のデータ転射を行う。
MSRX12 and MSRY13 are n-bit registers that hold values that are input to MULTIO. BUS
14 performs data transfer between the 5BSF11, MSRX12, and MSRY13.

BUS14のデータ幅は1本実施例では2nビットとす
るが、データ幅は本発明において本質的でない。
Although the data width of the BUS 14 is 2n bits in this embodiment, the data width is not essential to the present invention.

第2図は乗除算開平器の全体構成の詳細を示す図である
* Newton−Raphson法では漸化式の計算
における初期値が必要であるが、本実施例では定数テー
ブル(CT)20によって初期値を発生する。
FIG. 2 is a diagram showing the details of the overall configuration of the multiplication/division squarer.*The Newton-Raphson method requires an initial value for calculating the recurrence formula, but in this embodiment, the initial value is determined using the constant table (CT) 20. generate a value.

CT2Oは、定数テーブルアドレスレジスタ(CTAR
)201、定数記憶装置I(CTM)202゜定数テー
ブル出力レジスタ(CTOR)203から成り、BUS
14に接続されている。 CTAR201はBUS14
上のデータをデープル参照のアドレスとして受は取る。
CT2O is the constant table address register (CTAR
) 201, constant storage device I (CTM) 202, constant table output register (CTOR) 203, and BUS
14. CTAR201 is BUS14
The receiver takes the above data as the address of the daple reference.

CTAR201の内容をアドレスとしてCTM202内
の定数がCTOT203に読み出され、CTOR203
の内容はB U S 14に出力される。BUS14の
データ幅は2nビットであるが、その上位nビットをB
USH141、下位nビットをBUSL142とする。
Constants in CTM202 are read out to CTOT203 using the contents of CTAR201 as an address, and CTOR203
The contents of are output to the BUS 14. The data width of BUS14 is 2n bits, but the upper n bits are
USH141 and lower n bits are assumed to be BUSL142.

本実施例ではCTAR201はBUSH141と、CT
OR203はBUSH141及びBUSL142ト、M
SRX12はBUSH141と、MSRY13はBUS
)(141及びBUSL142と、5BSFIIはBU
SH141及びBUSL142と、それぞれ接続されて
いるものとする。
In this embodiment, CTAR201 connects to BUSH141 and CTAR201.
OR203 is BUSH141 and BUSL142, M
SRX12 is BUSH141, MSRY13 is BUS
) (141 and BUSL142, 5BSFII is BU
It is assumed that the SH 141 and the BUSL 142 are connected to each other.

制御装置(CTRL)21は本乗除算開平器の動作を制
御する。CTRL21は、近似計算の回数を制御するた
めのループカウンタ(LC)211及びデクリメンタ(
DEC)212を含む。
A control device (CTRL) 21 controls the operation of the multiplication/division squarer. The CTRL 21 includes a loop counter (LC) 211 and a decrementer (LC) 211 for controlling the number of approximate calculations.
DEC) 212.

LC211には所定の値が設定され、D E C212
はLC211の値を減する。LC211の値が0になっ
た場合、CTRL21は所定の制御を行うものとする。
A predetermined value is set in LC211, and D E C212
decreases the value of LC211. When the value of LC211 becomes 0, CTRL21 shall perform predetermined control.

なお、ループカウンタが制御装置に含まれることは本質
的ではなく、乗除算開平器を含む装置全体中にループカ
ウンタと同様の働きを持つ回数制御手段があれば良い。
Incidentally, it is not essential that the loop counter be included in the control device, and it is sufficient if there is a number control means having the same function as the loop counter in the entire device including the multiplication/division squarer.

本実施例では、取り扱うデータを浮動小数点数とする。In this embodiment, the data to be handled is a floating point number.

即ち、数はS−M・2E(ただしSは符号、Mは仮数、
市は指数)と表される。符号及び指数に関しては、変乗
除開平器の外部で処理されるとし、本乗除算開平器では
浮動小数点数の仮数のみを取り扱う0本実施例では小数
点位置は、MULTIOの出力以外でMSBの下位、即
ち整数ビットは1ビットであるとする。MSRX12及
びMDRY13においても小数点位置はMSBの下位に
あるため、MULTIOの出力は第3図に示すようにM
SB−1ビットの下位に小数点位置がある。即ちMUL
TLOの出力は整数ビットが2ビットになる。
In other words, the number is S-M・2E (where S is the sign, M is the mantissa,
City is expressed as index). The sign and exponent are processed outside the multiplication/division squarer, and this multiplication/division squarer handles only the mantissa of floating point numbers. That is, it is assumed that an integer bit is 1 bit. Since the decimal point position is also below the MSB in MSRX12 and MDRY13, the output of MULTIO is M as shown in Figure 3.
There is a decimal point position below the SB-1 bit. That is, MUL
The output of the TLO consists of two integer bits.

次に5BSFIIの機能について説明する。Next, the functions of 5BSFII will be explained.

5BSFIIの構成の詳細を第4図に示す。The details of the configuration of 5BSFII are shown in FIG.

5BSFI 1は減算回路(SUB)111、シフト回
路(SFT)112、出力レジスタ(S S OR)1
13、シフトアウトキャリレジスタ(SFC)114か
ら成る。5UB111はMULT1017)出力に対し
て減算を行い、5FT112は減算結果に対してシフト
操作を行い、結果を5SOR113及び5FC114に
格納する。
5BSFI 1 is subtraction circuit (SUB) 111, shift circuit (SFT) 112, output register (S S OR) 1
13 and a shift-out carry register (SFC) 114. The 5UB 111 performs subtraction on the MULT 1017) output, the 5FT 112 performs a shift operation on the subtraction result, and stores the results in the 5SOR 113 and 5FC 114.

SUB 111は除算及び開平器の場合、それぞれ2及
び3をMULTloの出力から減するが、この操作は次
のように行う、2からの減算は、即ち2の補数を取る操
作であり、MULTIOの出力をa =b 1In−1
b 2n−Lムb xn−s−b s b o (ムは
小数点)とすると、2− a == b 2n−1b 
xn−zムbzn−s・=bzbo+2″″(2′″−
”)(btはbIの反転、2−prl−gはLSBから
のキャリ入力)となる。3からの減算は、3−a=1+
(2−a)であるから、2−aの結果に1を加えれば良
い。ところで式(4)のAX−項は1に近い数であり る(即ち乗算結果が2を越える)ことが無いことに着目
すると、 3− a = b 2n−2b 2n−2ムb 2n−
3’1lll b s b o+ 2−(”″2)とな
る、一方、2−(zn−z)のキャリの大きさは、Ne
%+ton−Raphson法による近似計算による誤
差より小さいので、2″″(zn−z)のキャリを加え
なくても計算精度には影響しない、従って、5LIB1
11の処理はMULTloの出力結果b 2n−1b 
2n−2ムb 2n−3・・・b lboに対して、2
からの減算に対してはb !n−1b zn−zムb 
1n−3+++ b s b o を出力し、3からの
減算に対してはb zn−x b 2n−2ムb zn
−s−b 1b 。
In the case of division and square rooting, SUB 111 subtracts 2 and 3 from the output of MULTlo, respectively. This operation is performed as follows. Subtraction from 2 is an operation of taking two's complement, and MULTIO's The output is a = b 1In-1
b 2n-L mu b xn-s-b s b o (mu is a decimal point), then 2- a == b 2n-1b
xn-zmu bzn-s・=bzbo+2″″(2′″-
”) (bt is the inversion of bI, 2-prl-g is a carry input from LSB). Subtraction from 3 is 3-a=1+
Since (2-a), it is sufficient to add 1 to the result of 2-a. By the way, if we pay attention to the fact that the AX- term in equation (4) is a number close to 1 (that is, the multiplication result never exceeds 2), we get 3- a = b 2n-2b 2n-2 m b 2n-
3'1lll b s b o+ 2-(""2), on the other hand, the carry size of 2-(zn-z) is Ne
%+ton-Since the error is smaller than the error caused by the approximate calculation using the Raphson method, the calculation accuracy is not affected even if the carry of 2'''' (zn-z) is not added.Therefore, 5LIB1
11 processing is MULTlo output result b 2n-1b
2n-2mu b 2n-3...b For lbo, 2
b for subtraction from ! n-1b zn-zmu b
Outputs 1n-3+++ b s b o , and for subtraction from 3, outputs b zn-x b 2n-2 m b zn
-s-b 1b.

を出力することになる。なお、減算を行わない場合はM
ULTIOの出力をそのままSUB 111の出力とす
る。また、mビット(2n>m)までの近似計算しか行
わない場合は、下位2n+m−2ビットに関してはどの
ような値を出力しても無意味なため、SUB 111に
よる操作は、上位2 n−m+ 2ビットだけに行って
も良い。
will be output. In addition, if subtraction is not performed, M
The output of ULTIO is directly used as the output of SUB 111. Furthermore, if only approximate calculations are performed up to m bits (2n>m), it is meaningless to output any value for the lower 2n+m-2 bits, so the operation by the SUB 111 is performed using the upper 2n-2 bits. It is also possible to go only to m+2 bits.

SUB 111の出力はMSB−1ビットの下位に小数
点位置があるため、この値を再び演算に使用するために
は小数点位置を合わせなければならない。そのために5
FT112は、SUB 111に出力をO詰め左1ビッ
トシフトし、5SOR113に出力する。その際SUB
 111の出力のMSB1ビットはシフトアウトキャリ
として5FC114に出力される。これにより小数点位
置が合わせられる。なお、式(2)において2−B−x
t項は1に近い数であるので5FC114が1になるこ
とはない、開平器の場合、漸化式中の−を掛ける処理は
、SUB 111の出力をシフトせずにそのまま5SO
R113に出力すれば良い。即ち、見かけ止車数点位置
が1ビット左にずれたことになり、一を掛ける操作とな
る。なお、本実施例では乗算器出力に対してバス上の小
数点位置が左に1ビットずれているために、開平器の場
合はシフト操作を行わなくても良いが、小数点位置の関
係が本実施例と異なる場合には、開平器の場合、小数点
位置に対して1ビット右シフト操作を行うことが必要に
なる。
Since the output of SUB 111 has a decimal point position below the MSB-1 bit, the decimal point position must be adjusted in order to use this value again for calculation. For that reason 5
The FT 112 shifts the output to the SUB 111 by 1 bit to the left, and outputs it to the 5SOR 113. At that time SUB
The MSB 1 bit of the output of 5FC 111 is output to 5FC 114 as a shift-out carry. This aligns the decimal point. Note that in formula (2), 2-B-x
Since the t term is a number close to 1, 5FC114 will never be 1. In the case of a square rooter, the process of multiplying by - in the recurrence formula is to directly convert the output of SUB 111 to 5SO without shifting it.
It is sufficient to output it to R113. In other words, the positions of several points where the apparent stopped vehicle is shifted to the left by one bit, resulting in an operation of multiplying by one. Note that in this example, the decimal point position on the bus is shifted by 1 bit to the left with respect to the multiplier output, so in the case of a square rooter, there is no need to perform a shift operation, but the relationship between the decimal point positions is different from that in this example. In a case different from the example, in the case of a square rooter, it is necessary to perform a 1-bit right shift operation on the decimal point position.

次に、本実施例を用いて除算及び開平器を計算する方法
について説明する。
Next, a method of calculating division and square root square using this embodiment will be explained.

先ず除算について説明する。除算の計算のフローチャー
トを第5図に示す。第5図は、A÷Bの計算において、
式(2)の漸化式により一を求め、その後−・Aを求め
るものである。以下、第5図に従い、手順を説明する。
First, division will be explained. A flowchart of the division calculation is shown in FIG. Figure 5 shows that in the calculation of A÷B,
One is found by the recurrence formula of equation (2), and then -.A is found. The procedure will be explained below with reference to FIG.

先ず漸化式における繰返し回数をCTRL21中のLC
211に設定する。繰返し回数は初期値の精度及び求め
ようとする値の精度の関係から、あらかじめ決められる
。・・・(501)次に、漸化式の計算における初期値
をCT2Oから読み出す。
First, the number of repetitions in the recurrence formula is expressed as LC in CTRL21.
Set to 211. The number of repetitions is determined in advance based on the relationship between the accuracy of the initial value and the accuracy of the value to be determined. (501) Next, the initial value for calculating the recurrence formula is read from CT2O.

BUS14には除数Bの値が乗せられる。The value of the divisor B is placed on BUS14.

CTAR201には、BUSH141上のデータをb 
2n−1b 2n−2”’ b n+1 b nとする
とb zn−z b 2n−3・・・b Ln−*であ
るm−1ビットのデータが入れられる。これは、本乗除
算開平器が浮動小数点数の仮数データを取り扱っている
ため、BUS141上の整数ビット即ちb2h−iは必
ず1になっているためである。CTAR201の内容に
従いCTM202からは対応するΩビットの初期値が読
み出される。
The data on BUSH141 is stored in CTAR201.
2n-1b 2n-2"' b n+1 b n, then m-1 bit data of b zn-z b 2n-3...b Ln-* is input. This means that the multiplication/division squarer is This is because the integer bit, ie, b2h-i, on the BUS 141 is always 1 since floating point mantissa data is handled.The initial value of the corresponding Ω bit is read from the CTM 202 according to the contents of the CTAR 201.

CTM202の出力はCTOR203にセットされる。The output of CTM 202 is set to CTOR 203.

CTOR203のデータ幅は2nビットであるが、2n
ビット以下のデータ幅でも良い。
The data width of CTOR203 is 2n bits;
The data width may be less than one bit.

CTM202の出力データ幅Qはm−1以上とする。た
だし、除算の場合、初期値の取り得る範囲は−くx≦1
であり、2進表示で1〜0.111・・・(2)である
から、初期値の整数ビット及び小数点以下第1位のビッ
トはそればれO及び1とな、ることを利用し、CTM 
202のデータ幅Qを減らし、CTOR203に格納す
る際に、整数ビット及び小数点以下第1位のビットに0
及びlを入札ることができる。逆にデータ幅Qを変えず
に初期値の精度を向上させることができる。CTOR2
03の下位2n−Q−2ビットにはあらかじめ決めた一
定値が入れられる。・・・(502)CTOR203に
読み出された初期値はBUS14を介してMSRX12
に入れられる。・・・(503) MSRY13には除
数Bが入れられる。・・・(504) MSRX12と
MSRY13の乗算が行われる。これにより式(2)中
のB−xtの項が計算されたことになる。
The output data width Q of the CTM 202 is set to be m-1 or more. However, in the case of division, the possible range of the initial value is -x≦1
Since it is 1 to 0.111 (2) in binary representation, the integer bits of the initial value and the first bit below the decimal point are respectively O and 1. CTM
When reducing the data width Q of 202 and storing it in CTOR 203, 0 is added to the integer bits and the first bit below the decimal point.
and l can be bid. Conversely, the accuracy of the initial value can be improved without changing the data width Q. CTOR2
A predetermined constant value is entered into the lower 2n-Q-2 bits of 03. ...(502) The initial value read to CTOR203 is sent to MSRX12 via BUS14.
can be placed in ...(503) Divisor B is placed in MSRY13. (504) MSRX12 and MSRY13 are multiplied. This means that the term B-xt in equation (2) has been calculated.

・・・(505)次に5tJB 111によって乗算結
果から52が減じられ、式(2)中の2−B−X10項
が計算されたことになる。・・・(506)SFT11
2は減算結果を0詰め左1ビットシフトし、5FC11
4及び5SOR113にセットする。これにより小数点
位置が合わされる。・・・(507) 5SOR113
の内容の上位nビットがBUSH141を介してMSR
Y13に入れられる。・・・(508)MSRX12と
MSRY13の乗算が行なわれる。MSRX12の内容
は式(2)中のxtの値を保存しており1式(2)の右
辺X五・ (2B−xt)が計算されたことになる。・
・・(509)乗算結果に対して5UBIIIは操作を
行わず、5FT112は小数点位置合わせのための左シ
フトを行う。・・・(510) 5SOR113の上位
nビットがBUSH141を介してMSRX12に入れ
られる。これにより漸化式の右辺から左辺への代入が行
われたことになる。・・・(511)LC211の内容
がDEC212によって減じられ、その値がLC211
に入れられる。・・・(512)CTRL21はLC2
11の内容が計算終了条件を満たしていれば制御を手順
(514)に移し、さもなければ制御を手順(504)
に戻す、・・・(513)被除数Aの値をMSRY13
に入れる。
(505) Next, 52 is subtracted from the multiplication result by 5tJB 111, and the 2-B-X10 term in equation (2) is calculated. ...(506) SFT11
2 pads the subtraction result with 0 and shifts it to the left by 1 bit, 5FC11
Set to 4 and 5 SOR113. This aligns the decimal point. ...(507) 5SOR113
The upper n bits of the contents are sent to MSR via BUSH141.
It will be placed in Y13. (508) MSRX12 and MSRY13 are multiplied. The contents of MSRX12 store the value of xt in equation (2), which means that the right-hand side of equation (2) (2B-xt) has been calculated.・
(509) 5UBIII does not perform any operation on the multiplication result, and 5FT 112 performs a left shift to align the decimal point. (510) The upper n bits of the 5SOR 113 are input to the MSRX 12 via the BUSH 141. This means that the assignment from the right side of the recurrence formula to the left side has been performed. ...(511) The contents of LC211 are subtracted by DEC212, and the value is
can be placed in ...(512) CTRL21 is LC2
If the content of step 11 satisfies the calculation end condition, control is transferred to step (514); otherwise, control is transferred to step (504).
(513) Return the value of dividend A to MSRY13.
Put it in.

・・・(514)MSRX12とMS RY 13の乗
算を行う、これにより近似計算によって求めたーとAと
の乗算が行われ、−の除算が完了したことになる。・・
・(515)SFT112は乗算結果を左シフトし、5
FC114及び5SOR113に入れる。これにより本
実施例による除算の最終結果が5SORI 13に入っ
たことになる。・・・(516)次に開平算について説
明する。開平算の計算のフローチャートを第6図に示す
。第6図は、Hの計算において式(4)の漸化式により
一を求め、Jπ その後Aを掛けることにより5を求めるものである。以
下、第6図に従い、手順を説明する。
(514) MSRX12 and MSRY13 are multiplied. This means that - obtained by approximate calculation is multiplied by A, and the division of - is completed.・・・
・(515) SFT112 shifts the multiplication result to the left and
Enter into FC114 and 5SOR113. As a result, the final result of the division according to this embodiment is stored in 5SORI 13. (516) Next, square root calculation will be explained. A flowchart of the square root calculation is shown in FIG. In FIG. 6, in the calculation of H, 1 is obtained using the recurrence formula of equation (4), Jπ is then multiplied by A to obtain 5. The procedure will be explained below with reference to FIG.

先ず漸化式における繰返し回数をCTRL21中のLC
211に設定する。繰返し回数は除算の場合と同様にあ
らかじめ決められる。・・・(601)漸化式の計算に
おける初期値をCT2Oから読み出す。手順は除算の場
合と同様であるが、開平算の場合、指数値が奇数の場合
に仮数を2で割って指数値を偶数に直してから計算する
方式をとると仮数の整数ビットは必ずしも1ではない。
First, the number of repetitions in the recurrence formula is expressed as LC in CTRL21.
Set to 211. The number of repetitions is determined in advance as in the case of division. (601) The initial value for calculating the recurrence formula is read from CT2O. The procedure is the same as for division, but in the case of square root arithmetic, if the exponent value is an odd number, if you divide the mantissa by 2 to make the exponent value even and then calculate, the integer bit of the mantissa will not necessarily be 1. isn't it.

そのため、BUS14には被開平数Aの値が乗せられる
が、CTAR201には、BUSH141上のデータを
b !n−1b an−x・= b n+1 b nと
するとb 2n−1b 1ln−1・・・b !i−(
mat)であるm−1ビットのデータが入れられる。C
TAR201の内容に従いCTM202からは対応する
Ωビットの初期値が読み出される。CTM202の出力
はCTOR203にセットされるが、開平算の場合、初
期値の取り得数ビットは必ずしも1とは限らない。従っ
て除算の場合のようにあらかじめ整数ビットを決めるこ
とはできない。・・・(602)CTOR203に読み
出された初期値はBUS14を介してMSRX12に入
れられる。・・・(603)MSRY13には被開平数
Aが入れられる−(604)MSRX12とMSRY1
3の乗算が行われる。これにより式(4)中のA−xl
の項が計算されたことになる。
Therefore, the value of the open base number A is placed on BUS14, but the data on BUSH141 is placed on CTAR201. If n-1b an-x・= b n+1 b n, then b 2n-1b 1ln-1...b! i-(
m-1 bits of data, which is (mat), is input. C
According to the contents of TAR 201, the initial value of the corresponding Ω bit is read from CTM 202. The output of the CTM 202 is set in the CTOR 203, but in the case of square root calculation, the possible number of bits of the initial value is not necessarily 1. Therefore, the integer bits cannot be determined in advance as in the case of division. (602) The initial value read to the CTOR 203 is input to the MSRX 12 via the BUS 14. ...(603) MSRY13 is filled with the open fraction A - (604) MSRX12 and MSRY1
A multiplication of 3 is performed. As a result, A−xl in formula (4)
This means that the term has been calculated.

・・・(605)乗算結果に対して5FT113は小数
点位置を合わせるために1ビット左ジフトを行い、結果
を5FC114及び5SOR113に入れる。・ (6
06)SSOR113の上位nビットがBUSH141
を介してMS RY 13に入れられる。 ・(607
)MS RX 12とMS RY 13の乗算が行われ
る。MSRX12は式(4)中のX。
(605) The 5FT 113 shifts the multiplication result by 1 bit to the left in order to align the decimal point position, and inputs the result into the 5FC 114 and 5SOR 113.・(6
06) Upper n bits of SSOR113 are BUSH141
into MS RY 13 via.・(607
) MS RX 12 and MS RY 13 are multiplied. MSRX12 is X in formula (4).

の値を保存しており、式(4)中のA−xlzの項が計
算されたことになる。・・・(608)次に5UB11
1によって乗算結果から3が減じられる。これにより式
(4)中の3− A−x i2の項が計算されたことに
なる。・・・(609)SFT112は減算結果をシフ
トせずに5SOR113に入れる。これにより減算結果
は相対的に1ビット右シフトされま たことになり、式(4)中の−・(3−A−xt”)の
項が計算されたことになる。・・・(610) 5SO
R113の上位nビットがBUSH141を介してMS
RY13に入れられる。・・・(611)MS RX 
12とMSRY13の乗算が行われる。MSRX12の
内容は式(4)中のxlの値を保持しており、式(4)
の右辺X1・−・(3−A−xi”)が計算されたこと
になる。
This means that the term A-xlz in equation (4) has been calculated. ...(608) Next 5UB11
3 is subtracted from the multiplication result by 1. This means that the term 3-A-x i2 in equation (4) has been calculated. (609) The SFT 112 inputs the subtraction result into the 5SOR 113 without shifting it. As a result, the subtraction result is relatively shifted to the right by 1 bit, and the term -.(3-A-xt") in equation (4) has been calculated. (610) 5SO
The upper n bits of R113 are sent to the MS via BUSH141.
It will be placed in RY13. ...(611)MS RX
12 is multiplied by MSRY13. The contents of MSRX12 hold the value of xl in formula (4), and formula (4)
This means that the right-hand side X1...(3-A-xi'') has been calculated.

・・・(612)乗算結果に対して5FT112は小数
点位置合わせのための左シフトを行う、・・・(613
)SSOR113の上位nビットがBUSH141を介
してMSRXI2に入れられる。これにより漸化式の右
辺から左辺への代入が行われたことになる。・・・(6
14)LC211の内容がDEC212によって減じら
れ、その値がLC211に入れられる。・・・(615
”) CTRL21はLC211の内容が計算終了条件
を満たしていれば制御を手順(617)に移し、さもな
ければ制御を手順(604)に戻す、・・・(616)
被開平数Aの値をMSRYl3に入れる。・・・(61
7)MSRXI 2とMSRYl 317)乗算を行う
。これにより近似計算によって求めた −とAとの乗算
が行われ、5の計算が完了したことになる。・・・(6
18)SFT112は乗算結果を左シフトし、5FC1
14及び5SOR113に入れる。これにより本実施例
による開平器の最終結果が5SOR113に入ったこと
になる。・・・(619)以上の具体的説明によって、
本実施例により除算及び開平器が実行されることがわか
る。
...(612) The 5FT112 performs a left shift to align the decimal point on the multiplication result, ...(613
) The upper n bits of SSOR 113 are put into MSRXI2 via BUSH 141. This means that the assignment from the right side of the recurrence formula to the left side has been performed. ...(6
14) The contents of LC211 are subtracted by DEC212 and the value is placed in LC211. ...(615
(616)
Put the value of the open fraction A into MSRYl3. ...(61
7) Perform multiplication of MSRXI 2 and MSRYl 317). As a result, - obtained by approximate calculation is multiplied by A, and the calculation of 5 is completed. ...(6
18) SFT112 shifts the multiplication result to the left and converts it to 5FC1.
14 and 5SOR113. As a result, the final result of the square root squarer according to this embodiment is included in the 5SOR 113. ...(619) With the above specific explanation,
It can be seen that division and square rooting are executed according to this embodiment.

次に別の実施例について第7図及び第8図により説明す
る。
Next, another embodiment will be described with reference to FIGS. 7 and 8.

第7図及び第8図は前実施例における減算シフト回路の
、減算回路とシフト回路を分けたものである。第7図及
び第8図においてシフト回路30は、前実施例における
S FT 112.5SOR113及び5FC114と
同様の構造を持つ。第7図及び第8図において、減算回
路31は、前実施例におけるSUB 111と同様の構
造を持つ。ただしこの場合、データ幅はnビットとなる
。また、除算における2からの減算処理は、先にシフト
が行われているため、bzn−tからbnまで全てのビ
ットの反転となる。第7図においては、減算回路31は
シフト回路30の出力及びMSRYl 3の入力の間に
位置する。第8図においては、減算回路31はMSRY
l3の出力とMULTIOの入力の間に位置する。
FIGS. 7 and 8 show the subtraction and shift circuits of the previous embodiment in which the subtraction circuit and the shift circuit are separated. In FIGS. 7 and 8, the shift circuit 30 has the same structure as the SFT 112.5SOR 113 and 5FC 114 in the previous embodiment. In FIGS. 7 and 8, the subtraction circuit 31 has the same structure as the SUB 111 in the previous embodiment. However, in this case, the data width is n bits. Further, in the subtraction process from 2 in division, since a shift is performed first, all bits from bzn-t to bn are inverted. In FIG. 7, subtraction circuit 31 is located between the output of shift circuit 30 and the input of MSRYl 3. In FIG. 8, the subtraction circuit 31 is MSRY
It is located between the output of l3 and the input of MULTIO.

第7図及び第8図の実施例における除算及び開平器の計
算は前実施例と同様に行われる。
The division and square root calculations in the embodiments of FIGS. 7 and 8 are performed in the same manner as in the previous embodiments.

次に本乗除算開平器を使用した浮動小数点演算装置の実
施例について説明する。この実施例における基本構成を
第9図に示す。
Next, an embodiment of a floating point arithmetic device using the present multiplication/division squarer will be described. The basic configuration of this embodiment is shown in FIG.

浮動小数点演算器は大きく指数演算部、仮数演算部、乗
除算開平器、及び制御部から成る。指数演算部は、指数
レジスタファイル(ERF)40、指数演算部(EAU
)41.指数入力レジスタ(EIR)42、指数出力レ
ジスタ(EOR)43、指数Aバス(EABUS)44
、指数Bバス(EBBtJS)45を基本構成要素とす
る。仮数演算部は、仮数レジスタファイル(MRF)5
0゜仮数演算シフタ(MASF)51、仮数入力レジス
タ(MIR)52、仮数出力レジスタ(MOR)53、
仮数Aバス(MABUS)54、仮数Bバス(MBBU
S)55を基本構成要素とする。
The floating point arithmetic unit mainly consists of an exponent arithmetic section, a mantissa arithmetic section, a multiplication/division squarer, and a control section. The exponent calculation unit includes an exponent register file (ERF) 40, an exponent calculation unit (EAU)
)41. Exponent input register (EIR) 42, exponent output register (EOR) 43, exponent A bus (EABUS) 44
, an exponential B bus (EBBtJS) 45 is the basic component. The mantissa calculation unit is a mantissa register file (MRF) 5
0° mantissa calculation shifter (MASF) 51, mantissa input register (MIR) 52, mantissa output register (MOR) 53,
Mantissa A bus (MABUS) 54, mantissa B bus (MBBU)
S) 55 is the basic component.

ERF40は指数データを格納する。EAU41は浮動
小数点演算における指数部の演算を行う。
ERF 40 stores index data. The EAU 41 performs calculations on the exponent part in floating point calculations.

EIR42はBUS14からのデータを受は取る。EIR42 receives data from BUS14.

EOR43はBUS14にデータを送り出す。EOR43 sends data to BUS14.

EABUS44及びE B B U S 45は、ER
F40゜EAU41.EIR42,EOR43(7)間
のデータ転送を行うバスである。MRF50は仮数デー
タを格納する。MASF51は浮動小数点数の演算にお
ける仮数部の演算及びシフト操作を行う。
EABUS44 and EBBUS45 are ER
F40°EAU41. This is a bus for data transfer between EIR42 and EOR43 (7). The MRF 50 stores mantissa data. The MASF 51 performs mantissa operations and shift operations in floating point number operations.

MIR52はBUS14からのデータを受は取る。MIR52 receives and receives data from BUS14.

MOR53はB U S 14 L:、データを送り出
す。
The MOR 53 sends BUS14L: data.

MABUS54及びMBBUS55は、MRF50゜M
ASF51.MIR52,MOR53の間のデータ転送
を行うバスである。この実施例では、BUS14は、指
数演算部、仮数演算部及び乗除算開平器相互のデータ転
送も受は持っている。この実施例では、指数演算部、仮
数演算部及び乗除算開平器それぞれ独立に動作できるの
で、浮動小数点演算が高速に実行される。
MABUS54 and MBBUS55 have MRF50°M
ASF51. This is a bus that transfers data between the MIR 52 and MOR 53. In this embodiment, the BUS 14 also has the function of transmitting data between the exponent operation section, the mantissa operation section, and the multiplication/division squarer. In this embodiment, the exponent operation section, the mantissa operation section, and the multiplication/division squarer can each operate independently, so that floating point operations can be executed at high speed.

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

本発明によれば、Newton−Raphson法によ
る近似計算における乗算と減算の処理を連続して行える
ので、計算が高速化される。減算の処理を限定すること
で減算操作は簡略化され、減算に係る時間は乗算に係る
処理単位時間内に収めることが可能になるので、減算を
通常の加減算器で行った場合に比べ、さらに計算が高速
化される。
According to the present invention, since multiplication and subtraction processing in approximate calculation using the Newton-Raphson method can be performed continuously, calculation speed is increased. By limiting the subtraction process, the subtraction operation is simplified, and the time for subtraction can be kept within the processing unit time for multiplication, so compared to when subtraction is performed with a normal adder/subtractor, it is much faster. Calculations are made faster.

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

第1図は本発明の基本構成図、第2図は本発明の一実施
例の構成図、第3図は乗算器の動作を示す図、第4図は
減算シフト回路の詳細図、第5図は除算のフローチャー
ト、第6図は開平算のフローチャート、第7図及び第8
図は本発明の別の実施例の基本構成図、第9図は本発明
を浮動小数点演算装置に適用した実施例の構成図である
。 10・・・乗算器、14・・・バス、20・・・定数テ
ーブル。 111・・・減算回路、112・・・シフト回路。 第 因 第2因 吊 図 第4図 第5図 β7AR7 舎 ND 第6図 −f;’TART 寺 fNρ 第7因 第8区 第90
FIG. 1 is a basic configuration diagram of the present invention, FIG. 2 is a configuration diagram of an embodiment of the present invention, FIG. 3 is a diagram showing the operation of a multiplier, FIG. 4 is a detailed diagram of a subtraction shift circuit, and FIG. The figure is a flowchart of division, Figure 6 is a flowchart of square root calculation, Figures 7 and 8 are
This figure is a basic block diagram of another embodiment of the present invention, and FIG. 9 is a block diagram of an embodiment in which the present invention is applied to a floating point arithmetic unit. 10... Multiplier, 14... Bus, 20... Constant table. 111... Subtraction circuit, 112... Shift circuit. 2nd cause 2nd cause Figure 4 Figure 5 β7AR7 Building ND Figure 6-f;'TART Temple fNρ 7th cause 8th ward 90

Claims (1)

【特許請求の範囲】 1、乗算装置を有し、乗算及び加減算を繰り返す近似計
算により除算、開平算等の関数の値を求める乗除算開平
器において、該乗算装置の出力段と入力段をつなぐデー
タ転送経路の中に加減算装置またはシフト装置を設け、
該乗算装置の出力に対して、該加減算装置または該シフ
ト装置による操作が行われる場合と行われない場合で、
該乗算装置の出力段から入力段への転送マシンサイクル
数に変化が無いことを特徴とする乗除算開平器。 2、乗算装置を有し、乗算及び加減算を繰り返す近似計
算により除算、開平算等の関数の値を求める乗除算開平
器において、該乗算装置の出力段と入力段をつなぐデー
タ転送経路の中に近似計算専用の加減算装置またはシフ
ト装置を設けることを特徴とする乗除算開平器。 3、第1項または第2項において、加減算装置が2から
の減算または3からの減算に限定されていることを特徴
とする乗除算開平器。 4、第3項において、2からの減算を1の補数で近似す
ることを特徴とする乗除算開平器。 5、第1項または第2項において、シフト装置によりシ
フトされる量が左右どちらか1ビットであることを特徴
とする乗除算開平器。 6、第1項または第2項において、開平算の近似計算式
として、定数から近似値の2乗と被開平数の積を減じ、
その値と近似値と定数の積を使用することを特徴とする
乗除算開平器。
[Scope of Claims] 1. In a multiplication/division squarer having a multiplication device and determining the value of a function such as division or square rooting by approximation calculation that repeats multiplication and addition/subtraction, the output stage and the input stage of the multiplication device are connected. An addition/subtraction device or a shift device is provided in the data transfer path,
whether or not the output of the multiplication device is operated by the addition/subtraction device or the shift device;
A multiplication/division squarer characterized in that there is no change in the number of machine cycles transferred from the output stage to the input stage of the multiplication device. 2. In a multiplication/division squarer which has a multiplication device and calculates the value of a function such as division or square rooting by approximation calculation that repeats multiplication and addition/subtraction, in the data transfer path connecting the output stage and input stage of the multiplication device. A multiplication/division squarer device characterized by being provided with an addition/subtraction device or a shift device dedicated to approximate calculations. 3. A multiplication/division squarer, characterized in that in the first term or the second term, the addition/subtraction device is limited to subtraction from 2 or subtraction from 3. 4. In the third term, a multiplication/division squarer, characterized in that subtraction from 2 is approximated by a 1's complement number. 5. A multiplication/division squarer, characterized in that in the first term or the second term, the amount shifted by the shift device is 1 bit on either the left or the right. 6. In the first or second term, as an approximation formula for square root calculation, subtract the product of the square of the approximate value and the open root number from the constant,
A multiplication/division square rooter characterized by using the product of its value, an approximate value, and a constant.
JP63277242A 1988-11-04 1988-11-04 Dividing and multiplying square root extractor Pending JPH02125331A (en)

Priority Applications (8)

Application Number Priority Date Filing Date Title
JP63277242A JPH02125331A (en) 1988-11-04 1988-11-04 Dividing and multiplying square root extractor
US07/536,565 US5293558A (en) 1988-11-04 1989-11-02 Multiplication, division and square root extraction apparatus
EP89912134A EP0394499B1 (en) 1988-11-04 1989-11-02 Apparatus for multiplication, division and extraction of square root
DE68928376T DE68928376T2 (en) 1988-11-04 1989-11-02 DEVICE FOR MULTIPLICATING, DIVIDING AND DRAWING THE SQUARE ROOT
PCT/JP1989/001134 WO1990005335A1 (en) 1988-11-04 1989-11-02 Apparatus for multiplication, division and extraction of square root
KR1019900701428A KR100198472B1 (en) 1988-11-04 1990-07-04 Apparatus for multiplication, division and extraction of square root
US08/089,103 US5631858A (en) 1988-11-04 1993-08-12 System for obtaining strict solution in accordance with accuracy of approximate solutions
US08/797,653 US5956263A (en) 1988-11-04 1997-01-31 Multiplication, division and square root extraction apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63277242A JPH02125331A (en) 1988-11-04 1988-11-04 Dividing and multiplying square root extractor

Publications (1)

Publication Number Publication Date
JPH02125331A true JPH02125331A (en) 1990-05-14

Family

ID=17580801

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63277242A Pending JPH02125331A (en) 1988-11-04 1988-11-04 Dividing and multiplying square root extractor

Country Status (1)

Country Link
JP (1) JPH02125331A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107179894A (en) * 2016-03-09 2017-09-19 瑞昱半导体股份有限公司 Fast divider and rapid division method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107179894A (en) * 2016-03-09 2017-09-19 瑞昱半导体股份有限公司 Fast divider and rapid division method
CN107179894B (en) * 2016-03-09 2021-08-27 瑞昱半导体股份有限公司 Fast divider and fast division operation method

Similar Documents

Publication Publication Date Title
KR920005226B1 (en) Floating point arithmetic units
WO1990005335A1 (en) Apparatus for multiplication, division and extraction of square root
JPH03206557A (en) Method and device for arithmetic processing
JPH0454633A (en) High radix divider
JPH09212337A (en) Floating-point arithmetic processor
JPH02125331A (en) Dividing and multiplying square root extractor
JPH0540605A (en) Floating point multiplier
JPH0731591B2 (en) Leading 1 detection circuit and floating point addition / subtraction device
JP2000311079A (en) Real number computing element
JP2003084969A (en) Floating point remainder computing element, information processing device, and computer program
JPH0283728A (en) Floating point multiplier
JP2734274B2 (en) Floating point adder / subtracter
JP2856792B2 (en) Floating point arithmetic unit
JP2622012B2 (en) Shift circuit
JPS63254525A (en) Dividing device
JPH0540606A (en) Floating point multiplier/divider
JPH0455936A (en) Reciprocal calculation circuit
JPH0540609A (en) Floating point divider
JP3100868B2 (en) Arithmetic unit for floating point numbers
JP2530504B2 (en) Floating point arithmetic unit
JPS6175431A (en) Arithmetic device
JP3298119B2 (en) Zero flag generation adder / subtractor
JPH0675752A (en) Leading one predicting device and floating point addition/ subtraction device
JPH02171923A (en) Floating point adder/subtractor
JPH0414173A (en) Fixed point product sum computing element