JPS6258333A - Arithmetic unit - Google Patents

Arithmetic unit

Info

Publication number
JPS6258333A
JPS6258333A JP19775585A JP19775585A JPS6258333A JP S6258333 A JPS6258333 A JP S6258333A JP 19775585 A JP19775585 A JP 19775585A JP 19775585 A JP19775585 A JP 19775585A JP S6258333 A JPS6258333 A JP S6258333A
Authority
JP
Japan
Prior art keywords
value
approximate value
coefficient
root
numerical data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP19775585A
Other languages
Japanese (ja)
Inventor
Izuru Haruhara
春原 出
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP19775585A priority Critical patent/JPS6258333A/en
Publication of JPS6258333A publication Critical patent/JPS6258333A/en
Pending legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

PURPOSE:To obtain the nth root with a simple constitution at a high speed by changing the coefficient of a noticed position according to the result of comparison between the nth power value of the approximate value of the nth root and the input numerical data. CONSTITUTION:The n-root C 108 of (k) figures is obtained for input numerical data A 107 of (nXk) figures which is shown in the binary numbers. In such a case, the coefficients are successively decided from the highest position of n-power figure C 108 and therefore the approximate value X 110 of the n-root C 110 is stored in an approximate value register 102. Then the approximate value X 110 is supplied to an nth power arithmetic part 101 and the nth power value B 109. A comparing part 100 compares the value B 109 with the input numerical data 107. While a noticed position designating part 104 designates successively each position (noticed position 111) of an approximate value register 102 from the highest position. Then, a coefficient setting part 103 sets the coefficient of the position 111 at the prescribed value every time the position 111 is designated. A coefficient changing part 105 changes the coefficient of the position 111 to the appropriate value.

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、数値データのn乗根を求める演算装置に関す
るものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an arithmetic device for calculating the n-th root of numerical data.

[従来の技術] 従来のn乗根の演算装置は、加算器、乗算器等を組み合
わせ、テーラ−展開多項式や漸化式等を用いて行なって
おり、非常に時間がかかり回路も複雑であった。
[Prior Art] Conventional n-th root arithmetic devices combine adders, multipliers, etc., and use Taylor expansion polynomials, recurrence formulas, etc., which is very time consuming and requires complicated circuits. Ta.

又、n乗根値をROMに格納しておき、入力数値データ
を該ROMのアドレスとして入力するという手法もある
。しかし、演算装置ではn乗根のみならず 乗の数値を
求める必要が発生するのが通常であるから、このような
ときの為にn乗根用のROMのみならず 乗値を格納し
たROMをも用意しなくてはならず、不経済であり、又
当然回路規模も大きくなった。
There is also a method of storing the n-th root value in a ROM and inputting the input numerical data as an address of the ROM. However, in an arithmetic device, it is usually necessary to calculate not only the n-th root but also the power, so for such cases, it is necessary to store not only the ROM for the n-th root but also the ROM that stores the multiplicative value. This is uneconomical, and the circuit size also naturally increases.

[発明が解決しようとする問題点] 本発明は上記従来例の問題点に鑑みなされたもので、そ
の目的は簡単な構成で高速にn乗根を得る演算装置を提
案する所にある。
[Problems to be Solved by the Invention] The present invention has been made in view of the problems of the conventional example described above, and its purpose is to propose an arithmetic device that obtains the n-th root at high speed with a simple configuration.

[問題点を解決するための手段] 上記課題を達成するために例えば第1図に示した実施例
の演算装置は、2進表現で表わされるnXk桁の入力数
値データA107のに桁のn乗根ClO3を求める場合
、n乗根ClO3の最上位から順に係数を決定するため
に、n乗根Cl0Bの近似値Xll0を格納する近似値
レジスタ102と、近似値xitoを入力してn乗値B
109を出力するn乗演算部101と、入力数値データ
107とn乗値B109との大小関係を判別する比較部
100と、最上位から降順に近似値レジスタ102の各
位(注目位111)を指定する注目位指定部104と、
注目位指定部104が注目位111を指定する毎に、注
目位111の係数を所定の値に設定する係数設定部10
3と、比較部100の判別結果に応じ゛CCl位111
の係数を適当な値に変更する係数変更部105とを有し
てなる。
[Means for Solving the Problems] In order to achieve the above-mentioned problems, for example, the arithmetic device of the embodiment shown in FIG. When determining the root ClO3, in order to determine the coefficients sequentially from the most significant value of the nth root ClO3, the approximation register 102 that stores the approximate value Xll0 of the nth root Cl0B and the approximate value xito are input to determine the nth power value B
The n-th power calculation unit 101 outputs 109, the comparison unit 100 determines the magnitude relationship between the input numerical data 107 and the n-th power value B109, and each position (attention position 111) of the approximate value register 102 is specified in descending order from the highest value. an attention point designation unit 104 to
A coefficient setting unit 10 that sets the coefficient of the attention point 111 to a predetermined value each time the attention point designation unit 104 designates the attention point 111.
3, and according to the determination result of the comparison unit 100, the CCl rank 111
and a coefficient changing unit 105 that changes the coefficients of .

[作用] 上記構成において、近似値レジスタ102に格納される
近似値xttoは、注目位指定部104が指定した注目
位111より下位の位の係数113が“0”であるよう
にすると、上位の位112の係数が既知である場合に、
係数設定部103は注目位111の係数が“1°°とな
るように設定する。このように近似値X110を設定す
ると、求めるn乗根ClO3の注目位の係数が0゛°で
あるべき時は、必ずn乗値B109>数値データA10
7となり、逆に°1”′であるべきときは、n乗値B1
09≦数値データA107となる。従って、大小判別結
果106に基すいて係数変更部105はその係数を°゛
1′′又は0”に一意的に決定できる。
[Operation] In the above configuration, the approximate value If the coefficient at position 112 is known,
The coefficient setting unit 103 sets the coefficient at the position of interest 111 to be 1°°.If the approximate value is always n-th power value B109>numerical data A10
7, and conversely, when it should be °1''', the n-th power value B1
09≦numerical data A107. Therefore, based on the magnitude determination result 106, the coefficient changing unit 105 can uniquely determine the coefficient to be ``1'' or 0''.

[実施例]   ゛ 以下添付図面に基すいて本発明に係る実施例を更に詳細
に説明する。
[Embodiments] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings.

先ず、第1図に示した実施例において、大小判別結果1
06に基づいて注目位Illの係数が一意的に決定され
る事を以下に説明する。
First, in the example shown in FIG.
It will be explained below that the coefficient of the attention point Ill is uniquely determined based on 06.

く係数決定の原理〉 説明を簡略にするために、2乗根、つまり平方根を求め
る場合に限定して説明する。入力数値データ107をA
とし、平方根をCとする。則ち、C2=Aである。
Principle of Coefficient Determination> To simplify the explanation, the explanation will be limited to the case of finding the square root. Input numerical data 107 to A
and let C be the square root. That is, C2=A.

A = C2に−122に−1+ C2b−227に−
2+ 、、、、+ aOで表わされるとする。但し、8
2に−1” 1である。
A = -122 to C2 -1 + C2b -227 -
2+ , , , + aO. However, 8
2 to -1” 1.

回路規模の関係で、n乗演算部101の出力109は2
に桁に制限され事となる。従って、近似値レジスタ10
2の有効数字は高々に桁となる。従って、求める平方根
C(実際は小数点以下を無視した近似値であるが)は高
々に桁であり、C= Ck+2に−1+ Cb−22に
−2+ 、、、、+ C。
Due to the circuit scale, the output 109 of the n-th power calculation unit 101 is 2
This is limited to digits. Therefore, approximation register 10
The significant figures of 2 are at most digits. Therefore, the square root C to be found (although it is actually an approximation value ignoring the decimal point) is an order of magnitude at most, and C=Ck+2 -1+ Cb-22 -2+ , , + C.

と表わされる。It is expressed as

先ず、最上位を越える桁位置(k+1桁以上)の係数は
必ず“0”となる事を示す。今、注目位111をに+1
桁目とする。そうすると、近似値レジスタ102に設定
される数値Xは、下位の係数はすべて“011であるか
ら、X=2にとなる。従って・ Xノ=22質 であり、一方、 A=C2 =(ck−12に−1+Ck−22に−2+、、、、+
Co)?= (Cb−+2  + 20b−+Ck−2
)22に一2÷(Ck−+Ck−3+ Gk−2ck−
2)22に−3+(Ck−22十〇に−20に−3+ 
Ck−ack−1)2に一’+・・崇+CO2 となる。Ok−+ 、 Ck−2,−Goが全て” 1
 ”である場合を考えてみると、(Ck−+2+ 20
に一+fll:に−z)は”3”テ、りす、又(Ck−
+Ck−3+ Ck−2ck−2) 1fII 2 I
+・・・ ・・・となって、C2の項に22kが表われ
る事はない、従って、Cくxが得られる。ところで、有
効数字をに桁に設定した場合(小数点以下を無視した場
合)は最大精度での最小数はl“′であるから。
First, it is shown that the coefficients in digit positions beyond the most significant (k+1 digits or more) are always "0". Now, the attention rank 111 is +1
Digit number. Then, the numerical value X set in the approximate value register 102 will be X=2 since all the lower coefficients are "011".Therefore, the quality of X=22, and on the other hand, A=C2=(ck -12 to -1+Ck-22 to -2+,,,,+
Co)? = (Cb-+2 + 20b-+Ck-2
) 22 to one 2 ÷ (Ck-+Ck-3+ Gk-2ck-
2) 22 to -3+ (Ck-22 〇 to -20 to -3+
Ck-ack-1)2 becomes 1'+...Takashi+CO2. Ok-+, Ck-2, -Go are all” 1
”, (Ck-+2+ 20
niichi+fll:ni-z) is “3” te, squirrel, matata (Ck-
+Ck-3+ Ck-2ck-2) 1fII 2 I
+......, and 22k never appears in the term C2. Therefore, C x x is obtained. By the way, if the number of significant figures is set to 1 (ignoring the decimal places), the minimum number with maximum precision is l"'.

C≦X−’1 =2に−1=2に−1+ ・・・+ 1
となる。つまり、Aと2乗値であるB=X2 との大小
判別がつけば、平方根Cのに+1桁目の係数は°°O°
°でなくてはならない事が解る番となる。
C≦X-'1 =2 to -1=2 to -1+ ...+ 1
becomes. In other words, if we can distinguish the magnitude of A and the square value B=X2, the +1st digit coefficient of square root C is °°O°
It's time to understand that it has to be °.

言いかえれば、上記操作を繰返せば、平方根Cの最上位
の係数をその位の位置を含めて決定できるわけである。
In other words, by repeating the above operation, the most significant coefficient of the square root C can be determined including the position of that order.

こうして最上位(k桁目)の係数Ck−1が決定すると
1次にに一1桁目を注目位として、近似値Xを X = C1,−12に−1+ 2に−2とする− A
 > (Ch−+2’−1) 2 である事に注目しつ
つ、AとB (=X2 )との大小関係が比較部100
により解れば、つまり A>B (=X2 ) (7)時は、C>Jxであるか
ら(k−1)位の係数Ck−2が“1 ”であると決定
でき、 A<B (=X) 2 ノ時、cくJXであるから、(
k−1)位の係数Ck−2が0″であると決定できる。
When the most significant (k-th digit) coefficient Ck-1 is determined in this way, the approximate value X is set to X = C1, -12 to -1+ 2 to -2, focusing on the 11th digit.
>(Ch-+2'-1) 2 , the comparison unit 100 determines the magnitude relationship between A and B (=X2).
In other words, when A > B (= Since (
It can be determined that the coefficient Ck-2 of order k-1) is 0''.

このような操作を全位に適用すれば、最高位から順に最
下位までの係数が決定され、結局近似値レジスタ102
に平方根が求まる。
If such an operation is applied to all ranks, the coefficients from the highest rank to the lowest rank are determined, and eventually the coefficients are stored in the approximate value register 102.
Find the square root of .

(近似値決定動作〉 第2図は、第1図の実施例中の近似値レジスタ102等
を更に具体的なものに変更した実施例の回路図である。
(Approximate Value Determination Operation) FIG. 2 is a circuit diagram of an embodiment in which the approximate value register 102 and the like in the embodiment of FIG. 1 are changed to more specific ones.

コンパレータ1は第1図の比較部100に相当するもの
で、A>B出力106及びA=B出力lOを出力する。
The comparator 1 corresponds to the comparing section 100 in FIG. 1, and outputs an A>B output 106 and an A=B output lO.

n乗ROM2は第1図のn乗演算部101に相当する。The n-th power ROM 2 corresponds to the n-th power calculation unit 101 in FIG.

そのアドレス入力としてA k−1〜AOを入力し、デ
ータとしてnXkビットのn乗値B109を出力する。
A k-1 to AO are input as the address input, and an nXk bit value B109 to the power of n is output as data.

第1図の近似値設定部102はn乗根格納レジスタ3に
注目位指定部104は注目位指定シフトレジスタ4に置
換えられている。n乗根格納レジスタ3はQk”Q+ 
のに個のフリップフロップからなってに桁のn乗根を出
力する。注目位指定シフトレジスタ4はPh”P+のに
個のフリップフロップからなり、Pk −PI から順
に1つづつセットされ、注目位を指定する。
The approximation value setting section 102 in FIG. The nth root storage register 3 is Qk”Q+
It consists of a number of flip-flops and outputs the n-th root of a number of digits. The point-of-interest designation shift register 4 consists of a number of flip-flops of Ph''P+, which are set one by one in order from Pk - PI to designate the point of interest.

注目位指定シフトレジスタ4のフリップフロップPk”
P+のクロックは演算装置のクロック6である。一方、
フリップフロップQk”Q+ の各クロック入力は、そ
れらに対応するフリップフロップPk /−PI の出
力変化(セット→リセット)である、つまり、注目位を
1つの位から次の位に移動しようとするときに、それま
での注目位に対応するn乗根格納レジスタ3のフリップ
フロ、ブが(A>B)出力106に応じて変化する、こ
れらが、第1図の実施例の係数変更部103に対応する
わけである。又、注目位指定シフトレジスタ4のフリッ
プフロップPl出力レディ(READY)信号は近似値
の演算終了を外部のCPUに示す信号である。
Flip-flop Pk of attention point designation shift register 4
The clock of P+ is the clock 6 of the arithmetic unit. on the other hand,
Each clock input of a flip-flop Qk"Q+ is an output change (set→reset) of the corresponding flip-flop Pk/-PI, that is, when trying to move the attention point from one place to the next. , the flip-flow of the n-th root storage register 3 corresponding to the current position of interest changes in accordance with the (A>B) output 106. These correspond to the coefficient changing unit 103 of the embodiment shown in FIG. Furthermore, the flip-flop Pl output ready (READY) signal of the attention point designating shift register 4 is a signal that indicates to the external CPU that the calculation of the approximate value has been completed.

順を追って動作を説明すると、不図示の例えばCPU等
の外部の制御装置から演算開始の信号スタートパルス5
が来ると、スタートパルス5はn乗根格納レジスタ3の
全フリップフロップをリセットする共に、注目位指定シ
フトレジスタ4のフリップフロップPk (最上位)の
みをセットし、他のフリップフロップPに−1””PI
 はリセットする。即ち、注目位指定シフトレジスタ4
は最上位に注目した。そうすると、近似値Xll0が(
10・・・0)8(Bは2進値を表わす)の値をもって
、ORゲートを介してn乗ROM2のアドレス人力Ak
−+−Anに入力する。n乗ROM2は、近似値x11
0をアドレス入力に入力して、nXkビットのn乗値B
109をコン2くレータlに出力する。ここで、クロッ
ク6の周期はn乗ROM2のサイクルタイムはより長く
、かつ同期している。則ち、必ずコンパレータ1の出力
が確定してから、次のクロック6が入力され、注目位が
次にシフトする。
To explain the operation step by step, a signal start pulse 5 for starting calculation is sent from an external control device such as a CPU (not shown).
When , the start pulse 5 resets all the flip-flops of the n-th root storage register 3, sets only the flip-flop Pk (top) of the attention point specification shift register 4, and sets the other flip-flops P by -1. ””P.I.
is reset. That is, the attention point specification shift register 4
focused on the top. Then, the approximate value Xll0 becomes (
With the value of 10...0)8 (B represents a binary value), the address Ak of the n-th power ROM2 is determined via the OR gate.
-+-Input to An. The n-th power ROM2 has an approximate value x11
Input 0 to the address input and set the nXk bits to the power of B
109 is output to the converter l. Here, the cycle of the clock 6 is longer than the cycle time of the n-th power ROM 2, and is synchronized. That is, the next clock 6 is input after the output of the comparator 1 is determined, and the point of interest is shifted to the next one.

コンパレータlは数値データA107とn乗値B109
を比較して、それらの大小判別結果(A=B)10及び
(A>B)106を出力する。
Comparator l is numerical data A107 and n-th power value B109
are compared, and their size determination results (A=B) 10 and (A>B) 106 are output.

今、近似値Xi l O(10・・−0) sがn乗値
B109より大きいとしよう。そうすると、(A>B)
106は°O°”であるから、n乗根格納レジスタ3の
フリップフロップQkがリセットされようとする(前述
したように、付勢されるフリップフロップは注目位に対
応するフリップフロップのみである)。クロック6が入
力すると、注目位指定シフトレジスタ4は1つシフトす
る。則ち、次の注目位(フリップフロップPK−1に対
応)を指す、このPKの変化を捕らえて、フリップフロ
ップQkがリセットする。
Now, suppose that the approximate value Xi l O (10...-0) s is larger than the n-th power value B109. Then, (A>B)
106 is "°O°", the flip-flop Qk of the nth root storage register 3 is about to be reset (as mentioned above, the only flip-flop that is energized is the flip-flop corresponding to the position of interest). When the clock 6 is input, the attention point designation shift register 4 shifts by one.In other words, by catching the change in this PK pointing to the next attention point (corresponding to the flip-flop PK-1), the flip-flop Qk Reset.

次の近似値は(oio・・・0)B となる。前述した
のと同様な動作により、コンパレータ2には大小判別結
果が出力されるが、今度はA>Bであったとしよう。そ
うすると(A>B)106は” 1 ”となり、フリッ
プフロップPK−1により付勢されているフリップフロ
ップQに−1のみが次の注目位のシフト時にセットする
。こうして、n乗根格納レジスタ3には近似値(010
・・・O)Bが格納された。
The next approximate value is (oio...0)B. Through the same operation as described above, the size determination result is output to the comparator 2, but this time let us assume that A>B. Then, (A>B) 106 becomes "1", and only -1 is set in the flip-flop Q, which is energized by the flip-flop PK-1, when the next position of interest is shifted. In this way, the approximate value (010
...O)B has been stored.

以上の動作を繰り返す水により、最高位から順にn乗根
の係数が決定されていく。第3図に、上記動作のタイミ
ングチャートを示す。
By repeating the above operations, the nth root coefficients are determined in order from the highest order. FIG. 3 shows a timing chart of the above operation.

ここで、信号レディ115について説明する。Here, the signal ready 115 will be explained.

前述したように、フリップフロップP1は注目位指定シ
フトレジスタ4の最終段であるから、信号レディ115
が“1パである事は演算動作の終了を表わす、この信号
レディ115をみてCPU等は演算の終了を知り、n乗
根格納レジスタ3の各ステージ出力をn乗根として取り
込む。演算の途中でコンパレータ1の(A=B)10が
1′となった時も、n乗根が見付かったのだから、同様
に演算の終了である。そこで(A=B)10が強制的に
フリップフロップPI をセットする。こうすれば、最
終段までの演算終了を待つことなく、高速に演算結果が
得られる。
As mentioned above, since the flip-flop P1 is the final stage of the attention point designation shift register 4, the signal ready 115
is "1", which indicates the end of the calculation operation.The CPU etc. know the completion of the calculation by looking at this signal ready 115, and take in the output of each stage of the n-th root storage register 3 as the n-th root. When (A=B) 10 of comparator 1 becomes 1', the n-th root has been found, so the operation ends in the same way.Therefore, (A=B) 10 is forcibly connected to the flip-flop PI. In this way, the calculation result can be obtained quickly without having to wait for the calculation to finish up to the final stage.

〈実施例の拡張〉 上記説明は平方根の場合について行ったが、一般的にn
乗根にも適用できる事は容易に了解される。この場合、
上記説明は入力数値データAの最上位(Most 51
gn1ficant Bit)はnXk位であるとして
行ったが、そのような場合でない時(例えば最上位が(
nXk+ 1)等の時)は、例えば最上位の係数を°“
O゛として仮に桁数を増やして、上記操作を行えば問題
ない。
<Extension of Example> The above explanation was given for the case of square root, but generally n
It is easily understood that this can also be applied to root roots. in this case,
The above explanation is based on the highest level of input numerical data A (Most 51
gn1ficant Bit) is at the nXk position, but when this is not the case (for example, the topmost bit is (
nXk+ 1) etc.), for example, the highest coefficient is
If you increase the number of digits as O゛ and perform the above operation, there will be no problem.

一般に演算装置内部では、数値データを扱って演算する
場合に、その有効数字部分についての処理と小数点位置
についての処理を別個に行う事が多い。これは小数点位
置については基本的にシフトで処理できるのに対して、
有効数字部分については演算そのものを行わなければな
らないからである。この観点からでは、第1図及び第2
図に示した演算装置は有効数字部分の処理に主眼を置い
たものであり、小数点位置は問題にしていない。
Generally, within an arithmetic device, when handling numerical data and performing arithmetic operations, processing for the significant figure part and processing for the decimal point position are often performed separately. This is because the decimal point position can basically be handled by shifting, but
This is because the calculation itself must be performed for the significant figure part. From this point of view, Figures 1 and 2
The arithmetic device shown in the figure focuses on processing the significant figures, and does not care about the position of the decimal point.

従って、第1図又は第2図の実施例において、入力の数
値データA107の桁数をどのように取り扱うかの一般
論は、そのn乗根の有効数字桁数をに桁で求めるのであ
れば、入力する数値データ107の桁数を、そのMSH
の桁位置に関わらず、上位に” o ”を増やしてnX
k桁として処理すればよい事となる。
Therefore, in the embodiment of FIG. 1 or 2, the general theory of how to handle the number of digits of the input numerical data A107 is that if the number of significant digits of the n-th root is calculated in digits, then , the number of digits of the input numerical data 107, its MSH
Regardless of the digit position, add "o" to the top and make nX
It is sufficient to process it as k digits.

このような場合についても統一的に扱う手法は浮動小数
点を導入する事である。そこで、以下に浮動小数点デー
タのn乗根を求める実施例について説明する。
A method to uniformly handle such cases is to introduce floating point numbers. Therefore, an example for calculating the n-th root of floating point data will be described below.

く浮動小数点データ〉 第4図は演算装置内部での数値データの浮動少数点表示
を表わす0図中、指数部%は811〜e a c7) 
lビット長で、仮数部60はm2に−1〜n。
Floating point data> Figure 4 shows the floating point display of numerical data inside the arithmetic unit.
It is l bit long, and the mantissa part 60 is -1 to n in m2.

の2にビット長である。仮数部60の表示は通常少数点
を最左側に置く場合と、最右側に置く場合の2通りある
。本実施例では、最初に小数点を最右側に置く場合を説
明し、次に最左側に置く、場合を説明する。
2 is the bit length. There are usually two ways to display the mantissa part 60: a case where the decimal point is placed on the leftmost side, and a case where the decimal point is placed on the rightmost side. In this embodiment, the case where the decimal point is placed on the rightmost side will be explained first, and then the case where the decimal point will be placed on the leftmost side will be explained.

く浮動小数点データを処理する実施例)説明を簡単にす
るため、平方根の場合について説明する。第5図に示さ
れた実施例では、指数入力29が81−1〜eo、仮数
入力A21がm2に一1〜moである数値データが入力
されて、指数出力28がe)−2〜eo、仮数出力13
がmk−1”’mOである平方根を得る。
(Example for processing floating point data) To simplify the explanation, the case of square roots will be explained. In the embodiment shown in FIG. 5, numerical data in which the exponent input 29 is 81-1 to eo and the mantissa input A21 is 1 to 1 to m2 is input, and the exponent output 28 is e)-2 to eo. , mantissa output 13
Find the square root where is mk-1''mO.

図中、27は指数部を記憶するラッチ、20は仮数入力
21と2乗ROM30の出力22との大きさを比較する
コンパレータで、第1図の比較部100に対応する。3
0はn乗根格納レジスタ3からの近似値31を2乗する
ROMで、第1図のn乗演算部101に対応する。この
ROM30は第2図のROM2と基本的には変りがない
、n東根格納レジスタ3及び注目位指定シフトレジスタ
4については第2図の実施例と同じなので、仮数部の演
算については第2図の場合と同様となる。
In the figure, 27 is a latch that stores the exponent part, and 20 is a comparator that compares the magnitude of the mantissa input 21 and the output 22 of the square ROM 30, which corresponds to the comparison section 100 in FIG. 3
0 is a ROM that squares the approximate value 31 from the n-th root storage register 3, and corresponds to the n-th power calculation unit 101 in FIG. This ROM 30 is basically the same as the ROM 2 shown in FIG. 2. Since the n East root storage register 3 and the attention point designation shift register 4 are the same as in the embodiment shown in FIG. The same is true for .

その説明は省略する事とし、ここでは指数部30の処理
について説明する。
The explanation thereof will be omitted, and the processing of the exponent part 30 will be explained here.

〈指数部の処理)・・・小数点は最右側の場合指数部処
理の基本動作原理は次のようである。
<Processing of exponent part) When the decimal point is on the rightmost side, the basic operating principle of exponent part processing is as follows.

一般的に、仮数部をa、指数部すの浮動少数点表示デー
タYは Y=aX20.、、、、、、、、、、、、、、、、、(
L)となる、指数すが偶数(b=2+s) (mは正の
整数)の時を考察してみると、(1)式は=aX22−
となる。従って、Yの平方根を求める事は指数部につい
ては指数を右に1ビツトシフトすれば良く、又仮数部に
ついてはaの平方根のみを2乗ROM30に格納してお
けば、高速に浮動小数点表示の数値データの平方根が容
易に求められる。指数部のシフトは例えばラッチ27に
ラッチする時に1ビツトシフトしてラッチする。
Generally, floating point display data Y with a mantissa part and an exponent part is Y=aX20. ,,,,,,,,,,,,,,,,,,,(
Considering the case where the index is an even number (b=2+s) (m is a positive integer), equation (1) becomes =aX22-
becomes. Therefore, to find the square root of Y, the exponent part only needs to be shifted one bit to the right, and the mantissa part can be quickly expressed as a floating point value by storing only the square root of a in the square ROM 30. Easily find the square root of the data. For example, when the exponent part is latched into the latch 27, it is shifted by one bit and latched.

しかし指数部30の最下位ピッ)eoが°”1″の時(
即ち、指数部が奇数の時)に、指数部をシフトすると指
数の有効データが失われるので次のようにする。bが奇
数の場合、即ち、b = 2 m +1 (mは正の整
数)ならば(1)式を=+=aX2X22m   =2
aX221.......(2)と変形すれば、指数部
をシフトしても有効数字も失われず問題ない、そこで、
指数人力eI−1〜eoの最下位eOを信号線25を介
してフンパレータ20に入力する。この際、仮数人力A
21全体が左に1ビツトシフトするようにすると、仮数
部は2倍された事となり都合がよい。又指数が偶−数の
場合でも、このように最下位eoをコンパレータ20に
入力しても0”であるから、シフトしなくて済むだけで
ある。こうして、小数点位置が最右側のときは、第5図
に示された実施例で簡単に求められる。
However, when the lowest pix of the exponent part 30) eo is °"1" (
That is, when the exponent part is an odd number), if the exponent part is shifted, valid data of the exponent will be lost, so the following procedure is performed. If b is an odd number, that is, b = 2 m + 1 (m is a positive integer), then use formula (1) as =+=aX2X22m =2
aX221. .. .. .. .. .. .. If you transform it into (2), there is no problem even if you shift the exponent part without losing the significant digits, so,
The lowest eO of the exponents eI-1 to eo is input to the hump parator 20 via the signal line 25. In this case, mantissa human power A
If the entire 21 is shifted one bit to the left, the mantissa will be doubled, which is convenient. Also, even if the exponent is an even number, even if the lowest eo is input to the comparator 20 in this way, it will be 0'', so there is no need to shift it.In this way, when the decimal point is at the rightmost position, This can be easily obtained using the example shown in FIG.

(小数点が最左側の場合の実施例〉 本実施例でいう小数点を最左側におくとは、仮数部で小
数点を最左側に置き、かつ最上位のビ、ットは常に“1
°゛であるように正規化するものである0例えば°”1
1.0O101X 23”は’ 1.IQOlolX 
24”とされる、このような正規化の場合当然2乗RO
M30の格納データも正規化されねばならない。
(Example in which the decimal point is on the leftmost side) In this example, placing the decimal point on the leftmost side means placing the decimal point on the leftmost side in the mantissa, and the most significant bit is always “1”.
Normalize it so that °゛ is 0, for example °”1
1.0O101X 23"is' 1.IQOlolX
24”, and in this case of normalization, naturally the squared RO
The data stored in M30 must also be normalized.

しかし、例えば(1,1)e)2なる数値は((1,1
)a)z=((1,5)o)2= ((2,25)o)
  = ((10,01)a)となり、小数点位置が右
にずれてしまう(Oは十進の意味である)、これでは実
質的にコンパレータ20で比較できない。更に、前述し
たように指数部が奇数の場合、第5図において、指数部
の最下位eQを信号線25を介してコンパレータ20に
入力すると、仮数部が2倍される事となり、同じように
小数点位置がずれて比較できなくなる。
However, for example, the number (1,1)e)2 is ((1,1)
)a)z=((1,5)o)2=((2,25)o)
= ((10,01)a), and the decimal point position shifts to the right (O means decimal), which practically cannot be compared by the comparator 20. Furthermore, as mentioned above, when the exponent part is an odd number, if the lowest eQ of the exponent part is inputted to the comparator 20 via the signal line 25 in FIG. The decimal point will be shifted and comparisons will not be possible.

このような不都合を解消するために、本実施例では2つ
の工夫を第5図の実施例に加える。その1つは、第6図
に示すようにコンパレータ20を1ビツトのレジスタ4
0及゛び2にビットのレジスタ41、(2k+ 1)ビ
ットの比較器42.1ビツトのレジスタ44及び2にビ
ットのレジスタ43等で構成する。2にビットのレジス
タ41には仮数21を入力する。レジスタ40には指数
の最下位eQを入力する。ここで、仮数21の小数点位
置は不変であることに注意されたい。
In order to eliminate such inconveniences, this embodiment adds two features to the embodiment shown in FIG. 5. One of them is to connect the comparator 20 to a 1-bit register 4 as shown in FIG.
It consists of a register 41 for 0 and 2 bits, a comparator 42 for (2k+1) bits, a register 44 for 1 bit, a register 43 for 2 bits, and the like. The mantissa 21 is input to the 2-bit register 41. The lowest exponent eQ is input to the register 40. Note that the decimal point position of the mantissa 21 remains unchanged.

第2の工夫は第7図に示すようなROM30の構成にす
る事である。第7図のROMは、図面の紙面の関係上、
−例として11ビット入力、22ビツト出力であるもの
を示した。ROM7ドレス入力が2乗されるべき入力数
値を意味し、ROM出力が2乗された数値である。特に
、小数点位置はr21とr2Gの間にあり、r22のビ
ットは2乗した結果”l”をオーバフローした事を示す
ビットである。このr72のビットは如何なる数値を入
力すれば発生するかは前もってわかる。説明を具体的に
するために、” 1.4150390825″(各J−
2)が入力される場合について説明する。ROM30に
は“” 10110101001°”が入力される。こ
のとき、ROM30の仮数出力r21〜roは°’ 1
000000000100110010001”が出力
される。またビットr22も°“1′”となる。
The second idea is to configure the ROM 30 as shown in FIG. The ROM in Figure 7 is
- As an example, an 11-bit input and 22-bit output is shown. The ROM7 address input means the input numerical value to be squared, and the ROM output is the squared numerical value. In particular, the decimal point position is between r21 and r2G, and the bit of r22 is a bit indicating that the result of squaring overflowed "l". It is known in advance what numerical value should be input to generate the r72 bit. In order to make the explanation concrete, "1.4150390825" (each J-
The case where 2) is input will be explained. ""10110101001°" is input to the ROM 30. At this time, the mantissa outputs r21 to ro of the ROM 30 are °' 1
000000000100110010001" is output. Bit r22 also becomes "1'".

これらの(2に+1)ビットのr2k”ro を第6図
に示すように夫々レジスタ43.44に入力する。こう
すれば、小数点位置のずれも生じず、比較器42で2に
+1ビツトを比較して大小関係も判別できる。特に、か
かる正規化を用いれば、前述した小数点位置を最右側に
設定する正規化法に比べて、シフトに要する時間が必要
なくなり、更に高速化される。
These (2+1) bits r2k"ro are input to the registers 43 and 44, respectively, as shown in FIG. It is also possible to determine the magnitude relationship by comparison.In particular, if such normalization is used, compared to the normalization method described above in which the decimal point position is set to the rightmost side, the time required for shifting is not required, and the speed is further increased.

以上説明したように、浮動小数点データに対しても、如
何なる正規化法を用いても容易に2乗根が求められる事
が実証された。
As explained above, it has been demonstrated that the square root can be easily obtained even for floating point data using any normalization method.

〈変形例についての考察〉 第5図、第6図の実施例は平方根を求めるものであった
。整数型の入力数値データのn乗根に対しては第1図、
第2図の構成をそのまま使用できる。
<Considerations on Modifications> The embodiments shown in FIGS. 5 and 6 are for finding square roots. For the n-th root of input numerical data of integer type, Figure 1,
The configuration shown in FIG. 2 can be used as is.

一方、浮動小数点に対して、Y=aX2bのn乗根(但
しn=21.jは整数)を求める方法についても言及す
ると、指数部については平方根の時と同様にjピントシ
フトして指数演算部に入力すればよl、%。仮数部のR
OM内のデータについては以下のようにする。jビット
ずらした為に失われる指数部のデータは1,2.・・・
、n−1のいずれかである。従って、(a)’、(2a
 )n、  (3a) n  、・・・・・・。
On the other hand, referring to the method of finding the nth root of Y=aX2b (where n=21.j is an integer) for floating point numbers, for the exponent part, as with the square root, shift the focus by j and perform exponent operation. Just enter it in the section, %. R of the mantissa
The data in OM is as follows. The exponent data lost due to shifting j bits is 1, 2, . ...
, n-1. Therefore, (a)', (2a
)n, (3a) n,...

((n−1)a)l/n をROM内に前も°ッテ格納
しておいて、これらのいずれかを指数部の下位ビットe
 n−1〜eQの値によって選べばよい、こうして、n
乗根に対しても高速に演算できる。
((n-1)a)l/n is previously stored in the ROM, and one of these is stored as the lower bit e of the exponent.
It can be selected depending on the value of n-1 to eQ. In this way, n
It can also perform high-speed calculations on roots.

ところで、上記の浮動小数点表示では最上位は常に61
°゛なので、ROMの容量を減らすためにROM内には
データとして直接入力しない方法も考えられる。
By the way, in the floating point display above, the topmost value is always 61.
Therefore, in order to reduce the capacity of the ROM, it is possible to consider a method in which data is not directly input into the ROM.

〈実施例の効果〉 以上説明した実施例から、 ■:整数型又は浮動小数点型の入力数値のn乗根を高速
に求める事ができる。この場合、必要とされるクロック
数は、入力の数値(浮動小数点の場合は仮数部分)のビ
ット数の半分のクロック数であり、lクロックの時間は
ROMのアクセス時間及びコンパレータの遅延時間のみ
である。
<Effects of the Embodiment> From the embodiment described above, (1): The n-th root of an input numerical value of an integer type or a floating point type can be determined at high speed. In this case, the required number of clocks is half the number of bits of the input numerical value (the mantissa part in the case of floating point), and the clock time is only the ROM access time and comparator delay time. be.

■:演算課程で、コンパレータの=出力が°“l ”と
なった時は、その時点でn乗根が得られ、更に高速化が
果たせる。
■: During the calculation process, when the = output of the comparator becomes °“l”, the n-th root is obtained at that point, and further speeding up can be achieved.

■:回路構成が整然としており、拡張性に富み、従って
LSI化が容易である。
(2): The circuit configuration is well-organized, highly expandable, and therefore easy to integrate into an LSI.

■:従来のように、n乗根用及びn乗用の2つのROM
を別個に備えておく必要がなくなり、回路の小型化に適
する。
■: As before, two ROMs for n-th root and n-th root
This eliminates the need to separately provide a separate circuit, making it suitable for circuit miniaturization.

[発明の効果] 以上説明したように本発明の演算装置によれば、如何な
る型の数値でもn乗根が高速に得る事ができる。
[Effects of the Invention] As explained above, according to the arithmetic device of the present invention, the n-th root of any type of numerical value can be obtained at high speed.

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

第1図は実施例の基本構成図、 第2図は他の実施例の回路構成図、 第3図は第2図の実施例における係数を決定するための
動作のタイミングチャート。 第4図は浮動小数点データの構成を説明する図、 第5図は浮動小数点データのn乗根を得るための演算装
置の回路図、 第6図は変形例における第6図の比較部の詳細構成図、 第7図は平方根を求める場合の2乗ROMの内容を示す
一例の図である。 図中、 1.20・・・コンパレータ、2・・・n乗ROM、3
・・・n乗根格納レジスタ、4・・・注目位指定シフト
レジスタ、5・・・スタートパルス、6・・・クロック
、21・・・仮数人力A、22・・・平方値、10.2
3・・・A=B、24,106・・・A>B、25・・
・信号線、26・・・指数入力(e l−+ 〜e+)
、27・・・ラッチ、28−・・指数出力(el−2〜
e+、) 、  30−2乗ROM、31 、110 
・・・近似値X、40,41.43,44.・・・レジ
スタ、42・・・比較器、100・・・比較部、101
・・・n乗演算部、102・・・近似値レジスタ、10
3・・・係数設定部、104・・・注目位指定部、10
5・・・係数変更部、108・・・n乗根C,109・
・・n乗値B、111 ・・・注目位、112・・・注
目位より上位、113・・・注目位より下位、115・
・・信号レディである。
FIG. 1 is a basic configuration diagram of the embodiment, FIG. 2 is a circuit diagram of another embodiment, and FIG. 3 is a timing chart of operations for determining coefficients in the embodiment of FIG. Fig. 4 is a diagram explaining the structure of floating point data, Fig. 5 is a circuit diagram of an arithmetic unit for obtaining the nth root of floating point data, and Fig. 6 is a detail of the comparison section of Fig. 6 in a modified example. FIG. 7 is a block diagram showing an example of the contents of a square ROM when calculating a square root. In the figure, 1.20... comparator, 2... nth power ROM, 3
... nth root storage register, 4 ... point of interest specification shift register, 5 ... start pulse, 6 ... clock, 21 ... mantissa human power A, 22 ... square value, 10.2
3...A=B, 24,106...A>B, 25...
・Signal line, 26...Exponent input (el-+ ~ e+)
, 27... Latch, 28-... Exponential output (el-2~
e+, ), 30-square ROM, 31, 110
...Approximate value X, 40, 41.43, 44. ...Register, 42...Comparator, 100...Comparison unit, 101
. . . n-th power operation unit, 102 . . . Approximate value register, 10
3...Coefficient setting section, 104...Attention point specification section, 10
5...Coefficient change unit, 108...n-th root C, 109.
... n power value B, 111 ... attention level, 112 ... higher than the attention position, 113 ... lower than the attention position, 115.
...Signal ready.

Claims (5)

【特許請求の範囲】[Claims] (1)入力数値データのn乗根を求める演算装置におい
て、該n乗根の近似値を格納する近似値格納部と、該近
似値格納部に格納された近似値のn乗値を演算するn乗
演算部と、前記入力数値データと前記n乗値とを比較し
て大小判別結果を出力する比較部と、前記近似値の各位
毎の係数を決定するために前記近似値の注目する位を所
定の順に指定する注目位指定部と、該注目位指定部が注
目位を指定する毎に、前記注目位の係数を第1の所定の
値に設定する係数設定部と、前記比較部の大小判別結果
に従って前記注目位の係数を第2の所定の値に変更する
係数変更部とを有する演算装置。
(1) An arithmetic device that calculates the nth root of input numerical data includes an approximate value storage section that stores an approximate value of the nth root, and calculates the nth power value of the approximate value stored in the approximate value storage section. an n-th power calculation unit, a comparison unit that compares the input numerical data and the n-th power value and outputs a result of size determination, and a focused position of the approximate value to determine a coefficient for each position of the approximate value. an attention point specifying section that specifies the attention point in a predetermined order; a coefficient setting section that sets a coefficient of the attention point to a first predetermined value each time the attention point specification section specifies the attention point; and a coefficient changing unit that changes the coefficient of the attention position to a second predetermined value according to a result of size determination.
(2)注目位指定部が注目位を指定する所定の順は、近
似値の最高位からの降順であり、近似値格納部には、前
記注目位より上位の位の係数は全て既知であり、下位の
位の係数は全て“0”であり、第1の所定の値は“1”
であるように近似値が設定され、n乗値が入力数値デー
タより大であるとの判別結果を得た時の第2の所定の値
は“0”である事を特徴とする特許請求の範囲第1項に
記載の演算装置。
(2) The predetermined order in which the attention point designation section specifies the attention points is a descending order from the highest approximate value, and all coefficients higher than the attention point are known in the approximate value storage section. , the coefficients in the lower digits are all “0”, and the first predetermined value is “1”
The second predetermined value is "0" when the approximation value is set so that the n-th power value is larger than the input numerical data. The computing device according to scope 1.
(3)注目位指定部が近似値の全位を指定したとき、又
は比較部の大小判別結果が等しいとの判断であるときは
、近似値格納部の近似値を求めるn乗根とする事を特徴
とする特許請求の範囲第1項又は第2項に記載の演算装
置。
(3) When the attention point specification section specifies all the approximate values, or when the comparison section determines that the size determination results are equal, use the n-th root to find the approximate value in the approximate value storage section. An arithmetic device according to claim 1 or 2, characterized in that:
(4)入力数値データは浮動小数点表示の数値データで
ある事を特徴とする特許請求の範囲第1項乃至第3項の
いずれかに記載の演算装置。
(4) The arithmetic device according to any one of claims 1 to 3, wherein the input numerical data is numerical data expressed as a floating point number.
(5)n乗演算部はROMにて構成されている事を特徴
とする特許請求の範囲第1項乃至第4項のいずれかに記
載の演算装置。
(5) The arithmetic device according to any one of claims 1 to 4, wherein the n-th power arithmetic unit is constituted by a ROM.
JP19775585A 1985-09-09 1985-09-09 Arithmetic unit Pending JPS6258333A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19775585A JPS6258333A (en) 1985-09-09 1985-09-09 Arithmetic unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP19775585A JPS6258333A (en) 1985-09-09 1985-09-09 Arithmetic unit

Publications (1)

Publication Number Publication Date
JPS6258333A true JPS6258333A (en) 1987-03-14

Family

ID=16379804

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19775585A Pending JPS6258333A (en) 1985-09-09 1985-09-09 Arithmetic unit

Country Status (1)

Country Link
JP (1) JPS6258333A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02165328A (en) * 1988-12-20 1990-06-26 Matsushita Electric Ind Co Ltd Device for extraction of square root
US5147070A (en) * 1990-03-23 1992-09-15 Yamato Kakozai Co., Ltd. Pouring plug for a container having a tubular blade
JP2006243826A (en) * 2005-02-28 2006-09-14 Sony Corp Floating point arithmetic device and computer program for operating m-root of floating-point value

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02165328A (en) * 1988-12-20 1990-06-26 Matsushita Electric Ind Co Ltd Device for extraction of square root
US5147070A (en) * 1990-03-23 1992-09-15 Yamato Kakozai Co., Ltd. Pouring plug for a container having a tubular blade
JP2006243826A (en) * 2005-02-28 2006-09-14 Sony Corp Floating point arithmetic device and computer program for operating m-root of floating-point value

Similar Documents

Publication Publication Date Title
US4939686A (en) Method and apparatus for shared radix 4 division and radix 4 square root
EP0441121A2 (en) Arithmetic operation apparatus for elementary function
EP1049001A1 (en) Arithmetic apparatus
KR100756137B1 (en) Division and square root arithmetic unit
EP3286635A1 (en) High performance division and root computation unit
JP2008304921A (en) Improved modular reduction operator
US6847986B2 (en) Divider
US5268857A (en) Device and method for approximating the square root of a number
JP3003467B2 (en) Arithmetic unit
JPH05204611A (en) Method and device for executing pre-scale type division
JPS6258333A (en) Arithmetic unit
JPH082014B2 (en) Multi-stage digital filter
WO2023134507A1 (en) Stochastic calculation method, circuit, chip, and device
CN115146769A (en) Digital circuit module for calculating tanh function based on range addressable lookup table
US3716843A (en) Modular signal processor
JPH0585924B2 (en)
JP7006808B2 (en) Arithmetic processing unit and control method of arithmetic processing unit
US4881193A (en) Rational number operation unit for reduction
US7403966B2 (en) Hardware for performing an arithmetic function
KR100506470B1 (en) Method and hardware for computing reciprocal square root and a storage medium
JP2508286B2 (en) Square root calculator
US6954743B2 (en) Optimized method of computing the degree of membership of a fuzzy variable, and a calculator circuit implementing the method
JPH0721012A (en) Divider
US5737492A (en) Fuzzy logic membership function generating apparatus
US5081606A (en) Cube root calculation apparatus