JP3460780B2 - Numerical arithmetic unit - Google Patents

Numerical arithmetic unit

Info

Publication number
JP3460780B2
JP3460780B2 JP02184197A JP2184197A JP3460780B2 JP 3460780 B2 JP3460780 B2 JP 3460780B2 JP 02184197 A JP02184197 A JP 02184197A JP 2184197 A JP2184197 A JP 2184197A JP 3460780 B2 JP3460780 B2 JP 3460780B2
Authority
JP
Japan
Prior art keywords
digit
storage means
bcd
value
calculation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP02184197A
Other languages
Japanese (ja)
Other versions
JPH10222348A (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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP02184197A priority Critical patent/JP3460780B2/en
Publication of JPH10222348A publication Critical patent/JPH10222348A/en
Application granted granted Critical
Publication of JP3460780B2 publication Critical patent/JP3460780B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、BCD(Bina
ry Coded Decimal)コード化されたデ
ータを用いた数値演算装置に関し、より詳しくはグラフ
ィック関数電卓等に採用される数値演算装置に関する。
TECHNICAL FIELD The present invention relates to a BCD (Bina).
RY Coded Decimal) The present invention relates to a numerical operation device using coded data, and more particularly to a numerical operation device employed in a graphic scientific calculator or the like.

【0002】[0002]

【従来の技術】図8はBCDコード化されたデータの例
を示す。演算の対象となるデータは指数部100と仮数
部101で構成されており、図示例では仮数部101の
桁数は10桁、指数部100の桁数は2桁である。仮数
部101の各桁はBCDコードで表されていて、小数点
位置は上位桁から2桁目と3桁目の間にある。正規化さ
れた状態の仮数部101は最上位桁が10進数で0、2
桁目が10進数で0以外の数字になっている。図示例で
は1.23456789×(10の3乗)を表してい
る。
2. Description of the Related Art FIG. 8 shows an example of BCD coded data. The data to be calculated is composed of an exponent part 100 and a mantissa part 101. In the illustrated example, the mantissa part 101 has 10 digits and the exponent part 100 has 2 digits. Each digit of the mantissa part 101 is represented by a BCD code, and the decimal point position is between the second digit and the third digit from the higher digit. In the normalized mantissa part 101, the most significant digit is a decimal number 0, 2
The digit is a decimal number other than 0. In the example shown in the figure, it is represented by 1.234456789 × (10 to the third power).

【0003】つまり、仮数部101は小数点位置を固定
して有効桁数分のデータを保持し、指数部100で実際
の小数点位置を表すことになる。よって、このような形
式の2つのデータを加減算するには、小数点位置を合わ
せる必要があり、仮数部101は桁単位、つまり4ビッ
ト単位でシフトする必要がある。また、演算時には下位
桁からの桁上がりを考慮しながら1桁ずつ演算しなけれ
ばならない。
That is, the mantissa part 101 fixes the decimal point position and holds data for the number of significant digits, and the exponent part 100 represents the actual decimal point position. Therefore, in order to add / subtract two data in such a format, it is necessary to match the decimal point position, and the mantissa part 101 needs to be shifted in units of digits, that is, in units of 4 bits. Further, at the time of calculation, it is necessary to calculate one digit at a time, taking into account carry from the lower digit.

【0004】一般に、仮数部101の桁数はそれが演算
の精度を決める要素であるため、指数部100の桁数に
比べて桁数がかなり多くなっている。そのため、これら
の処理をCPU等の演算手段で行うには非常に多くの時
間がかかる。
In general, the number of digits in the mantissa 101 is a factor that determines the accuracy of the calculation, and therefore the number of digits is considerably larger than the number of digits in the exponent 100. Therefore, it takes a lot of time to perform these processes by a calculation means such as a CPU.

【0005】このような事情により、最近では、演算速
度を向上させる目的で、仮数部の演算をするための専用
装置が考案され、用いられている。
Under these circumstances, recently, a dedicated device for calculating the mantissa has been devised and used for the purpose of improving the calculation speed.

【0006】この種のBCD演算を行う数値演算装置
(以下ではBCD演算装置と称する)の従来例として、
例えば特開平4−316128号公報に開示されたもの
がある。図9はこのBCD演算装置を示す。このBCD
演算装置の仮数部の桁数は10桁である。演算対象の2
つのデータの仮数部をそれぞれA、Bとし、Aを各桁毎
に記憶する記憶手段をXとし、最下位桁から順にX0、
X1……X9、Bを各桁毎に記憶する記憶手段をYと
し、最下位桁から順にY0、Y1……Y9とする。X0
〜X9及びY0〜Y9はそれぞれ隣接する桁同士接続さ
れており、桁単位でシフトが可能になっている。
As a conventional example of a numerical operation device (hereinafter referred to as a BCD operation device) for performing this kind of BCD operation,
For example, there is one disclosed in Japanese Patent Laid-Open No. 4-316128. FIG. 9 shows this BCD arithmetic unit. This BCD
The mantissa part of the arithmetic unit has 10 digits. Operation target 2
Let the mantissa parts of the two data be A and B, respectively, and let X be the storage means for storing A for each digit, and X0,
Let Y be the storage means for storing X1 ... X9, B for each digit, and Y0, Y1 ... Y9 in order from the lowest digit. X0
.. to X9 and Y0 to Y9 are connected to adjacent digits, respectively, and can be shifted in digit units.

【0007】また、外部データバスと接続されたデータ
入出力制御手段(いずれも図示せず)によりデータが入
力される。また、記憶手段X、Yの値を演算するBCD
演算手段が各桁ごとに設けられており、それを最下位桁
から順にW0、W1……W9とする。そして、BCD演
算手段W9〜W0それぞれの演算結果を記憶する記憶手
段をZとし、最下位桁から順にZ0、Z1……Z9とす
る。Z0〜Z9はそれぞれ隣接する桁同士接続されてお
り、桁単位でシフトが可能になっている。BCD演算手
段W0〜W8における演算で生じた桁上がりはそれぞれ
W1〜W9に入力されている。
Data is input by data input / output control means (neither shown) connected to an external data bus. Also, a BCD for calculating the values of the storage means X and Y
Arithmetic means is provided for each digit, which are designated as W0, W1, ... W9 in order from the least significant digit. Then, the storage means for storing the calculation result of each of the BCD calculation means W9 to W0 is set to Z, and Z0, Z1 ... Z9 in order from the least significant digit. Z0 to Z9 are connected to adjacent digits, respectively, and can be shifted in digit units. The carry generated by the calculation in the BCD calculation means W0 to W8 is input to W1 to W9, respectively.

【0008】以下に、このBCD演算装置を用いて計算
を行う手順について説明する。今、一例として、998
7.654+23.456789を計算しようとする場
合を考える。
The procedure for performing calculations using this BCD arithmetic unit will be described below. Now, as an example, 998
Consider the case of trying to calculate 7.654 + 23.456789.

【0009】9987.654=9.987654×
(10の3乗) 23.456789=2.3456789×(10の1
乗) であるから、それぞれの仮数部を記憶手段X、Yに入力
すると、 X=0998765400 Y=0234567890 となる。
9987654 = 9.987654 ×
(10 to the third power) 23.456789 = 2.3456789 × (1 of 10)
Therefore, inputting the respective mantissa parts to the storage means X and Y results in X = 0998765400 Y = 02334567890.

【0010】次に、両者の指数部の値を揃えるため、指
数部が小さい方の仮数部のデータをシフトダウンする。
この例の場合、Yを2桁シフトダウンすることで指数部
の値を揃える。すると、 X=0998765400 Y=0002345678 となるから、演算を実行すると、 Z=X+Y=1001111078 となる。正規化された状態の仮数部は最上位桁が10進
数で0、2桁目が10進数で0以外の数字になっている
必要があるので、Zは1桁シフトダウンを行うことで正
規化を行う。すると、 Z=0100111107 となる。この時、指数部の値は4である。X、Y、Zの
各データはデータ入出力制御装置により外部データバス
に出力される。
Next, in order to make the values of both exponents uniform, the data of the mantissa having the smaller exponent is downshifted.
In the case of this example, the values of the exponent part are aligned by shifting down Y by two digits. Then, X = 00998765400 Y = 0002345678, so when the calculation is executed, Z = X + Y = 1001111078. Since the most significant digit of the normalized mantissa must be 0 in decimal and the second digit must be a decimal number other than 0, Z is normalized by shifting down by one digit. I do. Then, Z = 01001111107. At this time, the value of the exponent part is 4. The X, Y, and Z data are output to the external data bus by the data input / output control device.

【0011】次に、減算の例を示す。今、一例として、
3333.33−3332.33を計算する場合を考え
る。この時、それぞれの仮数部を記憶手段X、Yに入力
すると、 X=0333333000 Y=0333233000 となる。この時、指数部の値はともに3であるからシフ
トする必要がないので、そのまま演算を実行すると、 Z=X−Y=0000100000 となる。これを正規化するために、Zは3桁シフトアッ
プする必要がある。正規化を実行すると、 Z=0100000000 となり、指数部の値は0となる。
Next, an example of subtraction will be shown. Now, as an example,
Consider the case of calculating 3333.33-3332.33. At this time, when the respective mantissa parts are input to the storage means X and Y, X = 03333333000 Y = 03332333000. At this time, since the values of the exponent parts are both 3, there is no need to shift, so that if the calculation is executed as it is, Z = XY = 0000100000. To normalize this, Z needs to be shifted up by three digits. When the normalization is executed, Z = 0100000000 and the value of the exponent part becomes 0.

【0012】[0012]

【発明が解決しようとする課題】しかしながら、特開平
4−316128号公報に開示されたBCD演算装置で
は、以下に示す問題点がある。即ち、このBCD演算装
置は、各桁毎にBCD演算手段を用意することで、全て
の桁を同時に計算して演算の高速化を図ろうとしている
ため、まず、第1に、回路の規模が大きく、かつ複雑に
なってしまうため、BCD演算装置のコストアップを招
来する。
However, the BCD arithmetic unit disclosed in Japanese Patent Laid-Open No. 4-316128 has the following problems. That is, since this BCD arithmetic unit attempts to speed up the arithmetic by preparing all the digits at the same time by preparing the BCD arithmetic means for each digit, first of all, the circuit scale is Since it is large and complicated, the cost of the BCD arithmetic unit increases.

【0013】第2に、各桁のBCD演算手段は下位桁か
らの桁上がりが決定するまで演算結果が定まらないた
め、2桁の演算をするには1桁のBCD演算手段の演算
時間の2倍、3桁の演算をするためには1桁のBCD演
算手段の演算時間の3倍というように演算する桁数に比
例して演算時間が増加していくので、下位桁から1桁ず
つ繰り返しBCD演算を行う場合と比べてもあまり高速
化は望めない。
Secondly, since the calculation result of the BCD calculating means of each digit is not determined until the carry from the lower digit is decided, in order to perform the 2-digit calculation, the calculation time of the 1-digit BCD calculating means is 2 times. Since the calculation time increases in proportion to the number of digits to be calculated, that is, three times as long as the calculation time of the one-digit BCD calculation means in order to perform the calculation of three times and three digits. Even if the BCD calculation is performed, the speedup cannot be expected so much.

【0014】本発明は、このような現状に鑑みてなされ
たものであり、回路規模の小さなシステム構成で、演算
時間の高速化を図ることができるBCDコード化された
データを用いた数値演算装置を提供することを目的とす
る。
The present invention has been made in view of the above circumstances, and has a system configuration with a small circuit scale, and a numerical operation device using BCD coded data capable of speeding up the operation time. The purpose is to provide.

【0015】本発明の他の目的は、大幅なコストダウン
が可能になる数値演算装置を提供することにある。
Another object of the present invention is to provide a numerical operation device which enables a significant cost reduction.

【0016】[0016]

【課題を解決するための手段】本発明の数値演算装置
は、予め定めた第1の右シフトクロックに同期して1桁
右にシフトする、それぞれ対応する桁の値がBCDコー
ドを表す第1の記憶手段と、予め定めた第2の右シフト
クロックに同期して1桁右にシフトする、それぞれ対応
する桁の値がBCDコードを表す第2の記憶手段と、予
め定めた第3の右シフトクロックに同期して1桁右にシ
フトする、かつ予め定めた左シフトクロックに同期して
1桁左にシフトする、それぞれ対応する桁の値がBCD
コードを表す第3の記憶手段と、外部のデータバスに接
続されたデータ入出力制御手段と、該データ入出力制御
手段から入力される1桁のBCDコード、該第1の記憶
手段の最下位桁のBCDコード又は0の値のいずれかを
選択し、選択した信号を該第1の記憶手段の最上位桁に
入力する第1の選択手段と、該データ入出力制御手段か
ら入力される1桁のBCDコード、該第2の記憶手段の
最下位桁のBCDコード又は0の値のいずれかを選択
し、選択した信号を該第2の記憶手段の最上位桁に入力
する第2の選択手段と、前回の演算により生じた桁上が
りを記憶する桁上がり記憶手段と、該第1の記憶手段の
最下位桁で表されるBCDコード、該第2の記憶手段の
最下位桁で表されるBCDコード及び該桁上がり記憶手
段の値を、予め定めた演算クロックに同期してBCD演
算するとともに、演算により生じた桁上がりを該桁上が
り記憶手段に記憶させるBCD演算手段と、該BCD演
算手段の演算結果又は0の値のいずれかを選択し、選択
した信号を該第3の記憶手段の最上位桁に入力する第3
の選択手段と、該第1の右シフトクロック、該第2の右
シフトクロック、該第3の右シフトクロック、該左シフ
トクロック及び該演算クロックを発生するとともに、該
第1の選択手段、該第2の選択手段及び該第3の選択手
段を制御する演算制御手段とを備え、該データ入出力制
御手段が、該第1の選択手段及び該第2の選択手段へ入
力するデータを選択するとともに、該第1の記憶手段、
該第2の記憶手段及び該第3の記憶手段が記憶している
データを選択して該データバスヘ出力するように構成さ
れており、そのことにより上記目的が達成される。
According to the numerical operation device of the present invention, a first digit is shifted to the right by one digit in synchronization with a predetermined first right shift clock, and the corresponding digit values represent the BCD code. Storage means, a second storage means that shifts to the right by one digit in synchronization with a predetermined second right shift clock, each corresponding digit value representing a BCD code, and a predetermined third right. The value of the corresponding digit shifts to the right by one digit in synchronization with the shift clock and shifts by one digit to the left in synchronization with the predetermined left shift clock.
Third storage means representing a code, data input / output control means connected to an external data bus, a one-digit BCD code input from the data input / output control means, the lowest of the first storage means 1 selected from the digit BCD code or the value of 0 and inputting the selected signal to the most significant digit of the first storage means, and 1 input from the data input / output control means Second selection for selecting either the digit BCD code, the least significant digit BCD code of the second storage means or a value of 0 and inputting the selected signal to the most significant digit of the second storage means Means, a carry storage means for storing a carry generated by the previous calculation, a BCD code represented by the least significant digit of the first storage means, and a least significant digit of the second storage means. The BCD code and the value of the carry storage means are determined in advance. BCD operation is performed in synchronism with the operation clock, and the carry generated by the operation is stored in the carry storage means, and either the operation result of the BCD operation means or the value of 0 is selected and selected. The input signal to the most significant digit of the third storage means
Selecting means for generating the first right shift clock, the second right shift clock, the third right shift clock, the left shift clock, and the operation clock, and the first selecting means, The data input / output control unit includes a second selection unit and an arithmetic control unit for controlling the third selection unit, and the data input / output control unit selects data to be input to the first selection unit and the second selection unit. Together with the first storage means,
It is configured to select the data stored in the second storage means and the third storage means and output the data to the data bus, whereby the above object is achieved.

【0017】好ましくは、前記第3の記憶手段が、1桁
左にシフトする機能を持たず、かつ前記第3の選択手段
が、前記BCD演算手段の演算結果、前記第3の記憶手
段の最下位桁で表されるBCDコード又は0の値のいず
れかを選択し、選択した信号を該第3の記憶手段の最上
位桁に入力する構成とする。
Preferably, the third storage means does not have a function of shifting to the left by one digit, and the third selection means stores the calculation result of the BCD calculation means and the maximum value of the third storage means. Either the BCD code represented by the lower digit or the value of 0 is selected, and the selected signal is input to the most significant digit of the third storage means.

