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

JP3335769B2 - Fixed-point square root arithmetic unit - Google Patents

Fixed-point square root arithmetic unit

Info

Publication number
JP3335769B2
JP3335769B2 JP15367394A JP15367394A JP3335769B2 JP 3335769 B2 JP3335769 B2 JP 3335769B2 JP 15367394 A JP15367394 A JP 15367394A JP 15367394 A JP15367394 A JP 15367394A JP 3335769 B2 JP3335769 B2 JP 3335769B2
Authority
JP
Japan
Prior art keywords
square root
result
bit
primary
quadratic
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
JP15367394A
Other languages
Japanese (ja)
Other versions
JPH07175637A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP15367394A priority Critical patent/JP3335769B2/en
Publication of JPH07175637A publication Critical patent/JPH07175637A/en
Application granted granted Critical
Publication of JP3335769B2 publication Critical patent/JP3335769B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は固定小数点開平演算器に
関し、特に演算過程におけるオーバーフロー、アンダー
フローの発生を防止した固定小数点開平演算器に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a fixed-point square root arithmetic unit and, more particularly, to a fixed-point square root arithmetic unit capable of preventing occurrence of overflow and underflow in a calculation process.

【0002】[0002]

【従来の技術】従来の固定小数点開平演算器は、開平演
算にニュートン法(Newton−Raphson法)
や二分法などを用いている。ニュートン法は、以下に示
す式を繰り返すことによって実行される。
2. Description of the Related Art A conventional fixed-point square root arithmetic unit employs a Newton method (Newton-Raphson method) for square root operation.
And dichotomy. The Newton method is implemented by repeating the following equation.

【0003】[0003]

【数1】 (Equation 1)

【0004】上式から、a=1/x1/2 を求め、ax=
1/2 を求める。ここで、an は開平結果のn回目の近
似値を表し、xは被開平数を表す。
From the above equation, a = 1 / x 1/2 is obtained, and ax =
Find x 1/2 . Here, a n represents an n-th approximation of No. results, x is representative of the No. numbers.

【0005】ここでは、開平演算に二分法を用いた従来
の固定小数点開平演算器について説明する。図9は従来
の固定小数点開平演算器の構成を示すブロック図であ
る。図9において、被開平数データは、被開平数データ
を入力するデータ入力部1から開平演算部2に与えら
れ、レジスタまたはメモリ群で構成されるデータ記憶部
5との間でデータの交換を行いつつ、演算処理を施さ
れ、開平結果判定部3で演算結果の適否について判定が
行われ、適当と判断されれば開平結果出力部4に出力さ
れる。このとき、データ入力部1、開平演算部2、演算
結果判定部3、開平結果出力部4、データ記憶部5は制
御手段6により制御される。
[0005] Here, a conventional fixed-point square root arithmetic unit using the bisection method for the square root operation will be described. FIG. 9 is a block diagram showing a configuration of a conventional fixed-point square root arithmetic unit. In FIG. 9, square root data is provided from a data input unit 1 for inputting square root data to a square root operation unit 2, and exchanges data with a data storage unit 5 including a register or a memory group. While performing the calculation, the square root result determination unit 3 determines whether or not the calculation result is appropriate. If determined to be appropriate, the square root result output unit 4 outputs the result. At this time, the data input unit 1, the square root calculation unit 2, the calculation result determination unit 3, the square root result output unit 4, and the data storage unit 5 are controlled by the control unit 6.

【0006】次に、二分法を開平演算に用いる場合の具
体的手法について図9および図10を用いて説明する。
図10は二分法を用いた従来の開平演算器の動作手順を
示すフローチャートである。まず、データ入力部1から
開平演算部2に被開平数が入力される(ステップS
1)。このとき、入力された被開平数に対して、データ
記憶部5において整数部2L、小数部2Mビットの開平
結果の固定小数点フォーマットを用意する(ステップS
2)。次に、第1回目の開平結果として、整数部2Lビ
ットの半分であるLビットの位置に1を設定した数値を
初期値とし、第2回目以降の開平結果は、第1回目に1
を立てたビットから1回の計算ループごとに順次1ビッ
トLSB側のビットを1とした数値とする(ステップS
3)。次に、開平結果の初期値の2乗を求め、被開平数
と開平結果の2乗の数値比較を行う(ステップS4)。
Next, a specific method when the dichotomy is used for the square root operation will be described with reference to FIGS. 9 and 10. FIG.
FIG. 10 is a flowchart showing an operation procedure of a conventional square root calculator using the bisection method. First, the square root number to be squared is input from the data input unit 1 to the square root arithmetic unit 2 (step S).
1). At this time, for the input square root number to be input, a fixed-point format of the square root result of the integer part 2L and the decimal part 2M bits is prepared in the data storage unit 5 (step S).
2). Next, as the first square root result, a numerical value in which 1 is set in the position of L bit which is half of 2 L bits of the integer part is set as an initial value, and the square root result of the second and subsequent times is 1 in the first round.
Is set to a numerical value with the bit on the LSB side being set to 1 sequentially for each calculation loop from the bit for which the is set (step S
3). Next, the square of the square root of the square root of the square root of the square root of the square root of the square root of the square root of the square root result is calculated (step S4).

【0007】ステップS4において被開平数が開平結果
の2乗以上の数値であれば、演算結果判定部3におい
て、開平結果の現在処理を行っているビットがLSBで
あるか否かを判定する(ステップS6)。
If the square root number to be squared is equal to or larger than the square of the square root result in step S4, the arithmetic result determination unit 3 determines whether the bit currently being processed for the square root result is the LSB or not (step S4). Step S6).

【0008】ステップS6において、現在処理を行って
いるビットが開平結果のLSBであるならば、その数値
が最終の開平結果として、開平結果出力部4に出力され
る。一方、現在処理を行っているビットが開平結果のL
SBでなければ、再びステップS3以下の演算を行う。
In step S6, if the currently processed bit is the LSB of the square root result, the value is output to the square root result output unit 4 as the final square root result. On the other hand, the bit currently being processed is L in the square root result.
If it is not SB, the operation from step S3 is performed again.

【0009】ステップS4において被開平数が開平結果
の2乗に満たない数値であれば、その開平結果の数値に
ついて、ステップS3において1に設定したビットを0
に再設定し、開平結果とする(ステップS5)。続い
て、ステップS6において、与えられた開平結果の現在
処理を行っているビットがLSBであるならば、それが
最終の開平結果である。一方、与えられた開平結果の現
在処理を行っているビットがLSBでなければ、再びス
テップS3以下の演算を行う。
If the square root number to be squared is less than the square of the square root result in step S4, the bit set to 1 in step S3 is set to 0 for the numerical value of the square root result.
Is set again as the square root result (step S5). Subsequently, in step S6, if the currently processed bit of the given square root result is the LSB, that is the final square root result. On the other hand, if the bit currently being processed for the given square root result is not the LSB, the operation from step S3 is performed again.

【0010】次に、以上説明したフローチャートに従っ
て具体的な演算例を説明する。例えば、8ビットの整数
加減乗算を用いて被開平数9.5625の開平演算を行
う場合、該被開平数は、整数部4ビット、小数部4ビッ
トの固定小数点フォーマットでは1001.1001 で表され
る。
Next, a specific example of calculation will be described with reference to the flowchart described above. For example, when the square root extraction of 9.5625 is performed by using 8-bit integer addition / subtraction multiplication, the root squared number is represented by 1001.1001 in a fixed-point format having a 4-bit integer part and a 4-bit decimal part.

【0011】まず、ステップS1としてデータ入力部1
から被開平数1001.1001 を入力し、ステップS2とし
て、データ記憶部5に、整数部4ビット、小数部4ビッ
トの固定小数点フォーマットを用意する。次に、ステッ
プS3として開平演算部2において、被開平数1001.100
1 の開平結果の初期値として0010.0000 を与える。ここ
で開平結果の初期値は、被開平数の整数部のビット数の
半分の位置に1を設定することで得られた値である。仮
に初期値を0100.0000 とすると、2乗した場合に10000.
00000000となり、被開平数を超えてしまう。
First, as step S1, the data input unit 1
, And a fixed-point format of 4 bits for the integer part and 4 bits for the decimal part is prepared in the data storage unit 5 in step S2. Next, in step S3, the square root calculation unit 2 calculates the square root squared number 1001.100.
0010.0000 is given as the initial value of the square root result of 1. Here, the initial value of the square root result is a value obtained by setting 1 to a half position of the number of bits of the integer part of the square root number to be squared. Assuming that the initial value is 0100.0000, if it is squared, it will be 10000.
00000000, which exceeds the number of squares to be exposed.

【0012】[0012]

【数2】 (Equation 2)

【0013】ステップS4において、開平結果の初期値
の2乗と被開平数との比較を行う。開平結果の初期値の
2乗は被開平数には満たない{(1−1)式}ので、ス
テップS6により、ステップS3で設定した現在処理中
のビットがLSBであるか否かの判定を行う。初期値と
してステップS3で設定された現在処理中のビットはL
SBの位置にはないので再びステップS3に戻り、開平
結果の初期値の次のビットに1を設定して新たな開平結
果とし、ステップS4において、この値を2乗して被開
平数との比較を行う{(1−2)式}。
In step S4, the square of the initial value of the square root result is compared with the square root number to be squared. Since the square of the initial value of the square root result is less than the square root number to be squared {Equation (1-1)}, it is determined in step S6 whether or not the currently processed bit set in step S3 is the LSB. Do. The currently processed bit set in step S3 as an initial value is L
Since it is not at the position of SB, the process returns to step S3 again, and sets 1 to the next bit of the initial value of the square root result to obtain a new square root result. Perform comparison {Equation (1-2)}.

【0014】(1−2)式においては被開平数の方が大
きいのでステップS6により、ステップS3で設定した
現在処理中のビットがLSBであるか否かの判定を行
う。この場合の開平結果は0011.0000 であり、現在処理
中のビットはLSBにはないので、再びステップS3の
操作を行い、次のビットに1を設定して新たな開平結果
0011.1000 とし、ステップS4において、この値を2乗
して被開平数との比較を行う{(1−3)式}。
In equation (1-2), since the number of roots to be opened is larger, it is determined in step S6 whether or not the currently processed bit set in step S3 is the LSB. In this case, the square root result is 0011.0000. Since the bit currently being processed is not in the LSB, the operation of step S3 is performed again, and the next bit is set to 1 to set a new square root result.
In step S4, this value is squared and compared with the square root to be exposed {Equation (1-3)}.

【0015】(1−3)式においては、被開平数の方が
小さくなるので、ステップS5において、ステップS3
で1を設定したビットを0に再設定する。次にステップ
S6によりステップS5で再設定した0のビット(現在
処理中のビット)がLSBであるか否かの判定を行う 。この場合、再設定した0のビット(現在処理中のビッ
ト)はLSBにはないので、再びステップS3の操作を
行い、次のビットに1を設定して新たな開平結果0011.0
100 とし、ステップS4において、この値を2乗して被
開平数との比較を行う{(1−4)式}。
In equation (1-3), since the number of flat faces to be opened is smaller, step S3 is executed in step S5.
Resets the bit for which 1 was set to 0 to 0. Next, in step S6, it is determined whether the 0 bit (the bit currently being processed) reset in step S5 is an LSB. In this case, since the reset bit of 0 (the bit currently being processed) is not in the LSB, the operation of step S3 is performed again, the next bit is set to 1, and the new square root result 0011.0
In step S4, this value is squared and compared with the square root to be opened {Equation (1-4)}.

【0016】(1−4)式においては、被開平数の方が
小さくなるので、ステップS5において、ステップS3
で1を設定したビット(現在処理中のビット)を0に再
設定する。次にステップS6によりステップS5で再設
定した0のビット(現在処理中のビット)がLSBであ
るか否かの判定を行う。この場合、再設定した0のビッ
ト(現在処理中のビット)はLSBにはないので、再び
ステップS3の操作を行い、次のビットに1を設定して
新たな開平結果0011.0010 とし、ステップS4におい
て、この値を2乗して被開平数との比較を行う{(1−
5)式}。
In the equation (1-4), since the number of flat faces to be opened is smaller, the step S3 is executed in the step S5.
The bit for which 1 was set (the bit currently being processed) is reset to 0. Next, in step S6, it is determined whether the 0 bit (the bit currently being processed) reset in step S5 is an LSB. In this case, since the reset bit of 0 (the bit currently being processed) is not in the LSB, the operation of step S3 is performed again, the next bit is set to 1 to obtain a new square root result 0011.0010, and in step S4 , This value is squared and compared with the square root to be opened.
5) Equation}.

【0017】(1−5)式においては、被開平数の方が
小さくなるので、ステップS5において、ステップS3
で1を設定したビット(現在処理中のビット)を0に再
設定する。次にステップS6によりステップS5で再設
定した0のビット(現在処理中のビット)がLSBであ
るか否かの判定を行う。この場合、再設定した0のビッ
ト(現在処理中のビット)はLSBにはないので、再び
ステップS3の操作を行い、次のビットに1を設定して
新たな開平結果0011.0001 とし、ステップS4におい
て、この値を2乗して被開平数との比較を行う{(1−
6)式}。
In the equation (1-5), the flat number to be opened is smaller, so that in step S5, step S3
The bit for which 1 was set (the bit currently being processed) is reset to 0. Next, in step S6, it is determined whether the 0 bit (the bit currently being processed) reset in step S5 is an LSB. In this case, since the reset bit of 0 (the bit currently being processed) is not in the LSB, the operation of step S3 is performed again, and the next bit is set to 1 to obtain a new square root result 0011.0001, and in step S4 , This value is squared and compared with the square root to be opened.
6) Equation}.

【0018】(1−6)式においては被開平数の方が大
きいのでステップS6により、ステップS3で設定した
1のビットがLSBであるか否かの判定を行う。この場
合の開平結果は0011.0001 であり、1はLSBにあるの
で、これが最終の開平結果である。
In the equation (1-6), since the number of flat faces to be opened is larger, it is determined in step S6 whether or not the one bit set in step S3 is the LSB. The square root result in this case is 0011.0001, and since 1 is in the LSB, this is the final square root result.

【0019】二分法を用いた従来の固定小数点開平演算
器では、開平の途中過程である開平結果の2乗の結果が
8ビットでは納まらず、オーバーフローおよびアンダー
フローが発生していた。
In the conventional fixed-point square root arithmetic unit using the bisection method, the squared result of the square root result, which is a process in the middle of square root, cannot be stored in 8 bits, and overflow and underflow have occurred.

【0020】[0020]

【発明が解決しようとする課題】二分法を用いた従来の
固定小数点開平演算器は以上のような手順で開平演算を
行っていたので、開平演算の途中過程で行う乗算の結果
は被演算数の倍の長さとなり、演算結果を被演算数と同
じ固定小数点フォーマットにするために演算結果に処理
を施していた。
Since the conventional fixed-point square root arithmetic unit using the bisection method performs square root operation in the above procedure, the result of the multiplication performed in the middle of square root operation is the operand. In order to make the operation result the same fixed-point format as the operand, the operation result is processed.

【0021】従来の固定小数点開平演算器において、演
算結果をオーバフローすることなく求めるためには、ス
テップS4の乗算結果が被開平数を整数で表現できる範
囲に納まる必要がある。つまり、従来の固定小数点の開
平演算器において、整数乗算を用いて開平演算を実現す
る場合には、演算結果が整数で表現できる範囲に納まる
ような固定小数点の被開平数にしか有効に利用できない
という問題があった。
In order to obtain the operation result without overflow in the conventional fixed-point square root arithmetic unit, the multiplication result in step S4 needs to be within a range where the square root number to be expanded can be expressed by an integer. In other words, in a conventional fixed-point square root arithmetic unit, when implementing square root arithmetic using integer multiplication, it can only be effectively used for fixed-point square root squared numbers whose operation results fall within a range that can be expressed by integers. There was a problem.

【0022】本発明は以上のような問題点を解消するた
めになされたもので、固定小数点の開平演算を、整数乗
算と整数比較を用いて実現する際に、より広いビット数
で構成される固定小数点の被開平数に対して、開平演算
を可能とする固定小数点開平演算器を得ることを目的と
する。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problems, and when a fixed-point square root operation is realized using integer multiplication and integer comparison, the square root is constructed with a wider number of bits. It is an object of the present invention to obtain a fixed-point square root arithmetic unit that can perform square root arithmetic with respect to a fixed-point square root squared number.

【0023】[0023]

【課題を解決するための手段】本発明に係る固定小数点
開平演算器の第1の態様は、2Lビットの整数部と、2
Mビットの小数部で構成された固定小数点データに対し
て、開平演算を開平一次結果を得る過程と、開平二次結
果を得る過程に分けて行い、前記開平一次結果と開平二
次結果とを加算することで、2Lビットの整数部と2M
ビットの小数部で構成された開平結果を得る固定小数点
開平演算器であって、前記固定小数点データを受け、二
分法により、Lビットの整数部とMビットの小数部で構
成された前記開平一次結果を与える開平一次結果演算部
と、前記開平一次結果を受け、該結果が前記開平一次結
果演算部の最終結果であるか否かを判定する開平一次結
果判定部と、前記開平一次結果判定部において判定され
た最終開平一次結果を受け、二分法により、前記開平結
果の2Mビットの小数部のうち、下位Mビットとなるべ
き前記開平二次結果を得る開平二次結果演算部と、前記
開平二次結果を受け、該結果が前記開平二次結果演算部
の最終結果であるか否かを判定する開平二次結果判定部
と、前記開平二次結果判定部において判定された最終開
平二次結果と、前記最終開平一次結果とを加算演算し
て、開平結果を与える開平結果加算部とを備え、前記開
平二次結果演算部において、前記固定小数点データが、
前記開平一次結果と開平二次結果とを演算して得られる
前記開平結果の二乗値以上となる最大の前記開平二次結
果を与えることで、精度未満を切り捨てた開平結果を得
ることを特徴とする。
The first aspect of the fixed-point square root arithmetic unit according to the present invention comprises a 2L-bit integer part,
For fixed-point data composed of M-bit fractional parts, the square root extraction operation is divided into a step of obtaining a square root primary result and a step of obtaining a square root quadratic result, and the square root primary result and square root quadratic result are calculated. By adding, 2L-bit integer part and 2M
A fixed-point square root arithmetic unit for obtaining an square root result composed of a fractional part of bits, the square root primary part comprising an L-bit integer part and an M-bit decimal part, receiving the fixed-point data and performing a bisection method. A square root primary result calculation unit that gives a result, the square root primary result determination unit that receives the square root primary result, and determines whether the result is the final result of the square root primary result calculation unit, and the square root primary result determination unit Receiving the final square root primary result determined in the above, and using a bisection method to obtain the square root secondary result to be the lower M bits of the 2 M-bit fractional part of the square root result, A square root secondary result determination unit that receives a secondary result and determines whether the result is the final result of the square root secondary result calculation unit, and a final square secondary determined by the square root secondary result determination unit. Results and before And a final Unexamined primary result and addition operation, and a No. result adding unit that gives Unexamined result, in the Unexamined secondary result calculation unit, the fixed-point data,
The square root of the square root of the square root of the square root result obtained by calculating the square root primary result and square root secondary result is obtained by giving the maximum square root quadratic result that is greater than or equal to, to obtain a square root result truncated less than precision I do.

【0024】本発明に係る固定小数点開平演算器の第2
の態様は、前記固定小数点データの精度未満を切り捨て
た前記開平結果を受け、前記固定小数点データが、前記
開平一次結果と開平二次結果とを演算して得られる前記
開平結果の二乗値より大きくなる場合には、前記開平結
果の最下位ビットに「1」を加算し、等しい場合にはそ
のままの数値とすることで、精度未満を切り上げた開平
結果を与える精度未満切り上げ開平演算部をさらに備え
ている。
The second embodiment of the fixed-point square root arithmetic unit according to the present invention
The aspect of the square root of the square root of the square root of the square root result obtained by calculating the square root primary result and square root quadratic result, receiving the square root result of truncating less than the precision of the fixed point data, In this case, the square root extraction unit further adds a value "1" to the least significant bit of the square root result. ing.

【0025】本発明に係る固定小数点開平演算器の第3
の態様は、四捨五入用の2ビットと、2Lビットの整数
部と、2Mビットの小数部とで構成された固定小数点デ
ータに対して、開平演算を開平一次結果を得る過程と、
開平二次結果を得る過程に分けて行い、前記開平一次結
果と開平二次結果とをシフトした後に加算することで、
四捨五入用の2ビットと、2Lビットの整数部と2Mビ
ットの小数部で構成された開平結果を得る固定小数点開
平演算器であって、前記固定小数点データを受け、二分
法により、Lビットの整数部とMビットの小数部で構成
された前記開平一次結果を与える開平一次結果演算部
と、前記開平一次結果を受け、該結果が前記開平一次結
果演算部の最終結果であるか否かを判定する開平一次結
果判定部と、前記開平一次結果判定部において判定され
た最終開平一次結果を受け、二分法により、前記開平結
果の2Mビットの小数部のうち、下位Mビットと1ビッ
トの四捨五入ビットとでM+1ビットとなるべき開平二
次結果を与える開平二次結果演算部と、前記開平二次結
果を受け、該結果が前記開平二次結果演算部の最終結果
であるか否かを判定する開平二次結果判定部と、前記開
平二次結果判定部において判定された最終開平二次結果
を受け、該最終開平二次結果の四捨五入ビットである最
下位ビットが「1」であって、かつ、前記固定小数点デ
ータが、前記開平一次結果と前記開平二次結果とを演算
して得られる前記開平結果の二乗値より大きくなる場合
には、前記開平結果の最下位ビットに「1」を加算する
ことにより、精度未満を四捨五入した前記開平結果を与
える精度未満四捨五入演算部とを備えている。
The third embodiment of the fixed-point square root arithmetic unit according to the present invention
Is a process of obtaining a square root primary result by performing square root arithmetic on fixed-point data composed of 2 bits for rounding, 2 L-bit integer part, and 2 M-bit fraction part;
Performed separately in the process of obtaining the square root square result, by adding after shifting the square root primary result and square root secondary result,
A fixed-point square root arithmetic unit for obtaining a square root result composed of 2 bits for rounding, an integer part of 2L bits, and a fraction part of 2M bits, and receives the fixed-point data and obtains an L-bit integer by a bisection method. And a square root primary result calculation unit configured to provide the square root primary result, and determining whether the result is the final result of the square root primary result calculation unit. Receiving the final square root primary result determined by the square root primary result determination unit, and the lower M bits and the one-bit rounded-off bit of the 2 M-bit fractional part of the square root result by the bisection method. And a square root quadratic result calculation unit that gives a square root quadratic result to be M + 1 bits, and receives the square root quadratic result, and determines whether the result is the final result of the square root quadratic result calculation unit. The square root secondary result determination unit, and receives the final square root secondary result determined by the square root secondary result determination unit, and the least significant bit that is a rounded bit of the final square root secondary result is “1”, And, when the fixed-point data is larger than the square value of the square root result obtained by calculating the square root primary result and the square root secondary result, the least significant bit of the square root result is set to “1”. An arithmetic unit for rounding less than the precision to give the square root result rounded to the nearest whole number by adding.

【0026】[0026]

【作用】本発明に係る固定小数点開平演算器の第1の態
様によれば、2Lビットの整数部と、2Mビットの小数
部で構成された固定小数点データに対して開平演算を行
う場合に、開平一次結果演算部において、二分法によ
り、Lビットの整数部とMビットの小数部で構成された
開平一次結果を求め、開平二次結果演算部において、固
定小数点データが、開平一次結果と開平二次結果とを演
算して得られる開平結果の二乗値以上となるような、開
平二次結果を二分法により求め、開平一次結果と開平二
次結果とを演算することで、演算過程においてオーバー
フロー、アンダーフローが発生せず、精度未満を切り捨
てた開平結果を得ることができる。
According to the first aspect of the fixed-point square root arithmetic unit according to the present invention, when performing square-root arithmetic on fixed-point data composed of a 2L-bit integer part and a 2M-bit decimal part, A square root primary result calculation unit obtains a square root primary result composed of an L-bit integer part and an M-bit fractional part by a dichotomy, and in the square root quadratic result calculation unit, the fixed-point data is converted to the square root primary result and the square root. The square root of the square root result of the square root result obtained by calculating the quadratic result is obtained by the dichotomy, and the square root primary result and square root quadratic result are calculated. In this case, an underflow does not occur and a square root less than the precision can be obtained.

【0027】本発明に係る固定小数点開平演算器の第2
の態様によれば、精度未満切り上げ開平演算部を備える
ことで、固定小数点データの精度未満を切り捨てた開平
結果に対して、固定小数点データが、前記開平一次結果
と開平二次結果とを演算して得られる開平結果の二乗値
より大きくなる場合には、前記開平結果の最下位ビット
に「1」を加算し、等しい場合にはそのままの数値とす
ることで、演算過程においてオーバーフロー、アンダー
フローが発生せず、精度未満を切り上げた開平結果を得
ることができる。
The second embodiment of the fixed-point square root arithmetic unit according to the present invention
According to the aspect, by providing the less-precision round-up square root operation unit, for the square root result of truncating less than the precision of the fixed-point data, fixed-point data, the square root primary result and the square root quadratic result are calculated. If the squared value of the square root result is larger than the square value of the square root result, "1" is added to the least significant bit of the square root result. It is possible to obtain a square root result that does not occur and is rounded up below the precision.

【0028】本発明に係る固定小数点開平演算器の第3
の態様によれば、四捨五入用の2ビットと、2Lビット
の整数部と、2Mビットの小数部で構成された固定小数
点データに対して開平演算を行う場合に、開平一次結果
演算部において、二分法により、Lビットの整数部とM
ビットの小数部で構成された開平一次結果を求め、開平
二次結果演算部において、固定小数点データが、開平一
次結果と開平二次結果とを演算して得られる開平結果の
二乗値以上となるような、M+1ビットの開平二次結果
を二分法により求める。次に、開平二次結果判定部にお
いて、この開平二次結果が開平二次結果演算部における
最終結果であるか否かを判定し、判定された最終開平二
次結果を精度未満四捨五入演算部に与えることにより、
該開平結果の四捨五入ビットである最下位ビットが
「1」であって、かつ、固定小数点データが、開平一次
結果と最終開平二次結果とを加算して得られる開平結果
の二乗値より大きくなる場合には、開平結果の最下位ビ
ットに「1」を加算することにより、演算過程において
オーバーフロー、アンダーフローが発生せず、精度未満
を四捨五入した開平結果を得ることができる。
The third embodiment of the fixed-point square root arithmetic unit according to the present invention
According to the aspect, when the square root calculation is performed on the fixed-point data composed of 2 bits for rounding, an integer part of 2L bits, and a fraction part of 2M bits, the square root primary result calculation unit performs The integer part of L bits and M
A square root primary result composed of a fractional part of a bit is obtained, and a square point quadratic result calculation unit has fixed-point data that is equal to or larger than the square value of the square root result obtained by calculating the square root primary result and the square root quadratic result. Such an M + 1-bit square root quadratic result is obtained by a bisection method. Next, in the square root secondary result determination unit, it is determined whether or not this square root secondary result is the final result in the square root secondary result calculation unit, and the determined final square root secondary result is rounded to the precision less than the rounding calculation unit. By giving
The least significant bit which is the rounded bit of the square root result is "1", and the fixed-point data is larger than the square value of the square root result obtained by adding the square root primary result and the final square root secondary result. In such a case, by adding "1" to the least significant bit of the square root result, overflow and underflow do not occur in the calculation process, and the square root less than the precision can be obtained.

【0029】[0029]

【実施例】【Example】

<第1の実施例>本発明に係る固定小数点開平演算器の
第1の実施例を図1を用いて説明する。図1は本実施例
の構成を示すブロック図である。図1において、被開平
数データは、被開平数データを入力するデータ入力部1
Aから、開平一次結果演算部2Aに与えられ、レジスタ
またはメモリ群で構成されるデータ記憶部5Aとの間で
データの交換を行いつつ、演算処理を施されて開平一次
結果を得る。この結果は、開平一次結果判定部3Aに与
えられ、演算結果の適否について判定が行われ、適当と
判断されれば開平二次結果演算部7Aに与えられ、不適
と判断されれば再び開平一次結果演算部2Aで再演算さ
れる。
<First Embodiment> A first embodiment of a fixed-point square root arithmetic unit according to the present invention will be described with reference to FIG. FIG. 1 is a block diagram showing the configuration of this embodiment. In FIG. 1, the data to be exposed is a data input unit 1 for inputting the data to be exposed.
From A, the square root primary result calculation unit 2A is subjected to arithmetic processing while exchanging data with a data storage unit 5A composed of a register or a memory group to obtain a square root primary result. This result is provided to a square root primary result determination unit 3A, and a determination is made as to whether or not the calculation result is appropriate. If it is determined to be appropriate, it is provided to a square root secondary result calculation unit 7A. Recalculation is performed by the result calculation unit 2A.

【0030】開平二次結果演算部4Aでは、被開平数と
開平一次結果を用いて開平二次結果を求める演算が行わ
れ、開平二次結果を得る。この結果は、開平二次結果判
定部7Aに与えられ、演算結果の適否について判定が行
われ、適と判断されれば、開平結果加算部8Aにおい
て、小数点位置を考慮して開平一次結果と開平二次結果
の加算演算が施され、最終的な開平結果が開平結果出力
部9Aに出力される。
In the square root quadratic result calculation unit 4A, a calculation for obtaining the square root quadratic result is performed using the square root square root and the square root square primary result, and the square root quadratic result is obtained. This result is provided to a square root secondary result determination unit 7A, and a determination is made as to whether or not the calculation result is appropriate. If it is determined that the calculation result is appropriate, a square root primary result and square root extraction are performed in a square root result addition unit 8A in consideration of the decimal point position. The addition of the secondary result is performed, and the final square root result is output to the square root result output unit 9A.

【0031】このとき、データ入力部1A、開平一次結
果演算部2A、開平一次結果判定部3A、開平二次結果
演算部4A、開平二次結果判定部7A、開平結果加算部
8A、開平結果出力部9A、データ記憶部5Aは制御手
段6Aにより制御される。
At this time, the data input unit 1A, square root primary result calculation unit 2A, square root primary result determination unit 3A, square root secondary result calculation unit 4A, square root secondary result determination unit 7A, square root result addition unit 8A, square root result output The unit 9A and the data storage unit 5A are controlled by the control unit 6A.

【0032】本実施例に係る固定小数点開平演算は、そ
の値を2乗したときに被開平数と同じビット数となるよ
うに、被開平数の半分のビット数で構成される開平一次
結果と、開平一次結果で表現できない下位側を、小数点
以下のビット数の半分のビット数で表した開平二次結果
を用いて求めることにより、固定小数点の精度範囲未満
を切捨てた演算結果を得ることができる。
The fixed-point square root operation according to the present embodiment uses a square root primary result consisting of half the number of bits to be squared so that the squared value has the same number of bits as the square root to be squared. By calculating the lower side that cannot be expressed by the square root primary result using the square root quadratic result expressed by half the number of bits below the decimal point, it is possible to obtain the operation result truncated below the fixed-point precision range. it can.

【0033】次に、以上説明した図1と、図2および図
3に示す本実施例の動作を説明するフローチャートに従
って具体的な演算例を説明する。例えば、8ビットの整
数加乗算を用いて被開平数9.5625の開平演算を行
う場合、該被開平数は、整数部4ビット、小数部4ビッ
トの固定小数点表現では1001.1001 で表される。
Next, a specific calculation example will be described with reference to FIG. 1 described above and the flowcharts for explaining the operation of the present embodiment shown in FIGS. For example, in a case where the square root of 9.5625 is performed using 8-bit integer addition and multiplication, the square root is represented by 1001.1001 in a fixed-point representation of a 4-bit integer part and a 4-bit decimal part.

【0034】まず、ステップS1aとしてデータ入力部
1Aから被開平数1001.1001 を入力し、ステップS2a
として、データ記憶部5Aに、整数部2ビット(Lビッ
ト)、小数部2ビット(Mビット)の固定小数点フォー
マットを用意する。次に、ステップS3aとして開平一
次結果演算部2Aにおいて、被開平数1001.1001 の開平
一次結果の初期値として10.00 を与える。
First, as step S1a, the number of squares to be exposed 1001.1001 is input from the data input section 1A, and step S2a
In the data storage unit 5A, a fixed-point format having an integer part of 2 bits (L bits) and a decimal part of 2 bits (M bits) is prepared. Next, in step S3a, the square root primary result calculation unit 2A gives 10.00 as an initial value of the square root primary result of the square root squared number 1001.1001.

【0035】[0035]

【数3】 (Equation 3)

【0036】ステップS4aにおいて、開平一次結果の
初期値の2乗と被開平数との比較を行う。開平一次結果
の初期値の2乗は被開平数には満たない{(2−1)
式}ので、開平一次結果判定部3Aにおいて、ステップ
S6aにより、ステップS3aで設定した1のビットが
LSBであるか否かの判定を行う。初期値としてステッ
プS3aで設定された1はLSBの位置にないので再び
ステップS3aに戻り、開平一次結果の初期値の次のビ
ットに1を設定して新たな開平一次結果11.00 とし、ス
テップS4aにおいて、この値を2乗して被開平数との
比較を行う{(2−2)式}。
In step S4a, the square of the initial value of the square root primary result is compared with the square root number to be squared. The square of the initial value of the square root primary result is less than the square root number to be squared (2-1)
In equation (1), the square root primary result determination unit 3A determines in step S6a whether the one bit set in step S3a is an LSB. Since 1 set in step S3a as an initial value is not at the position of the LSB, the process returns to step S3a again, sets 1 to the next bit of the initial value of the square root primary result to obtain a new square root primary result 11.00, and in step S4a , This value is squared and compared with the square root to be opened {Equation (2-2)}.

【0037】(2−2)式において、開平一次結果を2
乗しても被開平数には満たないので開平一次結果判定部
3Aにおいて、ステップS6aにより、ステップS3a
で設定した1のビットがLSBであるか否かの判定を行
う。この場合の開平一次結果は11.00 であり、1はLS
Bにはないので、再びステップS3aの操作を行い、次
のビットに1を設定して新たな開平一次結果11.10 と
し、ステップS4aにおいて、この値を2乗して被開平
数との比較を行う{(2−3)式}。
In the equation (2-2), the square root primary result is expressed as 2
Since the square root does not reach the number of square roots to be squared, the square root square primary result determination unit 3A performs step S3a in step S6a.
It is determined whether or not the one bit set in (1) is the LSB. In this case, the square root primary result is 11.00, and 1 is LS
Since it is not in B, the operation in step S3a is performed again, the next bit is set to 1 to obtain a new square root primary result 11.10, and in step S4a, this value is squared and compared with the square root squared number. {Equation (2-3)}.

【0038】(2−3)式においては、被開平数の方が
小さくなるので、ステップS5aにおいて、ステップS
3aで1を設定したビットを0に再設定する。次に開平
一次結果判定部3Aにおいて、ステップS6aによりス
テップS5aで再設定した0のビットがLSBであるか
否かの判定を行う。この場合、再設定した0はLSBに
はないので、再びステップS3aの操作を行い、次のビ
ットに1を設定して新たな開平一次結果11.01 とし、ス
テップS4aにおいて、この値を2乗して被開平数との
比較を行う{(2−4)式}。
In equation (2-3), since the number of flat faces to be opened is smaller, step S5a is executed in step S5a.
The bit for which 1 was set in 3a is reset to 0. Next, the square root primary result determination unit 3A determines in step S6a whether the 0 bit reset in step S5a is the LSB. In this case, since the reset 0 does not exist in the LSB, the operation of step S3a is performed again, the next bit is set to 1 to obtain a new square root primary result 11.01, and this value is squared in step S4a. A comparison with the number of square roots to be opened {Equation (2-4)}.

【0039】(2−4)式においては、被開平数の方が
小さくなるので、ステップS5aにおいて、ステップS
3aで1を設定したビットを0に再設定する。次に開平
一次結果判定部3Aにおいて、ステップS6aによりス
テップS5aで再設定した0のビットがLSBであるか
否かの判定を行う。この場合、再設定した0はLSBに
あるので、最終的な開平一次結果は11.00 となる。
In the equation (2-4), since the number of flat faces to be opened is smaller, the step S5a is executed in the step S5a.
The bit for which 1 was set in 3a is reset to 0. Next, the square root primary result determination unit 3A determines in step S6a whether the 0 bit reset in step S5a is the LSB. In this case, since the reset 0 is in the LSB, the final square root primary result is 11.00.

【0040】次に開平二次結果を求める。まずステップ
S7aとして、データ記憶部5Aに、小数部4ビット
(2Mビット)の下位2ビット(Mビット)の開平二次
結果のフォーマットを用意する。開平二次結果は、被開
平数−(開平一次結果+開平二次結果)2 が正の最小と
なるような値である。すなわち、被開平数をx、開平一
次結果をy、開平二次結果をzとして上式を展開し、x
−y2 −2yz−z2 とし、これを変形して、
Next, the square root quadratic result is obtained. First, as step S7a, a format of a square root quadratic result of lower 2 bits (M bits) of a decimal part 4 bits (2M bits) is prepared in the data storage unit 5A. The square root squared result is a value such that square root squared number minus (primary square root squared result + square root squared result) 2 is a positive minimum. That is, the above equation is developed by defining the square root squared number as x, the square root squared result as y, and the square root squared result as z, and x
−y 2 −2yz−z 2 , which is transformed into

【0041】[0041]

【数4】 (Equation 4)

【0042】とした場合に、この関係を満たす最大のz
が求める値である。まず、(2−5)式の左辺は次式の
ようになる。
Where z is the maximum z that satisfies this relationship.
Is the desired value. First, the left side of equation (2-5) is as follows.

【0043】[0043]

【数5】 (Equation 5)

【0044】次に、開平二次結果演算部4Aにおいて、
ステップS8aとして開平二次結果zを仮定する。この
場合の開平二次結果は小数部4ビットの下位2ビット部
分であるので、z=0.0010として(2−5)式の右辺を
求めると、
Next, in the square root quadratic result calculation unit 4A,
The square root quadratic result z is assumed as step S8a. Since the square root quadratic result in this case is the lower 2 bits of the decimal part 4 bits, the right side of the equation (2-5) is obtained by setting z = 0.010.

【0045】[0045]

【数6】 (Equation 6)

【0046】となる。ここで、整数演算するためには小
数点位置を考慮する必要があるので、以下の手順に従っ
て小数点位置を変更する。
Is as follows. Here, in order to perform the integer operation, it is necessary to consider the decimal point position. Therefore, the decimal point position is changed according to the following procedure.

【0047】まず、(2−6)式で示される(2−5)
式の左辺の計算結果から小数点を除去して整数と見な
し、次に、(2−7)式で示される(2−5)式の右辺
の計算結果から小数点を除去すると以下のようになる。
First, (2-5) shown by the equation (2-6)
The decimal point is removed from the calculation result on the left side of the equation and regarded as an integer, and then the decimal point is removed from the calculation result on the right side of equation (2-5) shown in equation (2-7), as follows.

【0048】[0048]

【数7】 (Equation 7)

【0049】ここで、両辺の桁を揃えるため左辺を4ビ
ット(2Mビット)MSB側にシフトし、右辺の開平一
次結果を2ビット(Mビット)MSB側にシフトし、開
平二次結果を4ビット(2Mビット)MSB側にシフト
する。
Here, in order to align the digits on both sides, the left side is shifted to the 4-bit (2M bit) MSB side, the square root primary result on the right side is shifted to the 2-bit (M bit) MSB side, and the square root quadratic result is converted to 4 bits (M bits). Bit (2M bits) is shifted to the MSB side.

【0050】次にステップS9aとして、両辺の比較を
行う{(2−8)式}。
Next, as step S9a, both sides are compared {Equation (2-8)}.

【0051】[0051]

【数8】 (Equation 8)

【0052】(2−8)式においては左辺<右辺なの
で、ステップS10aにおいて、ステップS8aで1を
設定したビットを0に再設定する。次に開平二次結果判
定部7Aにおいて、ステップS11aによりステップS
10aで再設定した0のビットがLSBであるか否かの
判定を行う。この場合、再設定した0はLSBにはない
ので、再びステップS8aの操作を行い、次のビットに
1を設定して新たな開平二次結果01とし、ステップS9
aにおいて、左辺と右辺との比較を行う{(2−9)
式}。
In equation (2-8), since the left side is smaller than the right side, in step S10a, the bit for which 1 was set in step S8a is reset to 0. Next, in the square root secondary result determination unit 7A, the step S11a is performed in the step S11a.
It is determined whether the 0 bit reset in 10a is an LSB. In this case, since the reset 0 is not in the LSB, the operation of step S8a is performed again, and the next bit is set to 1 to obtain a new square root secondary result 01, and step S9
In a, the left side and the right side are compared {(2-9)
formula}.

【0053】(2−9)式においては左辺>右辺なの
で、開平二次結果判定部7Aにおいて、ステップS11
aにより、ステップS8aで設定した1のビットがLS
Bであるか否かの判定を行う。この場合、1はLSBに
あるので、最終の開平二次結果として01を得る。そし
て、開平結果加算部8Aにおいて、ステップS12aに
より、開平一次結果から小数点を除去して整数とみな
し、2ビット(Mビット)MSB側にシフトした値であ
る110000と整数加算演算することにより、最終の開平結
果110001を得る。開平結果の小数点位置を合わせるため
に、開平結果のLSB側から4ビット(2Mビット)め
の位置を小数点位置とすることにより、整数部4ビッ
ト、小数部4ビットの精度未満を切り捨てた開平結果00
11.0001 を得ることができる。
In the equation (2-9), since the left side is greater than the right side, the square root quadratic result determination unit 7A determines in step S11
a, the 1 bit set in step S8a is set to LS
B is determined. In this case, since 1 is in the LSB, 01 is obtained as the final square root quadratic result. Then, in step S12a, the square root extraction result adding unit 8A removes the decimal point from the square root primary result, regards the result as an integer, and performs an integer addition operation on the value shifted to the 2-bit (M-bit) MSB side, thereby obtaining the final result. To obtain the square root result 110001. In order to match the decimal point position of the square root result, the fourth bit (2M bits) from the LSB side of the square root result is used as the decimal point position, and the square root result with the precision less than the integer part 4 bits and the decimal part 4 bits rounded down 00
11.0001 can be obtained.

【0054】<第2の実施例>本発明に係る固定小数点
開平演算器の第2の実施例を図4を用いて説明する。図
4は本実施例の構成を示すブロック図である。図4にお
いて第1の実施例で得られた精度未満を切り捨てた開平
結果を、精度未満切り捨てデータ入力部1Bから、精度
未満切り上げ開平演算部2Bに与える。
<Second Embodiment> A second embodiment of the fixed-point square root arithmetic unit according to the present invention will be described with reference to FIG. FIG. 4 is a block diagram showing the configuration of this embodiment. In FIG. 4, the square root result obtained by rounding off less than the precision obtained in the first embodiment is provided from the lower precision rounded down data input unit 1B to the lower precision rounding and square root calculator 2B.

【0055】精度未満切り上げ開平演算部2Bではレジ
スタまたはメモリ群で構成されるデータ記憶部5Bとの
間でデータの交換を行いつつ、開平二次結果について演
算処理を行う。
The less-precision rounded-square operation unit 2B performs an operation process on the quadratic squared result while exchanging data with the data storage unit 5B composed of a register or a memory group.

【0056】開平結果加算部3Bでは、精度未満を切り
上げた開平二次結果と、開平一次結果を加算演算を行
い、精度未満を切り上げた開平結果が開平結果出力部4
Bに出力される。
The square root addition unit 3B performs an addition operation on the square root quadratic result rounded up to below the precision and the square root primary result, and the square root squared result rounded up to below the precision is the square root result output unit 4B.
B.

【0057】このとき、精度未満切り捨てデータ入力部
1B、精度未満切り上げ開平演算部2B、開平結果加算
部3B、開平結果出力部4B、データ記憶部5Bは制御
手段6Bにより制御される。
At this time, the less-precision rounded-down data input unit 1B, the less-precision round-up square root calculator 2B, the square root result adding unit 3B, the square root result output unit 4B, and the data storage unit 5B are controlled by the control unit 6B.

【0058】次に、以上説明した図4と、図5に示す本
実施例の動作を説明するフローチャートに従って具体的
な演算例を説明する。
Next, a specific example of calculation will be described with reference to FIGS. 4 and 5 which are described above and which illustrate the operation of this embodiment.

【0059】まず、ステップS1bとして第1の実施例
と同様の手順で、固定小数点の精度未満を切り捨てた開
平演算結果を求め、精度未満切り捨てデータ入力部1B
から、精度未満切り上げ開平演算部2Bに与える。開平
結果の精度未満を切り上げた場合は、第1の実施例で説
明した開平二次結果を求める(2−5)式は左辺<右辺
となるはずである。
First, as a step S1b, a square root operation result obtained by truncating less than the precision of the fixed point is obtained in the same procedure as in the first embodiment, and the fractional precision truncated data input section 1B is obtained.
From the precision to the round-up and square-root calculation unit 2B. If the precision of the square root result is rounded up, the expression (2-5) for obtaining the square root quadratic result described in the first embodiment should be such that left side <right side.

【0060】第1の実施例で用いた(2−5)式では左
辺≧右辺となるような開平二次結果を求めたが、本実施
例では左辺≦右辺となるような最小の開平二次結果を必
要とするので、(2−5)式で左辺>右辺となる最大の
開平二次結果のLSBに1を加えることにより、左辺<
右辺とすることができる。
In equation (2-5) used in the first embodiment, the square root quadratic result that satisfies left side ≧ right side is obtained. In this embodiment, the minimum square root quadratic result that satisfies left side ≦ right side is obtained. Since the result is needed, by adding 1 to the LSB of the largest square root quadratic result that satisfies left-hand side> right-hand side in equation (2-5), left-hand side <
Can be the right side.

【0061】具体的には、精度未満切り上げ開平演算部
2Bにおいて、ステップS2bとして、実施例1で説明
した(2−9)式の左辺と右辺との比較を行う。当然、
左辺>右辺なので、ステップS3bとして、開平二次結
果01のLSBに1を加えて、開平二次結果10を得る。こ
こで、左辺=右辺の場合はそのまま01が開平二次結果と
なる。
More specifically, in the less-precision round-up and square root calculator 2B, the left side and the right side of the equation (2-9) described in the first embodiment are compared as step S2b. Of course,
Since the left side is greater than the right side, 1 is added to the LSB of the square root quadratic result 01 to obtain the square root quadratic result 10 in step S3b. Here, when left side = right side, 01 is the square root square result as it is.

【0062】次に開平結果加算部3Bにおいて、ステッ
プS4bとして、開平一次結果から小数点を除去して整
数とみなし、2ビット(Mビット)MSB側にシフトし
た値である110000と整数加算演算することにより、最終
の開平結果110010を得る。最後に開平結果の小数点位置
を合わせるために、開平結果のLSB側から4ビット
(2Mビット)めの位置を小数点位置とすることによ
り、整数部4ビット、小数部4ビットの精度未満を切り
上げた開平結果0011.0010 を得ることができる。
Next, in step S4b, the square root extraction result adder 3B removes the decimal point from the square root primary result and regards the result as an integer, and performs an integer addition operation on 110000 which is a value shifted to the 2-bit (M-bit) MSB side. As a result, a final square root result 110010 is obtained. Finally, in order to adjust the decimal point position of the square root result, the position of the fourth bit (2M bits) from the LSB side of the square root result is set as the decimal point position, thereby rounding up the precision of the integer part 4 bits and the decimal part 4 bits. The square root result 0011.0010 can be obtained.

【0063】<第3の実施例>本発明に係る固定小数点
開平演算器の第3の実施例を図6を用いて説明する。図
6は本実施例の構成を示すブロック図である。図6にお
いて被開平数データは、被開平数データを入力するデー
タ入力部1Cから、開平一次結果演算部2Cに与えら
れ、レジスタまたはメモリ群で構成されるデータ記憶部
5Cとの間でデータの交換を行いつつ、演算処理を施さ
れて開平一次結果を得る。この結果は、開平一次結果判
定部3Cに与えられ、演算結果の適否について判定が行
われ、適と判断されれば開平二次結果演算部4Cに与え
られ、不適と判断されれば再び開平一次結果演算部2C
で再演算される。
<Third Embodiment> A third embodiment of the fixed-point square root arithmetic unit according to the present invention will be described with reference to FIG. FIG. 6 is a block diagram showing the configuration of the present embodiment. In FIG. 6, the square root data is supplied from a data input unit 1C for inputting the square root data to a square root primary result calculation unit 2C, and the data is exchanged with a data storage unit 5C composed of a register or a memory group. While performing the exchange, the arithmetic processing is performed to obtain the first square root result. This result is provided to the square root primary result determination unit 3C, and a determination is made as to whether or not the calculation result is appropriate. If the calculation result is determined to be appropriate, the determination is provided to the square root secondary result calculation unit 4C. Result calculation unit 2C
Is recalculated.

【0064】開平二次結果演算部4Cでは、被開平数と
開平一次結果を用いて開平二次結果を求める演算が行わ
れ、開平二次結果を得る。この結果は、開平二次結果判
定部7Cに与えられ、演算結果の適否について判定が行
われ、適と判断されれば、開平結果加算部8Cにおい
て、小数点位置を考慮して開平一次結果と開平二次結果
の加算演算が施される。
The square root quadratic result calculation unit 4C performs an operation to obtain the square root square root result using the square root square root and the square root square root primary result, and obtains the square root square root result. This result is given to the square root secondary result determination unit 7C, and the appropriateness of the calculation result is determined. If determined to be appropriate, the square root primary result and square root extraction are performed in the square root result addition unit 8C in consideration of the decimal point position. An addition operation of the secondary result is performed.

【0065】開平結果四捨五入演算部9Cにおいては、
開平結果加算部8Cで得られた開平結果のLSBについ
て演算を行い、精度未満のビットについて四捨五入を施
した開平結果を得ることができ、最終的な開平結果が開
平結果出力部10Cに出力される。
In the square root result rounding operation unit 9C,
An operation is performed on the LSB of the square root result obtained by the square root result adding unit 8C to obtain a square root result in which bits less than the precision are rounded, and the final square root result is output to the square root result output unit 10C. .

【0066】このとき、データ入力部1C、開平一次結
果演算部2C、開平一次結果判定部3C、開平二次結果
演算部4C、開平二次結果判定部7C、開平結果加算部
8C、開平結果四捨五入演算部9C、開平結果出力部1
0C、データ記憶部5Cは制御手段6Cにより制御され
る。
At this time, the data input section 1C, the square root primary result calculation section 2C, the square root primary result determination section 3C, the square root secondary result calculation section 4C, the square root secondary result determination section 7C, the square root result addition section 8C, and the square root rounding result are rounded. Calculation unit 9C, square root result output unit 1
0C, the data storage unit 5C is controlled by the control unit 6C.

【0067】次に、以上説明した図6と、図7および図
8に示す本実施例の動作を説明するフローチャートに従
って具体的な演算例を説明する。例えば、固定小数点表
現で精度未満のビットについて四捨五入を施し、有効数
字8ビットの開平結果を得る場合においては、四捨五入
を施すことを考慮して、被開平数は予め四捨五入のため
に2ビットを加えて10ビットで表す。すなわち、被開
平数9.5625の開平演算においては、該被開平数を
四捨五入用の2ビット、整数部4ビット、小数部4ビッ
トの固定小数点表現で表すと、001001.1001 となる。な
お、四捨五入用の2ビットはLSB側に付加しても良
い。
Next, a specific example of calculation will be described with reference to FIG. 6 described above and FIGS. 7 and 8 which are flowcharts illustrating the operation of this embodiment. For example, in the case where bits less than the precision in the fixed-point representation are rounded off to obtain a square root result of 8 significant digits, the square root to be rounded is added with 2 bits in advance in consideration of the rounding. And represented by 10 bits. In other words, in the square root extraction of the square root squared 9.5625, if the square root squared number is represented by a fixed-point representation of 2 bits for rounding, 4 bits for the integer part, and 4 bits for the decimal part, the result is 001011.1001. Note that 2 bits for rounding may be added to the LSB side.

【0068】二分法を用いた従来の開平演算器による開
平結果は、
The square root result of the conventional square root operator using the dichotomy is

【0069】[0069]

【数9】 (Equation 9)

【0070】のようになり、開平値として000011.0001
が得られる。二分法を用いた従来の固定小数点開平演算
器では、開平の途中過程である開平結果の2乗の結果が
10ビットでは納まらず、オーバーフローおよびアンダ
ーフローが発生する。
And the square root value is 000011.0001
Is obtained. In the conventional fixed-point square root arithmetic unit using the bisection method, the squared result of the square root result in the process of square root does not fit in 10 bits, and overflow and underflow occur.

【0071】そこで、図6に示した本実施例を適用する
と、同じ演算が以下のように実施される。
Therefore, when the present embodiment shown in FIG. 6 is applied, the same operation is performed as follows.

【0072】まず、ステップS1cとしてデータ入力部
1Cから被開平数001001.1001 を入力し、ステップS2
cとしてデータ記憶部5Cに、整数部2ビット、小数部
2ビットの開平一次結果用の固定小数点フォーマットを
用意する。
First, as step S1c, the number of squares to be exposed, 001001.1001, is input from the data input section 1C.
As c, a fixed-point format for the square root primary result of 2 bits for the integer part and 2 bits for the decimal part is prepared in the data storage unit 5C.

【0073】次に、ステップS3cとして開平一次結果
演算部2Cにおいて、被開平数001001.1001 の開平一次
結果の初期値として10.00 を与える。
Next, in step S3c, the square root primary result calculation unit 2C gives 10.00 as the initial value of the square root primary result of the square root to be squared 001001.1001.

【0074】[0074]

【数10】 (Equation 10)

【0075】ステップS4cにおいて、開平一次結果の
初期値の2乗と被開平数との比較を行う。開平一次結果
の初期値の2乗は被開平数には満たない{(3−1)
式}ので、開平一次結果判定部3Cにおいて、ステップ
S6cにより、ステップS3cで設定した1のビットが
LSBであるか否かの判定を行う。ステップS3cで設
定された1はLSBの位置にはないので再びステップS
3cの操作を行い、次のビットに1を設定して新たな開
平一次結果11.00 とし、ステップS4cにおいて、この
値を2乗して被開平数との比較を行う{(3−2)
式}。
In step S4c, the square of the initial value of the square root primary result is compared with the square root number to be squared. The square of the initial value of the square root primary result is less than the square root squared. (3-1)
In equation (1), the square root primary result determination unit 3C determines in step S6c whether the one bit set in step S3c is the LSB. Since 1 set in step S3c is not at the LSB position, step S3c is performed again.
By performing the operation of 3c, the next bit is set to 1 to obtain a new square root primary result 11.00, and in step S4c, this value is squared and compared with the square root squared {3-2}
formula}.

【0076】(3−2)式において、開平一次結果を2
乗しても被開平数には満たないので開平一次結果判定部
3Cにおいて、ステップS6cにより、ステップS3c
で設定した1のビットがLSBであるか否かの判定を行
う。この場合の開平一次結果は11.00 であり、1はLS
Bにはないので、再びステップS3cの操作を行い、次
のビットに1を設定して新たな開平一次結果11.10 と
し、ステップS4cにおいて、この値を2乗して被開平
数との比較を行う{(3−3)式}。
In the equation (3-2), the square root primary result is expressed as 2
Since the square root is less than the square root number to be squared, the square root square primary result determination unit 3C performs step S3c in step S6c.
It is determined whether or not the one bit set in (1) is the LSB. In this case, the square root primary result is 11.00, and 1 is LS
Since it is not in B, the operation in step S3c is performed again, the next bit is set to 1 to obtain a new square root primary result 11.10, and in step S4c, this value is squared and compared with the square root squared number. {Equation (3-3)}.

【0077】(3−3)式においては、被開平数の方が
小さくなるので、ステップS5cにおいて、ステップS
3cで1を設定したビットを0に再設定する。次に開平
一次結果判定部3Cにおいて、ステップS6cによりス
テップS5cで再設定した0のビットがLSBであるか
否かの判定を行う。この場合、再設定した0はLSBに
はないので、再びステップS3cの操作を行い、次のビ
ットに1を設定して新たな開平一次結果11.01 とし、ス
テップS4cにおいて、この値を2乗して被開平数との
比較を行う{(3−4)式}。
In equation (3-3), the number of flat faces to be opened is smaller.
The bit for which 1 was set in 3c is reset to 0. Next, in the square root primary result determination unit 3C, it is determined in step S6c whether the 0 bit reset in step S5c is the LSB. In this case, since the reset 0 is not in the LSB, the operation in step S3c is performed again, the next bit is set to 1 to obtain a new square root primary result 11.01, and in step S4c, this value is squared and A comparison with the number of roots to be opened is performed {Equation (3-4)}.

【0078】(3−4)式においては、被開平数の方が
小さくなるので、ステップS5cにおいて、ステップS
3cで1を設定したビットを0に再設定する。次に開平
一次結果判定部3Cにおいて、ステップS6cによりス
テップS5cで再設定した0のビットがLSBであるか
否かの判定を行う。この場合、再設定した0はLSBに
あるので、最終的な開平一次結果は11.00 となる。
In the equation (3-4), since the number of flat faces to be opened is smaller, the step S5c is executed in the step S5c.
The bit for which 1 was set in 3c is reset to 0. Next, in the square root primary result determination unit 3C, it is determined in step S6c whether the 0 bit reset in step S5c is the LSB. In this case, since the reset 0 is in the LSB, the final square root primary result is 11.00.

【0079】次に開平二次結果を求める。まずステップ
S7cとして、データ記憶部5Cに、小数部4ビット
(2Mビット)の下位2ビット(Mビット)と、四捨五
入用ビットの1ビットの計3ビットの開平二次結果のフ
ォーマットを用意する。開平二次結果は、被開平数−
(開平一次結果+開平二次結果)2 が正の最小となるよ
うな値である。すなわち、被開平数をx、開平一次結果
をy、開平二次結果をzとして上式を展開し、x−y2
−2yz−z2 とし、これを変形して、(2−5)式を
得る。この関係を満たす最大のzが求める値である。
Next, the square root quadratic result is obtained. First, in step S7c, a format of a square root quadratic result of 3 bits, that is, 2 bits of lower 2 bits (M bits) of 4 bits (2M bits) and 1 bit of rounding off is prepared in the data storage unit 5C. The square root squared result is the square root squared number minus
(Primary square root result + quadratic square root result) A value such that 2 is a positive minimum. That is, the above equation is developed with x as the square root squared, y as the square root primary result, and z as the square root quadratic result, and xy 2
−2yz−z 2 , which is modified to obtain the expression (2-5). The maximum z that satisfies this relationship is the value to be obtained.

【0080】(2−5)式の左辺は(2−6)式のよう
になる。次に、開平二次結果演算部4Cにおいて、ステ
ップS8cとして開平二次結果zを仮定する。この場合
の開平二次結果は小数部4ビットの下位2ビット部分と
四捨五入用の1ビットであるので、z=0.00100 として
(2−5)式の右辺を求めると、
The left side of equation (2-5) is as shown in equation (2-6). Next, the square root quadratic result calculation unit 4C assumes the square root quadratic result z as step S8c. Since the square root quadratic result in this case is the lower 2 bits of the 4 bits of the decimal part and 1 bit for rounding, when z = 0.00100, the right side of the equation (2-5) is obtained.

【0081】[0081]

【数11】 [Equation 11]

【0082】となる。ここで、整数演算するためには小
数点位置を考慮する必要があるので、以下の手順に従っ
て小数点位置を変更する。
Is obtained. Here, in order to perform the integer operation, it is necessary to consider the decimal point position. Therefore, the decimal point position is changed according to the following procedure.

【0083】まず、(2−6)式で示される(2−5)
式の左辺の計算結果から小数点を除去して整数と見な
し、次に、(3−5)式で示される(2−5)式の右辺
の計算結果から小数点を除去すると以下のようになる。
First, (2-5) shown by the equation (2-6)
The decimal point is removed from the calculation result on the left side of the equation and regarded as an integer, and then the decimal point is removed from the calculation result on the right side of equation (2-5) shown in equation (3-5), and the result is as follows.

【0084】[0084]

【数12】 (Equation 12)

【0085】ここで、両辺の桁を揃えるため左辺を6ビ
ット(2Mビット+2ビット)MSB側にシフトし、開
平一次結果を3ビット(M+1ビット)MSB側にシフ
トする。
Here, in order to align the digits on both sides, the left side is shifted to the 6-bit (2M bits + 2 bits) MSB side, and the square root primary result is shifted to the 3-bit (M + 1 bits) MSB side.

【0086】次にステップS9cとして、両辺の比較を
おこなう{(3−6)式}。
Next, as step S9c, both sides are compared {Equation (3-6)}.

【0087】[0087]

【数13】 (Equation 13)

【0088】(3−6)式においては左辺<右辺なの
で、ステップS10cにおいて、ステップS8cで1を
設定したビットを0に再設定する。次にステップS11
cによりステップS10cで再設定した0のビットがL
SBであるか否かの判定を行う。この場合、再設定した
0はLSBにはないので、再びステップS8cの操作を
行い、次のビットに1を設定して新たな開平二次結果01
0 とし、ステップS9cにおいて、左辺と右辺との比較
を行う{(3−7)式}。
In equation (3-6), since the left side is smaller than the right side, in step S10c, the bit for which 1 was set in step S8c is reset to 0. Next, step S11
c, the 0 bit reset in step S10c is L
It is determined whether it is SB. In this case, since the reset 0 does not exist in the LSB, the operation of step S8c is performed again, the next bit is set to 1, and the new square root secondary result 01 is obtained.
In step S9c, the left side and the right side are compared {Equation (3-7)}.

【0089】(3−7)式においては左辺>右辺なの
で、開平二次結果判定部7Cにおいて、ステップS11
cにより、ステップS8cで設定した1のビットがLS
Bであるか否かの判定を行う。この場合、1はLSBに
はないので、再びステップS8cの操作を行い、次のビ
ットに1を設定して新たな開平二次結果011 とし、ステ
ップS9cにおいて、左辺と右辺との比較を行う{(3
−8)式}。
In the equation (3-7), since the left side is greater than the right side, the square root quadratic result determination unit 7C determines in step S11
c, the one bit set in step S8c is LS
B is determined. In this case, since 1 is not in the LSB, the operation in step S8c is performed again, and the next bit is set to 1 to obtain a new square root quadratic result 011. In step S9c, the left side and the right side are compared. (3
-8) Equation}.

【0090】(3−8)式においては左辺<右辺なの
で、ステップS10cにおいて、ステップS8cで1を
設定したビットを0に再設定する。次に開平二次結果判
定部7Cにおいて、ステップS11cによりステップS
10cで再設定した0のビットがLSBであるか否かの
判定を行う。この場合、再設定した0はLSBにあるの
で、最終の開平二次結果として010 を得る。そして、ス
テップS12cにおいて、開平一次結果を3ビット(M
ビット+四捨五入用の1ビット)MSB側にシフトした
値である1100000と整数加算演算することにより、開平
結果1100010 を得る。
In equation (3-8), since the left side is smaller than the right side, in step S10c, the bit for which 1 was set in step S8c is reset to 0. Next, in the square root secondary result determination unit 7C, the step S11c is performed in the step S11c.
It is determined whether the 0 bit reset in 10c is the LSB. In this case, since the reset 0 is in the LSB, 010 is obtained as the final square root quadratic result. Then, in step S12c, the square root primary result is represented by 3 bits (M
By performing an integer addition operation with 1100000 which is a value shifted to the MSB side (bit + one bit for rounding), a square root result 1100010 is obtained.

【0091】次に開平結果四捨五入演算部9Cにおい
て、ステップS13cにより、ステップS12cで得た
開平二次結果の四捨五入ビットであるLSBが1であ
り、かつ、(2−5)式の左辺と右辺との関係が左辺>
右辺であるならば、ステップS12cで得た開平結果の
LSBに1を加えて、固定小数点の精度未満を四捨五入
した開平結果とし、一方、開平二次結果のLSBが0で
あるか、または(2−5)式の左辺と右辺との関係が左
辺>右辺でなければ、ステップS12cで求めた開平結
果を固定小数点の精度未満を四捨五入した開平結果とす
る。ここでは、ステップS12cで得た開平結果は1100
010 なので、四捨五入した開平結果の小数点位置を合わ
せるために、開平結果を1ビットLSB側にシフトし、
LSB側から4ビットめの位置を小数点位置とすること
により、整数部4ビット、小数部4ビットの精度未満を
四捨五入した最終の開平結果0011.0001を得ることがで
きる。
Next, in the square root result rounding operation section 9C, in step S13c, the LSB, which is the rounded bit of the square root quadratic result obtained in step S12c, is 1, and the left and right sides of equation (2-5) are The relationship on the left side>
If it is the right-hand side, 1 is added to the LSB of the square root result obtained in step S12c, and the square root less than the precision of the fixed point is rounded. On the other hand, the LSB of the square root quadratic result is 0 or (2 If the relationship between the left side and the right side of the equation (5) is not left side> right side, the square root result obtained in step S12c is the square root result rounded down to the precision of the fixed point. Here, the square root result obtained in step S12c is 1100
010, the square root result is shifted to the LSB side by one bit in order to match the decimal point position of the square root result rounded off,
By setting the fourth bit position from the LSB side as the decimal point position, it is possible to obtain the final square root result 0011.0001 obtained by rounding off the precision of the integer part 4 bits and the decimal part 4 bits.

【0092】[0092]

【発明の効果】請求項1記載の固定小数点開平演算器に
よれば、演算過程においてオーバーフロー、アンダーフ
ローが発生せずに精度未満を切り捨てた開平結果を得る
ことができ、開平演算部で必要となるビット数は固定小
数点データのビット数と同じなので、従来より広いビッ
ト数で構成される固定小数点データに対しての開平が可
能となる。
According to the fixed-point square root arithmetic unit of the first aspect, it is possible to obtain a square root result in which the precision is truncated to less than the precision without causing overflow or underflow in the operation process. Since the number of bits is the same as the number of bits of the fixed-point data, square rooting can be performed on fixed-point data having a larger number of bits than in the past.

【0093】請求項2記載の固定小数点開平演算器によ
れば、演算過程においてオーバーフロー、アンダーフロ
ーが発生せずに精度未満を切り上げた開平結果を得るこ
とができ、開平演算部で必要となるビット数は固定小数
点データのビット数と同じなので、従来より広いビット
数で構成される固定小数点データに対しての開平が可能
となる。
According to the fixed-point square root arithmetic unit of the second aspect, it is possible to obtain a square root result rounded up to a lower precision without causing overflow or underflow in the operation process, and the bit required for the square root arithmetic unit is used. Since the number is the same as the number of bits of the fixed-point data, square rooting can be performed on fixed-point data having a larger number of bits than in the past.

【0094】請求項3記載の固定小数点開平演算器によ
れば、予め固定小数点データに開平結果の精度未満の四
捨五入を考慮した四捨五入用の2ビットを付加すること
で、演算過程においてオーバーフロー、アンダーフロー
が発生せずに精度未満を四捨五入した開平結果を得るこ
とができ、開平演算部で必要となるビット数は固定小数
点データのビット数と同じなので、従来より広いビット
数で構成される固定小数点データに対しての開平が可能
となる。
According to the fixed-point square root arithmetic unit of the third aspect, two bits for rounding in consideration of rounding less than the precision of the square root result are added to the fixed-point data in advance, so that overflow and underflow in the arithmetic process are performed. The square root result can be obtained by rounding less than the precision without generating the fixed point data, and the number of bits required in the square root calculation unit is the same as the number of bits of the fixed point data. Is possible.

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

【図1】 本発明に係る固定小数点開平演算器の第1の
実施例の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a first embodiment of a fixed-point square root arithmetic unit according to the present invention.

【図2】 本発明に係る固定小数点開平演算器の第1の
実施例の動作を説明するフローチャートである。
FIG. 2 is a flowchart illustrating the operation of the first embodiment of the fixed-point square root arithmetic unit according to the present invention.

【図3】 本発明に係る固定小数点開平演算器の第1の
実施例の動作を説明するフローチャートである。
FIG. 3 is a flowchart illustrating the operation of the first embodiment of the fixed-point square root arithmetic unit according to the present invention.

【図4】 本発明に係る固定小数点開平演算器の第2の
実施例の構成を示すブロック図である。
FIG. 4 is a block diagram showing a configuration of a second embodiment of the fixed-point square root arithmetic unit according to the present invention.

【図5】 本発明に係る固定小数点開平演算器の第2の
実施例の動作を説明するフローチャートである。
FIG. 5 is a flowchart illustrating the operation of a fixed-point square root arithmetic unit according to a second embodiment of the present invention.

【図6】 本発明に係る固定小数点開平演算器の第3の
実施例の構成を示すブロック図である。
FIG. 6 is a block diagram showing a configuration of a third embodiment of the fixed-point square root arithmetic unit according to the present invention.

【図7】 本発明に係る固定小数点開平演算器の第3の
実施例の動作を説明するフローチャートである。
FIG. 7 is a flowchart illustrating an operation of a fixed-point square root arithmetic unit according to a third embodiment of the present invention.

【図8】 本発明に係る固定小数点開平演算器の第3の
実施例の動作を説明するフローチャートである。
FIG. 8 is a flowchart illustrating the operation of a fixed-point square root arithmetic unit according to a third embodiment of the present invention.

【図9】 従来の固定小数点開平演算器の構成を示すブ
ロック図である。
FIG. 9 is a block diagram showing a configuration of a conventional fixed-point square root arithmetic unit.

【図10】 従来の固定小数点開平演算器の動作を説明
するフローチャートである。
FIG. 10 is a flowchart illustrating the operation of a conventional fixed-point square root arithmetic unit.

【符号の説明】[Explanation of symbols]

1A,1C データ入力部、1B 精度未満切捨てデー
タ入力部、2B 精度未満切上げ開平演算部、2A,2
C 開平一次結果演算部、3A,3C 開平一次結果判
定部、4A,4C 開平二次結果演算部、5A,5B,
5C データ記憶部、6A,6B,6C 制御手段、7
A,7C 開平二次結果判定部、8A,3B,8C 開
平結果加算部、9C 開平結果四捨五入演算部、9A,
4B,10C 開平結果出力部。
1A, 1C data input section, 1B truncated data input section with less than precision, 2B Round-up square root less than precision section, 2A, 2
C square root primary result calculation unit, 3A, 3C square root primary result determination unit, 4A, 4C square root secondary result calculation unit, 5A, 5B,
5C data storage unit, 6A, 6B, 6C control means, 7
A, 7C square root secondary result determination unit, 8A, 3B, 8C square root result adding unit, 9C square root rounding calculation unit, 9A,
4B, 10C Square root result output unit.

フロントページの続き (56)参考文献 特開 平3−260723(JP,A) 特開 平3−75927(JP,A) 特開 平2−245825(JP,A) 特開 平2−219127(JP,A) 特開 昭62−58333(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 7/552 G06F 7/38 Continuation of the front page (56) References JP-A-3-260723 (JP, A) JP-A-3-75927 (JP, A) JP-A-2-245825 (JP, A) JP-A-2-219127 (JP) , A) JP-A-62-58333 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) G06F 7/552 G06F 7/38

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 2Lビットの整数部と、2Mビットの小
数部で構成された固定小数点データに対して、開平演算
を開平一次結果を得る過程と、開平二次結果を得る過程
に分けて行い、前記開平一次結果と開平二次結果とを加
算することで、2Lビットの整数部と2Mビットの小数
部で構成された開平結果を得る固定小数点開平演算器で
あって、 前記固定小数点データを受け、二分法により、Lビット
の整数部とMビットの小数部で構成された前記開平一次
結果を与える開平一次結果演算部と、 前記開平一次結果を受け、該結果が前記開平一次結果演
算部の最終結果であるか否かを判定する開平一次結果判
定部と、 前記開平一次結果判定部において判定された最終開平一
次結果を受け、二分法により、前記開平結果の2Mビッ
トの小数部のうち、下位Mビットとなるべき前記開平二
次結果を得る開平二次結果演算部と、 前記開平二次結果を受け、該結果が前記開平二次結果演
算部の最終結果であるか否かを判定する開平二次結果判
定部と、 前記開平二次結果判定部において判定された最終開平二
次結果と、前記最終開平一次結果とを加算演算して、前
記開平結果を与える開平結果加算部とを備え、 前記開平二次結果演算部において、前記固定小数点デー
タが、前記開平一次結果と開平二次結果とを演算して得
られる前記開平結果の最大の二乗値以上となる前記開平
二次結果を与えることで、精度未満を切り捨てた開平結
果を得ることを特徴とする固定小数点開平演算器。
1. A square root extraction operation is performed on fixed-point data composed of a 2L-bit integer part and a 2M-bit fraction part, into a step of obtaining a square root primary result and a step of obtaining a square root quadratic result. A fixed-point square root arithmetic unit for obtaining a square root result composed of a 2L-bit integer part and a 2M-bit decimal part by adding the square root primary result and the square root quadratic result, Receiving the square root primary result by the bisection method and providing the square root primary result formed by an L-bit integer part and an M-bit fractional part; A square root primary result determination unit that determines whether or not the final result is a final result. The final square root primary result determined by the square root primary result determination unit is received. A square root quadratic result calculating unit for obtaining the square root quadratic result to be the lower M bits, receiving the square root quadratic result, and determining whether the result is the final result of the square root quadratic result calculating unit A square root secondary result determiner, and a final square root secondary result determined by the square root secondary result determiner, and an addition operation of the final square root primary result, and a square root result adder that gives the square root result. In the square root quadratic result calculation unit, the fixed-point data is the square root quadratic result that is equal to or greater than the maximum square value of the square root result obtained by calculating the square root primary result and square root quadratic result. A fixed-point square root arithmetic unit, which obtains a square root result by rounding off less than precision.
【請求項2】 前記固定小数点データの精度未満を切り
捨てた前記開平結果を受け、前記固定小数点データが、
前記開平一次結果と開平二次結果とを演算して得られる
前記開平結果の二乗値より大きくなる場合には、前記開
平結果の最下位ビットに「1」を加算し、等しい場合は
そのままの数値とすることで、精度未満を切り上げた開
平結果を与える精度未満切り上げ開平演算部をさらに備
えた請求項1記載の固定小数点開平演算器。
2. Receiving the square root result in which the precision of the fixed-point data is rounded down,
When the square root of the square root result is larger than the square value of the square root result obtained by calculating the square root primary result and the square root quadratic result, "1" is added to the least significant bit of the square root result. The fixed-point square root arithmetic unit according to claim 1, further comprising a square root lower-rounding calculator that provides a square root result rounded up to a lower precision.
【請求項3】 四捨五入用の2ビットと、2Lビットの
整数部と、2Mビットの小数部とで構成された固定小数
点データに対して、開平演算を開平一次結果を得る過程
と、開平二次結果を得る過程に分けて行い、前記開平一
次結果と開平二次結果とをシフトした後に加算すること
で、四捨五入用の2ビットと、2Lビットの整数部と2
Mビットの小数部で構成された開平結果を得る固定小数
点開平演算器であって、 前記固定小数点データを受け、二分法により、Lビット
の整数部とMビットの小数部で構成された前記開平一次
結果を与える開平一次結果演算部と、 前記開平一次結果を受け、該結果が前記開平一次結果演
算部の最終結果であるか否かを判定する開平一次結果判
定部と、 前記開平一次結果判定部において判定された最終開平一
次結果を受け、二分法により、前記開平結果の2Mビッ
トの小数部のうち、下位Mビットと1ビットの四捨五入
ビットとでM+1ビットとなるべき開平二次結果を与え
る開平二次結果演算部と、 前記開平二次結果を受け、該結果が前記開平二次結果演
算部の最終結果であるか否かを判定する開平二次結果判
定部と、 前記開平二次結果判定部において判定された最終開平二
次結果を受け、該最終開平二次結果の四捨五入ビットで
ある最下位ビットが「1」であって、かつ、前記固定小
数点データが、前記開平一次結果と前記最終開平二次結
果とを演算して得られる前記開平結果の二乗値より大き
くなる場合には、前記開平結果の最下位ビットに「1」
を加算することにより、精度未満を四捨五入した前記開
平結果を与える精度未満四捨五入演算部と、を備えるこ
とを特徴とする固定小数点開平演算器。
3. A process for obtaining a first-order square root result by performing square root arithmetic on fixed-point data composed of 2 bits for rounding, an integer part of 2L bits, and a fraction part of 2M bits. The result is divided into steps for obtaining the result, and the square root primary result and the square root quadratic result are shifted and then added, so that 2 bits for rounding, an integer part of 2L bits and 2
What is claimed is: 1. A fixed-point square root arithmetic unit for obtaining a square root result formed of an M-bit fractional part, comprising: receiving the fixed-point data, and forming the square root by using a bisection method with an L-bit integer part and an M-bit decimal part. A square root primary result calculation unit that gives a primary result; a square root primary result determination unit that receives the square root primary result and determines whether the result is the final result of the square root primary result calculation unit; and the square root primary result determination Receiving the final square root primary result determined in the section, the square root method gives the square root secondary result to be M + 1 bits by the lower M bits and the 1-bit rounded-off bit of the 2 M-bit fractional part of the square root result. A square root quadratic result calculation unit, and a square root quadratic result determination unit that receives the square root quadratic result and determines whether the result is the final result of the square root quadratic result calculation unit, Receiving the final square root secondary result determined in the fixed part, the least significant bit which is a rounded bit of the final square root secondary result is “1”, and the fixed-point data is the square root primary result and the When the square root of the square root result obtained by calculating the final square root quadratic result is greater than the square value of the square root result, “1” is set in the least significant bit of the square root square result.
And a less-than-precision rounding operation unit that gives the squared result with the less than precision rounded by adding.
JP15367394A 1993-11-01 1994-07-05 Fixed-point square root arithmetic unit Expired - Fee Related JP3335769B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15367394A JP3335769B2 (en) 1993-11-01 1994-07-05 Fixed-point square root arithmetic unit

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP27359393 1993-11-01
JP5-273593 1993-11-01
JP15367394A JP3335769B2 (en) 1993-11-01 1994-07-05 Fixed-point square root arithmetic unit

Publications (2)

Publication Number Publication Date
JPH07175637A JPH07175637A (en) 1995-07-14
JP3335769B2 true JP3335769B2 (en) 2002-10-21

Family

ID=26482223

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15367394A Expired - Fee Related JP3335769B2 (en) 1993-11-01 1994-07-05 Fixed-point square root arithmetic unit

Country Status (1)

Country Link
JP (1) JP3335769B2 (en)

Also Published As

Publication number Publication date
JPH07175637A (en) 1995-07-14

Similar Documents

Publication Publication Date Title
US6175851B1 (en) Fast adder/subtractor for signed floating point numbers
US5260889A (en) Computation of sticky-bit in parallel with partial products in a floating point multiplier unit
US5862068A (en) Arithmetic circuit for calculating a square-root of a sum of squares
JP3335769B2 (en) Fixed-point square root arithmetic unit
US6347326B1 (en) N bit by M bit multiplication of twos complement numbers using N/2+1 X M/2+1 bit multipliers
Iyer et al. Generalised algorithm for multiplying binary numbers via vedic mathematics
JP3515462B2 (en) Remainder arithmetic device and method
JP2645422B2 (en) Floating point processor
US6549924B1 (en) Function generating interpolation method and apparatus
JP2803506B2 (en) Divider
JPH0831024B2 (en) Arithmetic processor
CN114978516A (en) Modular multiplication operation method under number theory transformation prime number
US20250036362A1 (en) Optimized multiply-accumulate operator for ai calculations
CN114217764A (en) A high-precision floating-point simulation method based on a domestic heterogeneous many-core platform
JP2777265B2 (en) High radix square root arithmetic unit
JPH1091614A (en) IDCT integer conversion method
EP4485168A1 (en) Computationally efficiently discretizing floating point numbers
JPH0251732A (en) Floating point computing element
US20040230630A1 (en) Method and apparatus for efficiently performing a square root operation
JPH0659862A (en) Multiplier
JP3136709B2 (en) Exponentiation unit
JP3433466B2 (en) Multiplication circuit
JP2023000142A (en) Arithmetic device
JP3612950B2 (en) Arithmetic apparatus and method
JPH0784996A (en) Double-precision product sum arithmetic unit

Legal Events

Date Code Title Description
S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080802

Year of fee payment: 6

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080802

Year of fee payment: 6

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090802

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees