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
JPS6029409B2 - Trigonometric function calculation device - Google Patents
[go: Go Back, main page]

JPS6029409B2 - Trigonometric function calculation device - Google Patents

Trigonometric function calculation device

Info

Publication number
JPS6029409B2
JPS6029409B2 JP1039078A JP1039078A JPS6029409B2 JP S6029409 B2 JPS6029409 B2 JP S6029409B2 JP 1039078 A JP1039078 A JP 1039078A JP 1039078 A JP1039078 A JP 1039078A JP S6029409 B2 JPS6029409 B2 JP S6029409B2
Authority
JP
Japan
Prior art keywords
storage means
contents
value
register
gate
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
Application number
JP1039078A
Other languages
Japanese (ja)
Other versions
JPS54104249A (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.)
NEC Corp
Original Assignee
Nippon Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP1039078A priority Critical patent/JPS6029409B2/en
Publication of JPS54104249A publication Critical patent/JPS54104249A/en
Publication of JPS6029409B2 publication Critical patent/JPS6029409B2/en
Expired legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Description

【発明の詳細な説明】 本発明は入力される角度変数に対する三角関数値を計算
するN進計算機における三角関数計算装置に関し、特に
座標変換によって上記三角関数値を計算する装置に関す
るものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a trigonometric function calculation device for an N-ary computer that calculates trigonometric function values for input angular variables, and particularly to a device that calculates the trigonometric function values by coordinate transformation.

従来、電子式卓上計算機で三角関数値を計算する方法と
して、級数展開等の近似式を利用する方法や、常微分方
程式の数値解を使用する方法などがあったが、いずれも
計算方法が複雑であり、十分な精度で演算させるために
は演算時間が長くなりすぎるという欠点がある。
Traditionally, methods for calculating trigonometric function values using electronic desktop calculators include methods that use approximations such as series expansion, and methods that use numerical solutions of ordinary differential equations, but all of these calculation methods are complicated. However, there is a drawback that the calculation time is too long to perform the calculation with sufficient accuracy.

さらにデグリー(十進度数)、ラジアン、グラジアン等
の角度単位系によってそれぞれ別の正規化が必要になる
という欠点がある。本発明の目的は上述した欠点を除去
した三角関数計算装置を提供することにある。
Furthermore, there is a drawback that different normalization is required depending on the angle unit system such as degrees (decimal degrees), radians, gradians, etc. An object of the present invention is to provide a trigonometric function calculation device that eliminates the above-mentioned drawbacks.

本発明によれば、通常の四則計算に使用するゲート群と
共通なゲートが多くハードウェアが簡単になる。
According to the present invention, there are many gates that are common to the gate group used in normal four arithmetic calculations, and the hardware is simplified.

また数値発生器の出力tan‐IN−Kあるいは1びt
an‐IN−Kを変数の単位系と同じ単位系のものとす
るだけで、いかなる単位系の計算も可能となり、従って
各単位系別に必要とされた正規化が不要となりかつ十分
な精度の演算を行なうのに必要な演算時間を短縮するこ
とができる。以下、本発明の原理および実施例を図面を
参照して説明する。
Also, the output of the numerical value generator tan-IN-K or 1 bit t
By simply setting an-IN-K to be in the same unit system as the unit system of the variable, calculations in any unit system are possible, which eliminates the need for normalization for each unit system and allows calculations with sufficient accuracy. The calculation time required to perform this can be reduced. Hereinafter, the principle and embodiments of the present invention will be explained with reference to the drawings.

本発明の演算原理はCORDIC(CMrdinate
RotationDigtaI Computerの略
:一松 信著、“初等関数の数値計算”1974王教育
出版発行、第三章四節参照)と呼ばれるものであり、特
に正薮(Gn)値を求める場合を例として以下に述べる
The calculation principle of the present invention is CORDIC (CMrdinate).
Abbreviation for RotationDigtaI Computer: Written by Makoto Ichimatsu, “Numerical Calculations of Elementary Functions”, published by Wang Kyoiku Publishing, 1974, see Chapter 3, Section 4).The following is an example of how to calculate the Gn value. I will explain.

複素平面上に点(xk,yk)が与られたものとし、m
式の如き一次変換を加え、新しい点(x川,,yk+,
)を作る。‘1}式を複数形式で表わすと xk+,十lyk+,=(xK+iyk)(1十i6K
).・・.・・■となり、極座標上に第1図の如く表わ
すことができる。
Assume that a point (xk, yk) is given on the complex plane, and m
Adding a linear transformation as shown in the equation, we obtain a new point (x river,, yk+,
)make. Expressing the expression '1} in plural form, xk+, 10lyk+, = (xK+iyk) (10i6K
).・・・. ...■, which can be expressed on polar coordinates as shown in Figure 1.

すなわち、{1’式の1次変換を極座標上の点(xk,
yk〉に加え新しい点(xk十,,yk十,)を作ると
、新しい点の動径Rk+,と偏角Aw,は急〒三≦暮三
千さ 害毒≧≦よ士ぎさ2)・/2}‐‐‐‘31の如
く表わすことができる。このように‘1)式の一次変換
を行なうことは、‘3}式のようにもとの点の動座をK
k倍し偏角をQkだけ回転させる回し伸ばし変換に相当
する。ここで新しい点は偏角地だけ回転した方向でもと
のベクトルに直角に進んだ点に相当する。ここで適当な
6kの列に対しk=0からk=n−1までこの変換を順
次繰り返し(x。
In other words, the linear transformation of equation {1' is converted to a point (xk,
If we create a new point (xk 10,, yk 10,) in addition to yk〉, the new point's radius Rk+ and declination angle Aw will become steep. 2}--'31. Performing the linear transformation of equation '1) in this way means changing the position of the original point to K as shown in equation '3}.
This corresponds to an extension conversion in which the argument is multiplied by k and the argument is rotated by Qk. Here, the new point corresponds to a point that is perpendicular to the original vector in a direction rotated by the declination. Here, this conversion is sequentially repeated from k=0 to k=n-1 for an appropriate 6k column (x.

,れ)→(xn−yn)となった時以下の関係式を得る
。ここで初期値として丸=0すなわちへ=0を用いると
‘4}式より又n=KXoCOSQ yn=KX。
, Re)→(xn-yn), we obtain the following relational expression. Here, if circle = 0, that is, = 0 is used as the initial value, n = KXoCOSQ yn = KX from the formula '4}.

sinQ ・・・{5
ー得られる。この‘5ー式のKを計算することにより直
接余弦(cos)値、正弦(Sin)値を求めることが
できるが、本源理による演算によれば次式に示すように
Kを求めることなくxnとynとの比として正援(ねn
)値を求めることができる。
sinQ...{5
- can be obtained. By calculating K in this '5-formula, it is possible to directly obtain the cosine (cos) value and sine (Sin) value, but according to the operation based on the original principle, xn and yn as a ratio (ne n
) value can be found.

ねnQ蓋:登窯暑薫きき薫き …‘6}他の三角関
数値は以上のようにして求めた正援値を基に変換するこ
とにより求める。
NenQ Lid: Nobori kiln heat smell Kiki Kaoruki...'6}Other trigonometric function values are obtained by converting based on the support value obtained in the above manner.

本発明は上記原理に基づいて任意に与えられた角度の正
援値を計算する装置を提供するものである。
The present invention provides an apparatus for calculating the support value of an arbitrarily given angle based on the above principle.

すなわち、本発明では与えられた角度Qに変換列6kの
逆正嬢値(tan‐16x)すなわちQkがいくつ存在
するかを数え、その後一定の座標、例えば(1,0)を
与えて上記変換列6kを用い前に教えた回数だけ回し伸
ばし変換することにより与えられた角度上にある変換点
の座標位置(Xn,yn)を求め、yn/xnを計算す
ることによって与えた角度Qの正援値を得るものである
。変換列としてはN進計算機の場合6k=N‐kを使用
する。
That is, in the present invention, the number of inverse positive and negative values (tan-16x), that is, Qk, of the transformation sequence 6k is counted for a given angle Q, and then constant coordinates, for example (1, 0) are given, and the above transformation is performed. Using column 6k, calculate the coordinate position (Xn, yn) of the transformation point on the given angle by stretching and transforming the number of times taught previously, and calculate the positive value of the given angle Q by calculating yn/xn. It is something that gives you support. In the case of an N-ary computer, 6k=N-k is used as the conversion string.

というのはN進計算機の場合変換列6kを上記のように
するとm式の一次変換がK桁回の右シフトと加減算で行
なうことができるからである。具体的には、2進の場合
6k=2‐k,IG隼の場合6k=10‐kであり、後
述する本発明の実施例では10進計算機を想定し変換列
として6k=10‐kを採用する。さらに新しい変数Y
k=1びykを導入すると{1ー式は以下の如く表わす
ことができる。×k十・=×k−10‐2kYkYk十
,=10×(Yk+xk) …の後述する本発
明の実施例における計算には{7}式を用いる。
This is because, in the case of an N-ary computer, if the conversion string 6k is set as described above, the linear conversion of the m-formula can be performed by right shifting and addition/subtraction of K digits. Specifically, in the case of binary, 6k = 2-k, and in the case of IG Hayabusa, 6k = 10-k. In the embodiment of the present invention, which will be described later, assuming a decimal computer, 6k = 10-k is used as the conversion string. adopt. A new variable Y
By introducing k=1 and yk, the {1-formula can be expressed as follows. ×k0·=×k−10−2kYkYk0,=10×(Yk+xk)… Formula {7} is used for calculations in the embodiments of the present invention described later.

次に本発明の実施例を説明する。第2図は本発明に従っ
て三角関数を計算する装置のハードウェアの一実施例を
示したものである。
Next, examples of the present invention will be described. FIG. 2 shows an embodiment of the hardware of an apparatus for calculating trigonometric functions according to the present invention.

図において、Xおよびxを含む部分はゲートla,2a
,3aを介しデータを循環保持するシフトレジスタであ
り、以下これをXレジスタと称する。Yおよびyを含む
部分はゲートlb,2b,3bを介しデータを循環保持
するシフトレジスタであり、以下これをYレジスタと称
する。Zおよびzを含む部分はゲートlc,2b,3c
を介みデータを循環保持するレジスタであり、以下これ
をZレジスタと称する。Wおよびwを含む部分はゲート
ld,2d,3dを介しデータを循環保持するシフトレ
ジスタであり、以下これをWレジスタと称する。FAは
入力信号Cによって加算と減算を制御可能な1Q隼計算
用のディレィド・フル・アダーであり入力A,Bに対し
(A−B),(A+B)を計算する。4および5はそれ
ぞれフル・アダーFAのA側およびB側の入力信号を選
択するゲートであり、4にはゲート3a,3b,3c,
33dの各出力が入力され、5にはゲート3b,3c,
3d,数値発生器Sの各出力が入力される。
In the figure, the portions containing X and x are gates la and 2a.
, 3a, and is hereinafter referred to as an X register. The portion including Y and y is a shift register that circulates and holds data via gates lb, 2b, and 3b, and is hereinafter referred to as the Y register. The part containing Z and z is gate lc, 2b, 3c
This is a register that circulates and holds data via the Z register, and is hereinafter referred to as the Z register. The portion including W and w is a shift register that circulates and holds data via gates ld, 2d, and 3d, and is hereinafter referred to as a W register. FA is a delayed full adder for 1Q Hayabusa calculation whose addition and subtraction can be controlled by input signal C, and calculates (A-B) and (A+B) for inputs A and B. 4 and 5 are gates that select the A side and B side input signals of the full adder FA, respectively, and 4 has gates 3a, 3b, 3c,
Each output of 33d is input, and 5 has gates 3b, 3c,
3d, each output of the numerical value generator S is input.

数値発生器Sは種々の数値データを発生することができ
る。Jはフル・アダーFAで計算された結果キヤリー(
Ca)やボロ−(Bo)が発生した時あるいはゲート6
を介してフルーアダーFAの出力によってセットされる
フリツプフロツプである。ROMは各ゲートの動作を支
配する命令コードを格納するりード・オンリ・メモリ、
ADCはリード・オンリ・メモリROMのアドレスを指
定しプログラム・シーケンスを制御するアドレス・カウ
ンタであり、フリツプフロツプJの出力によつてリード
・オン・メリROMのアドレスが修飾される。IDはリ
ード・オン・メモリROMから読み出された命令コード
を解読し各ゲート類を動作させるマイクロ命令を発生す
るィンストラクション・デコーダ、TEはデコーダID
からの命令に対応して各ゲートの動作タイミングを発生
するタイミング発生器である。第3図に×レジスタの詳
細な構成を示す。
The numerical value generator S is capable of generating various numerical data. J is calculated using full adder FA, resulting in carry (
When Ca) or Boro (Bo) occurs or gate 6
This is a flip-flop that is set by the output of the full adder FA via the FA. ROM is a read-only memory that stores instruction codes that control the operation of each gate.
The ADC is an address counter that specifies the address of the read-only memory ROM and controls the program sequence, and the address of the read-only memory ROM is modified by the output of the flip-flop J. ID is an instruction decoder that decodes the instruction code read from the read-on memory ROM and generates micro-instructions to operate each gate, and TE is the decoder ID.
This is a timing generator that generates operation timing for each gate in response to instructions from the gate. FIG. 3 shows the detailed configuration of the x register.

図示の如くXレジスタはデイジツトタイミング〜〜Tm
+2に対応したm+3桁の長さを持ち、Toに対応する
桁をx,T,〜Tm十,に対応する桁ふ〜×mを×,T
m+2に対応する桁を×kと称する。通常xは数値デー
タの小数点位置を、×は数値データを記憶し、Xkは種
々のコントロールに用いられる。以下の説明において、
×と称する錫合ふ〜×mを意味し、×レジスタと称する
場合レジスタ全体を意味するものとする。なお、Yレジ
スタ、ZレジスタおよびWレジスタもXレジスタと同様
の構成および意味を持つものとする。次に第2図の基本
動作を説明する。
As shown in the figure, the X register is the digit timing ~~Tm
It has a length of m+3 digits corresponding to +2, and the digit corresponding to To is x, T, ~Tm ten, and the digit corresponding to ~xm is x, T.
The digit corresponding to m+2 is called xk. Usually, x stores the decimal point position of numerical data, x stores the numerical data, and Xk is used for various controls. In the following explanation,
The term "x" refers to a tin combination of .times.m to xm, and the term "x register" refers to the entire register. Note that the Y register, Z register, and W register have the same configuration and meaning as the X register. Next, the basic operation shown in FIG. 2 will be explained.

1)レジスタ右シフト ×レジスタは通常はx→2a→×→3a→la→xのル
ープにより保持されているが、Xの右シフト命令(XR
S)が発生するとT,〜Tm+,時間×→3a→2a→
×のループが開くことにより×は右シフトされる。
1) Register right shift × Register is normally held by a loop of x → 2a → × → 3a → la →
When S) occurs, T, ~Tm+, time x → 3a → 2a →
By opening the loop of ×, × is shifted to the right.

この場合、xが1桁分であるので1桁右シフトされる。
Yレジスタ、Zレジスタおよび他のタイミングに関して
も同様である。2)レジスタ左シフト X左シフト命令(Xは)が発生ると、X→3a→4一F
A→6一la→x→2a→XのループがT,〜Tm+,
の間開く。
In this case, since x is one digit, it is shifted one digit to the right.
The same applies to the Y register, Z register, and other timings. 2) When register left shift X left shift command (X is) occurs, X → 3a → 4-F
The loop of A→6-la→x→2a→X is T, ~Tm+,
Open between.

フル・アダーFAは1桁分の時間遅れを持つためXの内
容は1桁左シフトされる。但しこの時のフル・アダーF
AのB側入力としてどの信号も選択されず、従ってフル
・アダーFAは(A十0)または(A−0)の動作をす
ることになり×の内容は変化しない。なお、他のレジス
タの場合も同様に動作する。3)レジスタ間の加減算 この命令が発生した場合、フル・アダーFAのA側入力
にはゲート3aの出力あるいはゲート3bの出力が入力
され、B側入力には他のゲート3bの出力あるいはゲー
ト3cの出力が入力される。
Since the full adder FA has a time delay of one digit, the contents of X are shifted to the left by one digit. However, at this time Full Adder F
No signal is selected as the B-side input of A, so the full adder FA operates as (A10) or (A-0), and the contents of x do not change. Note that the same operation applies to other registers. 3) Addition/subtraction between registers When this instruction occurs, the output of gate 3a or gate 3b is input to the A side input of full adder FA, and the output of another gate 3b or gate 3c is input to the B side input. The output of is input.

この時、信号Cによって加算、減算のどちらかを指定し
、フル・アダ−FAの出力はゲートを通じ×レジスタあ
るいはYレジスタへ格納される。またフル・アダーFA
による計算の結果桁上り(Ca)や桁借り(軌)が生じ
た時はフリツプフロツプJをセットしこのフリツプフロ
ツプJの出力によってアドレス・カウンタADCを修飾
する。次の命令がデコードされるとフリツプフロツプJ
はリセットされる。タイミング発生器TEは演算を実行
すべきタイミング信号を発生し上記のゲート類を開成さ
せるが、ゲートla〜ldにはフル・アダーFAの遅れ
に合わせるため1ディジット遅れのタイミングが加えら
れる。4)レジスタと数値データの加減算 この命令が発生すると、フル・アダーFAのA側入力に
はゲート3a〜3dの出力のいずれかが入力され、B側
入力には数値発生器Sより発生される数値データが入力
される。
At this time, either addition or subtraction is specified by signal C, and the output of the full adder FA is stored in the x register or the Y register through the gate. Also full adder FA
When a carry (Ca) or a borrow (trajectory) occurs as a result of the calculation, a flip-flop J is set and the output of the flip-flop J modifies the address counter ADC. When the next instruction is decoded, the flip-flop J
will be reset. The timing generator TE generates a timing signal to perform an operation and opens the gates mentioned above, but a one-digit delay is added to the gates la to ld to match the delay of the full adder FA. 4) Addition and subtraction of register and numerical data When this instruction is generated, one of the outputs of gates 3a to 3d is input to the A side input of the full adder FA, and the output from the numerical value generator S is input to the B side input. Numerical data is input.

ただし数値zは演算実行タイミングの最初のディジット
のみに発生され他のタイミングでは0とする。例えば、
X(T,〜Tm+,)ならばT,の時間に数値nが発生
されることになる。フル・アダ−FAによる加減算は上
記3)の場合と同様に行なわれる。5)レジスタの内容
と数値との比較 Xを例にとると、ゲート3aの出力は通常の保持を行な
うべくゲートlaに戻るとともにゲート4に入力されて
いるが、この命令が発生すると実行タイミング間ゲート
4はフル・アダーFAのA側入力としてゲート3aの出
力を選択しゲート5はB側入力として数値発生器Sの出
力を選択し、減算を行なう。
However, the numerical value z is generated only at the first digit of the calculation execution timing, and is set to 0 at other timings. for example,
If X(T,~Tm+,), then the numerical value n will be generated at time T. Addition and subtraction by the full adder FA is performed in the same manner as in case 3) above. 5) Comparison of register contents and numerical values Taking X as an example, the output of gate 3a returns to gate la for normal holding and is input to gate 4, but when this instruction occurs, the execution timing Gate 4 selects the output of gate 3a as the A-side input of the full adder FA, and gate 5 selects the output of the numerical value generator S as the B-side input to perform subtraction.

この演算結果はゲート6を介してフリツプフロツプJに
入力されるがゲートlaには入力されない。従って減算
結果が0の場合フリツプフロツプJはセットされずその
他の場合セットされ、またレジスタの内容は変化しない
。なお、他のレジスタの場合も同様の動作をする。6)
レジスタへの数値データのロード この命令が発生すると、ゲート4はフル・アダ−FAの
A側入力としてどの信号も選択せずゲート5はB側入力
として数値発生器Sの出力を選択し、フル・アダーFA
による加算が指示される。
The result of this calculation is input to flip-flop J via gate 6, but not to gate la. Therefore, flip-flop J is not set when the subtraction result is 0, and is set otherwise, and the contents of the register do not change. Note that the same operation is performed for other registers. 6)
Load numeric data into register When this instruction occurs, gate 4 does not select any signal as the A-side input of the full adder FA, gate 5 selects the output of the numeric generator S as the B-side input, and the full・Adder FA
Instructs addition by .

フル・アダーFAの出力はゲート6により選択されたレ
ジスタの入力ゲート(例えばXレジスタならばゲートl
a)に実行タイミング間入力される。この時、数値発生
器Sはディジット毎に異つたデータを発生することが可
能である。レジスタの入力ゲ−トla〜ldのタイミン
グは上記3)と同機1ディッシュ遅れとなる。7)Xレ
ジスタら他のレジスタへのデータ転送Yレジスタへのデ
ータ転送命令を例にとると、×(T,〜Tm+,)の出
力は3a→4→FAのA側入力と入力され、一方FAの
B側入力としてはゲート5はどの信号も選択しない。
The output of the full adder FA is the input gate of the register selected by gate 6 (for example, if it is an
A) is input during the execution timing. At this time, the numerical value generator S can generate different data for each digit. The timing of the input gates la to ld of the register is delayed by one dish from the above 3). 7) Data transfer from X register to other registers Taking the data transfer instruction to Y register as an example, the output of ×(T, ~Tm+,) is inputted to the A side input of 3a→4→FA Gate 5 does not select any signal as the B-side input of FA.

フル・アダーFAの出力はゲート6を介しゲートlbに
入力される。フル・アダーFAからの出力は1デイジツ
ト遅れるので、ゲートlbはT2〜Tm+2間ゲート6
の出力をyへ送りその他にはゲート3bの出力をyへ送
る。8)×レジスタへの他レジスタよりのデータ転送Z
レジスタよりZkの転送を例にとると、Zk(Tm+2
)の出力は3c→5→FAのB側入力と入力され、一方
FAのA側入力としてはゲート4はどの信号も選択しな
い。
The output of the full adder FA is input to gate lb via gate 6. Since the output from the full adder FA is delayed by one digit, gate lb is connected to gate 6 between T2 and Tm+2.
The output of gate 3b is sent to y, and the output of gate 3b is sent to y. 8) Data transfer from other registers to × register Z
Taking the transfer of Zk from the register as an example, Zk(Tm+2
) is input as the B-side input of 3c→5→FA, while the gate 4 does not select any signal as the A-side input of FA.

フル・アダーFAからの出力はゲート6を介しゲートl
aに入力される。フル・アダ−FAからの出力は1デイ
ジット遅れるので、ゲートlaはToの間ゲ−ト6の出
力をxに送りその他にはゲート3aの出力をxに送る。
次に本発明に従って第2図のハードウェアにニ角関数を
演算させるフローチャートの一実施例を示した第4図を
参照して本実施例による演算動作を説明する。まず、ス
テップ1において前述したハードウェアの動作6)を行
なってXkに数値データ0を記憶する。
The output from the full adder FA passes through gate 6 to gate l.
input to a. Since the output from the full adder FA is delayed by one digit, gate la sends the output of gate 6 to x during To, and otherwise sends the output of gate 3a to x.
Next, the calculation operation according to this embodiment will be explained with reference to FIG. 4, which shows an example of a flowchart for causing the hardware shown in FIG. 2 to calculate a bigonometric function according to the present invention. First, in step 1, the hardware operation 6) described above is performed to store numerical data 0 in Xk.

Xkを演算終了のカウンタとして用いるためXkをクリ
アする必要があるからである。次のスチップ2において
前述のハードウェアの動作6)を行ない数値発生器Sよ
りYに1びねn‐110‐Kをロードする。1びtan
‐110‐Kの値は角度単位系としてデグリー(deg
ree),ラジアン(radian),グラジアン(餌
adian)のいずれが基準となるかによりロードされ
る数値が異なる。
This is because it is necessary to clear Xk since it is used as a counter for the end of calculation. In the next step 2, the hardware operation 6) described above is performed to load 1 digit n-110-K into Y from the numerical value generator S. 1bitan
The value of -110-K is expressed in degrees as an angular unit system.
The numerical value loaded differs depending on whether the standard is ree), radian, or gradian (bait adian).

表1に例としてk=0より4までの各単位系のtan‐
110‐Kの値を示す。なお、グラジアンとはヨーロッ
パで用いられている単位系で9のegree=10咳r
adianの関係にある。以後本実施例においては単位
系としてラジアンが採用されているものとして説明する
が、他の単位系が基準となっている場合には以後の説明
の1びねn−110‐Kの値を他の単位系の値に置きか
えれば全く同じ説明となる。表1:tan‐110‐K この数値は例えば本実施例の如くラジアンを基本単位と
する場合、K=0の時0.7853・・・,K=1の時
0.9966である。
Table 1 shows tan- for each unit system from k=0 to 4 as an example.
110-K value is shown. Incidentally, gradian is a unit system used in Europe, where 9 egree = 10 cough r.
It is related to adian. Hereinafter, this example will be explained assuming that radians are adopted as the unit system, but if another unit system is used as the standard, the value of 1 dimension n-110-K in the following explanation can be changed to other values. If you replace it with the value of the unit system, the explanation will be exactly the same. Table 1: tan-110-K For example, when the basic unit is radian as in this embodiment, this value is 0.7853 when K=0, and 0.9966 when K=1.

第5図にYレジスタにK=0の時のデータがロードされ
ている様子を示す。またこの時被演算数(角度変数)は
×レジスタに既にロードされ小数点はXmの位置に固定
されているものとする。さらにZ,Wの両レジスタには
データとしてZ,Wの全桁に0がロードされ、クリアさ
れているものとする。ステップ3,4はXよりYをボロ
ーが出るまで減算しポローの出る直前までのループ回数
を乙に記憶する。ここでハードウェアの動作はステップ
3ではFAのA側入力として×がB側入力としてYがそ
れぞれ選択され減算結果を×に入れることにより、また
ステップ4ではFAのA側入力としてZが、B側入力と
して数値発生器SよりT.のタイミングで発生される1
がそれぞれ選択され加算結果は乙に記憶されることによ
り両ステップとも前述の動作3),4)を行なう。ステ
ップ5ではステップ3でBoが発生するまで減算を行な
っているので、1回引きすぎた状態となっているのでこ
れを元に戻すためにFAのA側入力をXレジス夕、B側
入力をYレジスタ、演算タイミングをT,〜Tm十,と
して加算を行なう。
FIG. 5 shows how data is loaded into the Y register when K=0. At this time, it is assumed that the operand (angle variable) has already been loaded into the x register and the decimal point is fixed at the position of Xm. Furthermore, it is assumed that all digits of Z and W are loaded with 0 as data in both registers Z and W, and are cleared. In steps 3 and 4, Y is subtracted from X until a borrow is produced, and the number of loops until just before a borrow is produced is stored in B. Here, the hardware operates by selecting x as the A-side input of the FA and Y as the B-side input and putting the subtraction result in x, and in step 4, selecting Z as the A-side input of the FA, T. from the numerical generator S as a side input. 1 generated at the timing of
are selected and the addition results are stored in B, thereby performing the above-mentioned operations 3) and 4) in both steps. In step 5, subtraction is performed until Bo is generated in step 3, so it is in a state where it has been subtracted one time too much, so to return to the original state, change the A side input of FA to Addition is performed using the Y register and the calculation timing as T, to Tm+.

これは前述の動作3)の加算である。ステップ6では×
の左シフトを行なう。これは数値発生器Sよりのデータ
を常にYm‐,からロードし有効桁数を減らさないよう
にするためである。従って、簡便な電子式卓上計算機に
おいてははn‐110‐Kを数値発生器よりロードする
ようにすればステップ6は不要となる。ステップ7では
Zの左シフトを行なう。これはこの×kの値の演算が終
了したので次のXkの値に対応するステップ3の減算回
数を記憶するためである。ステップ6および7では前述
のハードウェアの動作2)を×レジスタのX,Zレジス
タのZに対して行なっている。次のステップ8ではFA
のA側入力としてXレジスタ、B側入力として×kのタ
イミングで数値発生器Sより発生される数値データ1を
選択して前述のハードウェアの動作4)を行なう。この
動作は桁カウンタXkをインクリメントするためである
。ステップ9では桁カウン夕の内容Xkと数値データの
比較を行なって桁数分だけ計算しているかどうか判定し
ている。このステップは、ハードウェアの動作4)で述
べたようにFAのA側入力に×レジスタ、B側にNより
Tm+2のタイミングで発生されるmを選択して減算す
ることにより行なわれる。ステップ9までのステップで
‘41式において×の内容を表1の数列の部分和で表現
する過程が終了し、Zには各々数値を何度用いたかがK
の値に対応して格納されている。
This is the addition of operation 3) above. In step 6 ×
Performs a left shift. This is to ensure that the data from the numerical value generator S is always loaded from Ym-, and the number of effective digits is not reduced. Therefore, in a simple electronic desktop calculator, step 6 is not necessary if n-110-K is loaded from a numerical value generator. In step 7, Z is shifted to the left. This is to store the number of subtractions in step 3 corresponding to the next value of Xk since the calculation of this value of xk has been completed. In steps 6 and 7, the aforementioned hardware operation 2) is performed for X in the x register and Z in the Z register. In the next step 8, FA
The above-mentioned hardware operation 4) is performed by selecting the X register as the A-side input and the numerical data 1 generated by the numerical value generator S at the timing xk as the B-side input. This operation is to increment the digit counter Xk. In step 9, the content Xk of the digit counter is compared with the numerical data to determine whether calculations have been made for the number of digits. This step is performed by selecting and subtracting m generated at the timing Tm+2 from the x register on the A side input of the FA and N on the B side as described in hardware operation 4). In the steps up to step 9, the process of expressing the contents of × in the '41 formula as a partial sum of the sequence of numbers in Table 1 is completed, and Z is the number of times each numerical value is used.
is stored corresponding to the value of .

今度は【11式の1次変換を行なうのであるがここでは
の式の如く新しい変数YK=1ぴyKが導入された形で
計算される。この時点では、Zの内容としてZにK=i
(i=0〜m)の減算回数が記憶されている。またXに
は減算の余りが残っている。ここで、Xの減算の余りを
利用して演算速度を向上させる方法もあるが、説明を簡
単にするためにステップ10およびステップ11でハー
ドウェアの動作6に述べた手順により×およびYの全桁
に0をロードしクリアする。次のステップ12では同様
にハードウェアの動作6)で動作タイミングにTm十,
を選択し×mに1をロードし、これを初期値とする。こ
のように(1,0)という座標を与えて、上で使った6
Kを用い上で教えた数だけ回し伸ばし変換すれば、与え
られた角度上にある変換点の座標位置【5}式の(xm
yn)が求まる。ステップ13でZから1を減ずる。
This time, we will perform the linear transformation of Equation 11, but here it will be calculated with a new variable YK=1pyyK introduced as shown in the equation. At this point, K=i in Z as the content of Z.
The number of subtractions (i=0 to m) is stored. Also, the remainder from the subtraction remains in X. Here, there is a method to improve the calculation speed by using the remainder of the subtraction of Load the digit with 0 and clear it. In the next step 12, similarly, the hardware operation 6) sets the operation timing to Tm0,
Select , load 1 into ×m, and use this as the initial value. In this way, given the coordinates (1, 0), we used the 6
If we use K and extend the transformation by the number of times taught above, we can obtain the coordinate position of the transformation point on the given angle (xm
yn) is found. In step 13, 1 is subtracted from Z.

Zo=0ならB。を生じステップ16へ、Boを生じな
けばステップ14へ移る。この部分の動作についてはハ
ードウェアの動作4)で述べた通りである。ステップ1
4ではXの内容とYの内容を加算した値を1ぴ音した値
がYレジスタに記憶される。ステップ15で×よりYの
内容を2K回右シフトしたものを減算する。ここでKは
Xkの内容である。このK桁右シフトおよび減算は例え
ば第6図の如き命令の組合せで実現できる。第6図にお
いて、ステップ1では×kの内容をZkに転送する。
If Zo=0, then B. If Bo is not generated, the process moves to step 14. The operation of this part is as described in hardware operation 4). Step 1
4, a value obtained by adding the contents of X and Y by one tone is stored in the Y register. In step 15, the content of Y shifted to the right 2K times is subtracted from x. Here K is the content of Xk. This K-digit right shift and subtraction can be realized, for example, by a combination of instructions as shown in FIG. In FIG. 6, in step 1, the contents of xk are transferred to Zk.

これは以下の演算により×xが破壊されるのでXkの内
容を保存するためである。この動作についてはハードウ
ェアの動作7)で述べた通りで、Yレジスタの代りにZ
レジスタを用い、動作タイミングをTm+2とすること
により実現できる。続いてステップ2ではY内容をWに
転送する。これもハードウェアの動作7)で述べた動作
のタイミングをT,〜T帆,とすることにより実現でき
る。ステップ3ではXkより1を減ずるのでXk=1に
なればBoを生じ、Boを生じるとステップ6へ、また
Bを生じなければステップ4へ移る。ステップ4および
ステップ5ではWを右シフトしている。したがってこの
ループを氏が生ずるまで回ることによりYの内容がXk
の内容の2倍右シフトされ×kの内容がKであと10‐
球YがWレジスタに得られる。ステップ3で&を生ずる
と移行するステップ6ではXよりWが減算され差は×レ
ジス夕に記憶される。以上述べてきたようにステップ2
〜6により×−10‐靴Yが×に得られる。ステップ7
はハードウェアの動作8)で述べた如くZKに転送する
ステップ3によって破壊されたXkの内容を再びXkに
とりもどすためのものである。再び第4図の説明に戻る
This is to preserve the contents of Xk since xx will be destroyed by the following calculation. This operation is as described in hardware operation 7), and the Z register is used instead of the Y register.
This can be realized by using a register and setting the operation timing to Tm+2. Subsequently, in step 2, the contents of Y are transferred to W. This can also be realized by setting the timing of the operation described in hardware operation 7) to T, .about.T. In step 3, 1 is subtracted from Xk, so if Xk=1, Bo is generated, and if Bo is generated, the process goes to step 6, and if B is not generated, the process goes to step 4. In steps 4 and 5, W is shifted to the right. Therefore, by going through this loop until Mr. is generated, the content of Y becomes Xk
The content of ×k is shifted to the right by 2 times, and the content of ×k is K by 10-
Sphere Y is obtained in W register. When & is generated in step 3, W is subtracted from X in step 6, and the difference is stored in the x register. As mentioned above, step 2
~6 gives x-10-shoes Y at x. Step 7
This is for restoring to Xk the contents of Xk that were destroyed in step 3 of transferring to ZK as described in hardware operation 8). Returning to the explanation of FIG. 4 again.

ステップ13〜15は特定のKの値に対する乗算ルーチ
ンである。ステップ13で馬が生じステップ16へ移る
と次のKの値に対する減算回数乙にセットするためにZ
を1桁右シフトする。次のステップ17では桁合わせの
ためYを1桁右シフトする。続いてKの値をデクリメン
トするためにXkより1を減ずるステップ18はこの演
算の終了を検出するためのステップであり、Xkの値が
1を減じてBoを生ずるとこの演算は終了し、Xレジス
タには{5ー式のxnの右辺が、またYレジスタには【
5}式のynの右辺が求まることになる。以上述べてき
たようにこの方法による演算ではXレジスタとYレジス
タの比として正援値が与えられるので、正援値を求める
ためには‘6}式に示すようにYレジスタの内容を×レ
ジスタの内容で除算しなければならない。
Steps 13-15 are multiplication routines for specific values of K. In step 13, a horse is generated and the process moves to step 16, where Z is set to the number of subtractions for the next K value.
Shift right one place. In the next step 17, Y is shifted one digit to the right for digit alignment. Subsequently, step 18 of subtracting 1 from Xk in order to decrement the value of K is a step for detecting the end of this operation, and when the value of Xk is reduced by 1 to produce Bo, this operation ends and X The right side of xn in the {5-formula is in the register, and the Y register is [
5} The right side of yn in the equation can be found. As mentioned above, in calculations using this method, the positive value is given as the ratio of the X register and the Y register, so in order to obtain the positive value, the contents of the Y register are must be divided by the contents of .

この方法については単なる除算であって第7図に示すよ
うな方法によって行なわれる。第7図のステップ1では
×kをクリヤするためにXkに0をロードする。
This method is a simple division and is carried out as shown in FIG. In step 1 of FIG. 7, 0 is loaded into Xk to clear xk.

ステップ2ではXよりWへデータを転送する。ステップ
3ではFAのA側にYレジスタの出力、B側にWレジス
タの出力をそれぞれ選択し、T,〜T帆,のタイミング
で除算を行なう。このステップでBが生ずればステップ
5へ、Boが生じなければステップ4へ移行する。ステ
ップ4では特定のKの値に対する除算回数を記憶するた
めに乙に1を加算する。ステップ3で&が生ずると1回
引きすぎであるのでY+Wの加算を行ない元に戻す。次
のステップ6では次のKの値に対して再度除算が可能と
なるようYの左シフトを行なう。ステップ7では、次の
K値に対しての除算回数が記憶できるようにZの左シフ
トを行なう。ステップ8ではKの値のインクリメントを
行なうためにXkに1を加算する。次のステップ9は演
算終了の判定を行なうステップ×kと数値発生器Sの出
力mとの比較を行ないK=mなら演算が終了す。またK
≠mなる時は再びステップ3に戻り以上述べてきた動作
を反復する。最終的にはZの内容が求める正薮の値とな
る。以上の説明では記憶装置としてレジスタを用いたが
勿論この記憶装置としてRAM(ランダムアクセスメモ
リ)を使用することも可能である。
In step 2, data is transferred from X to W. In step 3, the output of the Y register is selected on the A side of the FA, and the output of the W register is selected on the B side, and division is performed at the timing of T, to T sail. If B occurs in this step, the process proceeds to step 5; if Bo does not occur, the process proceeds to step 4. In step 4, 1 is added to B in order to store the number of divisions for a specific value of K. If & is generated in step 3, it means that one too many subtractions have been made, so Y+W is added to restore the original state. In the next step 6, Y is shifted to the left so that the next value of K can be divided again. In step 7, Z is shifted to the left so that the number of divisions for the next K value can be stored. In step 8, 1 is added to Xk to increment the value of K. In the next step 9, the step xk for determining the end of the calculation is compared with the output m of the numerical value generator S, and if K=m, the calculation ends. Also K
When ≠m, return to step 3 again and repeat the operations described above. In the end, the content of Z becomes the desired value. In the above description, a register is used as a storage device, but it is of course possible to use a RAM (random access memory) as this storage device.

またROMより読み出される命令(ィンストラクション
)の一部が、特定命令が読み出された場合に数値データ
としてレジスタに入力されるように構成すると数値発生
器Sは不要となりROMで数値発生器Sの代用が可能で
ある。
In addition, if a part of the instructions read from the ROM is configured so that it is input into a register as numerical data when a specific instruction is read, the numerical value generator S becomes unnecessary, and the numerical value generator S can be generated in the ROM. It is possible to substitute

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

第1図は本発明の演算原理である1次変換を極座標上の
点として示した図で、(xk,yk)は1次変換を加え
る前の点で、この点に1次変換を加え(xk…yk+,
)とする。 第2図は本発明の一実施例を示したブロック図で、x,
y,z,X,Y,Zはしジスタ;la,2a,3a,l
b,2b,3b.lc,2c,3c,ld,2d,3d
,4,5,6はゲート;FAはデイレイド・フル・アダ
ー;ADCはアドレスカウンタ;■はインストラクシヨ
ンデコーダ;Jはフリツプフロツプ;ROMはリード・
オンリー・メモリ;Sは数値発生器;TEはタイミング
発生器である。第3図は第2図のXレジスタの詳細な構
成を示した図である。第4図は本発明の原理に従って×
レジスタとYレジスタの比として正援値を求める直前ま
でのフローチャートを示した図である。第5図はラジア
ンを単位としてtan‐110‐KがYレジスタにロー
ドされた状態を示した図である。第6図は第4図に用い
られるK桁右シフトおよび減算のフローチャートの一例
を示した図である。第7図は第4図のフローチャートに
続くXレジスタとYレジスタの比としてZレジスタに正
援値を求めるフローチャートの一例を示した図である。
第1図 第2図 第3図 第5図 界ム図 第6図 苑7図
Figure 1 shows the linear transformation, which is the calculation principle of the present invention, as a point on polar coordinates, where (xk, yk) is the point before the linear transformation is applied, and the linear transformation is applied to this point ( xk…yk+,
). FIG. 2 is a block diagram showing an embodiment of the present invention, in which x,
y, z, X, Y, Z Hashijista; la, 2a, 3a, l
b, 2b, 3b. lc, 2c, 3c, ld, 2d, 3d
, 4, 5, and 6 are gates; FA is a delayed full adder; ADC is an address counter; ■ is an instruction decoder; J is a flip-flop; ROM is a read
Only memory; S is a number generator; TE is a timing generator. FIG. 3 is a diagram showing the detailed configuration of the X register in FIG. 2. Figure 4 shows x according to the principles of the invention.
It is a figure which showed the flowchart just before calculating|requiring a support value as a ratio of a register and a Y register. FIG. 5 is a diagram showing the state in which tan-110-K is loaded into the Y register in units of radians. FIG. 6 is a diagram showing an example of a flowchart of K-digit right shift and subtraction used in FIG. 4. FIG. 7 is a diagram showing an example of a flowchart following the flowchart of FIG. 4, in which the support value is obtained in the Z register as the ratio of the X register and the Y register.
Figure 1 Figure 2 Figure 3 Figure 5 World Map Figure 6 Garden Figure 7

Claims (1)

【特許請求の範囲】[Claims] 1 入力される角度変数に対する三角関数値を計算する
N進計算機における三角関数計算装置において、入力さ
れる上記角度変数を記憶する第1の記憶手段と、入力さ
れる上記角度変数と同一単位系の逆正接値tan^−^
1N^−^Kまたは10^Ktan^−^1N^−^K
をK=0より正整数mまで逐次発生する手段と、固定さ
れたKに対する前記逆正接値を上記第1の記憶手段から
ボローが生じる直前まで繰り返し減算する手段と、該減
算手段をKの値に対応して記憶する第2の記憶手段と、
第3の記憶手段と、第4の記憶手段と、該第4の記憶手
段の内容を固定されたKの値の2倍の桁数分右シフトす
る手段と、上記第1の記憶手段の内容を上記第3の記憶
手段の内容に加算する手段と、上記第1の記憶手段の内
容より上記第4の記憶手段の内容を減算する手段と、任
意の数値を上記記憶手段の任意の記憶手段に記憶させる
手段と、上記記憶手段のうちのある記憶手段より他の記
憶手段へ記憶内容を転送する手段とを備え、Kの値の0
よりmまでのそれぞれに対応して逐次発生される上記逆
正接値を、Kの値にそれぞれ対応して上記第1の記憶手
段よりボローが生ずるまで減算し、ボローが生ずる直前
までの減算回数をKに対応して上記第2の記憶手段に記
憶し、上記演算がKの値で0よりmまで反復された後、
上記第1の記憶手段の内容を0として上記第1の記憶手
段に1を設定し、Kに対応した減算回数分だけ上記第3
の記憶手段の内容に上記第1の記憶手段の内容を加算し
た値を10倍するとともに上記第3の記憶手段の内容を
上記第4の記憶手段に転送し該第4の記憶手段の内容を
Kの数値の2倍の桁数分右シフトし、しかる後上記第1
の記憶手段の内容より上記第4の記憶手段の内容を減算
する操作を反復し、これをKの値が0からmになるまで
繰り返した後の上記第1の記憶手段の内容と上記第3の
記憶手段の内容の比として、上記角度変数の正接値を得
ることを特徴とする三角関数計算装置。
1. In a trigonometric function calculation device in an N-ary computer that calculates trigonometric function values for input angular variables, a first storage means for storing the input angular variables, and a first storage means for storing the input angular variables, and a first storage means for storing the input angular variables, Arc tangent value tan^-^
1N^-^K or 10^Ktan^-^1N^-^K
means for successively generating from K=0 to a positive integer m; means for repeatedly subtracting the arctangent value for a fixed K from the first storage means until immediately before a borrow occurs; a second storage means for storing data corresponding to;
a third storage means, a fourth storage means, a means for right-shifting the contents of the fourth storage means by a number of digits twice the fixed value of K, and contents of the first storage means. means for adding the contents of the fourth storage means to the contents of the third storage means; means for subtracting the contents of the fourth storage means from the contents of the first storage means; and means for transferring the stored contents from one of the storage means to another storage means,
The above-mentioned arctangent values sequentially generated corresponding to each value up to m are subtracted from the above-mentioned first storage means corresponding to each value of K until a borrow occurs, and the number of subtractions until immediately before a borrow occurs is calculated. After storing it in the second storage means corresponding to K, and repeating the above operation from 0 to m with the value of K,
The content of the first storage means is set to 0, the first storage means is set to 1, and the third storage means is set for the number of subtractions corresponding to K.
The value obtained by adding the contents of the first storage means to the contents of the storage means is multiplied by 10, and the contents of the third storage means are transferred to the fourth storage means, and the contents of the fourth storage means are Shift to the right by twice the number of digits of the value of K, and then
The contents of the first storage means after repeating the operation of subtracting the contents of the fourth storage means from the contents of the storage means of , and repeating this operation until the value of K becomes from 0 to m, and the contents of the third storage means A trigonometric function calculation device characterized in that the tangent value of the angle variable is obtained as a ratio of the contents of the storage means.
JP1039078A 1978-02-03 1978-02-03 Trigonometric function calculation device Expired JPS6029409B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1039078A JPS6029409B2 (en) 1978-02-03 1978-02-03 Trigonometric function calculation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1039078A JPS6029409B2 (en) 1978-02-03 1978-02-03 Trigonometric function calculation device

Publications (2)

Publication Number Publication Date
JPS54104249A JPS54104249A (en) 1979-08-16
JPS6029409B2 true JPS6029409B2 (en) 1985-07-10

Family

ID=11748787

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1039078A Expired JPS6029409B2 (en) 1978-02-03 1978-02-03 Trigonometric function calculation device

Country Status (1)

Country Link
JP (1) JPS6029409B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0776916B2 (en) * 1987-06-30 1995-08-16 日本電気株式会社 Trigonometric function calculation device using pseudo division method
JP2504102B2 (en) * 1988-02-17 1996-06-05 日本電気株式会社 Inverse trigonometric function calculator
JP4757328B2 (en) 2009-07-03 2011-08-24 富士通株式会社 Inverse tangent calculation device and inverse tangent calculation program

Also Published As

Publication number Publication date
JPS54104249A (en) 1979-08-16

Similar Documents

Publication Publication Date Title
US6243732B1 (en) Data processor and data processing system
US5737253A (en) Method and apparatus for direct digital frequency synthesizer
JPH03204720A (en) Elementary function arithmetic unit
KR100744216B1 (en) Device and method for calculating a multiplication involving a shifting of the multiplicand
JPS5862746A (en) Divider
US4956799A (en) Trigonometric function arithmetic processor using pseudo-division
JPS5847053B2 (en) data processing equipment
TWI517032B (en) Systems, apparatuses, and methods for performing an absolute difference calculation between corresponding packed data elements of two vector registers
US11922133B2 (en) Processor and method for processing mask data
JPS6051733B2 (en) Exponential function calculation device
JP2508784B2 (en) Exponential function calculator
JP2822399B2 (en) Logarithmic function arithmetic unit
JPS6029409B2 (en) Trigonometric function calculation device
US6338135B1 (en) Data processing system and method for performing an arithmetic operation on a plurality of signed data values
US4991132A (en) Apparatus for executing division by high-speed convergence processing
JP2597775B2 (en) Division method and division device
JPH03135627A (en) Fuzzy arithmetic unit
KR920002572B1 (en) Format converting circuit for numeric data
US4951238A (en) Processor for executing arithmetic operations on input data and constant data with a small error
CN115483934A (en) Data conversion method and device for multi-party secure computing
JP4728392B2 (en) Large number multiplication method and device
US5684730A (en) Booth multiplier for trigonometric functions
JPH0585924B2 (en)
JPH0325809B2 (en)
JPS6243774A (en) Data processor