【0018】また、本発明の数値演算装置は、予め定め
た第1の右シフトクロックに同期して1桁右にシフトす
る、それぞれ対応する桁の値がBCDコードを表す第1
の記憶手段と、予め定めた第2の右シフトクロックに同
期して1桁右にシフトするとともに、予め定めた左シフ
トクロックに同期して最下位桁に0の値を入力するとと
もに1桁左にシフトする、それぞれ対応する桁の値がB
CDコードを表す第2の記憶手段と、外部のデータバス
に接続されたデータ入出力制御手段と、該データ入出力
制御手段から入力される1桁のBCDコード、該第1の
記憶手段のそれぞれの最下位桁で表される1桁のBCD
コード又0の値のいずれかを選択し、選択した信号を該
第1の記憶手段の最上位桁に入力する第1の選択手段
と、前回の演算により生じた桁上がりを記憶する桁上が
り記憶手段と、該第1の記憶手段の最下位桁で表される
BCDコード、該第2の記憶手段の最下位桁で表される
BCDコード及び該桁上がり記憶手段の値を、予め定め
た演算クロックに同期してBCD演算するとともに、演
算により生じた桁上がりを該桁上がり記憶手段に記憶さ
せるBCD演算手段と、該データ入出力制御手段から入
力される1桁のBCDコード、該BCD演算手段の演算
結果又は0の値のいずれかを選択し、選択した信号を該
第2の記憶手段の最上位桁に入力する第2の選択手段
と、該第1の右シフトクロック、該第2の右シフトクロ
ック、該左シフトクロック及び該演算クロックを発生す
るとともに、該第1の選択手段及び該第2の選択手段を
制御する演算制御手段とを備え、該データ入出力制御手
段が、該第1の選択手段及び該第2の選択手段へ入力す
るデータを選択するとともに、該第1の記憶手段及び該
第2の記憶手段が記憶しているデータを選択して該デー
タバスヘ出力するように構成されており、そのことによ
り上記目的が達成される。
In the numerical operation device of the present invention, the first digit shifts to the right by one digit in synchronization with the predetermined first right shift clock, and the corresponding digit values represent the BCD code.
And a storage means for shifting a digit to the right by synchronizing with a predetermined second right shift clock and inputting a value of 0 to the least significant digit by synchronizing with a predetermined left shift clock and shifting the digit by one digit to the left. Shift to, and the value of the corresponding digit is B
Second storage means representing a CD code, data input / output control means connected to an external data bus, a one-digit BCD code input from the data input / output control means, and the first storage means, respectively. One-digit BCD represented by the least significant digit of
First selecting means for selecting either a code or a value of 0 and inputting the selected signal to the most significant digit of the first storing means, and a carry storage for storing a carry generated by the previous calculation. Means, the BCD code represented by the least significant digit of the first storage means, the BCD code represented by the least significant digit of the second storage means, and the value of the carry storage means, by a predetermined operation. A BCD calculation means for performing a BCD calculation in synchronization with a clock and for storing a carry generated by the calculation in the carry storage means, a one-digit BCD code input from the data input / output control means, and the BCD calculation means. Of the calculation result or the value of 0, and second selecting means for inputting the selected signal to the most significant digit of the second storing means, the first right shift clock, and the second Right shift clock, left shift clock And a calculation control unit that generates the calculation clock and controls the first selection unit and the second selection unit, and the data input / output control unit includes the first selection unit and the first selection unit. In addition to selecting the data to be input to the second selecting means, the data stored in the first storing means and the second storing means are selected and output to the data bus. The above object is achieved.

【0019】好ましくは、前記第2の記憶手段が、1桁
左にシフトする機能を持たず、かつ前記第2の選択手段
が、前記データ入出カ制御手段から入力される1桁のB
CDコード、前記BCD演算手段の演算結果、該第2の
記憶手段の最下位桁で表されるBCDコード又は0の値
のいずれかを選択し、選択した信号を該第2の記憶手段
の最上位桁に入力する構成とする。
Preferably, the second storage means does not have a function of shifting to the left by one digit, and the second selection means is a one-digit B input from the data input / output control means.
A CD code, a calculation result of the BCD calculation means, a BCD code represented by the least significant digit of the second storage means or a value of 0 is selected, and the selected signal is stored in the second storage means. It is configured to input in the upper digit.

【0020】以下に本発明の作用を説明する。The operation of the present invention will be described below.

【0021】上記のシステム構成及び動作内容によれ
ば、BCD演算手段が1桁ずつ繰り返し演算を行うこと
により、計算を行うことができるので、特開平4−31
6128号公報に開示されたBCD演算装置とは異な
り、各桁毎にBCD演算手段を設ける必要がない。
According to the system configuration and the operation contents described above, the calculation can be performed by the BCD computing means repeatedly performing the digit-by-digit operation.
Unlike the BCD calculation device disclosed in Japanese Patent No. 6128, it is not necessary to provide a BCD calculation means for each digit.

【0022】また、本発明では、全ての桁を演算するの
に要する時間は、1桁のBCD演算に必要な時間を演算
クロックの1サイクル時間にすることが可能であるの
で、特開平4−316128号公報に開示されたBCD
演算装置とほとんど変わらなくなる。
Further, according to the present invention, the time required to calculate all digits can be one cycle time of the operation clock, which is the time required for one-digit BCD operation. BCD disclosed in Japanese Patent No. 316128
Almost no different from a computing device.

【0023】[0023]

【発明の実施の形態】以下に本発明の実施の形態を図面
に基づき具体的に説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be specifically described below with reference to the drawings.

【0024】(実施形態1)図1〜図4は本発明数値演
算装置の実施形態1を示す。まず、図1に基づき本実施
形態1の数値演算装置(BCD演算装置)のシステム構
成について説明する。この数値演算装置は、第1の記憶
手段1、第2の記憶手段2、BCD演算手段3、第1の
選択手段4、第2の選択手段5、第3の記憶手段6、第
3の選択手段7、データ入出力制御手段8及び演算制御
手段9を備えており、これらはバス(データバス)18
〜28によって接続されている。以下に各部の構成と機
能を説明する。
(Embodiment 1) FIGS. 1 to 4 show Embodiment 1 of the numerical value arithmetic device according to the present invention. First, the system configuration of the numerical calculation device (BCD calculation device) of Embodiment 1 will be described with reference to FIG. This numerical operation device includes a first storage unit 1, a second storage unit 2, a BCD calculation unit 3, a first selection unit 4, a second selection unit 5, a third storage unit 6, and a third selection unit. A means 7, a data input / output control means 8 and an arithmetic control means 9 are provided, which are a bus (data bus) 18
Connected by ~ 28. The configuration and function of each unit will be described below.

【0025】第1の記憶手段1は、右シフト、つまりシ
フトダウン可能な演算桁数と同じ桁数であるシフトレジ
スタを4組配設して構成されている。同様に、第2の記
憶手段2も、シフトダウン可能な演算桁数と同じ桁数で
あるシフトレジスタを4組配設して構成されている。一
方、第3の記憶手段6は、左右シフト、つまりシフトア
ップとシフトダウンがともに可能なシフトレジスタを4
組配設して構成されている。
The first storage means 1 is configured by arranging four sets of shift registers having the same number of digits as the number of digits that can be right-shifted, that is, downshifted. Similarly, the second storage means 2 is also configured by arranging four sets of shift registers having the same number of digits as the number of operation digits that can be shifted down. On the other hand, the third storage means 6 has four shift registers capable of left-right shift, that is, both up-shift and down-shift.
They are arranged in pairs.

【0026】BCD演算手段3は、第1の記憶手段1の
最下位桁の値と第2の記憶手段2の最下位桁の値とを演
算する。第1の選択手段4は、第1の記憶手段1が右シ
フトを行うときに最上位桁に入力するデータを選択す
る。第2の選択手段5は、第2の記憶手段2が右シフト
を行うときに最上位桁に入力するデータを選択する。第
3の選択手段7は、第3の記憶手段6が右シフトを行う
ときに最上位桁に入力するデータを選択する。
The BCD calculation means 3 calculates the value of the least significant digit of the first storage means 1 and the value of the least significant digit of the second storage means 2. The first selection means 4 selects the data to be input to the most significant digit when the first storage means 1 shifts to the right. The second selection means 5 selects the data to be input to the most significant digit when the second storage means 2 shifts to the right. The third selection means 7 selects the data to be input to the most significant digit when the third storage means 6 shifts to the right.

【0027】データ入出力制御手段8は、外部データバ
ス(図示せず)とのデータのやりとりを制御する。ま
た、演算制御手段9は、第1の記憶手段1、第2の記憶
手段2及び第3の記憶手段6のシフト動作を制御する信
号を発生させるとともに、BCD演算手段3、第1の選
択手段4、第2の選択手段5及び第3の選択手段6を制
御する。
The data input / output control means 8 controls the exchange of data with an external data bus (not shown). The arithmetic control unit 9 also generates a signal for controlling the shift operation of the first storage unit 1, the second storage unit 2, and the third storage unit 6, and the BCD calculation unit 3 and the first selection unit. 4, controlling the second selecting means 5 and the third selecting means 6.

【0028】より具体的には、第1の記憶手段1の1桁
右へのシフト動作は、演算制御手段9から与えられる第
1の右シフトクロック10によって行われる。同様に、
第2の記憶手段2の1桁右へのシフト動作は、第2の右
シフトクロック11によって行われる。また、BCD演
算手段3は、演算制御手段9から与えられる演算クロッ
ク12によって制御される。
More specifically, the shift operation of the first storage means 1 to the right by one digit is performed by the first right shift clock 10 provided from the arithmetic control means 9. Similarly,
The shift operation to the right by one digit in the second storage unit 2 is performed by the second right shift clock 11. Further, the BCD calculation means 3 is controlled by the calculation clock 12 given from the calculation control means 9.

【0029】また、第1の選択手段4の選択動作は、演
算制御手段9から与えられる第1の選択信号13によっ
て制御される。同様に、第2の選択手段5の選択動作
は、第2の選択信号14によって制御される。
The selection operation of the first selection means 4 is controlled by the first selection signal 13 provided from the arithmetic control means 9. Similarly, the selection operation of the second selection means 5 is controlled by the second selection signal 14.

【0030】また、第3の記憶手段6の1桁右へのシフ
ト動作は、第3の右シフトクロック15によって行わ
れ、1桁左へのシフト動作は、左シフトクロック16に
よって行われる。第3の選択手段7の選択動作は、演算
制御手段9から与えられる第3の選択信号17によって
行われる。
The shift operation to the right by one digit in the third storage means 6 is performed by the third right shift clock 15, and the shift operation to the left by one digit is performed by the left shift clock 16. The selection operation of the third selection means 7 is performed by the third selection signal 17 provided from the arithmetic control means 9.

【0031】上記バス18は、第1の記憶手段1の全て
の桁の値をデータ入出力制御手段8へ出力するバスであ
る。また、バス19は第2の記憶手段2の全ての桁の値
をデータ入出力制御手段8へ出力するバス、バス20は
第3の記憶手段6の全ての桁の値をデータ入出カ制御手
段8へ出力するバス、バス21は第1の記憶手段1の最
下位桁の値を伝送する4ビットのバス、バス22は第2
の記憶手段2の最下位桁の値を伝送する4ビットのバ
ス、バス23はBCD演算手段3の演算結果の値を伝送
する4ビットのバス、バス24は第1の選択手段4の出
力を伝送する4ビットのバス、バス25は第2の選択択
手段5の出力を伝送する4ビットのバス、バス26は第
3の選択手段7の出力を伝送する4ビットのバス、バス
27はデータ入出カ制御手段8から第1の選択手段4へ
のBCDデータを伝送する4ビットのバス、バス28は
データ入出カ制御手段8から第2の選択手段5へのBC
Dデータを伝送する4ビットのバスである。
The bus 18 is a bus for outputting the values of all digits of the first storage means 1 to the data input / output control means 8. Further, the bus 19 outputs the values of all the digits of the second storage means 2 to the data input / output control means 8, and the bus 20 outputs the values of all the digits of the third storage means 6 to the data input / output control means. 8, a bus 21 is a 4-bit bus for transmitting the value of the least significant digit of the first storage means 1, and a bus 22 is a second bus.
A 4-bit bus for transmitting the value of the least significant digit of the memory means 2, a bus 23 for a 4-bit bus for transmitting the value of the operation result of the BCD operation means 3, and a bus 24 for the output of the first selecting means 4. A 4-bit bus for transmission, a bus 25 is a 4-bit bus for transmitting the output of the second selection means 5, a bus 26 is a 4-bit bus for transmitting the output of the third selection means 7, and a bus 27 is data. A 4-bit bus for transmitting BCD data from the input / output control means 8 to the first selection means 4, a bus 28 is a BC from the data input / output control means 8 to the second selection means 5.
It is a 4-bit bus for transmitting D data.

【0032】次に、本実施形態の数値演算装置の動作
を、仮数部が10桁で構成されている場合を例にとって
説明する。今、演算を行う2つのデータを、 データA:仮数部=0987654321、指数部 3 データB:仮数部=0123456789、指数部 5 とする。仮数部の小数点位置は上位から2桁目と3桁目
の間にある。
Next, the operation of the numerical operation device of this embodiment will be described by taking the case where the mantissa part is composed of 10 digits as an example. Now, let us say that two data to be operated are data A: mantissa part = 0987654321, exponent part 3 data B: mantissa part = 0123456789, exponent part 5. The decimal point position of the mantissa is between the second and third digits from the higher order.

【0033】なお、本発明において、指数部の演算は本
発明の本質とは関連が低いので、簡単に説明する。指数
部の値の比較などは本発明の数値演算装置の外部のCP
U等で行うこととし、外部のCPU等からデータ入出カ
制御手段8ヘデータを書き込むことでデータの入力が行
われ、外部のCPU等から演算制御手段9へ指示を行う
ことで、本発明の数値演算装置の演算が行われるものと
する。
In the present invention, the calculation of the exponent part has little relation to the essence of the present invention, so it will be briefly described. For comparison of the values of the exponent part, the CP outside the numerical operation device of the present invention is used.
The data is input by writing data to the data input / output control means 8 from an external CPU or the like, and the numerical value of the present invention is given by giving an instruction to the arithmetic control means 9 from the external CPU or the like. It is assumed that the calculation of the calculation device is performed.

【0034】まず、演算を行うデータを第1の記憶手段
1と第2の記憶手段2に入力する手順について説明す
る。演算制御手段9の制御による第1の選択信号13を
受けて、第1の選択手段4はデータ入出力制御手段8か
ら入力されるデータを選択する。データ入出力制御手段
8が、データAの仮数部の最下位桁の値”1”を第1の
選択手段4に出力するとともに、演算制御手段9が第1
の右シフトクロック10を1シフト分だけ発生させる。
すると、第1の記憶手段1の最上位桁に”1”が入力さ
れる。
First, the procedure for inputting the data to be calculated into the first storage means 1 and the second storage means 2 will be described. Upon receiving the first selection signal 13 under the control of the arithmetic control means 9, the first selection means 4 selects the data input from the data input / output control means 8. The data input / output control means 8 outputs the value "1" of the least significant digit of the mantissa part of the data A to the first selection means 4, and the arithmetic control means 9 makes the first value.
The right shift clock 10 is generated by one shift.
Then, "1" is input to the most significant digit of the first storage means 1.

【0035】次に、データ入出力制御手段8が、データ
Aの下位から2桁目の値”2”を第1の選択手段4に出
力するとともに、演算制御手段9が第1の右シフトクロ
ック10を1シフト分だけ発生させる。すると、第1の
記憶手段1の最上位桁の値が”2”になるとともに、第
1の記憶手段1の上位から2桁目の値が”1”になる。
同様に、1桁ずつこの入力動作を演算桁数だけ繰り返す
ことで第1の記憶手段1にデータAの仮数部の値が記憶
される。
Next, the data input / output control means 8 outputs the value "2" in the second lowest digit of the data A to the first selection means 4, and the arithmetic control means 9 causes the first right shift clock. 10 is generated for one shift. Then, the value of the most significant digit of the first storage means 1 becomes "2", and the value of the second digit from the high order of the first storage means 1 becomes "1".
Similarly, the value of the mantissa part of the data A is stored in the first storage means 1 by repeating this input operation digit by digit by the number of calculated digits.

【0036】同様に、演算制御手段9による制御によ
り、第2の選択手段5はデータ入出力制御手段8からの
データを選択する。データ入出力制御手段8が、データ
Bの最下位桁の値”9”を第2の選択手段5に出力する
とともに、演算制御手段9が第2の右シフトクロック1
1を1シフト分だけ発生させる。すると、第2の記憶手
段2の最上位桁にデータBの最下位桁の値”9”が入力
される。
Similarly, under the control of the arithmetic control means 9, the second selecting means 5 selects the data from the data input / output control means 8. The data input / output control means 8 outputs the value "9" of the least significant digit of the data B to the second selection means 5, and the operation control means 9 causes the second right shift clock 1 to operate.
1 is generated for one shift. Then, the value "9" of the least significant digit of the data B is input to the most significant digit of the second storage means 2.

【0037】次に、データ入出力制御手段8が、データ
Bの下位から2桁目の値”8”を第2の選択手段5に出
力するとともに、演算制御手段9が第2の右シフトクロ
ック11を1シフト分だけ発生させる。すると、第2の
記憶手段2の最上位桁の値が”8”になるとともに、第
2の記憶手段2の上位から2桁目の値が”9”になる。
同様の動作を演算桁数だけ繰り返すことで、第2の記憶
手段2に演算対象のデータが記憶される。この時の第1
の記憶手段1と第2の記憶手段2の状態を図示すると、
図2(a)のようになる。
Next, the data input / output control means 8 outputs the second lowest digit value "8" of the data B to the second selection means 5, and the arithmetic control means 9 causes the second right shift clock. 11 is generated for one shift. Then, the value of the most significant digit of the second storage means 2 becomes "8", and the value of the second digit from the higher order of the second storage means 2 becomes "9".
By repeating the same operation for the number of calculation digits, the data to be calculated is stored in the second storage means 2. First at this time
The states of the storage means 1 and the second storage means 2 of FIG.
It becomes like FIG.

