JPH0769788B2 - Square root arithmetic processing method - Google Patents

Square root arithmetic processing method

Info

Publication number
JPH0769788B2
JPH0769788B2 JP62314477A JP31447787A JPH0769788B2 JP H0769788 B2 JPH0769788 B2 JP H0769788B2 JP 62314477 A JP62314477 A JP 62314477A JP 31447787 A JP31447787 A JP 31447787A JP H0769788 B2 JPH0769788 B2 JP H0769788B2
Authority
JP
Japan
Prior art keywords
register
square root
partial
divisor
cycle
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 - Fee Related
Application number
JP62314477A
Other languages
Japanese (ja)
Other versions
JPH01155435A (en
Inventor
昌宏 柳田
重治 松崎
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP62314477A priority Critical patent/JPH0769788B2/en
Publication of JPH01155435A publication Critical patent/JPH01155435A/en
Publication of JPH0769788B2 publication Critical patent/JPH0769788B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔目次〕 概要 産業上の利用分野 従来の技術と発明が解決しようとする問題点 問題点を解決するための手段 作用 実施例 発明の効果 〔概要〕 基数2のオペランドから開平法によって平方根を求める
演算式 Rn=Rn-1−(4*An-1+1) 但し、Rn-1:前サイクルでの余り An-1:前サイクル迄の中間結果 を計算し、Rn<0であれば‘0'を、それ以外であれば
‘1'を部分解とし、且つ、Rn<0の場合にはRn-1を、そ
れ以外の場合はRnを2ビット左シフトしたものを部分剰
余とし、 前サイクル迄の中間結果を1ビット左シフトした結果
に、上記部分解を加えることを繰り返して平方根を求め
る平方根演算処理方式に関し、 開平法による平方根演算を、引き離し法による高基数非
回復型除算装置を用いて1演算サイクルで1桁の平方根
を得ることを目的とし、 少なくとも、除数レジスタと,除倍数回路と,該除倍数
の結果を保持する減数レジスタとを備えた高基数非回復
型除算装置に、オペランドを置数する被開平数レジスタ
と、上記置数されたオペランドを1演算サイクル毎に2
ビット左シフトして、上記高基数非回復型除算装置の部
分剰余レジスタに伝達する手段と、上記演算サイクル毎
に、上記除数レジスタを1ビット左シフトして帰還する
手段と、上記部分剰余レジスタの値から上記除数レジス
タの値を1ビット左シフトして4倍したものを減算した
ときに、加算器から得られるキャリ信号を、上記除数レ
ジスタの最下位ビットに帰還して、平方根の部分解を得
る手段と、上記演算サイクル毎に、部分剰余レジスタを
2ビット左シフトしたもの(Rn-1)と、上記減算処理に
よって得られる部分剰余(Rn)との何れかを、上記キャ
リ信号によって選択して、上記部分剰余レジスタに置数
して、当該演算サイクルでの部分剰余とする手段とを設
けて、当該高基数非回復型除算装置を用いて平方根演算
処理を行う方式において、前サイクルでの部分剰余を置
数した部分剰余レジスタから、減算すべき前サイクルの
部分中間結果である(An-1)の を生成するのに、1サイクル前の中間結果を1ビット左
シフトして‘×4'を行う第1の手段と、今回の演算サイ
クルで得られた部分解(キャリ)を1ビット左シフトし
て‘×4'を行うと同時に、該部分解(キャリ)を、上記
除数レジスタの最下位ビットに置数する第2の手段と、
上記第1の手段と第2の手段の結果を上記減数レジスタ
で合成する第3の手段と、上記演算結果であるキャリ信
号の極性に応じて、上記部分剰余レジスタの前サイクル
の結果(Rn-1)を選択するか、今回の演算によって得ら
れた部分剰余(Rn)を選択する切り替え手段とを設け
て、上記基数2のオペランドから開平法によって平方根
を求める演算式、 Rn=Rn-1−(4*An-1+1) を処理するように構成する。
DETAILED DESCRIPTION [Table of Contents] Outline Industrial field of application Conventional techniques and problems to be solved by the invention Means for solving problems Problem Example of effect of the invention [Outline] From radix-2 operand arithmetic expression Rn = Rn -1 obtaining the square root by No. method - (4 * an -1 +1) However, Rn -1: remainder in the previous cycle an -1: calculated intermediate results up to the previous cycle, Rn <0 If it is '0', otherwise '1' is a partial decomposition, and if Rn <0, Rn -1 is left, otherwise, Rn is left shifted by 2 bits. Regarding the square root operation processing method that finds the square root by repeating the above partial decomposition to the result of shifting the intermediate result up to the previous cycle by 1 bit to the remainder, the square root operation by the square root method and the high radix non-recovery by the separation method Square root of one digit in one operation cycle using the type divider For the purpose of obtaining, a high radix non-recovery type division device having at least a divisor register, a divisor circuit, and a divisor register for holding the result of the divisor, and an open radix register for registering operands , The number of the above operands is 2 for each operation cycle
A means for shifting to the left by a bit and transmitting it to the partial remainder register of the high radix non-recovery type division device; a means for shifting the divisor register left by one bit for feedback for each operation cycle; and a means for feeding back the partial remainder register. When a value obtained by shifting the value of the divisor register to the left by 1 bit and multiplying by 4 is subtracted from the value, the carry signal obtained from the adder is fed back to the least significant bit of the divisor register, and the partial decomposition of the square root is performed. The carry signal selects one of the means for obtaining, the partial remainder register left-shifted by 2 bits (Rn −1 ) and the partial remainder (Rn) obtained by the subtraction processing for each operation cycle by the carry signal. And a means for setting the partial remainder in the partial remainder register as a partial remainder in the operation cycle, and performing a square root operation process using the high radix non-recovery type division device. There are, the partial remainder in the preceding cycle from the registered number and the partial remainder register, a partial intermediate result of a cycle before to be subtracted (An -1) In order to generate, the first means for shifting the intermediate result one cycle before by 1 bit to the left and performing '× 4', and the partial decomposition (carry) obtained in this operation cycle are shifted to the left by 1 bit. And performing '× 4' at the same time, second partial means for registering the partial decomposition (carry) in the least significant bit of the divisor register,
Third means for combining the results of said first means and second means in the subtrahend register, depending on the polarity of the carry signal is the result of the calculation is obtained, the previous cycle of the partial remainder register result (Rn - 1 ) or a switching means for selecting the partial remainder (Rn) obtained by this operation, and an arithmetic expression for obtaining a square root from the radix-2 operand by the square root method, Rn = Rn −1 − It is configured to process (4 * An -1 +1).

〔産業上の利用分野〕[Industrial application field]

本発明は、基数2のオペランドから開平法によって平方
根を求める演算式 Rn=Rn-1−(4*An-1+1) 但し、Rn-1:前サイクルでの余り An-1:前サイクル迄の中間結果 を計算し、Rn<0であれば‘0'を、それ以外であれば
‘1'を部分解とし、且つ、Rn<0の場合にはRn-1を、そ
れ以外の場合はRnを2ビット左シフトしたものを部分剰
余とし、 上記部分解を、前サイクル迄の中間結果を1ビット左シ
フトした結果に加えることを繰り返して平方根を求める
平方根演算処理方式に関する。
In the present invention, an arithmetic expression for calculating a square root from a radix-2 operand by the square root method Rn = Rn −1 − (4 * An −1 +1) where Rn −1 : remainder in the previous cycle An −1 : up to the previous cycle The intermediate result is calculated, and if Rn <0, '0' is partial, otherwise '1' is partially decomposed, and if Rn <0, Rn -1 is obtained, otherwise Rn -1. The present invention relates to a square root operation processing method for obtaining a square root by repeating the above partial decomposition to the result obtained by shifting the intermediate result up to the previous cycle to the left by 1 bit as a partial remainder.

最近の計算機技術の進歩に伴って、該計算機によるデー
タ処理の多様化と,処理量の増加が進展し、該計算機に
対する処理能力の向上が求められており、科学技術計算
の分野で用いられる平方根演算についても、その高速化
が要求されるが、該平方根の演算を高速に処理する為
に、専用の平方根演算回路を設けることはハードウェア
量の増加が大きいことから、使用頻度の比較的少ない平
方根演算を経済的に、且つ高速に処理できる平方根演算
処理方式が求められることになる。
With the recent progress in computer technology, the diversification of data processing by the computer and the increase in the amount of processing have progressed, and it has been required to improve the processing capacity of the computer. The calculation is also required to be speeded up. However, in order to process the calculation of the square root at high speed, providing a dedicated square root calculation circuit causes a large increase in the amount of hardware, and therefore the frequency of use is relatively low. There is a demand for a square root calculation processing method that can process the square root calculation economically and at high speed.

一方、平方根演算は、高基数非回復型除算装置と云っ
た、所謂引き離し法の除算方式とその手順が類似してい
ることから、例えば、上記高基数非回復型除算装置に、
該平方根演算に必要な回路を、該除算装置での除算速度
に影響を与えない方法で付加して行う平方根演算処理方
式が知られている。
On the other hand, the square root operation is similar to the division method of the so-called separation method, which is called a high radix non-recovery type division apparatus, and therefore, for example, in the high radix non-recovery type division apparatus,
A square root calculation processing method is known in which a circuit required for the square root calculation is added by a method that does not affect the division speed of the division device.

上記引き離し法の除算方式によって高速の除算を実現す
ることを目的として、除倍数を減数レジスタに置数する
形式の高基数非回復型除算装置の構成法を、本願出願者
は特開昭60-160438号公報で開示しているが、このよう
な高基数非回復型除算装置を使用して平方根演算を行う
場合、平方根の中間結果、即ち、部分解が除数レジスタ
(DSR)の最下位ビットに帰還される為、1桁の平方根
を得るのに、演算結果のキャリ信号を除数レジスタ(DS
R)にセットするサイクルと、該除数レジスタ(DSR)の
値に基づいて、除倍数×除数(具体的には、除数の4倍
数)を求めるサイクルの2演算サイクルを必要とする問
題があり、この処理を該除算方式に影響を与えることな
く1演算サイクルで行う平方根演算処理方式が平方根演
算の高速化に必要となる。
For the purpose of realizing high-speed division by the division method of the above-mentioned separation method, the applicant of the present application has disclosed a method of constructing a high radix non-recovery type division device of the type in which a divisor is placed in a reduction register. As disclosed in Japanese Unexamined Patent Publication No. 160438, when a square root operation is performed using such a high radix non-recovery type division device, the intermediate result of the square root, that is, the partial decomposition is set to the least significant bit of the divisor register (DSR). Since it is fed back, the carry signal of the operation result is added to the divisor register (DS
R) and a cycle for obtaining a divisor × divisor (specifically, a quadruple of the divisor) based on the value of the divisor register (DSR). A square root operation processing method for performing this processing in one operation cycle without affecting the division method is required to speed up the square root operation.

〔従来の技術と発明が解決しようとする問題点〕[Problems to be solved by conventional technology and invention]

第4図は従来の平方根演算処理方式を説明する図であっ
て、(a)は除算回路を示し、(b)は該除算回路を用
いて、1演算サイクルで平方根の1桁をえる平方根演算
回路を示している。
FIG. 4 is a diagram for explaining a conventional square root operation processing method, in which (a) shows a division circuit and (b) uses the division circuit to obtain one digit of the square root in one operation cycle. The circuit is shown.

今、平方根を求める数をXとすると、数Xと、その平方
根Qn及び剰余Rnとの間には、 X=Qn2+Rn ……(1) なる関係がある。
Now, assuming that the number for which the square root is obtained is X, there is a relation X = Qn 2 + Rn (1) between the number X and the square root Qn and the remainder Rn.

(1)式に、n=1を入れると X=Q1 2+R1 R1=X−Q1 2 ここで、X=R0とすると、 R1=R0−Q1 2 平方根を浮動小数点データで表現すると、該平方根は、
仮数部と指数部とで表現される。この場合、該仮数部と
指数部とは別々に求められるので、以降での説明では説
明の便宜上、仮数部のみを取り扱い、該仮数部も、その
小数点の位置は、最上位桁の左にあるものとして説明す
る。即ち、求める平方根Qnは、 Qn=.(q1+q2+q3+〜〜qn) 但し、qi=pi2-i(p
i=0,1,2,〜n)で表されるものとする。以下、上記小
数点は省略して扱うものとする。
If n = 1 is put in the equation (1), X = Q 1 2 + R 1 R 1 = X−Q 1 2 where X = R 0 , R 1 = R 0 −Q 1 2 Expressed in data, the square root is
It is expressed by a mantissa part and an exponent part. In this case, since the mantissa part and the exponent part are obtained separately, only the mantissa part will be handled in the following description for convenience of description, and the decimal point position of the mantissa part is also to the left of the most significant digit. It will be described as a thing. That is, the calculated square root Qn is Qn =. (Q 1 + q 2 + q 3 + 〜〜qn) where qi = pi2 i (p
i = 0,1,2, -n). Hereinafter, the decimal point will be omitted.

Q1=q1であるので、 R1=R0−q1 2 ……(2) ここで、R0−q1 2=R0−p12-1 ……(3) とし、p1=1と仮定して計算し、この値が正であれば、
上記仮定は正かったものとして、そのままの値を部分剰
余R1=R0−2-1として、この値が負であると、上記仮定
は誤りであったとしてp1=0とし、p12-1を元に戻し、
部分剰余R1=R0とする。
Since Q 1 = q 1 , R 1 = R 0 −q 1 2 …… (2) where R 0 −q 1 2 = R 0 −p 1 2 −1 …… (3) and p 1 It is calculated assuming that = 1, and if this value is positive,
Assuming that the above assumption was positive, let the value as it is be the partial remainder R 1 = R 0 −2 −1 , and if this value is negative, p 1 = 0, assuming that the above assumption was false, and p 1 2 -1 back,
Partial remainder R 1 = R 0 .

次に、上記(1)式にn=2を入れると X=Q2 2+R2 R2=X−Q2 2 R2=R0−Q2 2 ここで、Q2=q1+q2であるので、上記の式に代入する
と、(2)式を用いて R2=R0−(q1+q2 =R1+q1 2−(q1+q2 =R1+q1 2−(q1 2+2q1q2+q2 2) =R1−2q1q2−q2 2 =R1−q2(2q1+q2) ……(4) ここで、R1−q2(2q1+q2) ……(5) に対して、q2=p22-2を代入し、p2=1と仮定して計算
し、この値が正であれば、上記仮定は正かったものとし
て、そのままの値を部分剰余R2=R1−2-2(2q1+2-2
として、この値が負であると、上記仮定は誤りであった
としてp2=0とし、2-2(2q1+2-2)を元に戻し、部分
剰余R2=R1とする。
Next, when n = 2 is put into the above equation (1), X = Q 2 2 + R 2 R 2 = X−Q 2 2 R 2 = R 0 −Q 2 2 where Q 2 = q 1 + q 2 Therefore, substituting into the above equation, using equation (2), R 2 = R 0 − (q 1 + q 2 ) 2 = R 1 + q 1 2 − (q 1 + q 2 ) 2 = R 1 + q 1 2 − (Q 1 2 + 2q 1 q 2 + q 2 2 ) = R 1 −2q 1 q 2 −q 2 2 = R 1 −q 2 (2q 1 + q 2 ) …… (4) where R 1 −q 2 (2q 1 + q 2 ) ... (5) is calculated by substituting q 2 = p 2 2 -2 and assuming p 2 = 1. If this value is positive, the above assumption is positive. As it is, the value as it is is the partial remainder R 2 = R 1 −2 -2 (2q 1 +2 -2 )
Then, if this value is negative, it is assumed that the above assumption is incorrect, and p 2 = 0, and 2 −2 (2q 1 +2 −2 ) is restored to the partial remainder R 2 = R 1 .

同様にして、R3=R2−q3{2(q1+q2)+q3)} ……
(6) ここで、R2−q3{2(q1+q2)+q3)}……(7)
に対して、q3=p32-3を代入し、p3=1と仮定して計算
し、この値が正であれば、上記仮定は正かったものとし
て、そのままの値を部分剰余R3=R2−2-3{2(q1
q2)+2-3}として、この値が負であると、上記仮定は
誤りであったとしてp3=0とし、2-3{2(q1+q2)+2
-3}を元に戻し、部分剰余R3=R2とする。
Similarly, R 3 = R 2 -q 3 {2 (q 1 + q 2) + q 3)} ......
(6) where R 2 −q 3 {2 (q 1 + q 2 ) + q 3 )} (7)
, Q 3 = p 3 2 -3 is substituted, and p 3 = 1 is calculated, and if this value is positive, the above assumption is correct, and the value is left as is. R 3 = R 2 −2 −3 {2 (q 1 +
If this value is negative as q 2 ) +2 -3 }, then the above assumption is false and p 3 = 0, and 2 -3 {2 (q 1 + q 2 ) +2
-3 } is restored to the partial remainder R 3 = R 2 .

以下同様にして、上記(1)〜(7)から、一般に、 但し、qk=pk2-k ここで、 に対して、qk=pk2-k ……(10) を代入して、pk=1と仮定して計算し、この値が正であ
れば、上記仮定は正しかたものとして、そのままの値を
部分剰余 として、この値が負であると、上記仮定は誤りであった
としてpk=0とし、 を元に戻し、部分剰余Rk=Rk-1とする。
Similarly, from (1) to (7) above, in general, Where qk = pk2 - k where , Qk = pk2 k (10) is substituted, and calculation is performed assuming that pk = 1. If this value is positive, the above assumption is correct and the value is partially Surplus If this value is negative, then the above assumption was false and pk = 0, Is restored to the original value, and the partial remainder Rk = Rk −1 .

このようにして、(8),(9),(10)で示した演算
をn回繰り返すことにより、 上記(11)式と、前述の(1)式とを比較することによ
り、 となり、数Xの平方根Qnを決定することができる。
In this way, by repeating the operations shown in (8), (9), and (10) n times, By comparing the above equation (11) with the above equation (1), And the square root Qn of the number X can be determined.

つまり、平方根を求める演算が正しかったかどうかを判
定する式(9)の処理をn回計算し、各段階で判定され
たPkの列を求めれば、数Xの平方根が求まることとな
る。
That is, the square root of the number X can be obtained by calculating the process of the equation (9) n times for determining whether the calculation for obtaining the square root was correct and calculating the column of Pk determined at each stage.

然し、上記判定式(9)式を計算する回路は、各演算回
路毎に値が替わるqk=pk2-kをを代入する回路が必要と
なり、現実的ではない。
However, the circuit for calculating the determination formula (9) requires a circuit for substituting qk = pk2 k whose value changes for each arithmetic circuit, which is not realistic.

そこで、本発明では、上記(9)式を22k倍する。即
ち、上記判定式として、 を求めると、(13)式は、各演算回数毎に“1"を加算す
る回路となる。
Therefore, in the present invention, the above equation (9) is multiplied by 2 2 k. That is, as the above determination formula, Equation (13) is a circuit that adds "1" for each number of calculations.

ここで、 とすると、前述の(10)式より、qi=pk2-iであるの
で、 Ak-1=2k-1p12-1+2k-1p22-2+……+2pk-2+pk-1=2k
-2p1+2k-3p2+……+2pk-2+pk-1 ……(15) となり、piを毎回2倍しながら加算したものであること
が分かる。
here, Then, from the above equation (10), qi = pk2 - i, so Ak -1 = 2k -1 p 1 2 -1 + 2k -1 p 2 2 -2 + ... + 2pk -2 + pk -1 = 2k
-2 p 1 + 2k -3 p 2 + ... + 2pk -2 + pk -1 (15), which means that pi is added while doubling each time.

つまり、 Ak-1=2k-2p1+2k-3p2+……+2pk-2+pk-1 =2(2k-3p1+2k-4p2+……+pk-2)+pk-1 =2Ak-2+pk-1 ……(16) となる。That is, Ak -1 = 2k -2 p 1 + 2k -3 p 2 + ... + 2pk -2 + pk -1 = 2 (2k -3 p 1 + 2k -4 p 2 + ... + pk -2 ) + pk -1 = 2Ak -2 + pk -1 (16)

即ち、Ak-1を求める回路は、単に、1ビットの左シフト
回路に、pk-1を加算する回路で実現される。
That is, the circuit for obtaining Ak −1 is simply realized by a circuit for adding pk −1 to the 1-bit left shift circuit.

ここで、上記(13)式で示した判定式 に、上記(14)式を代入すると、該k回目の判定式は、 22kRk-1−{4Ak-1+1} ……(17) となる。Here, the judgment formula shown in the above formula (13) To, substituting the equation (14), said k-th judgment formula is, 2 2 KRK -1 - a {4Ak -1 +1} ...... (17 ).

ここで、Rck=22(k+1)Rk ……(18) とおくと、 Rck=2222kRk=4・22kRk ……(19) 上記(19)式に、(8)式を代入すると、 (10)式qk=pk2-kを代入すると、 ここで、 を判定式とし、pk=1と仮定して計算し、この値が正で
あれば、上記仮定は正しかったものとして、その侭の値
を部分剰余 となる。上記(19)式Rck=22(k+1)Rkより、 Rck-1=22kRk-1 が得られるので、上記部分剰余は、 が得られる。ここで、前述の(14)式を代入すると、該
部分剰余は、 Rck=4{Rck-1−(4A+1)} となり、上記の判定式の値が負であると、上記仮定は誤
りであったとして、Pk=0とし、 を元に戻し、部分剰余Rck=4Rck-1とする。即ち、部分
剰余Rckは、 となる。
Here, if Rck = 2 2 ( k +1) Rk …… (18), then Rck = 2 2 2 2 kRk = 4 ・ 2 2 kRk …… (19) In equation (19), (8) Substituting the expression, (10) Substituting the equation qk = pk2 - k, here, Is assumed to be a judgment formula, and calculation is performed assuming pk = 1. If this value is positive, it is assumed that the above assumption was correct, and the value of that samurai is a partial remainder. Becomes Since Rck −1 = 2 2 kRk −1 is obtained from the above equation (19) Rck = 2 2 ( k +1) Rk, the above partial remainder is Is obtained. Here, when substituting the above equation (14), the partial remainder becomes Rck = 4 {Rck −1 − (4A + 1)}, and if the value of the above decision equation is negative, the above assumption is erroneous. Assuming that Pk = 0, To the original value and set the partial remainder Rck = 4Rck -1 . That is, the partial remainder Rck is Becomes

よって、上記判定式の内、 22kRk-1−{4Ak-1+1} =Rck-1−{4Ak-1+1}=C ……(21) とおき、該(21)式の計算結果であるCが正であると、
上記(12)式のPi=1として、数Xの部分平方根を求
め、この値Cを4倍(回路上では、2ビット左シフトで
実現される)したものを次の部分剰余Rckとし、上記C
が負であると、上記Pi=0として、数Xの部分平方根を
求め、該部分剰余Rck=4Rck-1とする。
Therefore, among the above judgment formulas, 2 2 kRk −1 − {4Ak −1 +1} = Rck −1 − {4Ak −1 +1} = C …… (21) is set and the calculation result of the formula (21) is set. If some C is positive,
With Pi = 1 in the equation (12), the partial square root of the number X is calculated, and this value C is quadrupled (realized by a 2-bit left shift on the circuit) as the next partial remainder Rck. C
Is negative, the partial square root of the number X is obtained with Pi = 0, and the partial remainder Rck = 4Rck −1 .

つまり、 C≧0であると、pk=1,Ak=2Ak-1+pk,RCk=4c C<0であると、pk=0,Ak=2Ak-1+pk,RCk=4Rck-1
なる。
That is, if C ≧ 0, pk = 1, Ak = 2Ak −1 + pk, RCk = 4c If C <0, pk = 0, Ak = 2Ak −1 + pk, RCk = 4Rck −1 .

上記の(21)式は、引き離し法による除算の演算式であ
る、 R1=r・R0+m・D 但し、D=除数 r=基数 m=除倍数(部分予測商) と類似しており、該引き離し法による除算回路を用いて
平方根演算ができることが分かる。
The above formula (21) is similar to R 1 = r · R 0 + m · D, which is an arithmetic expression of division by the separation method, where D = divisor r = radix m = divisor (partial prediction quotient) It can be seen that the square root calculation can be performed using the division circuit according to the separation method.

上記(21)式において、C=Rn、Rck-1=Rn-1、Ak-1=A
n-1とおけば、〔産業上の利用分野〕で示した、基数2
のオペランドか開平法によって平方根を求める演算式と
して挙げている Rn=Rn-1−(4*An-1+1) と一致し、且つ、上記(20)式で示し判定条件から、該
Rn<0であれば“0"を、それ以外であれば、“1"を部分
解Piとし、且つRn<0の場合には、Rn-1を、それ以外の
場合はRnを2ビット左シフトしたものを部分剰余とし、
上記部分解を、前サイクル迄の中間結果An-1を1ビット
左シフトした結果に加えることを繰り返して平方根を求
める記述と一致する。
In the above formula (21), C = Rn, Rck -1 = Rn -1 , Ak -1 = A
If you say n -1 , the radix of 2 shown in [Industrial application]
Or Rn = Rn −1 − (4 * An −1 +1), which is given as an arithmetic expression for obtaining the square root by the square root method, and from the judgment condition shown in the above equation (20),
If Rn <0, "0" is set as the partial decomposition Pi, otherwise "1" is set as the partial decomposition Pi. If Rn <0, Rn- 1 is set. The shifted one is the partial remainder,
This is in agreement with the description for obtaining the square root by repeating the above partial decomposition and adding the intermediate result An -1 up to the previous cycle to the result of left shifting by 1 bit.

第4図の(a)は該除算回路の構成例を示したものであ
り、(b)は該除算回路を用いて、上記(22)式に基づ
いて平方根演算回路を構成した例を示したものである。
FIG. 4 (a) shows an example of the configuration of the division circuit, and FIG. 4 (b) shows an example in which the division circuit is used to form a square root operation circuit based on the equation (22). It is a thing.

上記平方根演算方式の導出結果,及び構成例について
は、例えば、文献「“除算演算と平方根演算の為の共用
ハードウェア",ジョージS.テイラー著,米国電気電子工
学協会,1981,(“COMPATIBLE HARDWARE FOR DIVISION A
ND SQUARE ROOT"George S.Taylor,IEEE,1981」に示され
ているが、上記除算回路の動作については、前述の特開
昭60-160438号公報に開示されているので、ここでの説
明は省略する。又、第4図(b)の平方根演算回路の動
作については、上記文献にも示されているが、その概略
を説明すると、以下のとおりとなる。即ち、先ず、被開
平数レジスタ(SQR)6に、オペランドが置数される
と、平方根演算が開始される。
For the derivation result of the above-mentioned square root operation method and a configuration example, for example, refer to "Common Hardware for Division Operation and Square Root Operation", George S. Taylor, American Institute of Electrical and Electronics Engineers, 1981, ("COMPATIBLE HARDWARE FOR DIVISION A
ND SQUARE ROOT "George S. Taylor, IEEE, 1981", the operation of the division circuit is disclosed in the above-mentioned JP-A-60-160438, the description here is omitted. Omit it. The operation of the square root operation circuit of FIG. 4 (b) is also described in the above-mentioned document, but the outline thereof is as follows. That is, first, when an operand is placed in the open-ended number register (SQR) 6, the square root operation is started.

除数レジスタ(DSR)1と、演算結果レジスタ(FQR)に
は、上記平方根演算を行う場合、数Xの平方根である、
前述の(14)式で示した が、1演算サイクル毎に左シフトされて置数されてい
く。
The divisor register (DSR) 1 and the operation result register (FQR) are the square roots of the number X when the above square root operation is performed,
It is shown in the above equation (14). Are shifted to the left for each operation cycle and are registered.

除倍数回路2では、上記Ak-1*4が演算され、部分剰余
レジスタ(NMR)5に置数される部分剰余Rckとの間で、
前述の(21)式で示した RCk-1−{4Ak-1+1}=C が加算器(ADDER)4で演算され、該演算結果Cは、前
述のように2ビット左シフト、即ち、4倍されて、上記
部分剰余レジスタ(NMR)4に入力され、次の演算サイ
クルの部分剰余として使用される。
In the divisor circuit 2, the above Ak -1 * 4 is calculated, and with respect to the partial remainder Rck that is registered in the partial remainder register (NMR) 5,
RCk −1 − {4Ak −1 +1} = C shown in the above equation (21) is calculated by the adder (ADDER) 4, and the calculation result C is shifted by 2 bits to the left, that is, 4 by 4 bits. It is multiplied and input to the partial remainder register (NMR) 4 and used as the partial remainder of the next operation cycle.

上記加算器(ADDER)4のキャリー(Carry)は、上記の
演算でのオーバフローを示しており、前述のPiそのもの
を示していることになる。即ち、該キャリー(Carry)
が“1"であると、上記Cが正であったことを示すので、
該キャリー(Carry)を、上記除数レジスタ(DSR)1
と、演算結果レジスタ(FQR)の最下位ビットに置数
し、1ビット左シフトすることで、上記 で示した平方根が生成されることになる。
The carry of the adder (ADDER) 4 indicates an overflow in the above calculation, which means Pi itself described above. That is, the carry
Is "1", it means that the above C was positive.
The carry (Carry) is converted to the divisor register (DSR) 1
And, by registering to the least significant bit of the operation result register (FQR) and shifting left by 1 bit, The square root shown by will be generated.

又、部分剰余レジスタ(NMR)4の入力側に示されてい
るセレクト回路は、上記Piが“1"(正)か“0"(負)に
よって、前述の Rck=4C(演算結果Cを4倍したもの) ……Pi=1 Rck=4Rck-1(前回の部分剰余を4倍したもの) ……Pi
=0 なる切り替えを行う回路である。
In addition, the select circuit shown on the input side of the partial remainder register (NMR) 4 has the above-mentioned Rck = 4C (calculation result C of 4 when the Pi is “1” (positive) or “0” (negative). Pi = 1 Rck = 4Rck -1 (4 times the previous partial remainder) ...... Pi
It is a circuit for switching such that = 0.

尚、本平方根演算回路においては、上記平方根の小数点
位置(前述のように、平方根は1演算毎に左シフトされ
るので、最下位にある)と、オペランドの小数点位置
(最上位にある)とが異なるので、その位置を合わせる
必要があるが、その為には、部分剰余レジスタ(NMR)
5と、除倍数回路(×4)2と、上記加算器(ADDER)
4は、2倍長とする必要がある。
In the square root operation circuit, the decimal point position of the square root (as described above, the square root is left-shifted for each operation, is at the lowest position), and the decimal point position of the operand (at the highest position). Since it is different, it is necessary to match the position, but for that purpose, the partial remainder register (NMR)
5, a divisor circuit (× 4) 2, and the adder (ADDER)
4 needs to be double length.

然しながら、実際の演算においては、上記除倍数回路
(×4)2の下位半分は全“0"であるので、上記加算器
(ADDER)4の下位半分は不要となる。従って、図示さ
れているように、被開平数レジスタ(SQR)6と、部分
剰余レジスタ(NMR)5とを直列に接続して2倍長の部
分剰余レジスタを構成し、オペランドを、その下半分の
被開平数レジスタ(SQR)6にのみ置数して、1演算毎
に、2ビット左シフトすることで、等価的に2倍長の部
分剰余レジスタとして動作させることができる。
However, in the actual calculation, since the lower half of the divisor circuit (× 4) 2 is all “0”, the lower half of the adder (ADDER) 4 is unnecessary. Therefore, as shown in the figure, the square root register (SQR) 6 and the partial remainder register (NMR) 5 are connected in series to form a double remainder partial remainder register. It is possible to equivalently operate as a double remainder partial remainder register by registering only in the SQR (SQR) 6 and shifting left by 2 bits for each operation.

上記のように動作するので、第4図(a)に示した除算
回路に若干の回路を付加するのみで、平方根演算を行う
ことができる平方根演算回路を構築することができる。
本図からも明らかな如く、この除算方式においては、除
倍数×除数(mD)を置数する為の減数レジスタ(SR)を
持っていない為、除算での1演算サイクルに必要な時間
が長くなると云う問題がある。
Since it operates as described above, it is possible to construct a square root operation circuit capable of performing a square root operation only by adding some circuits to the division circuit shown in FIG. 4 (a).
As is clear from this figure, this division method does not have a reduction register (SR) for registering the divisor × divisor (mD), so the time required for one operation cycle for division is long. There is a problem to say.

そこで、本願出願者は、除数(D)は最初に一度除数レ
ジスタ(DSR)に置数すると、該除算の演算が終了する
迄変化することがないことに着目して、除倍数×除数
(mD)を置数する為の減数レジスタ(SR1,2,3)を設け
て、1演算サイクルタイムを短くして高速の除算を行う
ことができる高基数非回復型除算装置を、前述の特開昭
60-160438号公報に開示している。
Therefore, the applicant of the present application pays attention to the fact that once the divisor (D) is first registered in the divisor register (DSR), it does not change until the calculation of the division is completed, and the divisor × divisor (mD ), A high radix non-recovery type division device capable of performing high-speed division by shortening one operation cycle time by providing a reduction register (SR1, 2, 3).
No. 60-160438.

この方式においては、上記除倍数×除数(mD)の全ての
ケースを予め計算して、減数レジスタ(SR1〜3)に置
数できるようにしておき、各演算サイクルにおいて出力
される部分商予測値mによって、その一つを選択し、該
減数レジスタ(SR1〜3)に置数することで、1演算サ
イクルタイムを短くして、且つ該1演算サイクルタイム
で1桁の除算結果を得るものである。
In this method, all cases of the above divisor × divisor (mD) are calculated in advance so that they can be registered in the subtraction registers (SR1 to 3), and the partial quotient predicted value output in each operation cycle is calculated. One of them is selected by m and is registered in the subtraction register (SR1 to 3) to shorten one operation cycle time and obtain a one-digit division result in the one operation cycle time. is there.

然しながら、この高基数非回復型除算装置を用いて、上
記開平法による平方根演算を行う場合には、該除算装置
の加算回路のキャリとして得られる1桁の部分解を、当
該除算回路の除数レジスタ(DSR)の最下位ビットに帰
還して更新する必要がある為、前述の、基数2のオペラ
ンドから開平法によって平方根を求める演算式 Rn=Rn-1−(4*An-1+1) 但し、Rn-1:前サイクルでの余り(Rc), An-1:前サイクル迄の中間結果(a) を計算し、Rn<0であれば‘0'を、それ以外であれば
‘1'を部分解とし、且つ、Rn<0の場合にはRn-1を、そ
れ以外の場合はRnを2ビット左シフトしたものを部分剰
余とし、 上記部分解を、前サイクル迄の中間結果を1ビット左シ
フトした結果に加えることを繰り返して平方根を求める
演算を行おうとすると、「4*An-1」を減数レジスタ
(SR1〜3)に置数するサイクルと、該置数された「4
*An-1」を用いて前サイクルの部分剰余「Rn-1」から減
算するサイクルの2サイクルを必要とし、当該高速化さ
れた高基数非回復型除算装置を用いて平方根演算を行う
場合には高速化できないと云う問題があった。
However, when the square root operation is performed by the square root method using the high radix non-recovery type division device, a one-digit partial decomposition obtained as a carry of the addition circuit of the division device is used as the divisor register of the division circuit. Since it is necessary to feed back and update the least significant bit of (DSR), the above-mentioned arithmetic expression for calculating the square root from the radix-2 operand by the square root method Rn = Rn −1 − (4 * An −1 +1) Rn -1 : Remainder (Rc) in the previous cycle, An -1 : Interim result (a) up to the previous cycle is calculated, and if Rn <0, then '0', otherwise '1' Partial decomposition, and if Rn <0, Rn -1 is used, otherwise Rn is left-shifted by 2 bits to the partial remainder. The partial decomposition is 1 bit of the intermediate result up to the previous cycle. When trying to calculate the square root by repeating adding to the result of left shift, "4 * An -1 "is registered in the subtraction register (SR1 to 3), and the registered" 4 "
* An -1 "is required to perform two cycles of subtraction from the partial remainder" Rn -1 "of the previous cycle, and the square root operation is performed using the accelerated high radix non-recovery type division device. Had a problem that it could not speed up.

本発明は上記従来の欠点に鑑み、除倍数×除数(mD)の
結果を、そのサイクルで得られる部分商予測値mに基づ
いて選択し、減数レジスタ(SR1〜3)に置数する方式
の高基数非回復型除算装置を用いて、基数2のオペラン
ドから開平法によって平方根を求める演算式 Rn=Rn-1−(4*An-1+1) 但し、Rn-1:前サイクルでの余り(Rc) An-1:前サイクル迄の中間結果(a) の演算を1演算サイクルで行うことで、1桁の平方根
(部分解)を1演算サイクルで得る平方根演算処理方式
を提供することを目的とするものである。
In view of the above-mentioned conventional drawbacks, the present invention is a method of selecting the result of divisor × divisor (mD) based on the partial quotient prediction value m obtained in the cycle and registering it in the subtraction registers (SR1 to 3). Rn = Rn -1- (4 * An -1 +1) where Rn -1 is the remainder in the previous cycle ( Rc) An -1 : The object of the present invention is to provide a square root operation processing method for obtaining a one-digit square root (partial decomposition) in one operation cycle by performing the operation of the intermediate result (a) up to the previous cycle in one operation cycle. It is what

〔問題点を解決するための手段〕[Means for solving problems]

第1図は本発明の平方根演算処理方式の原理図である。 FIG. 1 is a principle diagram of the square root calculation processing method of the present invention.

上記の問題点は、下記の如くに構成された平方根演算処
理方式によって解決される。
The above problems can be solved by the square root operation processing method configured as follows.

基数2のオペランドから開平法によって平方根を求める
演算式 Rn=Rn-1−(4*An-1+1) 但し、Rn-1:前サイクルでの余り An-1:前サイクル迄の中間結果 を計算し、Rn<0であれば‘0'を、それ以外であれば
‘1'を部分解とし、且つ、Rn<0の場合にはRn-1を、そ
れ以外の場合はRnを2ビット左シフトしたものを部分剰
余とし、 上記部分解を、前サイクル迄の中間結果を1ビット左シ
フトした結果に加えることを繰り返して平方根を求める
のに、 少なくとも、除数レジスタ1と,除倍数回路2と,該除
倍数×除数の結果を保持する減数レジスタ3とを備えた
高基数非回復型除算装置に、オペランドを置数する被開
平数レジスタ(SQR)6と、 上記置数されたオペランドを1演算サイクル毎に2ビッ
ト左シフトして、上記高基数非回復型除算装置の部分剰
余レジスタ(PR)5に伝達する手段と、 上記演算サイクル毎に、上記除数レジスタ(DSR)1を
1ビット左シフトして帰還する手段と、 該部分剰余レジスタ(PR)5の値から上記除数レジスタ
(DSR)1の値を1ビット左シフトして4倍したものを
減算したときに、加算器(ADD)4から得られるキャリ
信号(CARRY)を、上記除数レジスタ(DSR)1の最下位
ビットに帰還して、平方根の部分解を得る手段と、 上記演算サイクル毎に、部分剰余レジスタ(PR)5を2
ビット左シフトしたもの(Rn-1)と、上記減算処理によ
って得られる部分剰余(Rn)との何れかを、上記キャリ
信号(CARRY)の値によって選択して、上記部分剰余レ
ジスタ5に置数し、当該演算サイクルでの部分剰余とす
る手段とを設けて、 当該高基数非回復型除算装置を用いて平方根演算処理を
行う方式において、 上記オペランドの上位2ビットを置数した部分剰余レジ
スタ(PR)5から減算すべき前サイクルの部分中間結果
(An-1)の を生成するのに、 1サイクル前の中間結果(An-1)(DSR)1を1ビット
左シフトして‘×4'を行う第1の手段と、 今回の演算サイクルで得られた部分解(キャリ)を1ビ
ット左シフトして‘×4'を行うと同時に、該部分解(キ
ャリ)を、上記除数レジスタ(DSR)1の最下位ビット
に置数する第2の手段と、 上記第1の手段と第2の手段の結果を上記減数レジスタ
(SR3)3で合成する第3の手段と、 上記演算結果であるキャリ信号(CARRY)の値に応じ
て、上記部分剰余レジスタ(PR)5の前サイクルの結果
(Rn-1)を選択するか、今回の演算によって得られた部
分剰余(Rn)を選択する切り替え手段とを設けて、 上記基数2のオペランドから開平法によって平方根を求
める演算式、 Rn=Rn-1−(4*An-1+1) を処理するように構成する。
Arithmetic expression to calculate square root from square root operand by square root method Rn = Rn −1 − (4 * An −1 +1) where Rn −1 : remainder in previous cycle An −1 : calculate intermediate result up to previous cycle If Rn <0, then '0' is partially decomposed, and if not, '1' is partially decomposed, and if Rn <0, Rn -1 is used. Otherwise, Rn is left 2 bits. To obtain the square root by repeating adding the intermediate result up to the previous cycle to the result obtained by shifting the intermediate result up to the previous cycle by 1 bit as the partial remainder, at least the divisor register 1 and the divisor circuit 2 are used. , A high radix non-recovery type division device having a divisor register 3 for holding the result of the divisor × divisor, and an open square number register (SQR) 6 for registering an operand, and the above-registered operand for 1 The high radix non-recovery type division device is shifted to the left by 2 bits for each operation cycle. Means for transmitting to the remainder register (PR) 5, means for left-shifting the divisor register (DSR) 1 by 1 bit for each operation cycle, and returning, and the divisor from the value of the partial remainder register (PR) 5. When the value of register (DSR) 1 is left shifted by 1 bit and multiplied by 4 is subtracted, the carry signal (CARRY) obtained from adder (ADD) 4 is used as the least significant bit of divisor register (DSR) 1 above. A means for returning to bits to obtain a partial decomposition of the square root, and a partial remainder register (PR) 5 for each operation cycle described above.
Either the bit left shifted (Rn -1 ) or the partial remainder (Rn) obtained by the subtraction process is selected according to the value of the carry signal (CARRY), and the number is stored in the partial remainder register 5. In the method of performing square root arithmetic processing by using the high radix non-recovery type division device by providing means for calculating the partial remainder in the operation cycle, the partial remainder register (2) in which the upper 2 bits of the operand is set ( PR) 5 of the partial intermediate result (An -1 ) of the previous cycle that should be subtracted from To generate, the first means to shift the intermediate result (An -1 ) (DSR) 1 one cycle before by 1 bit to the left and perform '× 4', and the partial decomposition obtained in this operation cycle (Carry) is left-shifted by 1 bit to perform '× 4', and at the same time, the partial decomposition (carry) is placed in the least significant bit of the divisor register (DSR) 1; The third means for synthesizing the results of the first means and the second means by the reduction register (SR3) 3 and the partial remainder register (PR) according to the value of the carry signal (CARRY) which is the operation result. A square root is calculated from the operand of the above radix 2 by the square root method by providing a switching means for selecting the result (Rn -1 ) of the previous cycle of 5 or selecting the partial remainder (Rn) obtained by this operation. It is configured to process the arithmetic expression Rn = Rn −1 − (4 * An −1 +1).

〔作用〕[Action]

即ち、本発明によれば、基数2のオペランドから開平法
によって平方根を求める演算式 Rn=Rn-1−(4*An-1+1) 但し、Rn-1:前サイクルでの余り An-1:前サイクル迄の中間結果 を計算し、Rn<0であれば‘0'を、それ以外であれば
‘1'を部分解とし、且つ、Rn<0の場合にはRn-1を、そ
れ以外の場合はRnを2ビット左シフトしたものを部分剰
余とし、 上記部分解を、前サイクル迄の中間結果を1ビット左シ
フトした結果に加えることを繰り返して平方根を求める
方式である。
That is, according to the present invention, an arithmetic expression Rn = Rn −1 − (4 * An −1 +1) for calculating a square root from a radix-2 operand by a square root method, where Rn −1 : remainder An −1 in the previous cycle: The intermediate result up to the previous cycle is calculated, and if Rn <0, the value is '0'; otherwise, the value is '1'. If Rn <0, Rn -1 is used. In this case, Rn is shifted by 2 bits to the left and used as a partial remainder, and the partial decomposition is repeated to add the intermediate result up to the previous cycle to the result of shifting it by 1 bit to the left to obtain the square root.

上記の演算式における減算を補数を用いた加算に書き替
えると、 となる。
Rewriting the subtraction in the above arithmetic expression to the addition using complement, Becomes

この加算を行うのに必要な を求める場合、従来方式においては、除数レジスタを1
ビット左シフトすると同時に、該平方根演算で求めた部
分解であるキャリ信号(CARRY)を、1ビット左シフト
した上記除数レジスタ(DSR)の最下位ビットに帰還し
て更新し、該更新した除数レジスタ(DSR)の1の補数
をとったものを4倍して、減数レジスタ(SR3)にセッ
トする処理となる為、1桁の部分解を得るのに2演算サ
イクルを必要としている。
Needed to make this addition In the conventional method, the divisor register is set to 1
At the same time as shifting by one bit to the left, a carry signal (CARRY) which is a partial solution obtained by the square root operation is fed back to the least significant bit of the divisor register (DSR) shifted by one bit and updated, and the updated divisor register is updated. (DSR) 1's complement is multiplied by 4 and set in the subtraction register (SR3), so two operation cycles are required to obtain a one-digit partial solution.

そこで、本発明においては、減数レジスタ(SR3)にセ
ットする値を上記更新した除数レジスタ(DSR)からで
はなく、更新前、即ち、前サイクルの除数レジスタ(DS
R)の値を1ビット左シフト(即ち、2倍)したものの
4倍したもの(従って、8倍したもの)の1の補数をと
ったものと、当該演算サイクルで得られた部分解{キャ
リ信号(CARRY)}を8倍、即ち、3ビット左シフトし
たものの1の補数をとったものとを、該減数レジスタに
セットするようにする。
Therefore, in the present invention, the value to be set in the subtraction register (SR3) is not from the updated divisor register (DSR) but before the update, that is, the divisor register (DS) of the previous cycle.
The value obtained by taking the 1's complement of the value obtained by shifting the value of R) by 1 bit to the left (that is, doubling it) (therefore, multiplying it by 8) and the partial decomposition {carry The signal (CARRY)} is multiplied by eight, that is, a signal obtained by shifting left by 3 bits and taking a complement of 1 is set in the reduction register.

第3図は本発明による の演算方式を説明する図であって、(a)は除数レジス
タ(DSR)にキャリ信号(CARRY)を帰還した後におい
て、1の補数をとる場合を示しており、(b)は上記の
本発明による の処理方式(即ち、1演算サイクルで求める方式)を示
しており、両者とも同じ結果が得られることが分かる。
FIG. 3 is according to the present invention FIG. 6A is a diagram for explaining the calculation method of, and FIG. 6A shows a case where a 1's complement is taken after the carry signal (CARRY) is fed back to the divisor register (DSR), and FIG. According to the invention The processing method (i.e., the method obtained in one operation cycle) is shown, and it can be seen that the same result is obtained in both cases.

従って、本発明においては、減数レジスタを備えた引き
離し法による除算装置を用いて平方根演算を行う際に必
要な、 Rn=Rn-1−(4*An-1+1) なる演算を1演算サイクルで実行でき、最小限のハード
ウェアを付加するだけで、高速の平方根演算処理方式が
実現できる効果がある。
Therefore, in the present invention, the calculation of Rn = Rn −1 − (4 * An −1 +1) necessary for performing the square root calculation using the division device using the separation method having the subtraction register is performed in one calculation cycle. Execution is possible, and there is an effect that a high-speed square root arithmetic processing method can be realized by adding minimum hardware.

〔実施例〕〔Example〕

以下本発明の実施例を図面によって詳述する。 Embodiments of the present invention will be described in detail below with reference to the drawings.

前述の第1図が本発明の平方根演算処理方式の原理図で
あり、第2図は本発明の一実施例を模式的に示した図で
あって、第1図,第2図における被開平レジスタ(SQ
R)6,除数レジスタ(DSR)1を1ビット左シフト(1 bi
t-LEFT-SHIFT)する手段,部分剰余レジスタ(PR)5
を2ビット左シフト(2 bit-LEFT-SHIFT)する手段,
加算器(ADD)4からのキャリ信号(CARRY)と、前サイ
クルの除数レジスタ(DSR)とを用いて、 を減数レジスタ(SR3)3で合成する手段,及び該キ
ャリ信号(CARRY)の値によって、部分剰余レジスタ(P
R)5にセットする部分剰余を選択する手段が本発明
を実施するのに必要な手段である。尚、全図を通して、
同じ符号は同じ対象物を示している。
FIG. 1 described above is a principle diagram of the square root calculation processing method of the present invention, and FIG. 2 is a diagram schematically showing an embodiment of the present invention. Register (SQ
R) 6, divisor register (DSR) 1 is shifted left by 1 bit (1 bi
t-LEFT-SHIFT) means, partial remainder register (PR) 5
2 bit left shift (2 bit-LEFT-SHIFT),
Using the carry signal (CARRY) from the adder (ADD) 4 and the divisor register (DSR) of the previous cycle, Of the partial remainder register (P3) by the means for synthesizing the subtraction register (SR3) 3 and the value of the carry signal (CARRY).
R) The means for selecting the partial remainder to be set to 5 is the means necessary for carrying out the present invention. In addition,
The same code | symbol has shown the same target object.

以下、第1図〜第3図を用いて、本発明による平方根演
算処理方式を説明する。
Hereinafter, the square root calculation processing method according to the present invention will be described with reference to FIGS.

本発明を実施しても、引き離し法による除算装置を用い
て平方根を求める基本的な動作は従来方式と特に変わる
ことはないので省略し、ここでは、前述の基数2の開平
演算式、 で必要となる を1演算サイクルで求める処理を中心にして、第2図を
用いて説明する。
Even if the present invention is carried out, the basic operation for obtaining the square root by using the division device by the separation method is not particularly different from that of the conventional method, and therefore the description thereof is omitted here. Needed in A description will be given with reference to FIG.

先ず、第2図に示した#0サイクルにおいて、オペラン
ドが被開平レジスタ(SQR)6にセットされると共に、
除数レジスタ(DSR)1,減数レジスタ(SR1〜3)3,部分
剰余レジスタ(PR)5が、それぞれクリア(‘0'セッ
ト)される。
First, in the # 0 cycle shown in FIG. 2, while the operand is set in the square root register (SQR) 6,
The divisor register (DSR) 1, the divisor register (SR1 to 3) 3, and the partial remainder register (PR) 5 are each cleared (set to “0”).

続いて、同じサイクルにおいて、被開平レジスタ(SQ
R)6の上位2ビットが最初の平方根を求めるのに、部
分剰余レジスタ(PR)5の最下位2ビットに伝達され
ると共に、該被開平レジスタ(SQR)6の最下位2ビッ
トに‘00'が挿入される。
Then, in the same cycle, the square root register (SQ
The upper 2 bits of R) 6 are transmitted to the lower 2 bits of the partial remainder register (PR) 5 to obtain the first square root, and the lower 2 bits of the square root register (SQR) 6 are set to '00. 'Is inserted.

又、除数レジスタ(DSR)1の1の補数をとったものを
3ビットシフト、即ち、上記開平演算式に必要な を求める為の4倍と、1演算処理が行われる毎に、得ら
れた平方根(キャリ)が該除数レジスタ(DSR)1の最
下位1ビットに置数する為に、該除数レジスタ(DSR)
1を1ビット左シフト、即ち、2倍との合計8倍する必
要がある為に、3ビット左シフト(これを、本図におい
ては、 で示している)して減数レジスタ(SR3)3にセットす
る。
Also, the one's complement of the divisor register (DSR) 1 is shifted by 3 bits, that is, necessary for the square root calculation formula. 4 times for obtaining and the square root (carry) obtained every time one arithmetic operation is performed is placed in the least significant 1 bit of the divisor register (DSR) 1, so that the divisor register (DSR)
Since it is necessary to shift 1 by 1 bit to the left, that is, 2 times, a total of 8 times, it is necessary to shift by 3 bits to the left (this is , And set it in the subtraction register (SR3) 3.

以下、1演算サイクルでの動作を詳細に説明する。The operation in one operation cycle will be described in detail below.

(1)上記式の を行う為に、減数レジスタ(SR3)3と、部分剰余レジ
スタ(PR)5が加算器(ADD)4において加算される。
(1) In the above equation In order to perform, the subtraction register (SR3) 3 and the partial remainder register (PR) 5 are added in the adder (ADD) 4.

(2)除数レジスタ(DSR)1は左に1ビットシフト
され、その最下位ビットに上記の加算結果のキャリ(CA
RRY)がシフトイン(CARRY SHIFT-IN C)される。
(2) The divisor register (DSR) 1 is shifted 1 bit to the left, and the carry (CA) of the above addition result is placed in the least significant bit.
RRY) is shifted in (CARRY SHIFT-IN C).

ここでは、前述のように、補数の加算によって減算を行
っているので、該減数の結果が正の場合には、キャリ
(CARRY)が‘1'となるため、該キャリ(CARRY)の値が
その儘部分解となる。
Here, as described above, since subtraction is performed by addition of complements, when the result of the subtraction is positive, the carry (CARRY) becomes '1', and therefore the value of the carry (CARRY) is The part will be disassembled.

従って、減数レジスタ(SR3)3にセットする場合に
は、その1の補数をとった‘’を入力する 必要がある。
Therefore, when setting it to the subtraction register (SR3) 3, enter "1" that is the complement of that. There is a need.

(3)減数レジスタ(SR3)3には、前サイクルの除数
レジスタ(DSR)1の1の補数を左に3ビットシフトし
たもの をセットし、最下位から3ビット目に、上記キャリの1
の補数‘’をセットし、下位2ビットには、‘00'の
1の補数である‘11'をセット(SHIFT-IN)する。{第
3図(b)参照} ここで、除数レジスタ(DSR)1の1の補数を3ビット
シフトするのは、前述のように、現サイクルにおける1
ビットシフトと、その結果を更に、4倍するための2ビ
ットシフトを合わせたものである。
(3) The subtraction register (SR3) 3 is the one's complement of the divisor register (DSR) 1 of the previous cycle shifted left 3 bits. Is set and the 1st bit of the above carry is set to the 3rd least significant bit
Is set to the lower two bits and '11' which is the one's complement of '00' is set (SHIFT-IN). {Refer to FIG. 3 (b)} Here, as described above, the 1's complement of the divisor register (DSR) 1 is shifted by 3 bits in the current cycle.
It is a combination of a bit shift and a 2-bit shift for multiplying the result by 4.

(4)部分剰余レジスタ(PR)5は演算結果であるキャ
リ(CARRY)の値によって、次の2通りのセットが行わ
れる。
(4) The partial remainder register (PR) 5 is set in the following two ways depending on the value of carry (CARRY) which is the operation result.

該キャリ(CARRY)が‘1'であれば、加算器(ADD)4の
結果が2ビット左シフトされ(#2サイクル参照)、
該シフト後の下位2ビットに、被開平数レジスタ(SQ
R)6の上位2ビットがシフトインされる。
If the carry (CARRY) is '1', the result of the adder (ADD) 4 is left shifted by 2 bits (see # 2 cycle),
In the lower 2 bits after the shift, the square root register (SQ
The upper 2 bits of R) 6 are shifted in.

該キャリ(CARRY)が‘0'であれば、前サイクルの部分
剰余レジスタ(PR)5が2ビット左シフトされて、該
シフト後の下位2ビットに、被開平数レジスタ(SQR)
6の上位2ビットがシフトインされる。
If the carry (CARRY) is '0', the partial remainder register (PR) 5 of the previous cycle is left shifted by 2 bits, and the lower 2 bits after the shift are subjected to the open square number register (SQR).
The upper 2 bits of 6 are shifted in.

以下、同じ動作が#1〜の各サイクル毎に、除数レジス
タ(DSR)1に、上記加算器(ADD)4のキャリ(CARR
Y)信号がシフトイン(CARRY SHIFT-IN Cで示す)され
て保持されていく中間結果が必要な桁数になる迄繰り返
される。
Thereafter, the same operation is performed for each cycle of # 1 to the divisor register (DSR) 1 to the carry (CARR) of the adder (ADD) 4.
Y) The signal is shifted in (indicated by CARRY SHIFT-IN C) and held until the intermediate result held is the required number of digits.

このように、本発明による平方根演算処理方式を用いれ
ば、減数レジスタ(SR1〜3)3を備えた高速度の除算
装置を共用した開平演算回路で、1サイクル毎に1ビッ
トの部分解を求めることができる。
As described above, if the square root arithmetic processing method according to the present invention is used, a square root arithmetic circuit sharing a high-speed divider equipped with the subtraction registers (SR1 to 3) 3 finds a 1-bit partial decomposition for each cycle. be able to.

このように、本発明は、引き離し法による、例えば、高
基数非回復型除算装置での除算方式と、平方根の演算方
式とが類似していることに着目し、該除算回路に最小限
のハードウェアを付加して、平方根演算を行う方式にお
いて、該除算回路が除倍数×除数(mD)を減数レジスタ
(SR1〜3)に置数する形式の場合、除数レジスタ(DS
R)に開平結果である加算器(ADD)のキャリ信号(CARR
Y)を帰還した後、該減数レジスタ(SR1〜3)への置数
処理が通常2演算サイクル必要となる処理を、1演算サ
イクルでできるように、前サイクルでの除数レジスタ
(DSR)の1の補数をとって、3ビット左シフトしたも
のと、該演算結果であるキャリ信号(CARRY)の1の補
数をとって3ビット左シフトしたものとを減数レジスタ
(SR3)で合成すると共に、次の演算の為に該キャリ信
号(CARRY)を除数レジスタ(DSR)の最下位ビットに帰
還するようにした所に特徴がある。
As described above, the present invention focuses on the fact that the division method based on the separation method, for example, in a high radix non-recovery type division apparatus and the square root arithmetic method are similar, and the division circuit has a minimum hardware. In the method of performing square root operation by adding wear, if the division circuit registers the divisor × divisor (mD) in the subtraction registers (SR1 to 3), the divisor register (DS
R) is the square root result of the adder (ADD) carry signal (CARR
After returning Y), the number of the divisor register (DSR) in the previous cycle is set to 1 so that the processing that normally requires two operation cycles to perform the number processing to the subtraction registers (SR1 to 3) can be performed in one operation cycle. Of the carry signal (CARRY), which is the result of the operation, and the result of shifting by 3 bits to the left. It is characterized in that the carry signal (CARRY) is fed back to the least significant bit of the divisor register (DSR) for the calculation.

〔発明の効果〕〔The invention's effect〕

以上、詳細に説明したように、本発明の平方根演算処理
方式は、基数2のオペランドから開平法によって平方根
を求める演算式 Rn=Rn-1−(4*An-1+1) 但し、Rn-1:前サイクルでの余り An-1:前サイクル迄の中間結果 を計算し、Rn<0であれば‘0'を、それ以外であれば
‘1'を部分解とし、且つ、Rn<0の場合にはRn-1を、そ
れ以外の場合はRnを2ビット左シフトしたものを部分剰
余とし、 上記部分解を、前サイクル迄の中間結果を1ビット左シ
フトした結果に加えることを繰り返して平方根を求める
方式において、 上記減算を補数を用いた加算に書き替えると、 となることから、この加算を行うのに必要な、 を求めるのに、減数レジスタ(SR3)にセットする値
を、演算結果によって更新した除数レジスタ(DSR)か
らではなく、更新前、即ち、前サイクルの除数レジスタ
(DSR)の値を1ビット左シフト(即ち、2倍)したも
のの4倍したものの1の補数をとったものと、当該演算
サイクルで得られた部分解{キャリ信号(CARRY)}を
8倍、即ち、3ビット左シフトしたものの1の補数をと
ったものとを、該減数レジスタにセットするようにした
ものであるので、減数レジスタを備えた引き離し法によ
る除算装置を用いて平方根演算を行う際に必要な、 Rn=Rn-1−(4*An-1+1) なる演算を1演算サイクルで実行でき、最小限のハード
ウェアを付加するだけで、高速の平方根演算処理方式が
実現できる効果がある。
As described above in detail, in the square root arithmetic processing method of the present invention, the arithmetic expression Rn = Rn −1 − (4 * An −1 +1) where Rn −1 is used to calculate the square root from the radix-2 operand by the square root method. : Residue in the previous cycle An -1 : Intermediate result up to the previous cycle is calculated. If Rn <0, '0' is partially decomposed, otherwise '1' is partially decomposed, and Rn <0 If Rn -1 in the case, otherwise Rn left shifted by 2 bits is taken as the partial remainder, and the above partial decomposition is repeated by adding the intermediate result up to the previous cycle to the result shifted left by 1 bit. In the method of finding the square root, if the above subtraction is rewritten as addition using complement, Therefore, it is necessary to perform this addition, The value set in the subtraction register (SR3) is not shifted from the divisor register (DSR) updated by the operation result, but the value of the divisor register (DSR) in the previous cycle is shifted to the left by 1 bit. (That is, doubled), which is obtained by taking 1's complement of 4 times that obtained, and the partial decomposition {carry signal (CARRY)} obtained in the operation cycle is multiplied by 8 times, that is, 1 obtained by shifting left by 3 bits. Since the complement of is taken to be set in the reduction register, Rn = Rn −1 , which is necessary when performing a square root operation using a division device with a subtraction method equipped with a reduction register, An operation of − (4 * An −1 +1) can be executed in one operation cycle, and there is an effect that a high-speed square root operation processing method can be realized by adding minimum hardware.

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

第1図は本発明による平方根演算処理方式の原理図, 第2図は本発明の一実施例を模式的に示した図, 第3図は本発明による の演算方式を説明する図, 第4図は従来の平方根演算処理方式を説明する図, である。 図面において、 1は除数レジスタ(DSR),2は除倍数回路,3は減数レジ
スタ(SR1〜3),4は加算器(ADD),5は部分剰余レジス
タ(PR),6は被開平数レジスタ(SQR),〜はシフ
ト等の動作,CARRYはキャリ信号(C),又は部分解,を
それぞれ示す。
FIG. 1 is a principle diagram of a square root operation processing method according to the present invention, FIG. 2 is a diagram schematically showing an embodiment of the present invention, and FIG. 3 is according to the present invention. FIG. 4 is a diagram for explaining the above calculation method, and FIG. 4 is a diagram for explaining the conventional square root calculation processing method. In the drawing, 1 is a divisor register (DSR), 2 is a divisor circuit, 3 is a divisor register (SR1 to 3), 4 is an adder (ADD), 5 is a partial remainder register (PR), and 6 is a radix register. (SQR), ~ indicate an operation such as shift, and CARRY indicates a carry signal (C) or partial decomposition.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】基数2のオペランドから開平法によって平
方根を求める演算式 Rn=Rn-1−(4*An-1+1) 但し、Rn-1:前サイクルでの余り An-1:前サイクル迄の中間結果 を計算し、Rn<0であれば‘0'を、それ以外であれば
‘1'を部分解とし、且つ、Rn<0の場合にはRn-1を、そ
れ以外の場合はRnを2ビット左シフトしたものを部分剰
余とし、 前サイクル迄の中間結果を1ビット左シフトした結果
に、上記部分解を加えることを繰り返して平方根を求め
るのに、 少なくとも、除数レジスタ(1)と,除倍数回路(2)
と,該除倍数の結果を保持する減数レジスタ(3)とを
備えた高基数非回復型除算装置に、オペランドを置数す
る被開平数レジスタ(6)と、 上記置数されたオペランドを1演算サイクル毎に2ビッ
ト左シフトして、上記高基数非回復型除算装置の部分剰
余レジスタ(5)に伝達する手段()と、 上記演算サイクル毎に、上記除数レジスタ(1)を1ビ
ット左シフトして帰還する手段()と、 上記部分剰余レジスタ(5)の値から上記除数レジスタ
(1)の値を1ビット左シフトして4倍したものを減算
したときに、加算器(4)から得られるキャリ信号を、
上記除数レジスタ(1)の最下位ビットに帰還して、平
方根の部分解を得る手段()と、 上記演算サイクル毎に、部分剰余レジスタ(5)を2ビ
ット左シフト()したもの(Rn-1)と、上記減算処理
によって得られる部分剰余(Rn)との何れかを、上記キ
ャリ信号の値によって選択して、上記部分剰余レジスタ
(5)に置数し、当該演算サイクルでの部分剰余とする
手段()とを設けて、 当該高基数非回復型除算装置を用いて平方根演算処理を
行う方式において、 前サイクルでの部分剰余を置数した部分剰余レジスタ
(5)から減算すべき前サイクルの部分中間結果(A
n-1)の を生成するのに、 1サイクル前の中間結果(1)を1ビット左シフトし
て、‘×4'を行う第1の手段と、 今回の演算サイクルで得られた部分解(キャリ)を1ビ
ット左シフトして‘×4'を行うと同時に、該部分解(キ
ャリ)を、上記除数レジスタ(1)の最下位ビットに置
数する第2の手段と、 上記第1の手段と第2の手段の結果を上記減数レジスタ
(3)で合成する第3の手段と、 上記演算結果であるキャリ信号の極性に応じて、上記部
分剰余レジスタ(5)の前サイクルの結果(Rn-1)を選
択するか、今回の演算によって得られた部分剰余(Rn)
を選択する切り替え手段()とを設けて、 上記基数2のオペランドから開平法によって平方根を求
める演算式、 Rn=Rn-1−(4*An-1+1) を処理することを特徴とする平方根演算処理方式。
1. An arithmetic expression for calculating a square root from a radix-2 operand by a square root method Rn = Rn −1 − (4 * An −1 +1) where Rn −1 : remainder in previous cycle An −1 : up to previous cycle The intermediate result of is calculated, and if Rn <0, the value is '0', if not, the value is '1', and if Rn <0, the value is Rn -1 , otherwise. A partial remainder is obtained by shifting Rn to the left by 2 bits, and the above partial decomposition is repeatedly added to the result of shifting the intermediate result up to the previous cycle by 1 bit to find the square root. At least, the divisor register (1) And the divisor circuit (2)
And a subtraction register (3) for holding the result of the divisor, a high radix non-recovery type division device, an apex number register (6) for registering an operand, and the operand with the above register A means () for shifting to the left by 2 bits for each operation cycle and transmitting it to the partial remainder register (5) of the high radix non-recovery type division device, and for each operation cycle, the divisor register (1) is moved left by 1 bit. A means () for shifting and feeding back, and an adder (4) when subtracting a value obtained by shifting the value of the divisor register (1) to the left by 1 bit and multiplying it by 4 from the value of the partial remainder register (5). The carry signal obtained from
Fed back to the least significant bits of the divisor register (1), and means for obtaining a partial solution of the square root (), for each of the operation cycle, 2-bit left shift of the partial remainder register (5) () were those (Rn - Either 1 ) or the partial remainder (Rn) obtained by the subtraction process is selected according to the value of the carry signal and is entered in the partial remainder register (5) to obtain the partial remainder in the operation cycle. In the method of performing the square root arithmetic processing using the high radix non-recovery type division device by providing the means (), before subtraction from the partial remainder register (5) in which the partial remainder in the previous cycle is registered. Partial intermediate result of cycle (A
n -1 ) In order to generate, the first means for performing'x4 'by shifting the intermediate result (1) one cycle before by 1 bit to the left and the partial decomposition (carry) obtained in this operation cycle are set to 1 A second means for shifting the bits to the left and performing '× 4', and at the same time, placing the partial decomposition (carry) in the least significant bit of the divisor register (1), the first means and the second means. The result of the preceding cycle (Rn -1 ) of the partial remainder register (5) depending on the third means for synthesizing the result of the means in the subtraction register (3) and the polarity of the carry signal which is the operation result. Or the partial remainder (Rn) obtained by this operation
And a switching means () for selecting, and processing an arithmetic expression, Rn = Rn −1 − (4 * An −1 +1), for calculating a square root from the operand of radix 2 by the square root method. Arithmetic processing method.
JP62314477A 1987-12-11 1987-12-11 Square root arithmetic processing method Expired - Fee Related JPH0769788B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62314477A JPH0769788B2 (en) 1987-12-11 1987-12-11 Square root arithmetic processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62314477A JPH0769788B2 (en) 1987-12-11 1987-12-11 Square root arithmetic processing method

Publications (2)

Publication Number Publication Date
JPH01155435A JPH01155435A (en) 1989-06-19
JPH0769788B2 true JPH0769788B2 (en) 1995-07-31

Family

ID=18053792

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62314477A Expired - Fee Related JPH0769788B2 (en) 1987-12-11 1987-12-11 Square root arithmetic processing method

Country Status (1)

Country Link
JP (1) JPH0769788B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6820107B1 (en) 1997-05-08 2004-11-16 Renesas Technology Corporation Square root extraction circuit and floating-point square root extraction device

Also Published As

Publication number Publication date
JPH01155435A (en) 1989-06-19

Similar Documents

Publication Publication Date Title
CA1231455A (en) Nonrestoring divider
EP0149248A2 (en) Method and apparatus for division using interpolation approximation
US8639737B2 (en) Method to compute an approximation to the reciprocal of the square root of a floating point number in IEEE format
EP0356153B1 (en) Radix-2**n divider method and apparatus using overlapped quotient bit selection and concurrent quotient rounding and correction
US5132925A (en) Radix-16 divider using overlapped quotient bit selection and concurrent quotient rounding and correction
US8060551B2 (en) Method and apparatus for integer division
JPH04283831A (en) Divider
JP2502836B2 (en) Preprocessing device for division circuit
US7016930B2 (en) Apparatus and method for performing operations implemented by iterative execution of a recurrence equation
KR102208274B1 (en) Fma-unit, in particular for use in a model calculation unit for pure hardware-based calculation of a function-model
JPH0346024A (en) Floating point computing element
JPH0769788B2 (en) Square root arithmetic processing method
JP2777265B2 (en) High radix square root arithmetic unit
JP3517162B2 (en) Division and square root arithmetic unit
JPS6155691B2 (en)
JP2803442B2 (en) Square root device
JPH0368415B2 (en)
JP3477866B2 (en) Divider division method
JPH0427587B2 (en)
JP2607759B2 (en) Divider
JPS61118835A (en) Hardware divider
JPH06180640A (en) Device and method for division
JPH08249161A (en) Cubic root arithmetic unit
JPH01128129A (en) Floating point addition/subtraction device
JPH0199126A (en) Extension accuracy dividing processing system

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees