JPH033033A - Square root arithmetic unit - Google Patents

Square root arithmetic unit

Info

Publication number
JPH033033A
JPH033033A JP13816489A JP13816489A JPH033033A JP H033033 A JPH033033 A JP H033033A JP 13816489 A JP13816489 A JP 13816489A JP 13816489 A JP13816489 A JP 13816489A JP H033033 A JPH033033 A JP H033033A
Authority
JP
Japan
Prior art keywords
register
zero
square root
value
bits
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.)
Granted
Application number
JP13816489A
Other languages
Japanese (ja)
Other versions
JP2508269B2 (en
Inventor
Misayo Nakayama
中山 美小夜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP13816489A priority Critical patent/JP2508269B2/en
Publication of JPH033033A publication Critical patent/JPH033033A/en
Application granted granted Critical
Publication of JP2508269B2 publication Critical patent/JP2508269B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To reduce the load of processing based upon a microprogram by setting up a flag to '1' at the time of starting operation, and when the 1st and 2nd zero detecting circuits detect that a partial residual is zero and the number of inputs is also zero, resetting the flag to '0' with the outputs of the 1st and 2nd zero detecting circuits. CONSTITUTION:The arithmetic unit for square roots is provided with an input number register 101, arithmetic registers 103, 104, an ALU 105, a partial residual register 106, an operated result register 109, the 1st zero detecting circuit 107 provided with a flag 110 to detect the partial residual is zero, the 2nd zero detecting register 102 for detecting the number of inputs on the way of operation is zero, and an NAND gate 108. The NAND gate 108 sets up the OR of values outputted from the circuits 102 on the sticky bit 110. Consequently, processing executed by a microprogram can be omitted and the sticky bit can easily be set up.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、平方根演算装置に関する。より詳細には、本
発明は、浮動小数点演算を実行するシステム上で平方根
演算を行う際に、スティッキービッ) (Sticky
 bit)を設定する処理を行う装置の新規な構成に関
する。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a square root calculation device. More specifically, the present invention provides a method for reducing sticky bits when performing square root operations on systems that perform floating point operations.
This invention relates to a new configuration of a device that performs processing for setting bits.

従来の技術 IEEE標準に従って丸めを行う浮動小数点演算装置に
おいて平方根演算を行う場合、精度落ちがあったかどう
かを調べるためのフラグが必要である。即ち、IEEE
標準による丸め処理においては、浮動小数点フォーマッ
トの仮数部最下位ビットより更に下位に、丸め処理のた
めの2ビツト(Guard bitおよびRound 
bit)とRound bitより下位のビットすべて
の論理和をとったピッ) (Stickybit)とが
必要である。そして、これらのビットど4種類の丸めモ
ード(+00の方向、−〇〇の方向、0への方向、最近
値への方向)とに基づいて、切り上げ処理または切り捨
て処理が実行される。
Prior Art When performing a square root operation in a floating point arithmetic unit that performs rounding according to the IEEE standard, a flag is required to check whether there is a loss of precision. That is, IEEE
In standard rounding processing, two bits (Guard bit and Round
A sticky bit is required, which is the logical sum of all bits lower than the round bit. Then, rounding up or rounding down is performed based on four types of rounding modes (towards +00, -00, towards 0, and towards the nearest value).

第2図は、平方根演算処理の過程を示す図である。ここ
で、平方根演算を行った場合の本当の演算結果を無限精
度で表すものとするが、実際には、演算器が無限精度で
演算するのではなく、仮数部にGuarcl Bit、
 Round bitまで平方根を求め、5ticky
 bitにRound bitより下位の論理和を入れ
ることにより、あたかも無限精度であったかのように見
せることができる。
FIG. 2 is a diagram showing the process of square root calculation processing. Here, it is assumed that the true result of the square root operation is expressed with infinite precision, but in reality, the arithmetic unit does not perform the operation with infinite precision, but instead uses Guarcl Bit,
Find the square root up to Round bit, 5ticky
By inserting a logical sum lower than the round bit into the bit, it can be made to appear as if it had infinite precision.

第6図および第7図は、それぞれ、上述のような丸めの
ための3ビツトを求めるための平方根引き放し法を実行
する装置の構成を示すブロック図と、この装置上で実行
される処理を示すフローチャートである。
FIGS. 6 and 7 are block diagrams showing the configuration of a device that executes the square root pull-off method for obtaining 3 bits for rounding as described above, and the processing executed on this device, respectively. FIG.

まず、第7図に処理701 として示すように、入力数
用レジスタ601 に入力数をA=a、a2 ・・・a
7を格納した後、入力数の上位2桁をR2H,a2 と
して演算用レジスタ602に、演算用レジスタ603に
“l”をそれぞれ格納する。
First, as shown as process 701 in FIG. 7, the number of inputs is entered in the input number register 601 as follows:
After storing 7, the upper two digits of the input number are set as R2H,a2 and "l" is stored in the calculation register 602 and the calculation register 603, respectively.

次に、処理702 として示すように、演算用レジスタ
602から603の値を減算し、部分剰余を部分剰余用
レジスタ605に格納する。
Next, as shown in process 702, the value in the calculation registers 602 and 603 is subtracted, and the partial remainder is stored in the partial remainder register 605.

ここで、処理703として示すように、部分剰余用レジ
スタのキャリーがb 正またはゼロならば、処理704として示すように、演
算結実用レジスタを1ビツト左シフトさせ、最下位のビ
ットに“ビをセントする。また、処理704 において
は、レジスタ601を2ビツト左シフトさせ、上位2ビ
ツトをレジスタ602の下位2ビツトへ、レジスタ60
5の値を2ビツト左シフトさせたものをレジスタ602
へ格納する。更に、レジスタ606の値を2ビツト左シ
フトしたものに“0ビを加えたものをレジスタ603へ
格納する。
Here, as shown in process 703, if the carry in the partial remainder register is b positive or zero, as shown in process 704, the operation result register is shifted to the left by 1 bit, and the lowest bit is set to ``bit''. Also, in process 704, the register 601 is shifted to the left by 2 bits, the upper 2 bits are transferred to the lower 2 bits of the register 602, and the register 601 is shifted to the left by 2 bits.
The value of 5 shifted to the left by 2 bits is stored in register 602.
Store it in Further, the value of the register 606 is shifted to the left by 2 bits and "0 bit" is added to the result and stored in the register 603.

次に、処理705として示すように、レジスタ672か
ら603の値を減算する。また、処理706として示す
ように、処理702で行った演算結果、即ち、部分剰余
が負ならば演算結実用レジスタを1ビツト左シフトさせ
、最下位のビットに0をセットする。
Next, as shown in process 705, the value of register 603 is subtracted from register 672. Further, as shown in process 706, if the operation result performed in process 702, that is, the partial remainder is negative, the operation result register is shifted to the left by 1 bit, and the least significant bit is set to 0.

次に、処理706として示すように、レジスタ601を
2ビツト左シフトさせ、上位2ビツトをレジスタ602
へ、レジスタ605の値を2ビツト左シフトさせたもの
をレジスタ602へそれぞれ格納する。
Next, as shown in process 706, the register 601 is shifted to the left by 2 bits, and the upper 2 bits are transferred to the register 602.
Then, the value of register 605 is shifted to the left by 2 bits and stored in register 602, respectively.

また、レジスタ606の値を2ビツト左シフトしたもの
に、” l 1 ”を加えたものをレジスタ603へ格
納する。
Further, the value obtained by shifting the value of the register 606 to the left by 2 bits and adding "l 1 " is stored in the register 603.

次に、処理707として示すように、レジスタ602と
603の値とを加算する。
Next, as shown in process 707, the values of registers 602 and 603 are added.

これら、処理703から707までの処理を、レジスタ
の桁数分繰り返すことによって、処理717に示すよう
に、レジスタ606に平方根が得られる。
By repeating these processes 703 to 707 for the number of digits in the register, the square root is obtained in the register 606 as shown in process 717.

続いて、演算結果が精度落ちしたかどうかを調べる。即
ち、部分剰余レジスタ605の値により、次のように補
正する。
Next, check whether the accuracy of the calculation result has decreased. That is, the correction is made as follows using the value of the partial remainder register 605.

(a)レジスタ605の値が0ならば何もしない。(a) If the value of register 605 is 0, nothing is done.

ら)レジスタ605の値が正ならば、処理711 とし
て示すように、レジスタ602とレジスタ603の値を
加算する。
) If the value of register 605 is positive, the values of register 602 and register 603 are added as shown in process 711.

(C)レジスタ605の値が負ならば、処理712とし
て示すように、レジスタ606の値を2ビツト左シフト
したものに01”を加えたものをレジスタ603へ格納
し、次に、処理713として示すように、レジスタ60
2 、!ニレジスタロ03の値を加算する。
(C) If the value of the register 605 is negative, as shown in process 712, the value of the register 606 is shifted to the left by 2 bits and 01'' is added and stored in the register 603, and then as shown in process 713 As shown, register 60
2,! Add the value of NIR register 03.

以上のようにして補正した結果を、処理714として示
すように検査し、60″ならば処理715として示すよ
うに5ticky bit607を“0″にセットし、
“1”ならば処理715 として示すように5tick
ybit 5Q7を“ピにセットする。
The result corrected as above is checked as shown in process 714, and if it is 60'', the 5ticky bit 607 is set to "0" as shown in process 715,
If it is “1”, process 715 as shown in 5tick.
Set ybit 5Q7 to “P”.

尚、上述のような従来の装置では、これらの精度落ち用
フラグをセットする処理710から716までの処理を
、マイクロプログラムによって行っていた。
Note that in the conventional apparatus as described above, the processes 710 to 716 for setting these flags for decreasing precision are performed by a microprogram.

発明が解決しようとする課題 上述のような従来の平方根演算処理において、精度落ち
があったかどうかを調べるためのフラグである5tic
ky bitは、演算終了後の部分剰余の値が正、負ま
たはゼロの何れであるかの判定と、これが正また・は負
であった場合の部分剰余の補正と、補正されたものがゼ
ロであるかどうかの検出と、5ticky bitのセ
ットとの各処理が必要であり、これらは全てマイクロプ
ログラムにより行われていた。従って、マイクロプログ
ラムのステップ数が多く、実行うロック数が増加すると
いう欠点があった。
Problems to be Solved by the Invention In the conventional square root arithmetic processing as described above, the 5tic flag is used to check whether there is a drop in accuracy.
The ky bit is used to determine whether the value of the partial remainder after the completion of the operation is positive, negative, or zero, to correct the partial remainder if it is positive or negative, and to determine whether the corrected value is zero. It is necessary to detect whether or not it is true, and to set 5 ticky bits, all of which are performed by a microprogram. Therefore, there is a drawback that the number of microprogram steps is large and the number of locks to be executed increases.

そこで、本発明の目的は、上記従来技術の問題点を解決
し、特定の回路を設けて、マイクロプログラムによる処
理の負担を軽減し、且つ、処理時間を短縮した新規な平
方根演算装置を提供することにある。
SUMMARY OF THE INVENTION Therefore, an object of the present invention is to provide a novel square root arithmetic device which solves the above-mentioned problems of the prior art, reduces the burden of processing by microprograms, and shortens processing time by providing a specific circuit. There is a particular thing.

課題を解決するための手段 即ち、本発明に従うと、丸めを含む浮動小数点演算装置
上で入力数の平方根演算処理を実行する平方根演算装置
において、精度落ちが発生したことを表示するフラグと
、演算途中の部分剰余がゼロであることを検出する第1
のゼロ検出回路と、演算途中の入力数がゼロであること
を検出する第2のゼロ検出回路とを備え、演算開始時に
該フラグを“ビにセットし、前記第1および第2のゼロ
検出回路により、部分剰余がゼロであり、且つ、入力数
もゼロである場合には、該第1および第2のゼロ検出回
路の出力により、該フラグをOにリセットする機能を有
することを特徴とする平方根演算装置が提供される。
Means for Solving the Problems According to the present invention, in a square root arithmetic unit that executes square root arithmetic processing of an input number on a floating point arithmetic unit including rounding, a flag indicating that precision loss has occurred, and an operation The first step is to detect that the intermediate partial remainder is zero.
and a second zero detection circuit that detects that the number of inputs during the calculation is zero, sets the flag to "bi" at the start of the calculation, and performs the first and second zero detection circuit. The circuit has a function of resetting the flag to O by the outputs of the first and second zero detection circuits when the partial remainder is zero and the number of inputs is also zero. A square root calculation device is provided.

作用 前述した従来の平方根演算装置に対して、本発明に係る
装置は、部分剰余がゼロであることを検出する第1のゼ
ロ検出回路と、演算途中の入力数がゼロであることを検
出する第2のゼロ検出回路とを備えていることをその主
要な特徴としている。
Function: In contrast to the conventional square root calculation device described above, the device according to the present invention includes a first zero detection circuit that detects that the partial remainder is zero, and a first zero detection circuit that detects that the number of inputs during the calculation is zero. Its main feature is that it is equipped with a second zero detection circuit.

即ち、この第1ゼロ検出回路1が出力する値と第2ゼロ
検出回路が出力する値との論理和を、5ticky b
itにセットすることにより、従来技術において、第7
図に処理710から716として示した処理が不用にな
り、更に、5ticky bitの設定も容易になる。
That is, the logical sum of the value output by the first zero detection circuit 1 and the value output by the second zero detection circuit is calculated as 5ticky b
In the prior art, by setting it to
The processes shown as processes 710 to 716 in the figure become unnecessary, and furthermore, the setting of 5 ticky bits becomes easy.

従って、マイクロプログラムのステップ数並びにクロッ
ク数を共に減少させることができる。
Therefore, both the number of microprogram steps and the number of clocks can be reduced.

以下、図面を参照して本発明をより具体的に説明するが
、以下の開示は本発明の一実施例に過ぎず、本発明の技
術的範囲を何ら限定するものではない。
Hereinafter, the present invention will be described in more detail with reference to the drawings, but the following disclosure is only one embodiment of the present invention, and does not limit the technical scope of the present invention in any way.

実施例1 第1図は、本発明に係る平方根演算装置の構成例を°示
すブロック図である。
Embodiment 1 FIG. 1 is a block diagram showing an example of the configuration of a square root calculation device according to the present invention.

第1図に示すように、この平方根演算装置は、入力数用
レジスタ101 と、演算用レジスタ103および10
4と、ALU105と、部分剰余用レジスタ106 と
、演算結実用レジスタ109 と、フラグ110とを備
えている。これらの構成並びに機能は、第6図に示した
従来の平方根演算装置と基本的に同じである。さらに、
この平方根演算装置は、第1および第2のゼロ検出回路
107および102と、NANDゲート108とを備え
ている。
As shown in FIG. 1, this square root calculation device includes an input number register 101, calculation registers 103 and 10.
4, an ALU 105, a partial remainder register 106, an operation result register 109, and a flag 110. These structures and functions are basically the same as the conventional square root calculation device shown in FIG. moreover,
This square root calculation device includes first and second zero detection circuits 107 and 102 and a NAND gate 108.

ここで、第1のゼロ検出回路107は、部分剰余がゼロ
であることを検出する機能を有している。
Here, the first zero detection circuit 107 has a function of detecting that the partial remainder is zero.

また、第2のゼロ検出回路102は、演算途中の入力数
がゼロであることを検出機能を有している。
Further, the second zero detection circuit 102 has a function of detecting that the number of inputs during calculation is zero.

更に、NANDゲート108は、後述するように、第1
ゼロ検出回路107と第2ゼロ検出回路107とが出力
する値の論理和を、5ticky bitllQにセッ
トする機能を有している。
Furthermore, the NAND gate 108 has a first
It has a function of setting the logical sum of the values output by the zero detection circuit 107 and the second zero detection circuit 107 to 5ticky bitllQ.

第2図は、既に説明したように、5ticky bit
を説明する図である。ここでは、無限精度の演算結果の
うち、丸め精度以下2 bitがGuard bitお
よびRound bitに格納される。また、5tic
ky bitは、Round bit以後の論理和が格
納されζ精度落ちがある場合には“1″、ない場合には
“0°′が格納される。
As already explained, Figure 2 shows 5 ticky bits.
FIG. Here, of the infinite precision calculation results, 2 bits below the rounding precision are stored in the Guard bit and Round bit. Also, 5tic
The ky bit stores the logical sum after the round bit, and if there is a loss of ζ precision, "1" is stored, and if there is no loss, "0°" is stored.

第3図は、第1図に示した装置において実行される処理
を示すフローチャートである。
FIG. 3 is a flowchart showing the processing executed in the apparatus shown in FIG.

第3図に処理301として示すように、まず、入力数を
A=ata2 ・・・alとして入力数用レジスタ10
1に格納し、入力数の上位2桁をRo”a、a2を演算
用レジスタ103に格納し、更に、演算用レジスタ10
4に1を格納する。
As shown as process 301 in FIG. 3, first, the input number is set to A=ata2...al and the input number register 10
1, store the upper two digits of the input number Ro''a and a2 in the calculation register 103, and further store the calculation register 10
Store 1 in 4.

次に、処理302 として示すように、フラグ110に
5ticky bit=“1 ”をセットする。
Next, as shown in process 302, 5ticky bit="1" is set in the flag 110.

次に、処理303 として示すように、演算用レジスタ
103の値からレジスタ104の値を減算し、部分剰余
用レジスタ106に格納する。
Next, as shown in process 303, the value of the register 104 is subtracted from the value of the calculation register 103, and the result is stored in the partial remainder register 106.

またこの時、処理304として示すように、部分剰余用
レジスタ106の値が“0″であるかどうかを検査し、
II OIIであるときは、処理305として示すよう
に、ゼロ検出回路107の出力を“l”とし、入力数用
レジスタ101を2ビツト左シフトさせたものの値が0
″のとき、ゼロ検出器102の出力をパビとし、ゼロ検
出回路107および102の出力をNANDゲート10
8によりフラグ110、即ち、5ticky bitを
“0″にセットする。これら処理304および305は
、ハードウェアにより実行される。
At this time, as shown in process 304, it is checked whether the value of the partial remainder register 106 is "0",
II OII, as shown in process 305, the output of the zero detection circuit 107 is set to "l", and the value of the input number register 101 is shifted to the left by 2 bits, and the value is 0.
'', the output of the zero detector 102 is set as Pavi, and the outputs of the zero detection circuits 107 and 102 are set as the NAND gate 10.
8 sets the flag 110, ie, the 5ticky bit, to "0". These processes 304 and 305 are executed by hardware.

次に、処理306として示すように、部分剰余レジスタ
の値を検査し、これが、正または“0′″ならば、以下
の処理307および308を実行する。
Next, as shown in process 306, the value of the partial remainder register is checked, and if it is positive or "0'", the following processes 307 and 308 are executed.

即ち、まず、処理307として示すように、演算結実用
レジスタ109を1ビツトシフトさせ、最下位のビット
に”1”をセットする。続いて、レジスタ101を2ビ
ツト左シフトさせ、上位2ビツトをレジスタ103の下
位2ビツトへ、レジスタ106の値を2ビツト左シフト
させたものをレジスタ103へそれぞれ格納する。また
、レジスタ109の値を2ビツト左シフトしたものに’
01”を加えたものをレジスタ104へ格納する。次に
、処理308として示すように、レジスタ103の値か
らレジスタ104の値を減算する。
That is, first, as shown in process 307, the operation result register 109 is shifted by one bit, and the least significant bit is set to "1". Subsequently, the register 101 is shifted to the left by 2 bits, the upper 2 bits are transferred to the lower 2 bits of the register 103, and the value of the register 106 is shifted to the left by 2 bits and stored in the register 103, respectively. Also, the value of register 109 is shifted to the left by 2 bits.
01'' is added and stored in the register 104. Next, as shown in process 308, the value of the register 104 is subtracted from the value of the register 103.

一方、処理306において、部分剰余が負であることが
検出された場合には、以下の処理309および310を
実行する。
On the other hand, if it is detected in process 306 that the partial remainder is negative, the following processes 309 and 310 are executed.

まず、処理309として示すように、演算結実用レジス
タ109を1ビツト左シフトさせ、最下位ビットに“0
″をセットする。続いて、レジスタ101を2ビツト左
シフトさせ、上位2ビツトをレジスタ103へ、レジス
タ106の値を2ビツト左シフトさせたものをレジスタ
103へそれぞれ格納する。
First, as shown in process 309, the operation result register 109 is shifted to the left by 1 bit, and the least significant bit is set to "0".
Then, register 101 is shifted to the left by 2 bits, the upper 2 bits are stored in register 103, and the value of register 106 is shifted to the left by 2 bits and stored in register 103, respectively.

また、レジスタ109の値を2ビツト左シフトしたもの
に、lじを加えたものをレジスタ104へ格納する。次
に、レジスタ103の値とレジスタ104の値とを加算
する。
Further, the value obtained by shifting the value of register 109 to the left by 2 bits and adding 1 is stored in register 104. Next, the value of register 103 and the value of register 104 are added.

以上のような処理306から310までの処理を、処理
311および312として示すように、レジスタの桁数
分繰り返すことにより、処理313として示すように、
入力数の平方根が得られる。
By repeating the above processes 306 to 310 as many times as the number of digits in the register, as shown as processes 311 and 312, as shown as process 313,
The square root of the input number is obtained.

実施例2 第5図は、本発明に従って構成された平方根演算装置の
他の構成例を示すブロック図である。
Embodiment 2 FIG. 5 is a block diagram showing another example of the configuration of a square root calculation device configured according to the present invention.

第5図に示すように、この装置の構成は、第1図に示し
た実施例1の装置と基本的に同じであり、その詳細な説
明は省略するが、各構成要素の参照番号は、第1桁が“
l”から′5″に変化しただけで第1図と対応している
。尚、具体的に後述するように、本実施例の装置では、
引きもどし法により平方根を得る構成となっている。
As shown in FIG. 5, the configuration of this device is basically the same as the device of Example 1 shown in FIG. The first digit is “
It corresponds to FIG. 1 only by changing from l'' to '5''. In addition, as will be specifically described later, in the apparatus of this embodiment,
The structure is such that the square root is obtained using the back-back method.

第4図は、第5図に示した平方根演算装置における処理
の過程を示すフローチャートである。
FIG. 4 is a flowchart showing the process of the square root calculation device shown in FIG.

まず、第4図に処理401 として示すように、入力数
A=a、、a2 ・・alを入力数用レジスタ501に
格納した後、演算用レジスタ503に入力数の上位2桁
をR6−aIn a2+ ahとして格納し、演算用レ
ジスタ504には“l”を格納する。
First, as shown as process 401 in FIG. 4, after storing the number of inputs A=a,, a2 . a2+ah, and “l” is stored in the calculation register 504.

次に、処理402として、フラグ501に5ticky
 bit=1をセットする。
Next, as process 402, 5ticky is set in the flag 501.
Set bit=1.

次に、処理403として、演算用レジスタ503に格納
された値からレジスタ504に格納された値を減算し、
部分剰余用レジスタ506にその値を格納する。
Next, as process 403, the value stored in the register 504 is subtracted from the value stored in the calculation register 503,
The value is stored in the partial remainder register 506.

このとき、部分剰余用レジスタ506の値が“0″の場
合は、処理405として、ゼロ検出回路507の出力を
“ビとし、入力数用レジスタ501を2ビツト左シフト
させたものの値が“0”のとき、ゼロ検出回路502の
出力を″l″とし、ゼロ検出回路507および502の
出力を、NANDゲート508を介してフラグ510に
入力することにより、5tickybitを“0″にセ
ットする。ここで、処理404フよび405は、ハード
ウェアにより実行される。
At this time, if the value of the partial remainder register 506 is "0", as a process 405, the output of the zero detection circuit 507 is set to "B", and the value of the input number register 501 is shifted to the left by 2 bits, and the value is "0". ”, the output of the zero detection circuit 502 is set to “1”, and the outputs of the zero detection circuits 507 and 502 are input to the flag 510 via the NAND gate 508, thereby setting 5tickybit to “0”. Processes 404 and 405 are executed by hardware.

次に部分剰余レジスタの値が正または“°0′″ならば
、以下の処理を実行する。
Next, if the value of the partial remainder register is positive or "°0'", the following processing is executed.

まず、処理407 として、演算結実用のレジスタ50
9を1ビツトシフトさせて、最下位ビットに“ビをセン
トする。また、レジスタ501を2ビツト左シフトさせ
、上位2ピントをレジスタ503の下位2ビツトへ、レ
ジスタ506の値を2ビツト左シフトさせたものをレジ
スタ503へそれぞれ格納する。更に、レジスタ509
の値を2ビツト左シフトしたものに01”を加えたもの
をレジスタ504へ格納する。次に、処理409として
、レジスタ503の値からレジスタ504の値を減算す
る。
First, as a process 407, the register 50 for the operation result is
9 is shifted by 1 bit, and "B" is placed in the least significant bit. Also, the register 501 is shifted to the left by 2 bits, the upper 2 pin points are shifted to the lower 2 bits of register 503, and the value of register 506 is shifted to the left by 2 bits. are stored in the registers 503.Furthermore, the registers 509
The value obtained by shifting the value of 2 bits to the left and adding 01" is stored in the register 504. Next, in process 409, the value of the register 504 is subtracted from the value of the register 503.

また、処理403で行った演算結果、即ち、部分剰余が
負ならば以下の処理を実行する。
Further, if the calculation result performed in process 403, that is, the partial remainder is negative, the following process is executed.

まず、処理408 として、演算結実用レジスタ509
を1ビツト左シフトさせ、最下位ビットに“0″をセッ
トする。また、レジスタ501 を2ビツト左シフトさ
せ、上位2ビツトをレジスタ503へ格納し、更に、レ
ジスタ503を2ビツト左シフトする。
First, as processing 408, the operation result practical register 509
is shifted to the left by 1 bit, and the least significant bit is set to "0". Also, the register 501 is shifted to the left by 2 bits, the upper 2 bits are stored in the register 503, and the register 503 is further shifted to the left by 2 bits.

次に、レジスタ509の値を2ビツト左シフトしたもの
に01″′を加えたものをレジスタ504へ格納する。
Next, the value of register 509 is shifted to the left by 2 bits and 01'' is added to the result and stored in register 504.

続いて、処理409として、レジスタ503の値からレ
ジスタ504の値を減算する。
Subsequently, in process 409, the value of the register 504 is subtracted from the value of the register 503.

処理410および411として、上述のような処理40
6から409までの処理を、レジスタの桁数分繰り返す
とレジスタ509に入力数の平方根が得られる。
Processes 410 and 411 include process 40 as described above.
By repeating the processes from 6 to 409 for the number of digits in the register, the square root of the input number is obtained in the register 509.

発明の詳細 な説明したように、本発明に係る平方根演算装置は、部
分剰余がゼロであることを検出する第1のゼロ検出回路
と、演算途中の入力数がゼロであることを検出する第2
のゼロ検出回路とを備え、これら第1および第2のゼロ
検出回路の出力する値の論理和を5ticky bit
にセットすることより、従来はマイクロプログラムで行
っていた処理を不用とし、且つ、5ticky bit
の設定を容易としている。従って、この装置においては
、平方根演算に際して、マイクロプログラムのステップ
数およびクロック数を共に減少させることができる。
As described in detail, the square root calculation device according to the present invention includes a first zero detection circuit that detects that the partial remainder is zero, and a first zero detection circuit that detects that the number of inputs during the calculation is zero. 2
and a zero detection circuit, and the logical sum of the values output from these first and second zero detection circuits is calculated as 5 ticky bits.
By setting the 5ticky bit to
It is easy to set up. Therefore, with this device, both the number of microprogram steps and the number of clocks can be reduced during square root calculation.

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

第1図は、本発明に係る平方根演算装置の構成例を示す
プロ7り図であり、 第2図は、スティッキービット(Sticky bit
)を説明する図であり、 第3図は、第1図に示した装置において実行さされる平
方根引き放し法の処理を説明するフローチャートであり
、 第4図は、本発明に係る平方根演算装置の他の構成例を
示すブロック図であり、 第5図は、第4図に示した装置において実行さされる平
方根引きもどし法の処理を説明するフローチャートであ
り、 第6図は、従来の平方根演算装置の構成例を示すブロッ
ク図であり、 第7図は、第6図に示した装置において実行さされる平
方根引き放し法の処理を説明するフローチャートである
。 〔主な参照番号〕 101  ・・人力用レジスタ、 102.107  ・・ゼロ検出回路、103.104
  ・・演算用レジスタ、105  ・・ALU。 106  ・・部分剰余用レジスタ、 108  ・ ・NANDゲート、 109  ・・演算結実用レジスタ、 110  ・・フラグ
FIG. 1 is a schematic diagram showing an example of the configuration of a square root arithmetic device according to the present invention, and FIG.
), FIG. 3 is a flowchart illustrating the processing of the square root pull-off method executed in the apparatus shown in FIG. 1, and FIG. 5 is a block diagram showing another configuration example; FIG. 5 is a flowchart illustrating the processing of the square root subtracting method executed in the device shown in FIG. 4; FIG. 6 is a conventional square root calculating device. FIG. 7 is a flowchart illustrating the processing of the square root pull-off method executed in the apparatus shown in FIG. 6. FIG. [Main reference numbers] 101...Manual register, 102.107...Zero detection circuit, 103.104
...Arithmetic register, 105...ALU. 106...Partial remainder register, 108...NAND gate, 109...Operation result register, 110...Flag

Claims (1)

【特許請求の範囲】 丸めを含む浮動小数点演算装置上で入力数の平方根演算
処理を実行する平方根演算装置において、精度落ちが発
生したことを表示するフラグと、演算途中の部分剰余が
ゼロであることを検出する第1のゼロ検出回路と、演算
途中の入力数がゼロであることを検出する第2のゼロ検
出回路とを備え、 演算開始時に該フラグを“1”にセットし、前記第1お
よび第2のゼロ検出回路により、部分剰余がゼロであり
、且つ、入力数もゼロである場合には、該第1および第
2のゼロ検出回路の出力により、該フラグを0にリセッ
トする機能を有することを特徴とする平方根演算装置。
[Claims] In a square root arithmetic unit that performs square root arithmetic processing of an input number on a floating point arithmetic unit that includes rounding, a flag indicating that precision loss has occurred and a partial remainder in the middle of the operation are zero. a first zero detection circuit that detects that the number of inputs is zero during the calculation, and a second zero detection circuit that detects that the number of inputs during the calculation is zero, sets the flag to "1" at the start of the calculation, and If the partial remainder is zero and the number of inputs is zero by the first and second zero detection circuits, the flag is reset to 0 by the outputs of the first and second zero detection circuits. A square root calculation device characterized by having a function.
JP13816489A 1989-05-31 1989-05-31 Square root calculator Expired - Fee Related JP2508269B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13816489A JP2508269B2 (en) 1989-05-31 1989-05-31 Square root calculator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13816489A JP2508269B2 (en) 1989-05-31 1989-05-31 Square root calculator

Publications (2)

Publication Number Publication Date
JPH033033A true JPH033033A (en) 1991-01-09
JP2508269B2 JP2508269B2 (en) 1996-06-19

Family

ID=15215523

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13816489A Expired - Fee Related JP2508269B2 (en) 1989-05-31 1989-05-31 Square root calculator

Country Status (1)

Country Link
JP (1) JP2508269B2 (en)

Also Published As

Publication number Publication date
JP2508269B2 (en) 1996-06-19

Similar Documents

Publication Publication Date Title
JP3487903B2 (en) Arithmetic device and arithmetic method
US4891780A (en) Divisional operation system for obtaining a quotient by repeated subtraction and shift operations
JPS62191926A (en) Arithmetic unit
CN113342671B (en) Method, device, electronic equipment and medium for verifying operation module
EP0262674A2 (en) Microcomputer having Z-flag capable of detecting coincidence at high speed
JPH033033A (en) Square root arithmetic unit
CN114564336A (en) Data consistency checking method, device, equipment and storage medium
EP0276856B1 (en) Trigonometric function preprocessing system
US20180004485A1 (en) Architecture and instruction set to support interruptible floating point division
US20090216822A1 (en) Method, system and computer program product for verifying floating point square root operation results
JPS6051728B2 (en) High-speed calculation processing method
US20020188640A1 (en) Dual mode arithmetic saturation processing
US5801978A (en) Overflow detection for integer-multiply instruction
CN113419762A (en) Data updating method and device and electronic equipment
JP2726479B2 (en) Division device
JP2001306346A (en) Arithmetic processor
JPS5940665Y2 (en) Power calculation control device
CN116112130A (en) Data correction and complement method, device, equipment and system
SU362301A1 (en) ALL-UNION 'YYT? YTIO "T: 11:; G'e" NDP
JP2998324B2 (en) Normalized shift device and normalized shift method
JPH05734B2 (en)
JPS63123123A (en) Unnormalized floating point arithmetic unit
JPS6033653A (en) Electronic desk calculator
JPS61165171A (en) Microcomputer
JPH02166517A (en) Division system

Legal Events

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