【0038】次に、第1の記憶手段1と第2の記憶手段
2との桁あわせをする手順について説明する。指数部の
値がともに同じでなければ演算の前に桁あわせを行わな
けれぱならない。本実施形態1の例では、第1の記憶手
段1の値を2桁右にシフトして指数部の値を5に桁あわ
せをする必要がある。第1の選択手段4は”0”の値を
選択し、演算制御手段9は第1の右シフトクロック10
を2シフト分発生させる。こうすることで、第1の記憶
手段1の値は2桁右ヘシフトする。この時の第1の記憶
手段1と第2の記憶手段2の状態を図示すると、図2
(b)のようになる。第2の記憶手段2の値を右シフト
する場合においても、同様に、第2の選択手段5は”
0”の値を選択し、演算制御手段9は第2の右シフトク
ロック11をシフトさせる桁数だけ発生させる。
Next, a procedure for aligning the digits in the first storage means 1 and the second storage means 2 will be described. If the exponent values are not the same, digit alignment must be performed before the operation. In the example of the first embodiment, it is necessary to shift the value of the first storage unit 1 to the right by two digits and adjust the value of the exponent part to 5 digits. The first selection means 4 selects the value "0", and the operation control means 9 selects the first right shift clock 10
Is generated for 2 shifts. By doing so, the value of the first storage means 1 is shifted to the right by two digits. The states of the first storage means 1 and the second storage means 2 at this time are shown in FIG.
It becomes like (b). Similarly, when the value of the second storage means 2 is right-shifted, the second selection means 5 is "
The value "0" is selected, and the arithmetic control means 9 generates the second right shift clock 11 by the number of digits to be shifted.

【0039】最後に、第1の記憶手段1と第2の記憶手
段2とを演算する手順について説明する。ここでは加算
する場合を例にとって説明する。なお、減算を行う場合
も同様である。
Finally, the procedure for calculating the first storage means 1 and the second storage means 2 will be described. Here, the case of addition will be described as an example. The same applies when subtraction is performed.

【0040】まず、BCD演算手段3の詳細について説
明する。図3に示すように、BCD演算手段3は、1桁
のBCDコード同士を加減算するBCD加減算手段30
と、BCD加減算手段30の演算により生じた桁上がり
を記憶する桁上がり記憶手段31とで構成されている。
BCD加減算手段30は、入力された2つのBCDコー
ドを桁上がり記憶手段31からの桁上がり信号とともに
加減算し、その演算結果を出力するとともに、演算時に
生じた桁上がり信号を桁上がり記憶手段31に出力す
る。
First, the details of the BCD calculation means 3 will be described. As shown in FIG. 3, the BCD calculation means 3 is a BCD addition / subtraction means 30 for adding / subtracting one-digit BCD codes.
And a carry storage means 31 for storing a carry generated by the calculation of the BCD addition / subtraction means 30.
The BCD addition / subtraction means 30 adds / subtracts the two input BCD codes together with the carry signal from the carry storage means 31, outputs the operation result, and stores the carry signal generated during the operation in the carry storage means 31. Output.

【0041】桁上がり記憶手段31は、演算制御手段9
から演算クロック12が出力されるまでは現在の値を保
持する。そして、演算制御手段9から演算クロック12
が出力されると、それに同期してBCD加減算手段30
からの桁上がり信号を記憶する。
The carry storage means 31 is the arithmetic control means 9
The current value is held until the operation clock 12 is output. Then, the arithmetic control means 9 to the arithmetic clock 12
Is output, the BCD adding / subtracting means 30 is synchronized with it.
The carry signal from is stored.

【0042】次に、演算の手順について説明する。演算
制御手段9の制御により、第1の選択手段4は第1の選
択信号13を受けて、第1の記憶手段1の最下位桁の
値”3”を選択する。第2の選択手段5は第2の選択信
号14を受けて、第2の記憶手段2の最下位桁の値”
9”を選択する。第3の選択手段7は第3の選択信号1
7を受けて、BCD演算手段3の演算結果の値を選択す
る。この時、BCD演算手段3は第1の記憶手段1の最
下位桁の値”3”と第2の記憶手段2の最下位桁の値”
9”を桁上がり記憶手段31の桁上がり信号”0”とと
もにBCD加算し、その加算結果”2”を第3の選択手
段7に出力するとともに、桁上がり信号”1”を桁上が
り記憶手段31に出力する。この時、桁上がり記憶手段
31は演算クロック12を受けていないので、初期値”
0”のままである。
Next, the calculation procedure will be described. Under the control of the arithmetic control unit 9, the first selection unit 4 receives the first selection signal 13 and selects the value “3” of the least significant digit of the first storage unit 1. The second selection means 5 receives the second selection signal 14, and receives the value of the least significant digit of the second storage means 2.
9 "is selected. The third selection means 7 outputs the third selection signal 1
In response to 7, the value of the calculation result of the BCD calculation means 3 is selected. At this time, the BCD calculation means 3 has the value of the least significant digit “3” of the first storage means 1 and the value of the least significant digit of the second storage means 2.
9 "is BCD added with the carry signal" 0 "of the carry storage means 31, the addition result" 2 "is output to the third selecting means 7, and the carry signal" 1 "is carried to the carry storage means 31. At this time, since the carry storage means 31 does not receive the operation clock 12, the initial value "
It remains 0 ”.

【0043】この状態で演算制御手段9は、第1の右シ
フトクロック10、第2の右シフトクロック11、第3
の右シフトクロック15及び演算クロック12とを同時
に出力する。すると、第1の記憶手段1と第2の記憶手
段2が1桁右シフトし、第3の記憶手段6の最上位桁に
加算結果”2”が入力されるとともに、桁上がり記憶手
段31に前回の桁上がり値”1”が入力される。
In this state, the arithmetic control means 9 has the first right shift clock 10, the second right shift clock 11, and the third right shift clock 10.
The right shift clock 15 and the operation clock 12 are simultaneously output. Then, the first storage means 1 and the second storage means 2 are shifted to the right by one digit, the addition result “2” is input to the most significant digit of the third storage means 6, and the carry storage means 31 is entered. The previous carry value "1" is input.

【0044】この時の第1の記憶手段1、第2の記憶手
段及び第3の記憶手段6の状態を図示すると、図4
(a)のようになる。この時、BCD演算手段3は、第
1の記憶手段1の最下位桁の値”4”と第2の記憶手段
2の最下位桁の値”8”を桁上がり記憶手段31の桁上
がり信号”1”とともにBCD加算し、その加算結果”
3”を第3の選択手段7に出力するとともに、桁上がり
信号”1”を桁上がり記憶手段31に出力している。
The states of the first storage means 1, the second storage means and the third storage means 6 at this time are shown in FIG.
It becomes like (a). At this time, the BCD calculation means 3 sets the value "4" of the least significant digit of the first storage means 1 and the value "8" of the least significant digit of the second storage means 2 to the carry signal of the carry storage means 31. BCD addition with "1" and the addition result "
3 "is output to the third selecting means 7, and the carry signal" 1 "is output to the carry storing means 31.

【0045】この状態で、1桁目と同様に、演算制御手
段9は第1の右シフトクロック10、第2の右シフトク
ロック11、第3の右シフトクロック15及び演算クロ
ック12を同時に出力する。すると、1桁目と同様に第
1の記憶手段1と第2の記憶手段2が1桁右シフトし、
第3の記憶手段6の最上位桁に加算結果”3”が入力さ
れるとともに、1桁右シフトし、桁上がり記憶手段31
に前回の桁上がり値”1”が入力される。
In this state, the arithmetic control means 9 outputs the first right shift clock 10, the second right shift clock 11, the third right shift clock 15 and the arithmetic clock 12 at the same time as in the first digit. . Then, like the first digit, the first storage means 1 and the second storage means 2 shift right by one digit,
The addition result "3" is input to the most significant digit of the third storage means 6 and the carry storage means 31 shifts to the right by one digit.
The previous carry value "1" is input to.

【0046】この時の第1の記憶手段1、第2の記憶手
段及び第3の記憶手段6の状態を図示すると、図4
(b)のようになる。そして、上記動作を10桁分実行
すると、図4(c)のようになる。この図を見るとわか
るように、第1の記憶手段1と第2の記憶手段2の値は
保存され、第3の記憶手段6には演算結果が格納されて
いることがわかる。
The states of the first storage means 1, the second storage means and the third storage means 6 at this time are shown in FIG.
It becomes like (b). Then, when the above operation is executed for 10 digits, the result is as shown in FIG. As can be seen from this figure, the values of the first storage means 1 and the second storage means 2 are stored, and the calculation results are stored in the third storage means 6.

【0047】本実施形態1では、第3の記憶手段6に格
納された演算結果は正規化されたと同じ状態のため、こ
のままで他の演算に利用可能であるが、例えば第3の記
憶手段6の値が1234567890のように最上位桁
の値が”0”以外の時は、1桁右シフトして正規化する
必要がある。そのとき、指数部の値は1増加されなけれ
ばならない。一方、減算を行ったときの第3の記憶手段
の値が、例えば0000123456のように上位2桁
の値がともに0であった場合は、左シフトして正規化す
る必要がある。この例では、3桁左シフトすることて正
規化される。そのとき指数部の値は3減少されなければ
ならない。
In the first embodiment, since the operation result stored in the third storage means 6 is in the same state as that in the normalized state, it can be used for other operations as it is. For example, the third storage means 6 is used. If the value of the most significant digit is other than "0" such as 1234567890, it is necessary to shift the value to the right by one digit for normalization. At that time, the value of the exponent part must be incremented by 1. On the other hand, when the value of the third storage means when the subtraction is performed is such that the value of the upper two digits is 0 as in the case of 0000123456, it is necessary to shift to the left to normalize. In this example, it is normalized by shifting left by 3 digits. Then the value of the exponent must be reduced by 3.

【0048】本実施形態1の数値演算装置によれば、B
CD演算手段3が1桁ずつ繰り返し演算を行うことによ
り、計算を行うことができるので、上述の特開平4−3
16128号公報に開示されたBCD演算装置とは異な
り、各桁毎にBCD演算手段を設ける必要がない。
According to the numerical operation device of the first embodiment, B
The calculation can be performed by the CD computing means 3 repeatedly performing digit-by-digit calculations.
Unlike the BCD calculation device disclosed in Japanese Patent No. 16128, it is not necessary to provide a BCD calculation means for each digit.

【0049】また、全ての桁を演算するのに要する時間
は、1桁のBCD演算に必要な時間を演算クロックの1
サイクル時間にすることが可能であるので、特開平4−
316128号公報に開示されたBCD演算装置とほと
んど変わらなくなる。
As for the time required to calculate all the digits, the time required for 1-digit BCD calculation is 1 of the operation clock.
Since it is possible to set the cycle time, it is possible to use
It is almost the same as the BCD arithmetic device disclosed in Japanese Patent No. 316128.

【0050】(実施形態2)図5は本発明数値演算装置
の実施形態2を示す。本実施形態2の数値演算装置は、
以下の点で実施形態1の数値演算装置とは異なってい
る。即ち、図5と図1とを比較してみれば明かなよう
に、本実施形態2の数値演算装置では、第3の記憶手段
6が左シフトする機能を持たない(演算制御手段9から
左シフトクロック16が与えられない)ことと、第3の
選択手段7にBCD演算手段3の出力と”0”の値だけ
でなく、第3の記憶手段6の最下位桁の値29を入力す
る点ある。なお、実施形態1と対応する部分には同一の
符号を付し、具体的な説明については省略する。
(Embodiment 2) FIG. 5 shows Embodiment 2 of the numerical operation device of the invention. The numerical operation device according to the second embodiment is
The numerical calculation device of the first embodiment is different in the following points. That is, as is apparent from a comparison between FIG. 5 and FIG. 1, in the numerical calculation device according to the second embodiment, the third storage unit 6 does not have the function of shifting to the left (from the calculation control unit 9 to the left. (The shift clock 16 is not given), and not only the output of the BCD calculation means 3 and the value of "0" but also the value 29 of the least significant digit of the third storage means 6 is input to the third selection means 7. There are points. The parts corresponding to those of the first embodiment are designated by the same reference numerals, and the detailed description will be omitted.

【0051】このように、本実施形態2の数値演算装置
では、第3の記憶手段6が左シフトする機能を持たない
ので、減算後の正規化を行うときに左シフトする必要が
生じた場合には、以下のようにする。例えば、0000
123456を3桁左シフトする場合は、まず演算制御
手段9の制御により、第3の選択手段7は第3の選択信
号17を受けて、第3の記憶手段6の最下位桁の値”
6”を選択する。そして、第3の右シフトクロック15
を受けて第3の記憶手段6は1桁右シフトする。
As described above, in the numerical operation device according to the second embodiment, since the third storage means 6 does not have the function of shifting to the left, it is necessary to shift to the left when performing the normalization after the subtraction. To do this, do the following: For example, 0000
In the case of shifting 123456 to the left by three digits, first, the third selecting means 7 receives the third selecting signal 17 under the control of the arithmetic control means 9, and the value of the least significant digit of the third storing means 6 "
6 ". And the third right shift clock 15
In response to this, the third storage means 6 shifts to the right by one digit.

【0052】すると、第3の記憶手段6の値は6000
012345となる。これを(10−3)桁分、つまり
7桁分繰り返すと、第3の記憶手段6の値は01234
56000となり、3桁左シフトしたのと同じ結果にな
る。第3の記憶手段6の左シフト以外の動作について
は、実施形態1と全て同じである。
Then, the value of the third storage means 6 is 6000.
It becomes 012345. When this is repeated for (10-3) digits, that is, for 7 digits, the value of the third storage means 6 is 01234.
It becomes 56000, which is the same result as shifting by 3 digits to the left. The operations other than the left shift of the third storage means 6 are all the same as in the first embodiment.

【0053】このように構成することで、左シフトする
機能を持つシフトレジスタが使用できない場合や、回路
規模を縮小する場合に対応することが出来る。即ち、本
実施形態2によれば、より一層簡潔なシステム構成で、
高速演算が可能な数値演算装置を実現できる利点があ
る。
With such a configuration, it is possible to deal with the case where the shift register having the function of shifting to the left cannot be used or the circuit scale is reduced. That is, according to the second embodiment, with a simpler system configuration,
There is an advantage that a numerical operation device capable of high-speed operation can be realized.

【0054】(実施形態3)図6は本発明数値演算装置
の実施形態3を示す。本実施形態3の数値演算装置は、
以下の点で実施形態1の数値演算装置とは異なってい
る。即ち、図6と図1とを比較してみれば明らかなよう
に、本実施形態3の数値演算装置では、第3の選択手段
7と第3の記憶手段6を具備しないことと、第2の記憶
手段2が左シフトクロック16を受けて左シフトする機
能を持つことと、第2の選択手段5に第2の記憶手段2
の最下位桁の代わりにBCD演算手段3の演算結果を入
力する点にある。なお、実施形態1と対応する部分には
同一の符号を付し、具体的な説明については省略する。
(Embodiment 3) FIG. 6 shows Embodiment 3 of the numerical value arithmetic device of the present invention. The numerical operation device according to the third embodiment is
The numerical calculation device of the first embodiment is different in the following points. That is, as is clear from a comparison between FIG. 6 and FIG. 1, the numerical operation device of the third embodiment does not include the third selecting means 7 and the third storing means 6, and That the second storage means 2 of the second selection means 5 has the function of shifting to the left by receiving the left shift clock 16.
The point is to input the calculation result of the BCD calculation means 3 instead of the least significant digit. The parts corresponding to those of the first embodiment are designated by the same reference numerals, and the detailed description will be omitted.

【0055】本実施形態2において、演算を行うとき、
第2の選択手段5はBCD演算手段3の演算結果を選択
する。こうすることで、演算実施後、演算前に第2の記
憶手段2に記憶されていたデータの代わりに演算結果が
記憶されるようになる。第2の記憶手段2に記憶されて
いたデータを保存する必要のないとき、このように構成
することで実施形態1よりも回路規模を縮小することが
出来る。即ち、本実施形態3によっても、より一層簡潔
なシステム構成で、高速演算が可能な数値演算装置を実
現できる利点がある。
In the second embodiment, when the calculation is performed,
The second selection means 5 selects the calculation result of the BCD calculation means 3. By doing so, after the calculation is performed, the calculation result is stored instead of the data stored in the second storage unit 2 before the calculation. When it is not necessary to save the data stored in the second storage means 2, the circuit scale can be reduced as compared with the first embodiment by adopting such a configuration. That is, the third embodiment also has an advantage that a numerical operation device capable of high-speed operation can be realized with a simpler system configuration.

【0056】(実施形態4)図7は本発明数値演算装置
の実施形態4を示す。本実施形態4の数値演算装置は、
以下の点で実施形態3の数値演算装置とは異なってい
る。即ち、図7と図6とを比較してみれば明かなよう
に、本実施形態4の数値演算装置では、第2の記憶手段
2が左シフトする機能を持たないことと、第2の選択手
段5にデータ入出力制御手段9から入力される1桁のB
CDコードとBCD演算手段3の出力と”0”の値だけ
でなく、第2の記憶手段2の最下位桁の値を入力する点
にある。なお、実施形態3と対応する部分には同一の符
号を付し、具体的な説明については省略する。
(Fourth Embodiment) FIG. 7 shows a fourth embodiment of the numerical operation device of the present invention. The numerical operation device according to the fourth embodiment is
It differs from the numerical operation device of the third embodiment in the following points. That is, as apparent from a comparison between FIG. 7 and FIG. 6, in the numerical operation device according to the fourth embodiment, the second storage unit 2 does not have the function of shifting to the left, and the second selection. One digit B input to the means 5 from the data input / output control means 9
The point is that not only the CD code, the output of the BCD calculation means 3 and the value of "0" but also the value of the least significant digit of the second storage means 2 is input. The parts corresponding to those in the third embodiment are designated by the same reference numerals, and the detailed description will be omitted.

【0057】本実施形態4の数値演算装置では、第2の
記憶手段2が左シフトする機能を持たないので、減算後
の正規化を行うときには、実施形態2と同様に、演算制
御手段9の制御により、第2の選択手段5が第2の選択
信号14を受けて、第2の記憶手段2の最下位桁の値を
選択するとともに、第2の右シフトクロック12を受け
て、第2の記憶手段2が(演算桁数−左シフト数)だけ
シフトする。
In the numerical operation device according to the fourth embodiment, the second storage means 2 does not have the function of shifting to the left. Therefore, when performing the normalization after the subtraction, as in the second embodiment, the operation control means 9 operates. Under the control, the second selection means 5 receives the second selection signal 14 to select the value of the least significant digit of the second storage means 2 and receives the second right shift clock 12 to receive the second Storage means 2 shifts by (the number of calculated digits-the number of left shifts).

【0058】本実施形態4によっても、より一層簡潔な
システム構成で、高速演算が可能な数値演算装置を実現
できる利点がある。
The fourth embodiment also has an advantage that a numerical arithmetic unit capable of high-speed arithmetic can be realized with a simpler system configuration.

【0059】[0059]

【発明の効果】本発明の数値演算装置は、BCD演算手
段が1桁ずつ繰り返し演算を行うことにより、計算を行
うことができるので、特開平4−316128号公報に
開示されたBCD演算装置とは異なり、各桁毎にBCD
演算手段を設ける必要がない。このため、本発明によれ
ば、回路規模の小さい、簡潔なシステム構成で実現でき
る利点がある。
In the numerical operation device of the present invention, since the BCD operation means can perform the operation by performing the iterative operation for each digit, the BCD operation device disclosed in Japanese Patent Laid-Open No. 4-316128 is disclosed. Is different, BCD for each digit
There is no need to provide a calculation means. Therefore, according to the present invention, there is an advantage that it can be realized with a simple system configuration having a small circuit scale.

【0060】また、本発明の数値演算装置では、全ての
桁を演算するのに要する時間は、1桁のBCD演算に必
要な時間を演算クロックの1サイクル時間にすることが
可能であるので、特開平4−316128号公報に開示
されたBCD演算装置とほとんど変わらなくなる。
Further, in the numerical operation device of the present invention, the time required to calculate all the digits can be the time required for one-digit BCD operation to be one cycle time of the operation clock. It is almost the same as the BCD arithmetic unit disclosed in Japanese Patent Laid-Open No. 4-316128.

【0061】よって、本発明によれば、回路規模の小さ
なシステム構成で、演算時間の高速化を図ることができ
るBCD演算装置を実現できる、といった効果を奏する
ことができる。
Therefore, according to the present invention, it is possible to achieve an effect that it is possible to realize a BCD arithmetic unit capable of speeding up an arithmetic time with a system configuration having a small circuit scale.

【0062】また、特に請求項2〜請求項4記載の数値
演算装置によれば、より一層簡潔なシステム構成で、高
速演算が可能な数値演算装置を実現できる利点がある。
Further, in particular, according to the numerical operation device described in claims 2 to 4, there is an advantage that a numerical operation device capable of high-speed operation can be realized with a more simple system configuration.

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

【図1】本発明数値演算装置の実施形態1を示す、シス
テム構成を示すブロック図。
FIG. 1 is a block diagram showing a system configuration showing a first embodiment of a numerical operation device of the present invention.

【図2】本発明数値演算装置の実施形態1を示す、
(a)、(b)は桁合わせ動作を説明するための説明
図。
FIG. 2 shows Embodiment 1 of the numerical operation device of the present invention,
(A), (b) is explanatory drawing for demonstrating a digit alignment operation.

【図3】本発明数値演算装置の実施形態1を示す、BC
D演算手段の詳細を示すブロック図。
FIG. 3 is a BC diagram showing the first embodiment of the numerical operation device of the present invention.
The block diagram which shows the detail of D calculating means.

【図4】本発明数値演算装置の実施形態1を示す、
(a)〜(c)は演算動作を説明をするための説明図。
FIG. 4 shows the first embodiment of the numerical operation device of the present invention,
(A)-(c) is explanatory drawing for demonstrating arithmetic operation.

【図5】本発明数値演算装置の実施形態2を示す、シス
テム構成を示すブロック図。
FIG. 5 is a block diagram showing a system configuration showing a second embodiment of the numerical calculation device of the present invention.

【図6】本発明数値演算装置の実施形態3を示す、シス
テム構成を示すブロック図。
FIG. 6 is a block diagram showing a system configuration showing a third embodiment of a numerical operation device of the present invention.

【図7】本発明数値演算装置の実施形態4を示す、シス
テム構成を示すブロック図。
FIG. 7 is a block diagram showing a system configuration showing a fourth embodiment of the numerical calculation device of the invention.

【図8】BCDコード化されたデータの一例を示す図。FIG. 8 is a diagram showing an example of BCD-coded data.

【図9】数値演算装置の従来例を示す、システム構成を
示すブロック図。
FIG. 9 is a block diagram showing a system configuration showing a conventional example of a numerical operation device.

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

1 第1の記憶手段 2 第2の記憶手段 3 BCD演算手段 30 BCD加減算手段 31 桁上がり記憶手段 4 第1の選択手段 5 第2の選択手段 6 第3の記憶手段 7 第3の選択手段 8 データ入出力制御手段 9 演算制御手段 10 第1の右シフトクロック 11 第2の右シフトクロック 12 演算クロック 15 第3の右シフトクロック 16 左シフトクロック 18〜28 バス 1 First storage means 2 Second storage means 3 BCD calculation means 30 BCD addition / subtraction means 31 Carry memory 4 First selection means 5 Second selection means 6 Third storage means 7 Third selection means 8 Data input / output control means 9 Arithmetic control means 10 First right shift clock 11 Second right shift clock 12 Arithmetic clock 15 Third right shift clock 16 Left shift clock 18-28 bus

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 予め定めた第1の右シフトクロックに同
期して1桁右にシフトする、それぞれ対応する桁の値が
BCDコードを表す第1の記憶手段と、 予め定めた第2の右シフトクロックに同期して1桁右に
シフトする、それぞれ対応する桁の値がBCDコードを
表す第2の記憶手段と、 予め定めた第3の右シフトクロックに同期して1桁右に
シフトする、かつ予め定めた左シフトクロックに同期し
て1桁左にシフトする、それぞれ対応する桁の値がBC
Dコードを表す第3の記憶手段と、 外部のデータバスに接続されたデータ入出力制御手段
と、 該データ入出力制御手段から入力される1桁のBCDコ
ード、該第1の記憶手段の最下位桁のBCDコード又は
0の値のいずれかを選択し、選択した信号を該第1の記
憶手段の最上位桁に入力する第1の選択手段と、 該データ入出力制御手段から入力される1桁のBCDコ
ード、該第2の記憶手段の最下位桁のBCDコード又は
0の値のいずれかを選択し、選択した信号を該第2の記
憶手段の最上位桁に入力する第2の選択手段と、 前回の演算により生じた桁上がりを記憶する桁上がり記
憶手段と、 該第1の記憶手段の最下位桁で表されるBCDコード、
該第2の記憶手段の最下位桁で表されるBCDコード及
び該桁上がり記憶手段の値を、予め定めた演算クロック
に同期してBCD演算するとともに、演算により生じた
桁上がりを該桁上がり記憶手段に記憶させるBCD演算
手段と、 該BCD演算手段の演算結果又は0の値のいずれかを選
択し、選択した信号を該第3の記憶手段の最上位桁に入
力する第3の選択手段と、 該第1の右シフトクロック、該第2の右シフトクロッ
ク、該第3の右シフトクロック、該左シフトクロック及
び該演算クロックを発生するとともに、該第1の選択手
段、該第2の選択手段及び該第3の選択手段を制御する
演算制御手段とを備え、該データ入出力制御手段が、該
第1の選択手段及び該第2の選択手段へ入力するデータ
を選択するとともに、該第1の記憶手段、該第2の記憶
手段及び該第3の記憶手段が記憶しているデータを選択
して該データバスヘ出力する数値演算装置。
1. A first storage means for shifting a digit to the right by one digit in synchronization with a predetermined first right shift clock, each storing digit representing a BCD code, and a predetermined second right. Shifting to the right by one digit in synchronization with the shift clock, second storage means in which the corresponding digit values represent the BCD code, and shifting to the right by one digit in synchronization with a predetermined third right shift clock , And shift to the left by one digit in synchronization with a predetermined left shift clock.
A third storage means representing the D code, a data input / output control means connected to an external data bus, a one-digit BCD code input from the data input / output control means, and a maximum of the first storage means. It is input from the data input / output control means and first selection means for selecting either the BCD code of the lower digit or the value of 0 and inputting the selected signal to the most significant digit of the first storage means. A second digit which selects either the one-digit BCD code, the least significant digit BCD code of the second storage means or a value of 0 and inputs the selected signal to the most significant digit of the second storage means. A selection means, a carry storage means for storing a carry generated by the previous calculation, and a BCD code represented by the least significant digit of the first storage means,
The BCD code represented by the least significant digit of the second storage means and the value of the carry storage means are BCD operated in synchronization with a predetermined operation clock, and the carry generated by the operation is carried up. BCD calculation means to be stored in the storage means, and third selection means for selecting either the calculation result of the BCD calculation means or the value of 0 and inputting the selected signal to the most significant digit of the third storage means. Generating the first right shift clock, the second right shift clock, the third right shift clock, the left shift clock and the operation clock, and the first selecting means and the second selecting clock. The data input / output control means selects data to be input to the first selection means and the second selection means, and an arithmetic control means for controlling the selection means and the third selection means. First memorizer Math unit to the Detabasuhe selects and outputs the data to the second storage means and third storage means is storing.
【請求項2】 前記第3の記憶手段が、1桁左にシフト
する機能を持たず、かつ前記第3の選択手段が、前記B
CD演算手段の演算結果、前記第3の記憶手段の最下位
桁で表されるBCDコード又は0の値のいずれかを選択
し、選択した信号を該第3の記憶手段の最上位桁に入力
する請求項1記載の数値演算装置。
2. The third storage means does not have the function of shifting to the left by one digit, and the third selection means is the B
As the calculation result of the CD calculating means, either the BCD code represented by the least significant digit of the third storing means or the value of 0 is selected, and the selected signal is input to the most significant digit of the third storing means. The numerical operation device according to claim 1.
【請求項3】 予め定めた第1の右シフトクロックに同
期して1桁右にシフトする、それぞれ対応する桁の値が
BCDコードを表す第1の記憶手段と、 予め定めた第2の右シフトクロックに同期して1桁右に
シフトするとともに、予め定めた左シフトクロックに同
期して最下位桁に0の値を入力するとともに1桁左にシ
フトする、それぞれ対応する桁の値がBCDコードを表
す第2の記憶手段と、 外部のデータバスに接続されたデータ入出力制御手段
と、 該データ入出力制御手段から入力される1桁のBCDコ
ード、該第1の記憶手段のそれぞれの最下位桁で表され
る1桁のBCDコード又0の値のいずれかを選択し、選
択した信号を該第1の記憶手段の最上位桁に入力する第
1の選択手段と、 前回の演算により生じた桁上がりを記憶する桁上がり記
憶手段と、 該第1の記憶手段の最下位桁で表されるBCDコード、
該第2の記憶手段の最下位桁で表されるBCDコード及
び該桁上がり記憶手段の値を、予め定めた演算クロック
に同期してBCD演算するとともに、演算により生じた
桁上がりを該桁上がり記憶手段に記憶させるBCD演算
手段と、 該データ入出力制御手段から入力される1桁のBCDコ
ード、該BCD演算手段の演算結果又は0の値のいずれ
かを選択し、選択した信号を該第2の記憶手段の最上位
桁に入力する第2の選択手段と、 該第1の右シフトクロック、該第2の右シフトクロッ
ク、該左シフトクロック及び該演算クロックを発生する
とともに、該第1の選択手段及び該第2の選択手段を制
御する演算制御手段とを備え、該データ入出力制御手段
が、該第1の選択手段及び該第2の選択手段へ入力する
データを選択するとともに、該第1の記憶手段及び該第
2の記憶手段が記憶しているデータを選択して該データ
バスヘ出力する数値演算装置。
3. A first storage means for shifting a digit to the right by one digit in synchronization with a predetermined first right shift clock, each corresponding digit value representing a BCD code, and a predetermined second right. The value shifts to the right by one digit in synchronization with the shift clock, and the value of 0 is input to the least significant digit and shifts to the left by one digit in synchronization with the predetermined left shift clock. Second storage means for representing a code, data input / output control means connected to an external data bus, a one-digit BCD code input from the data input / output control means, and each of the first storage means First selecting means for selecting either one digit BCD code represented by the least significant digit or a value of 0 and inputting the selected signal to the most significant digit of the first storing means; Remember carry caused by And up storage unit, BCD code represented by the least significant digit of the first storage means,
The BCD code represented by the least significant digit of the second storage means and the value of the carry storage means are BCD operated in synchronization with a predetermined operation clock, and the carry generated by the operation is carried up. The BCD calculation means to be stored in the storage means, the one-digit BCD code input from the data input / output control means, the calculation result of the BCD calculation means, or the value of 0 are selected, and the selected signal is set to the first signal. Second selection means for inputting to the most significant digit of the second storage means, the first right shift clock, the second right shift clock, the left shift clock and the operation clock, and the first selection means. And a calculation control means for controlling the second selection means, the data input / output control means selects data to be input to the first selection means and the second selection means, and The Numerical calculation unit for the Detabasuhe outputs first storage means and second storage means selects the stored data.
【請求項4】 前記第2の記憶手段が、1桁左にシフト
する機能を持たず、かつ前記第2の選択手段が、前記デ
ータ入出カ制御手段から入力される1桁のBCDコー
ド、前記BCD演算手段の演算結果、該第2の記憶手段
の最下位桁で表されるBCDコード又は0の値のいずれ
かを選択し、選択した信号を該第2の記憶手段の最上位
桁に入力する請求項3記載の数値演算装置。
4. The second storage means does not have a function of shifting to the left by one digit, and the second selection means is a one-digit BCD code input from the data input / output control means. The calculation result of the BCD calculation means is selected, either the BCD code represented by the least significant digit of the second storage means or the value of 0, and the selected signal is input to the most significant digit of the second storage means. The numerical operation device according to claim 3.
JP02184197A 1997-02-04 1997-02-04 Numerical arithmetic unit Expired - Fee Related JP3460780B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP02184197A JP3460780B2 (en) 1997-02-04 1997-02-04 Numerical arithmetic unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP02184197A JP3460780B2 (en) 1997-02-04 1997-02-04 Numerical arithmetic unit

Publications (2)

Publication Number Publication Date
JPH10222348A JPH10222348A (en) 1998-08-21
JP3460780B2 true JP3460780B2 (en) 2003-10-27

Family

ID=12066320

Family Applications (1)

Application Number Title Priority Date Filing Date
JP02184197A Expired - Fee Related JP3460780B2 (en) 1997-02-04 1997-02-04 Numerical arithmetic unit

Country Status (1)

Country Link
JP (1) JP3460780B2 (en)

Also Published As

Publication number Publication date
JPH10222348A (en) 1998-08-21

Similar Documents

Publication Publication Date Title
US6233597B1 (en) Computing apparatus for double-precision multiplication
EP0149248A2 (en) Method and apparatus for division using interpolation approximation
EP0136834A2 (en) A digital circuit performing an arithmetic operation with an overflow
US5105378A (en) High-radix divider
JPS6347874A (en) Arithmetic unit
JPH03105614A (en) Matrix computation circuit
JPH05250146A (en) Arithmetic operation circuit executing integer involution processing
JP3460780B2 (en) Numerical arithmetic unit
EP0326006A2 (en) Format converting circuit for numeric data
JP3517162B2 (en) Division and square root arithmetic unit
US7243119B1 (en) Floating point computing unit
JPS6222178A (en) Multiplier for multiplying two complex numbers
JPH02205923A (en) Arithmetic processor
US6470369B1 (en) Euclid mutual division arithmetic circuit and processing circuit
US3813623A (en) Serial bcd adder
KR100251547B1 (en) Digital signal processor
JPH10198552A (en) Multiplier
JP2951685B2 (en) Fixed-point arithmetic unit
JP2972326B2 (en) Square root calculator
JPH0368415B2 (en)
KR100223738B1 (en) Floating arithmetic apparatus of processing division and square root with a data path
JPS62214435A (en) Digital dividing circuit
JPH0285922A (en) Arithmetic circuit
GB2369901A (en) A circuit for squaring a number using a shifter and selective addition
JPH1185471A (en) Operation method and arithmetic unit

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20030729

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

Free format text: PAYMENT UNTIL: 20070815

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20080815

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20080815

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20090815

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20090815

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100815

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110815

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20110815

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20120815

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees