JP3535808B2 - Pair-down multiplication method, pair-down multiplication device, and computer-readable recording medium - Google Patents
Pair-down multiplication method, pair-down multiplication device, and computer-readable recording mediumInfo
- Publication number
- JP3535808B2 JP3535808B2 JP2000163140A JP2000163140A JP3535808B2 JP 3535808 B2 JP3535808 B2 JP 3535808B2 JP 2000163140 A JP2000163140 A JP 2000163140A JP 2000163140 A JP2000163140 A JP 2000163140A JP 3535808 B2 JP3535808 B2 JP 3535808B2
- Authority
- JP
- Japan
- Prior art keywords
- array
- digit
- value
- partial product
- product
- 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 - Lifetime
Links
- 238000000034 method Methods 0.000 title claims description 115
- 230000036961 partial effect Effects 0.000 claims description 219
- 230000008569 process Effects 0.000 claims description 85
- 238000003491 array Methods 0.000 claims description 36
- 239000000047 product Substances 0.000 description 258
- 238000007792 addition Methods 0.000 description 72
- 238000010586 diagram Methods 0.000 description 10
- 230000007704 transition Effects 0.000 description 5
- 230000002829 reductive effect Effects 0.000 description 4
- 230000002441 reversible effect Effects 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 1
- JJWKPURADFRFRB-UHFFFAOYSA-N carbonyl sulfide Chemical compound O=C=S JJWKPURADFRFRB-UHFFFAOYSA-N 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 239000012467 final product Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000007480 spreading Effects 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
- 238000010977 unit operation Methods 0.000 description 1
Description
【0001】[0001]
【発明の属する技術分野】本発明は乗算方法及びその装
置に関し、特に桁数の多い巨大数どうしの乗算に好適な
ペアダウン乗算方法及びペアダウン乗算装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a multiplication method and an apparatus therefor, and more particularly to a pair-down multiplication method and a pair-down multiplication apparatus suitable for multiplication between huge numbers having a large number of digits.
【0002】[0002]
【従来の技術】巨大数の乗算は例えば宇宙科学の分野や
非線形計画法(NP)などの分野で必要となるが、2進
数に従い且つ浮動小数点演算による通常の演算方式で
は、計算誤差が大きく実用に供しえない。そこで本発明
者は、従来の乗算方式とは全く異なる位数積という新し
い積を利用し、最終積を誤差なく高速に求めることがで
きる以下のような乗算装置(以下、従来の乗算装置と称
す)を既に提案した(特許第2818512号)。2. Description of the Related Art Multiplication of huge numbers is required in the fields of space science and nonlinear programming (NP), for example. However, in a normal arithmetic method based on binary numbers and floating point arithmetic, a calculation error is large and practical. Cannot be used for Therefore, the present inventor utilizes a new product, which is an order product that is completely different from the conventional multiplication method, and can obtain the final product at high speed without error (hereinafter referred to as a conventional multiplication device). ) Has already been proposed (Japanese Patent No. 2818512).
【0003】(a)被乗数XをL進数(L≧2)で表さ
れるN(N≧2)桁の数値とし、乗数Yを同じくL進数
でM(M≧2)桁の数値とすると、先ず、被乗数Xを構
成する任意の1つの数値と乗数Yを構成する任意の1つ
の数値との全ての組み合わせを、組み合わされる2つの
数値の被乗数,乗数における位を示す位数0〜N−1,
0〜M−1の和の種類毎に、位数の和0から(N−1)
+(M−1)までのグループにグループ化する。(A) If the multiplicand X is a numerical value of N (N ≧ 2) digits represented by an L-adic number (L ≧ 2), and the multiplier Y is also an L-adic numerical value of M (M ≧ 2) digits, First, all combinations of any one numerical value that constitutes the multiplicand X and any one numerical value that constitutes the multiplier Y are the multiplicands of the two numerical values to be combined, and the digits 0 to N-1 indicating the place in the multiplier. ,
From the sum of orders 0 to (N-1) for each type of sum of 0 to M-1
Group into groups up to + (M-1).
【0004】(b)次に、各グループ毎に、組み合わさ
れる2つの数値の乗算値をそのグループに属する全組み
合わせについて加算する。この加算値が当該グループの
位数積となる。(B) Next, for each group, the multiplication value of two numerical values to be combined is added for all combinations belonging to that group. This added value is the order product of the group.
【0005】(c)次に、位数の和が0となるグループ
の位数積の最下位桁を尻数として出力すると共に最下位
桁以外の数値すべての桁を1桁だけ下げ、つまり1桁シ
フトしたものを現時点の残留数とし、位数の和が1のグ
ループの位数積から位数の和が(N−1)+(M−1)
のグループの位数積まで順に、現時点の残留数と位数積
とを加算してその加算値の最下位桁を尻数として出力す
ると共にその加算値の最下位桁以外の数値すべての桁を
1桁だけ下げたものを現時点の残留数とする演算を繰り
返す。(C) Next, the least significant digit of the product of the groups in which the sum of the orders is 0 is output as the tail number, and all digits other than the least significant digit are lowered by one digit, that is, 1 The digit-shifted one is the remaining number at the present time, and the sum of orders is (N-1) + (M-1) from the product of orders of the group where the sum of orders is 1.
In order up to the order product of the group of, the current residual number and the order product are added, the lowest digit of the added value is output as the tail number, and all digits other than the lowest digit of the added value are output. Repeat the calculation with the remaining number at the current value reduced by one digit.
【0006】被乗数Xと乗数Yとの積Qは、前記出力さ
れた尻数および演算終了時点の前記残留数を並べたもの
として与えられる。The product Q of the multiplicand X and the multiplier Y is given as an array of the output tail number and the residual number at the end of the calculation.
【0007】[0007]
【発明が解決しようとする課題】上述した従来の乗算装
置によれば、位数積と尻数による単位操作により、元の
被乗数,乗数に比べて遙に桁の少ない数に対してのみの
演算で、桁数の多い巨大数の乗算を高速に誤差なく実行
することができた。According to the above-described conventional multiplication device, by the unit operation by the product of orders and the number of tails, calculation is performed only on a number having a digit far smaller than the original multiplicand and multiplier. Thus, it was possible to execute multiplication of huge numbers with many digits at high speed and without error.
【0008】しかし、従来の乗算装置にも未だ改善すべ
き課題が残されている。それは、従来の乗算装置では、
前記(c)の処理において、現処理対象とする位数積を
順次に切り替えているが、切り替え対象となる位数積の
数は約N+M個となる。そのため、現処理対象とする位
数積の頻繁な切り替えが発生し、それが演算処理のオー
バヘッドの要因となることである。また、位数積の桁が
全グループ間で同じにならないため、現時点の残留数と
位数積との加算に際して画一的な加算方法が使用できな
いこと、加算値の最下位桁以外の数値すべてを1桁だけ
下げるシフト動作が介在することも、特にコンピュータ
のソフトウェアで乗算を実行する場合の演算速度の低下
要因となっている。However, the conventional multiplication device still has a problem to be improved. That is, in the conventional multiplier,
In the process of (c), the order products to be currently processed are sequentially switched, but the number of order products to be switched is about N + M. Therefore, frequent switching of the order product to be currently processed occurs, which causes an overhead of arithmetic processing. In addition, since the digits of the order product are not the same in all groups, it is not possible to use a uniform addition method when adding the residual number and the order product at the present time. The intervening shift operation for lowering the value by one digit is also a factor of decreasing the operation speed particularly when the multiplication is executed by software of the computer.
【0009】そこで本発明の目的は、巨大数どうしの乗
算を高精度に、より高速に求めることができるようにす
ることにある。Therefore, an object of the present invention is to enable multiplication of huge numbers to be obtained with high accuracy and at high speed.
【0010】また本発明の別の目的は、演算結果である
乗算値の一部を順次に求める処理の繰り返しにおいて、
毎回、同じ桁の数値を同じにように扱えるようにすると
共にシフト動作を排除することで、演算速度のより一層
の高速化を図ることにある。Another object of the present invention is to repeat a process of sequentially obtaining a part of a multiplication value which is an operation result,
A numerical value of the same digit can be treated in the same way every time, and the shift operation is eliminated to further increase the operation speed.
【0011】また本発明の他の目的は、演算処理の過程
で必要な記憶容量を削減し得るようにすることにある。Another object of the present invention is to reduce the storage capacity required in the process of arithmetic processing.
【0012】[0012]
【課題を解決するための手段】本発明のペアダウン乗算
装置は、L進数(L≧2)で表されるN桁(N≧2)の
被乗数Xと、前記L進数で表されるM桁(M≧2)の乗
数Yとの積Qを求める乗算装置において、前記乗数Yに
おけるそれぞれの桁の数値毎に、当該数値と前記被乗数
Xとの乗算値であるN+1桁の部分積を算出する部分積
算出手段と、該部分積算出手段で算出された部分積を、
前記乗数Yの0桁目の数値に対応する部分積からM−1
桁目の数値に対応する部分積まで順に隣接する部分積2
つをペアにして斜め加算処理と桁上げ処理によって前記
積Qを構成する各桁の数値を順次に導出するペアダウン
演算手段とを備える。より具体的には、前記部分積算出
手段で算出された部分積の最下位桁の数値を格納する第
0番目の配列要素から最上位桁の数値を格納する第N番
目の配列要素までのN+1個の配列要素を含む複数の配
列を更に備え、前記ペアダウン演算手段は、前記乗数Y
の0桁目の数値に対応する部分積における最下位桁の数
値を前記積Qの一部として出力すると共に、前記乗数Y
の1桁目の数値に対応する部分積からM−2桁目の数値
に対応する部分積まで順に隣接する部分積2つをペアに
して、i+1(i=1〜M−3)桁目の数値に対応する
部分積を格納する前記配列上の第k−1(k=1〜N+
1)番目の配列要素の値に、i桁目の数値に対応する部
分積を格納する前記配列上の第k番目の配列要素の値を
加算した後にi+1桁目の数値に対応する部分積の隣接
する配列要素間で加算結果の桁上げ処理を行って各配列
要素の値を1桁化した上で第0番目の配列要素の数値を
前記積Qの一部として出力する処理を繰り返し、前記乗
数YのM−1桁目の数値に対応する部分積については、
当該部分積を格納する前記配列上の第k−1(k=1〜
N+1)番目の配列要素の値に、前記乗数YのM−2桁
目の数値に対応する部分積を格納する前記配列上の第k
番目の配列要素の値を加算した後にM−1桁目の数値に
対応する部分積の隣接する配列要素間で加算結果の桁上
げ処理を行って各配列要素の値を1桁化した上で当該配
列に格納された数値を前記積Qの一部として出力するよ
う構成される。また、前記複数の配列としては、記憶容
量の削減を狙って、前記ペアダウン乗算手段による処理
に同期して前記部分積算出手段によって前記乗数Yの0
桁目の数値に対応する部分積からM−1桁目の数値に対
応する部分積まで交互に部分積が格納される2個の配列
を備える。 A pair-down multiplication device of the present invention is an N-digit (N ≧ 2) multiplicand X represented by an L-adic number (L ≧ 2) and an M-digit represented by the L-adic number ( In a multiplication device for obtaining a product Q of M ≧ 2) with a multiplier Y, a part for calculating, for each numerical value of each digit in the multiplier Y, a partial product of N + 1 digits which is a multiplication value of the numerical value and the multiplicand X. The product calculating means and the partial product calculated by the partial product calculating means,
From the partial product corresponding to the 0th digit of the multiplier Y, M-1
Partial products 2 that are sequentially adjacent to the partial product corresponding to the digit in the second digit
And pair-down arithmetic means for sequentially deriving a numerical value of each digit forming the product Q by pairing the two and performing a diagonal addition process and a carry process. More specifically, N + 1 from the 0th array element storing the numerical value of the least significant digit of the partial product calculated by the partial product calculating means to the Nth array element storing the numerical value of the most significant digit. Further comprising a plurality of arrays including a plurality of array elements, wherein the pair-down operation means is the multiplier Y
The numerical value of the least significant digit in the partial product corresponding to the numerical value of 0th digit is output as a part of the product Q, and the multiplier Y
From the partial product corresponding to the numerical value of the first digit to the partial product corresponding to the numerical value of the M-2 digit, two adjacent partial products are paired to form the i + 1 (i = 1 to M-3) digit The k−1 th (k = 1 to N +) on the array which stores the partial product corresponding to the numerical value.
1) Add the value of the k-th array element on the array storing the partial product corresponding to the i-th digit numerical value to the value of the 1st-th array element, and then add the partial product corresponding to the i + 1-th numerical value The process of carrying the addition result between adjacent array elements is performed to digitize the value of each array element, and then the value of the 0th array element is output as a part of the product Q. For the partial product corresponding to the M-th digit of the multiplier Y,
The k−1th (k = 1 to 1) on the array which stores the partial product
The value of the (N + 1) th array element stores the partial product corresponding to the numerical value at the (M-2) th digit of the multiplier Y.
After adding the value of the th array element, carry out the carry process of the addition result between adjacent array elements of the partial product corresponding to the numerical value of the M-1st digit, and after digitizing the value of each array element, It is configured to output the numerical values stored in the array as part of the product Q. Also, as the plurality of sequences, aiming to reduce the serial憶容amount, in synchronization with the processing by the Peadaun multiplying means the partial product calculating said by means multiplier Y 0
Ru comprises two sequence partial products alternately is stored from the partial product corresponding to the digit numbers to the partial product corresponding to the M-1 digit numbers.
【0013】本発明のペアダウン乗算装置にあっては、
積Qを構成する各桁の数値を順次に導出するペアダウン
演算手段において、処理の対象とする部分積の数は約M
個になるため、ペアとなる処理対象を切り替える頻度が
従来の乗算装置に比べて半減し、その分、演算処理のオ
ーバヘッドが低減する。また、演算結果である乗算値の
一部を順次に求めるペアダウン演算手段における処理対
象が常にN+1桁という同じ桁数になるため、隣接する
部分積2つをペアにして実行する処理を画一化できる。
更に、その処理内容は斜め加算処理と桁上げ処理であ
り、シフト処理を必要としないので、演算速度のより一
層の高速化が可能となる。In the pair-down multiplication device of the present invention,
In the pair-down arithmetic means for sequentially deriving the numerical values of each digit forming the product Q, the number of partial products to be processed is about M.
Since the number of individual processing objects is changed, the frequency of switching the pair of processing targets is reduced to half that of the conventional multiplication device, and the overhead of the arithmetic processing is reduced accordingly. Further, since the processing target in the pair-down calculation means for sequentially obtaining a part of the multiplication value as the calculation result is always the same number of digits of N + 1 digits, the processing of executing two adjacent partial products as a pair is standardized. it can.
Further, since the processing contents are the diagonal addition processing and the carry processing, and the shift processing is not required, the calculation speed can be further increased.
【0014】また、本発明のペアダウン乗算方法は、L
進数(L≧2)で表されるN桁(N≧2)の被乗数X
と、前記L進数で表されるM桁(M≧2)の乗数Yとの
積Qを求める乗算方法において、前記乗数Yにおけるi
(i=0〜M−1)桁目の数値と前記被乗数Xとの乗算
値をi桁目対応部分積と呼ぶとき、第0番目から第N番
目までのN+1個の配列要素を含む2個の配列の一方
に、0桁目対応部分積を算出して格納すると共に、他方
の配列に、1桁目対応部分積を算出して格納するステッ
プと、前記2個の配列のうち、0桁目対応部分積を格納
する配列の第0番目の配列要素の数値を前記積Qの一部
として出力すると共に、1桁目対応部分積を格納する配
列上の第k−1(k=1〜N+1)番目の配列要素の値
に、0桁目対応部分積を格納する配列上の第k番目の配
列要素の値を加算した後に1桁目対応部分積の隣接する
配列要素間で加算結果の桁上げ処理を行って各配列要素
の値を1桁化した上で第0番目の配列要素の数値を前記
積Qの一部として出力するステップと、前記乗数Yにお
ける2桁目の数値からM−2桁目の数値まで順に、i桁
目対応部分積を算出して前記2個の配列のうち、i−2
桁目対応部分積を格納した方の配列に上書きした後、該
上書きした配列上の第k−1(k=1〜N+1)番目の
配列要素の値に、他方の配列上の第k番目の配列要素の
値を加算した後にi桁目対応部分積の隣接する配列要素
間で加算結果の桁上げ処理を行って各配列要素の値を1
桁化した上で第0番目の配列要素の数値を前記積Qの一
部として出力する処理を繰り返すステップと、M−1桁
目対応部分積を算出して前記2個の配列のうち、M−3
桁目対応部分積を格納した方の配列に上書きした後、該
上書きした配列上の第k−1(k=1〜N+1)番目の
配列要素の値に、他方の配列上の第k番目の配列要素の
値を加算した後にM−1桁目対応部分積の隣接する配列
要素間で加算結果の桁上げ処理を行って各配列要素の値
を1桁化した上で前記上書きした配列に格納された数値
を前記Qの一部として出力するステップとを含むことを
特徴とする。Further , the pair-down multiplication method of the present invention uses L
N digit (N ≧ 2) multiplicand X represented by a base number (L ≧ 2)
And a multiplier Y of M digits (M ≧ 2) represented by the L-adic number, i in the multiplier Y is obtained.
When the multiplication value of the (i = 0 to M−1) -th digit value and the multiplicand X is referred to as the i-th digit corresponding partial product, two including N + 1 array elements from the 0th to the Nth Calculating and storing a 0th digit corresponding partial product in one of the arrays and storing and calculating a 1st digit corresponding partial product in the other array; The numerical value of the 0th array element of the array storing the eye-corresponding partial product is output as a part of the product Q, and the k-1th (k = 1 to 1) on the array storing the first digit corresponding partial product. The value of the (N + 1) th array element is added to the value of the kth array element on the array that stores the 0th digit corresponding partial product, and then the result of the addition is calculated between adjacent array elements of the 1st digit corresponding partial product. Performs carry processing to digitize the value of each array element and outputs the numerical value of the 0th array element as a part of the product Q. Comprising the steps of, in order from the value of the second digit in the multiplier Y to a value of M-2 digit, of the two sequences to calculate the i-th digit corresponding partial product, i-2
After overwriting the array storing the digit-corresponding partial product, the value of the k−1 (k = 1 to N + 1) th array element on the overwritten array is set to the kth array element on the other array. After adding the array element values, carry out the carry processing of the addition result between adjacent array elements of the i-th digit corresponding partial product, and set the value of each array element to 1
A step of repeating the process of digitizing the numerical value of the 0th array element as a part of the product Q, and calculating a partial product corresponding to the (M-1) th digit to calculate M among the two arrays. -3
After overwriting the array storing the digit-corresponding partial product, the value of the k−1 (k = 1 to N + 1) th array element on the overwritten array is set to the kth array element on the other array. After the values of the array elements are added, carry processing of the addition result is performed between adjacent array elements of the M-1 digit corresponding partial product, and the value of each array element is digitized and stored in the overwritten array. Outputting the calculated numerical value as a part of the Q.
【0015】[0015]
【発明の実施の形態】次に本発明の実施例について図面
を参照して詳細に説明するが、それに先立って、本発明
を10進数の乗算に適用した10進数ペアダウン乗算方
式の基本原理について説明する。BEST MODE FOR CARRYING OUT THE INVENTION Next will be described the actual 施例 with reference to the drawings in detail of the present invention, prior to it, the basic principle of the decimal Peadaun multiplication scheme in which the present invention is applied to the multiplication of decimal explain.
【0016】本10進数ペアダウン乗算方式において被
乗数XをN桁の10進数とすると、以下のように示され
る。
ここで、[ ]は配列を示し、xは配列名である。括弧
の中の数は0からの正の整数であり、この数を添字とい
い、配列内の元の数の桁を与える。例えば、被乗数Xが
4桁の10進数で6957の場合、N=4なので、x
[N−1]=x[3]=6であり、同様に、x[2]=
9、x[1]=5、x[0]=7である。When the multiplicand X is an N-digit decimal number in the present decimal number pair down multiplication system, it is shown as follows. Here, [] indicates an array, and x is an array name. The number in parentheses is a positive integer from 0, this number is called a subscript and gives the digit of the original number in the array. For example, when the multiplicand X is a four-digit decimal number 6957, N = 4, so x
[N-1] = x [3] = 6, and similarly, x [2] =
9, x [1] = 5 and x [0] = 7.
【0017】また、乗数YをM桁の10進数とすると、
以下のように示される。
例えば、乗数Yが4桁の10進数で8134の場合、M
=4なので、y[M−1]=y[3]=8、y[2]=
1、y[1]=3、y[0]=4である。更に、乗数Y
の1つの桁は次のように表される。
When the multiplier Y is an M-digit decimal number,
It is shown as follows. For example, when the multiplier Y is a four-digit decimal number 8134, M
= 4, y [M-1] = y [3] = 8, y [2] =
1, y [1] = 3 and y [0] = 4. Furthermore, the multiplier Y
One digit of is represented as:
【0018】さて、本10進数ペアダウン乗算方式にお
いては、先ず、被乗数Xの桁をN、乗数Yの桁をMと
し、下記(A4)のように乗数Yの下桁10進数より1
桁ずつ被乗数Xとの部分積をつくり、2次元等長部分積
配列におく。
In the decimal pair down multiplication method, first, the digit of the multiplicand X is N and the digit of the multiplier Y is M, and the lower digit of the multiplier Y is 1 from the lower digit as shown in (A4) below.
A partial product with the multiplicand X is created for each digit and placed in a two-dimensional equal-length partial product array.
【0019】この2次元等長部分積配列をp[i] i
=0,1,…,M−1と略記する。数配列として、この
部分積はN+1桁か、N桁で、1桁の乗数y[i]の整
数が小さいとN桁となるが、このとき先頭に1桁10進
数0をおいてN+1桁とし、全ての部分積をN+1桁の
2次元等長部分積配列におく。This two-dimensional isometric partial product array is represented by p [i] i
Abbreviated as = 0, 1, ..., M-1. As a number array, this partial product is N + 1 digits, or N digits, and if the integer of the one-digit multiplier y [i] is small, it becomes N digits. At this time, 1 digit decimal number 0 is placed at the beginning to make N + 1 digits. , All partial products are placed in a two-dimensional equal-length partial product array of N + 1 digits.
【0020】上記(A4)に示す2次元等長部分積配列
の第1の添字iは、1つの配列の各配列項に共通する第
1の添字で、同時に乗数Yの1桁成分の桁を最低位の0
より順に与える。第2の添字N,N−1,…,0は、被
乗数Xの桁Nに対応するもので、(A4)のように各配
列で同形で与えられる。また、2次元等長部分積配列の
[ ][ ]内の添字の和はその項の桁を与える。例え
ばu[i][1]の桁はi+1である。これを上記(A
4)では()の中に示した。The first subscript i of the two-dimensional equal-length partial product array shown in (A4) above is the first subscript common to each array term of one array, and at the same time the digit of the one-digit component of the multiplier Y is Lowest 0
Give in order. The second subscript N, N-1, ..., 0 corresponds to the digit N of the multiplicand X and is given in the same shape in each array as in (A4). The sum of the subscripts in [] [] of the two-dimensional isometric partial product array gives the digit of the term. For example, the digit of u [i] [1] is i + 1. This is the above (A
In 4), it is shown in parentheses.
【0021】2次元等長部分積配列p[i]は、i=
0,1,2,…,M−1と並び、下のようにM個ある。
The two-dimensional isometric partial product array p [i] is i =
0, 1, 2, ..., M-1, and there are M as shown below.
【0022】さて、10進ペアダウン乗算は等長部分積
配列p[0],p[1]のペアダウン動作で始まる。下
記(A6)において、)はペア加算動作を示し、+を付
記した斜めの線は斜加算記号である。ペア加算動作で
は、N個の1桁の斜加算が行われ、p[1]のu[1]
[N−1]〜u[1][0]に置く。斜加算の和は0〜
18で、それ以外の値はない。p[1]の下端記号|
は、2桁和などをキャリ算で1桁のみの配列とするダウ
ン動作を示す。p[1]*は、p[1]配列を1桁化し
た1桁配列である。
この(A6)は最初のペアダウンで第1ペアの上配列p
[0]の右端項u[0][0]は斜加算に不参加で、積
最下位q[0]である。
Decimal pair-down multiplication starts with a pair-down operation of equal-length partial product arrays p [0] and p [1]. In the following (A6),) indicates a pair addition operation, and a diagonal line with a plus sign is a diagonal addition symbol. In the pair addition operation, N 1-digit diagonal additions are performed, and u [1] of p [1]
Place it in [N-1] to u [1] [0]. The sum of diagonal addition is 0
At 18, there is no other value. p [1] bottom symbol |
Indicates a down operation in which an array of only one digit is calculated by carrying out a two-digit sum or the like. p [1] * is a one-digit array obtained by digitizing the p [1] array. This (A6) is the first pair down and the upper array p of the first pair.
The rightmost term u [0] [0] of [0] does not participate in the diagonal addition and is the lowest product q [0].
【0023】配列p[1]*が得られると、続いてp
[1]*,p[2]で第2のペアダウンp[2]*を得
る。
これを繰り返して第M−1ペアダウンは、
このとき、N桁被乗数とM桁乗数の積は、
で与えられる。この積の後部はペアの上部配列の右端項
を逆順に並べたもので、M−1個の10進1桁積を与え
る。この値はペアダウン計算中に高速に決定される。Once the sequence p [1] * has been obtained, then p
A second pair down p [2] * is obtained from [1] * , p [2]. Repeating this, the M-1th pair down, At this time, the product of the N-digit multiplicand and the M-digit multiplier is Given in. The tail of this product is the rightmost term of the upper array of pairs arranged in reverse order, giving M-1 decimal one-digit products. This value is quickly determined during the pair down calculation.
【0024】以下に計算例を示す。A calculation example is shown below.
【0025】計算例; 6957×8134
被乗数Xは4桁10進数の6957であり、乗数Yは4
桁10進数の8134である。N=4。M=4。
Calculation example: 6957 × 8134 The multiplicand X is a 4-digit decimal number 6957, and the multiplier Y is 4
The digit is a decimal number 8134. N = 4. M = 4.
【0026】このように、積の下位の桁と上位桁が別々
に求められるので、キャリ計算の巨大誤差を発生しな
い。M桁乗数との積の下位は2次元等長部分積配列の末
尾項値並びq[0]q[1]…q[M−2]のビット並
びでよい。これが確定すれば、p[M−3]〜p[0]
は消去してよく、p[M−2]*,p[3]のペアダウ
ン乗算で高速高精度に積最上位をあたえる。In this way, since the lower and upper digits of the product are obtained separately, a huge error in carry calculation does not occur. The lower order of the product with the M digit multiplier may be the bit sequence of the last term value sequence q [0] q [1] ... q [M-2] of the two-dimensional equal-length partial product array. If this is confirmed, p [M-3] to p [0]
May be deleted, and the product top is given at high speed and high precision by pair-down multiplication of p [M-2] * , p [3].
【0027】以下に、本発明にかかる10進数ペアダウ
ン乗算方式の特徴点を記す。The features of the decimal pair down multiplication method according to the present invention will be described below.
【0028】1.従来のあらゆる欧米、中近東での巨大
数積の計算の高精度、高速の失敗はシフトする部分積の
膨大な加算にもとづく。しかるに、本発明では特異な等
長2次元部分積配列を考案し、このペア配置を考案し、
1桁10進数の2数加算という小さい数の演算のみに
て、巨大数積上位を決め、ペアを構成する等長2次元部
分積配列の上位配列右端配列項は巨大数積の下位自動決
定につかわれるのは部分積配列の2次元化による、等長
2次元部分積配列の配列位置による桁変動である。本発
明では等長2次元部分積配列は被乗数桁Nより1大であ
るが、乗数が小なるときN桁となるがこのとき先頭配列
N+1桁に0をおく。1. The high precision and high speed failure of the conventional calculation of huge number products in all Western countries and the Middle East is based on the huge addition of shifting partial products. However, in the present invention, a unique equal-length two-dimensional partial product array is devised, and this pair arrangement is devised,
The upper right array element of the equal-length two-dimensional partial product array forming the pair is determined only by the operation of a small number such as 1-digit decimal number addition of 2 and the lower-order automatic determination of the huge number product is performed. What is shown is a digit change due to the array position of the equal-length two-dimensional partial product array due to the two-dimensionalization of the partial product array. In the present invention, the equal-length two-dimensional partial product array is one larger than the multiplicand digit N, but becomes N digits when the multiplier is small. At this time, 0 is placed in the head array N + 1 digit.
【0029】2.等長2次元部分積配列は乗数i桁につ
いて、p[i]:u[i][N]u[i][N−1]…
u[i][1]u[i][0]i=0,1,2,…,M
−1のM行がえられ、p[0],p[1]のペアより、
N個の同じ桁の配列項の1桁10進数を加算してゆく
が、この加算が斜加算である。この加算和は下の配列に
置かれる。
2次元配列にしているから、斜線上下の元の添字の和つ
まり桁が等しく加算できるのである。0+N=1+N−
1、0+N−1=1+N−2、…。端のu[0]
[0],u[1][N]の項以外は斜加算可能で、和は
下行配列におかれる。2. The equal-length two-dimensional partial product array has p [i]: u [i] [N] u [i] [N−1] ...
u [i] [1] u [i] [0] i = 0, 1, 2, ..., M
-1 M rows are obtained, and from the pair of p [0] and p [1],
N-digit one-digit decimal numbers of the array elements having the same digits are added, and this addition is oblique addition. This sum is placed in the array below. Since it is a two-dimensional array, the sum of the original subscripts above and below the diagonal lines, that is, the digits can be added equally. 0 + N = 1 + N-
1, 0 + N-1 = 1 + N-2, .... U [0] at the end
Other than the terms [0] and u [1] [N], diagonal addition is possible and the sum is placed in the descending array.
【0030】3.ペアの斜加算は1桁数0〜9の2数の
加算で、和は0〜18までである。本乗算方式ではこれ
を超える和は現れない。第1のペアダウンは、
この2次元等長部分積配列は2種の添字をもっている。
第1の添字は1つの等長部分積配列上で同一値で、p
[0]で0、p[1]で1で上のペアで斜線上で、桁が
同じで、加算ができる。和を下配列p[1]におく。例
えば、
このようにp[0]〜p[1]ペアの下配列の2番目か
らの項には1桁和か2桁和がおかれる。この1桁和はそ
のままでよいが、2桁和10〜18のとき、左配列項の
下位数に2桁の上位桁1がキャリとして加算し、1桁の
みの配列とする操作をダウンという。このとき下位行配
列p[1]のN+1桁の項u[1][N]は部分積の上
位桁がおかれるので、下位桁よりのキャリがあっても9
以上にならず2次元等長部分積配列の等長性は保持され
る。このように1桁数のならびになったp[1]をp
[1]*とかく。次のペアダウン動作はp[1]*先頭
にてp[2]とペア。
3. The diagonal addition of a pair is the addition of two numbers of one digit 0-9, and the sum is 0-18. In this multiplication method, the sum exceeding this does not appear. The first pair down This two-dimensional isometric partial product array has two types of subscripts.
The first subscript has the same value on one isometric partial product array, and p
[0] is 0, and p [1] is 1 and the above pair is diagonally shaded, the digits are the same, and addition is possible. The sum is placed in the lower array p [1]. For example, As described above, the one-digit sum or the two-digit sum is placed in the second and subsequent terms of the lower array of the p [0] to p [1] pair. This one-digit sum may be used as it is, but when the two-digit sum is 10 to 18, an operation of adding the two-digit high-order digit 1 as a carry to the low-order number of the left array item to form an array of only one digit is called down. At this time, in the N + 1 digit term u [1] [N] of the lower row array p [1], the upper digit of the partial product is placed, so that even if there is a carry from the lower digit, 9
This is not the case and the isometric property of the two-dimensional isometric partial product array is maintained. In this way, p [1], which has a one-digit number, becomes p
[1] * Anyway. The next pair down operation is p [1] * Pair with p [2] at the beginning.
【0031】4.以上のように部分積そうとうの10進
数の被乗数の桁Nより1桁多いN+1桁の数の並びを被
乗数と乗数下位より1桁ずつ掛けてつくる。N桁となっ
てしまうときは先頭に0をおく。この数のならびはp
0,p1,p2,…,pM。これをp0〜p1のように
ペアでとり、斜加算や桁下げの計算をし、p1をp1*
のように1桁化させるペアダウンをおこない、つぎにp
1*〜p2のように第2のペアにはいり、p2*を出
す。つぎのような等長並列な配列によって、巨大数の乗
算が超高速に、誤差なく実行される。
巨大積も幅N+1桁の最後の配列p(M−1)*とダウ
ン列の途中端数で与えられる。4. As described above, a sequence of N + 1 digits, which is one digit more than the digit N of the decimal multiplicand to be partially multiplied, is formed by multiplying the multiplicand and the lower digit of the multiplier by one digit. If it becomes N digits, put 0 at the beginning. This number is p
0, p1, p2, ..., pM. Take this as a pair like p0 to p1, calculate diagonal addition and carry-off, and p1 to p1 *
Perform pair down to convert to 1 digit, and then p
Enter the second pair as in 1 * -p2 and issue p2 * . With the following equal-length parallel arrays, multiplication of huge numbers can be performed at extremely high speed without error. The enormous product is also given by the final array p (M-1) * having a width of N + 1 digits and the fraction of the down column.
【0032】5.本発明方式では10進数の簡単な処理
つまり加算や桁上げなどの処理でソフトウェアに適合
し、高速に処理され、高速に結果をうる。C++なる言
語で記載され、do−while文の繰り返しによりペ
アダウン処理を行うことにより、巨大数積を高速正解す
る。5. In the system of the present invention, simple decimal processing, that is, processing such as addition and carry, is suitable for software, processed at high speed, and results can be obtained at high speed. It is written in the language C ++, and a pair-down process is performed by repeating a do-while statement, so that a huge number product can be correctly answered at high speed.
【0033】次に本発明を2進数の乗算に適用した2進
数ペアダウン乗算方式の基本原理について説明する。Next, the basic principle of the binary number pair-down multiplication system in which the present invention is applied to binary multiplication will be described.
【0034】2進数ペアダウン乗算方式
乗算法は億程度までの数の乗算は問題なく正解がえられ
るが、大形数の場合はキャリの関係で大きな誤差を生ず
る。本2進数ペアダウン乗算方式は極めて簡単に巨大積
を求められる。被乗数の2進数を与えるとき、その先頭
にビット0を加えたものを考え、これと同等の0のみの
2進数列を考えて、乗数とのペアダウン方式を考えるこ
とにより高速正確に積がえられる。ここでペアとは1桁
化した2進数の並列加算であり、ダウンとは2桁加算和
の高速1桁化を意味し、ペア動作とダウン動作の組み合
わせで、巨大積を直列型と並列型により、誤差なく高速
算定する。2進数の場合とくに高速である。宇宙関係巨
大諸量の計算に有効であろう。In the binary number pair-down multiplication method multiplication method, a correct answer can be obtained without problem for multiplication of numbers up to about 100 million, but in the case of a large number, a large error occurs due to carry. This binary pair-down multiplication method can very easily find a huge product. When giving the binary number of the multiplicand, consider the one with bit 0 added to the beginning, consider a binary number sequence of only 0 equivalent to this, and consider the pair down method with the multiplier, so that multiplication can be done accurately at high speed . Here, a pair is a parallel addition of 1-digit binary numbers, and a down means a high-speed 1-digit addition of 2-digit addition sums. A pair product and a down operation are combined, and a huge product is serial type and parallel type. Therefore, high-speed calculation is possible without error. It is particularly fast for binary numbers. It will be useful for calculating huge quantities related to space.
【0035】2進数ペアダウン乗算方式の特長を以下に
記す。
(1)通常の乗算と異なりシフトをもちいず同長水平配
置2進被乗数に0ビット先頭数付部分積配列と同じ配列
で全0ビットの配列との2種類のみを用い乗算器をつく
る。
(2)2進乗数を下桁より順にy[0],y[1],
…,y[M−1]として書くと、この配列は1,0のい
ずれかで、y[i],i=0,…,M−1とおくと、添
字iは乗数の桁位置を与えると同時に(1)の同長水平
N+1桁0ビット先頭被乗数部分積配列の添字も兼ね
る。この同長配列をp[i]とかくと、i=0,1,
2,…,M−1とならぶ。The features of the binary pair-down multiplication system will be described below. (1) Unlike normal multiplication, a multiplier is created using only two types, that is, the same length horizontally arranged binary multiplicand and the same array as the partial product array with 0-bit head number and an array of all 0 bits, without using shift. (2) The binary multiplier is y [0], y [1], in order from the lower digit.
When written as ..., y [M-1], this array is either 1 or 0. When y [i], i = 0, ..., M-1 is set, the subscript i gives the digit position of the multiplier. At the same time, it also serves as a subscript of the same-length horizontal N + 1 digit 0-bit head multiplicand partial product array of (1). If this same-length sequence is p [i], i = 0,1,
2, ..., M-1.
【0036】このような同長配列をi=0よりp
[0]、p[1]の斜加算と、和をp[1]においてN
+1桁の1桁2進数の配列p[1]*をうる。この斜加
算をペア、和の1桁化をダウンという。続いてp[1]
*,p[2]で第2のペアダウンp[2]*をうる。第
M−1回のペアダウンで巨大積が正確高速にえられる。
途中の積は途中の各ペアで超高速に1桁ずつ得られる。Such an array of the same length can be converted into p from i = 0.
The diagonal addition of [0] and p [1] and the sum at p [1] are N
An array p [1] * of +1 digit and 1 digit binary number is obtained. This diagonal addition is called a pair, and digitization of the sum is called a down. Then p [1]
A second pair down p [2] * is obtained by * , p [2]. A huge product can be obtained accurately and rapidly by the M-1th pair down.
The product in the middle of each pair can be obtained one digit at an extremely high speed for each pair in the middle.
【0037】乗算は加算に比し複雑でとくに巨大数の乗
算は巨大誤差の発生が問題となるが、本方式では2進数
の同じ桁の1桁数の2進数加算のみでよい。つまり4種
類の加算である。
The multiplication is more complicated than the addition, and a huge error occurs particularly in the multiplication of a huge number. However, in the present method, only a binary addition of one digit of the same binary digit is necessary. That is, there are four types of addition.
【0038】ペア段階では1桁加算は被乗数N桁の順に
応じ斜加算が行われ、和はペア配列の下行配列におかれ
る。この和を
とおく。N個あって、その和の形は0,1,10のみで
ある。In the pair stage, one-digit addition is performed obliquely according to the order of the multiplicand N digits, and the sum is placed in the lower array of the pair array. This sum far. There are N, and the sum form is only 0, 1, 10.
【0039】次に被乗数を2進数でN桁とすると、通常
の部分積配列ではNかN+1桁であるが、本乗算法では
N+1桁の部分積配列に統一し、シフトのない2次元等
長部分積配列のみ考える。これをp[i]とおくと、
(3)のように書ける。乗数y[i]は2進数でM桁と
してi=0ならば0桁の乗数の2進数で1,0のいずれ
かである。i=0,1,…,M−1乗数の0〜M桁のい
ずれかに対応し、
であるから、p[i]の配列はN桁の被乗数の0,1配
列に先頭のN+1桁の0を付したもので、乗数桁オール
0の配列(4)と乗数桁1と被乗数との部分積配列
(5)の2種類の配列のペアダウン計算のみにて、宇宙
的巨大乗算を高速誤差無く実施できる。この同長部分積
配列は(4),(5)のいずれかで与えられる。N+1
桁である。
ただし、桁は異なる。上配列の最下位桁はi,jであ
る。(4)の最下桁はi桁で、(5)のはj桁である。Next, assuming that the multiplicand is N digits in binary number, it is N or N + 1 digits in a normal partial product array, but in the present multiplication method, it is unified into an N + 1 digit partial product array, and there is no shift in two-dimensional equal length. Consider only partial product arrays. Let this be p [i],
You can write like (3). The multiplier y [i] is a binary number of M digits, and if i = 0, it is a binary digit of a 0-digit multiplier, which is either 1 or 0. i = 0, 1, ..., Corresponds to any of 0 to M digits of the M-1 multiplier, Therefore, the array of p [i] is an array of N digit multiplicands 0 and 1 with the leading N + 1 digit 0 added, and an array (4) of multiplier digit all 0s, a multiplier digit 1 and a multiplicand The cosmic huge multiplication can be performed without a high-speed error only by the pair-down calculation of the two types of arrays of the partial product array (5). This same-length partial product array is given by either (4) or (5). N + 1
It is a digit. However, the digits are different. The least significant digit of the upper array is i, j. The lowest digit of (4) is the i digit, and the (5) is the j digit.
【0040】本乗算法の数の取り扱いは桁の取り扱いで
従来のと異なる。(3)のようなN+1次の2次元等長
部分積配列を中心に考える。第1の添字iは1つの配列
の各配列項に共通する第1の添字で、同時に乗数の1桁
成分の桁を最低位の0より順にあたえる。第2の添字
N,N−1,…,0は被乗数の桁Nに対応するもので、
(3)のように各配列で同形で与えられる。(3)のp
[i]の順は、
のようなM桁の配列であるが、2進数ペアダウン乗算は
この配列の上のペア配列p[0],p[1]より順次実
行される。The handling of numbers in this multiplication method is different from the conventional one in handling digits. Consider, as an example, an (N + 1) -th order two-dimensional equal-length partial product array. The first subscript i is a first subscript common to each array item of one array, and simultaneously gives the digits of the one-digit component of the multiplier in order from the lowest 0. The second subscripts N, N-1, ..., 0 correspond to the digit N of the multiplicand,
It is given in the same shape in each sequence as in (3). P in (3)
The order of [i] is However, the binary pair down multiplication is sequentially executed from the pair arrays p [0] and p [1] above this array.
【0041】さて2進ペアダウン乗算は等長部分積配列
p[0],p[1]のペアダウン動作で始まる。(7)
において、)はペア加算動作を示し、N個の1桁の斜加
算が行われ、p[1]のu[1][N−1]〜u[1]
[0]に置く。p[1]の下端記号|は2桁和などをキ
ャリ算で1桁のみの配列とするダウン動作を示す。p
[1]*はp[1]配列を1桁化した1桁配列である。
この(7)は最初のペアダウンで第1ペアの上配列p
[0]の右端項u[0][0]は斜加算に不参加で、積
最下位q[0]である。
The binary pair-down multiplication starts with the pair-down operation of the equal-length partial product arrays p [0] and p [1]. (7)
, Indicates a pair addition operation, where N 1-digit diagonal additions are performed, and u [1] [N-1] to u [1] of p [1]
Place in [0]. The lower-end symbol | of p [1] indicates a down operation in which an array of only one digit is calculated by carrying out a two-digit sum or the like. p
[1] * is a one-digit array in which the p [1] array is digitized. This (7) is the first pair down, and the upper array p of the first pair.
The rightmost term u [0] [0] of [0] does not participate in the diagonal addition and is the lowest product q [0].
【0042】従来の巨大数乗算は乗算積が大きくなると
桁上がりの増大で積が増えると大きな誤差を発生する。
しかるに、本発明になるペアダウン乗算方式は巨大誤差
の発生は皆無となり、微少誤差もない。2進数の場合は
2次元等長部分積配列が2種類に与えられ計算の高速化
が得られる。乗数をYとし、y[i],i=0,1,
…,m−2,m−1は2進数0,1のいずれかであると
する。iにより、その2進数の桁をしめす。m個の乗数
桁がある。0桁よりとるとm−1桁まで乗数は桁をも
つ。被乗数も2進でN桁とし、x[N−1]x[N−
2]…x[0]のような1桁の2進数を各配列の元とす
る。2次元等長部分積配列は被乗数の桁数を表示する添
字N,N−1,…,0と乗数単桁添字iとの2次元配列
である。Nの数はN+1の2次元配列である。添字iの
2次元等長部分積配列をp[i]とし、各配列項はそれ
ぞれの添字和の桁の2進数0か1が置かれる。p[i]
の配列項の数はN+1である。配列項の変数をuとし
て、2次元等長部分積配列p[i]は次のように書け
る。
In the conventional giant number multiplication, when the multiplication product becomes large, the carry increases, and when the product increases, a large error occurs.
However, in the pair-down multiplication method according to the present invention, a huge error does not occur, and there is no minute error. In the case of a binary number, two types of two-dimensional equal-length partial product arrays are given to speed up the calculation. Let Y be the multiplier, and y [i], i = 0, 1,
..., m-2, and m-1 are binary numbers 0 and 1. The digit of the binary number is indicated by i. There are m multiplier digits. The multiplier has digits up to m-1 digit when taking from 0 digit. The multiplicand is also binary and has N digits, and x [N-1] x [N-
2] ... A single digit binary number such as x [0] is used as the element of each array. The two-dimensional equal-length partial product array is a two-dimensional array of subscripts N, N-1, ..., 0 indicating the number of digits of the multiplicand and a single digit of the multiplier subscript i. The number of N is a two-dimensional array of N + 1. A two-dimensional equal-length partial product array of the subscript i is defined as p [i], and each array item is provided with a binary number 0 or 1 of the digit of each subscript sum. p [i]
The number of array terms of is N + 1. Letting the variable of the array term be u, the two-dimensional isometric partial product array p [i] can be written as follows.
【0043】[1]
演算前のp[i]はu[i][N]=0で、以降の配列
項は被乗数の2進ビットパターンそのものか、オールゼ
ロのビットパターンのいずれかで、それぞれ乗数の1,
0に対応する。
[2]
p[i]の各配列項の元の2進数の桁は上式の下の(1
0)の( )内添字和である。上の例でi+N桁〜i桁
である。この各配列項は2進数0,1を元とするが、配
列の斜加算後10をふくむときダウン操作で、上配列2
進数の1を左項へ移し、0をその項におく。p[i]の
総ての配列項が1,0の並びでp[i]をp[i]*と
書く。[1] p [i] before the operation is u [i] [N] = 0, and the subsequent array items are either the binary bit pattern of the multiplicand or the bit pattern of all zeros. 1,
Corresponds to 0. [2] The original binary digit of each array term of p [i] is (1
It is the sum of subscripts in () of 0). In the above example, i + N digits to i digits. Each of these array terms is based on the binary numbers 0 and 1, but after the diagonal addition of the array is included, the down operation is performed to include the upper array 2
Move the base 1 to the left term and place 0 in that term. In the case where all the array terms of p [i] are 1 and 0, p [i] is written as p [i] * .
【0044】2次元等長部分積配列はM行で次のように
書ける。
…
このM行配列をp[0]よりペアダウン動作(9)を次
のように変形配列p[1]*,p[2]*を加え繰り返
す。
これを繰り返して第M−1ペアダウンは、
このとき、N桁被乗数とM桁乗数の積は、
で与えられる。この積の後部はペアの上部配列の右端項
を逆順に並べたもので、M−1個の2進1桁積を与え
る。この値はペアダウン計算中に高速に決定される。A two-dimensional isometric partial product array can be written in M rows as follows. … The pair down operation (9) is repeated from p [0] for this M row array by adding modified arrays p [1] * and p [2] * as follows. Repeating this, the M-1th pair down, At this time, the product of the N-digit multiplicand and the M-digit multiplier is Given in. The back of this product is the rightmost term of the upper array of pairs arranged in reverse order, giving M-1 binary one-digit products. This value is quickly determined during the pair down calculation.
【0045】以下に計算例を示す。A calculation example is shown below.
【0046】
計算例1; 111110111×1111
この場合乗数が1だけなので、2次元同長部分積配列は
1種類で、0被乗数の形でオール0はない。N=9、M
=4。
Calculation Example 1; 111110111 × 1111 In this case, since the multiplier is only 1, there is one type of two-dimensional same-length partial product array, and there is no all 0 in the form of 0 multiplicand. N = 9, M
= 4.
【0047】このように、積の下位の桁と上位桁が別々
に求められるので、キャリ計算の巨大誤差を発生せず、
遠距離観測等の信頼性を高める。万光年などの近似のな
い積演算の可能性を本発明は示す。M桁乗数との積の下
位は2次元同長部分積配列の末尾項値並びq[0]q
[1]…q[M−2]のビット並びでよい。これが確定
すれば、p[M−3]〜p[0]は消去してよく、p
[M−2]*,p[3]のペアダウン乗算で高速高精度
に積最上位をあたえる。以上手計算で与えたが、C++
などの超高速無誤差処理は後述する実施例にて明白であ
り、宇宙空間を含め、21世紀のプログラムである。In this way, since the lower and upper digits of the product are obtained separately, a huge error in carry calculation does not occur,
Improve the reliability of long-distance observation. The present invention shows the possibility of product operation without approximation such as million years. The lower order of the product with the M digit multiplier is the tail term value sequence q [0] q of the two-dimensional same-length partial product array.
A bit sequence of [1] ... q [M-2] may be used. If this is confirmed, p [M-3] to p [0] may be deleted, and
[M-2] * , p [3] pair-down multiplication gives high-speed and high-precision product top. Although given by hand above, C ++
The ultra-high-speed error-free processing such as is obvious in the embodiment described later, and is a program of the 21st century including outer space.
【0048】計算例2; 乗数に1,0があれば、p
[i]はN+1桁の2種類配列で、乗数y=10101
1,被乗数111011、M=6,N=6なら、
Calculation example 2; if the multiplier is 1,0, p
[I] is an N + 1 digit two-type array, and a multiplier y = 10101.
1, multiplicand 111011, M = 6, N = 6,
【0049】以下に、本発明にかかる2進数ペアダウン
乗算方式の特徴点を記す。The features of the binary pair-down multiplication method according to the present invention will be described below.
【0050】1.被乗数の桁をNとし2進数とする。こ
れをbN-1 bN-2 …b0 。乗数の桁をMとし、下桁2進
数より1桁ずつ被乗数との部分積をつくると、N桁の2
進数配列をうるが、左上位に1桁2進数0を強制的にお
いて、N+1桁の2次元等長部分積配列をうる。この配
列は数値としては、0bN-1 bN-2 …b0 か、000…
0の何れかであり、個数はM個ある。この配列を用い
て、N桁、M桁の被乗数、乗数の積を高速に誤差なく求
められる。1. Let N be the digit of the multiplicand and be a binary number. This is bN-1 bN-2 ... b0. If the digit of the multiplier is M and the partial product with the multiplicand is created one digit each from the lower digit binary number, the N digit 2
A binary number array is obtained, but a one-digit binary number 0 is forced to the upper left, and a two-dimensional equal-length partial product array of N + 1 digits is obtained. This array is numerically 0bN-1 bN-2 ... b0 or 000 ...
The number is 0 and the number is M. Using this array, the product of the multiplicand and the multiplier of N digits and M digits can be obtained at high speed without error.
【0051】2.この配列は2進数の定長配列を与える
が、同時に配列元の桁を与える。この桁位置を2次元等
長部分積配列の2組の添字和で与えるが桁そのものを演
算式上に記載しない。この記述法は補足請求する。乗数
の2進1桁の桁位置を0桁を最下位としiで示し、1桁
2進数をy[i],i=0,1,2,…,M−1とし、
2次元等長部分積配列をp[i],i=0,1,2,
…,M−1としるす。乗数桁がy[i]=1のとき:p
[i]=0bN-1 bN-2 …b0 のようにかける。乗数桁
がy[i]=0のとき:p[i]=000…0のように
かける。p[i]はこの何れかをとる。しかし、この配
列は2次元であるので、第一の添字subscript
(i)と第2の添字Nとをもつ配列関数で次のように示
される。
この第1第2の添字和は各配列項2進数の桁を示す。2. This array gives a fixed-length binary array, but at the same time gives the digits of the original array. This digit position is given by two sets of subscript sums of the two-dimensional equal-length partial product array, but the digit itself is not described in the arithmetic expression. This description method requires a supplement. The digit position of the binary one digit of the multiplier is represented by i with 0 digit being the least significant, and the one digit binary number is y [i], i = 0, 1, 2, ..., M−1,
A two-dimensional isometric partial product array is represented by p [i], i = 0, 1, 2,
..., M-1. When the multiplier digit is y [i] = 1: p
[I] = 0bN-1 bN-2 ... b0. When the multiplier digit is y [i] = 0: multiply by p [i] = 000 ... 0. p [i] takes either of these. However, since this array is two-dimensional, the first subscript subscript
An array function having (i) and a second subscript N is shown as follows. The first and second subscript sums indicate the digits of each array item binary number.
【0052】3.i=0,1,…,M−1は乗数桁を示
すが同時に2次元同長部分積配列の順を与え、p
[0])p[1]は最初の2進数斜加算で、0+1=
1,0+0=0,1+1=10の和SがN個のペアで得
られ下行配列p[1]に置き換えられる。この動作をペ
ア動作という。S=0,1のときは1ビットでそのまま
でよいが、S=10のときはその配列項が2ビットを占
有するので、其の項は0ビットを置き、キャリビットC
1を左項にたて其の項がS=0なら、S=1とし、其の
項がS=1なら、S=0としキャリビットC1をその左
項に立てる。この動作をダウンという。
p[1]*はu[1][N]=0で、u[1][N−
1]の和SがS=10でも桁ののびは起こらない。2次
元同長部分積配列のN+1桁は保たれる。以上のよう
に、同じ桁のペアp[0],p[1]の2進数の2数を
斜加算し、和Sを下列p[1]のu[1][N−1]…
u[1][0]に置く。S=0,1,10。これまでの
段階をペア段という。以上のペアの上配列p[0]の右
端配列項u[0][0]は斜加算に参加せず、真の巨大
積の最下位をあたえる。
さてペア段をかくと、加算和S=0,1,10はp
[1]の第N項u[1][N−1]より、第1項u
[1][0]まで斜加算され、和はp[1]に置かれ
る。下に書く。2桁2進の和S=10のとき、其の桁を
0ビットとし、キャリC1を立て左項和Sに加える。S
=0なら、S=1。S=1なら左項和S=10で左項S
=0となり、さらに左項へキャリC1が移る。このよう
にペア下配列の和を1桁2進数列にするのをダウン法と
いう。ペア下配列左端項u[1][N]はもともと0だ
が、u[1][N−1]項がS=10となると、u
[1][N]=1になるだけで、ペア下配列はN+1桁
に留まり、ダウン終了後*の記号を付す。p[1]*。
以下に第1のペアダウンを示す。
以上の第1のペアダウンの上配列p[0]の右端配列項
はあきらかに斜加算に参加せず真の巨大積の最下位桁を
与える。
3. i = 0, 1, ..., M-1 indicates a multiplier digit, but at the same time gives the order of a two-dimensional same-length partial product array, and p
[0]) p [1] is the first binary addition, and 0 + 1 =
The sum S of 1,0 + 0 = 0 and 1 + 1 = 10 is obtained in N pairs and is replaced with the descending array p [1]. This operation is called a pair operation. When S = 0 or 1, 1 bit may be used as it is, but when S = 10, the array term occupies 2 bits, so that term is set to 0 bit and carry bit C
If 1 is added to the left term and the term is S = 0, then S = 1, and if the term is S = 1, S = 0 and the carry bit C1 is set to the left term. This operation is called down. p [1] * is u [1] [N] = 0, and u [1] [N−
Even if the sum S of [1] is S = 10, digit spreading does not occur. N + 1 digits of the two-dimensional same-length partial product array are retained. As described above, two binary numbers of the pair p [0] and p [1] of the same digit are obliquely added, and the sum S is u [1] [N-1] ... Of the lower column p [1].
u [1] [0]. S = 0,1,10. The steps so far are called pair steps. The rightmost array item u [0] [0] of the above pair of upper arrays p [0] does not participate in the diagonal addition and gives the bottom of the true huge product. Now, when the pair stage is drawn, the addition sum S = 0, 1, 10 is p
From the Nth term u [1] [N-1] of [1], the first term u
[1] [0] is diagonally added, and the sum is placed in p [1]. Write down below. When the 2-digit binary sum S = 10, the digit is set to 0 bit and the carry C1 is set up and added to the left term sum S. S
If = 0, S = 1. If S = 1, left term sum S = 10 and left term S
= 0, and the carry C1 moves to the left side. In this way, the sum of paired arrays is made into a one-digit binary sequence, which is called the down method. The left-most term u [1] [N] of the pair lower array is originally 0, but when u [1] [N-1] is S = 10, u
Only [1] [N] = 1, the array under the pair remains at N + 1 digits, and the symbol * is added after the end of down. p [1] * .
The first pair down is shown below. The rightmost array term of the upper array p [0] of the above first pair-down gives the least significant digit of the true huge product without explicitly participating in the diagonal addition.
【0053】4.以上のような、ペアダウン動作を繰り
返しつつ、巨大積の下位桁を順次に高速決定しつつ、巨
大積の上位N桁を正確高速に決定する。第2のペアダウ
ン動作はp[1]*と前記2次元同長部分積配列p
[2]で行われ、巨大積下位を正確高速に決めつつp
[2]*を決める。
同様に、…乗数y[M−1]までつづくとき、最後のペ
アダウンは
この巨大積はp[M−1]*q[M−2]q[M−3]
…q[1]q[0]によりえられる。被乗数はN桁の2
進数で、乗数はM桁の2進数である。本ペアダウン乗算
方式では被乗数の2進数パターンと乗数ビットの1,0
で区別される2種の0ビット先頭等長ビットN+1桁配
列をM個使用すればいい。つまり、i番目のp[i]を
取り出すとき、乗数i桁が0なら、被乗数N=14桁な
ら、先頭ビットはいつも0で、乗数i桁がビット0な
ら、部分積ビット00…0で、2次元等長部分積配列は
p[i]=000000000000000
乗数i桁がビット1なら、被乗数N=14桁で1010
1010101010なら上記p[i]は0と被乗数ビ
ットのみで、
p[i]=010101010101010
p[i]はこの2種しかなく、各ペアダウンは最初のペ
アダウンより順次実行されて、巨大積を高速誤差無く得
られる。
4. While repeating the pair down operation as described above, the lower digits of the huge product are sequentially determined at high speed, and the upper N digits of the huge product are accurately determined at high speed. The second pair-down operation is p [1] * and the two-dimensional same-length partial product array p
It is performed in [2], and p
[2] Decide * . Similarly, when continuing up to the multiplier y [M-1], the last pair down is This huge product is p [M-1] * q [M-2] q [M-3]
It is obtained by q [1] q [0]. Multiplicand is N digit 2
The base number is a binary number having M digits. In this pair-down multiplication method, the binary pattern of the multiplicand and the multiplier bit of 1,0
It suffices to use M types of two 0-bit head equal length bits N + 1 digit arrays that are distinguished by. That is, when the i-th p [i] is taken out, if the multiplier i digit is 0, the first bit is always 0 if the multiplicand N = 14 digits, and if the multiplier i digit is bit 0, the partial product bits 00 ... 0, A two-dimensional isometric partial product array has p [i] = 000000000000000000. If the multiplier i digit is bit 1, the multiplicand N = 14 digits and 1010
In the case of 1010101010, the above p [i] is only 0 and the multiplicand bit, and p [i] = 010101010101010 p [i] are only these two types. can get.
【0054】5.本発明方式では2進数1,0の簡単な
処理つまり加算や桁あげなどの処理でソフトウェアに適
合し、高速に処理され、高速に結果をうる。C++なる
言語で記載され、do−while文のくり返しにより
ペアダウン処理を行うことにより、巨大数積を高速正解
する。5. In the system of the present invention, simple processing of binary numbers 1, 0, that is, processing such as addition and carry-over, is suitable for software, processed at high speed, and results are obtained at high speed. It is written in the language C ++, and a pair-down process is performed by repeating a do-while statement, so that a huge number product can be correctly answered at high speed.
【0055】[0055]
【前提例】次に本発明にかかる10進数ペアダウン乗算
方式の前提例について詳細に説明する。[Precondition] Next precondition decimal Peadaun multiplication method according to the present invention will be described in detail.
【0056】図1を参照すると、本発明を適用したコン
ピュータ1の前提例は、入力装置2、出力装置3および
記録媒体4に接続され、内部に、入力手段11、部分積
算出手段12、ペアダウン演算手段13および出力手段
14といった機能部と、入力メモリ15、ワークメモリ
16および出力メモリ17といった記憶部とを有してい
る。各記憶部15〜17はコンピュータ1を構成する主
記憶装置で構成され、各機能部11〜14はコンピュー
タ1を構成するMPUと乗算プログラムとで構成され
る。乗算プログラムは、CD−ROM、フロッピィディ
スク、半導体メモリ等の機械読み取り可能な記録媒体4
に格納されており、コンピュータ1の起動時などに、記
録媒体4中の乗算プログラムがコンピュータ1によって
読み取られ、コンピュータ1の動作を制御することによ
り、コンピュータ1上に各機能部11〜14および各記
憶部15〜17を生成する。Referring to FIG. 1, a premise example of a computer 1 to which the present invention is applied is connected to an input device 2, an output device 3 and a recording medium 4, and internally has an input means 11, a partial product calculation means 12 and a pair down. It has a functional unit such as an arithmetic unit 13 and an output unit 14, and a storage unit such as an input memory 15, a work memory 16 and an output memory 17. Each of the storage units 15 to 17 is composed of a main storage device constituting the computer 1, and each of the functional units 11 to 14 is composed of an MPU constituting the computer 1 and a multiplication program. The multiplication program is a machine-readable recording medium 4 such as a CD-ROM, a floppy disk, or a semiconductor memory.
When the computer 1 is started, the multiplication program in the recording medium 4 is read by the computer 1, and the operation of the computer 1 is controlled. The storage units 15 to 17 are generated.
【0057】入力装置2は、キーボードやディスク装置
などで構成され、被乗数Xおよび乗数Yはこの入力装置
2からコンピュータ1に入力される。The input device 2 is composed of a keyboard, a disk device, etc., and the multiplicand X and the multiplier Y are input to the computer 1 from the input device 2.
【0058】入力手段11は、入力装置2から入力され
た被乗数X、乗数Yおよびその桁数N、Mを入力メモリ
15に格納する部分である。The input means 11 is a part for storing in the input memory 15 the multiplicand X, the multiplier Y and the digits N and M thereof inputted from the input device 2.
【0059】部分積算出手段12は、入力メモリ15に
格納された乗数Yにおけるそれぞれの桁の数値に、当該
数値と被乗数Xとの乗算値であるN+1桁の部分積を算
出し、ワークメモリ16に格納する手段である。ここ
で、各部分積は、第1添字および第2添字の2つの添字
を持つ第0番目の配列要素u[第1添字][第2添字]
から第N番目の配列要素u[第1添字][第2添字]ま
でのN+1個の配列要素を持つ配列pとして表現され、
ワークメモリ16に格納される。ここで、配列pの各配
列要素は、後述するペアダウン演算手段13による演算
に備えて2桁分の数値を格納する容量を持つ。The partial product calculating means 12 calculates, for each numerical value of each digit in the multiplier Y stored in the input memory 15, a partial product of N + 1 digits which is a multiplication value of the numerical value and the multiplicand X, and the work memory 16 Is a means for storing in. Here, each partial product is a 0th array element u [first subscript] [second subscript] having two subscripts of a first subscript and a second subscript.
To an N-th array element u [first subscript] [second subscript], represented as an array p having N + 1 array elements,
It is stored in the work memory 16. Here, each array element of the array p has a capacity for storing a numerical value for two digits in preparation for the calculation by the pair-down calculation means 13 described later.
【0060】ワークメモリ16は、部分積算出手段12
によって前述したように生成された配列pを複数記憶す
る容量を持つメモリである。The work memory 16 is a partial product calculating means 12
Is a memory having a capacity for storing a plurality of arrays p generated as described above.
【0061】ペアダウン演算手段13は、部分積算出手
段12で算出されてワークメモリ16に配列として格納
された部分積を、乗数Yの0桁目の数値に対応する部分
積からM−1桁目の数値に対応する部分積まで順に、隣
接する部分積2つをペアにして斜め加算処理と桁上げ処
理によって、被乗数Xと乗数Yの積Qを構成する各桁の
数値を順次に導出し、出力メモリ17に出力する部分で
ある。積Qは、第0番目の配列要素q[0]から第N+
M−1番目の配列要素q[N+M−1]までのN+M個
の配列要素を持つ配列qとして表現される。The pair-down operation means 13 calculates the partial product calculated by the partial product calculation means 12 and stored in the work memory 16 as an array from the partial product corresponding to the 0th digit of the multiplier Y to the (M-1) th digit. In order up to the partial product corresponding to the numerical value of, two adjacent partial products are paired and the numerical value of each digit forming the product Q of the multiplicand X and the multiplier Y is sequentially derived by diagonal addition processing and carry processing. This is a part for outputting to the output memory 17. The product Q is from the 0th array element q [0] to the N + th array element.
It is expressed as an array q having N + M array elements up to the M−1th array element q [N + M−1].
【0062】出力手段14は、出力メモリ17に格納さ
れた積Qを出力装置3に出力する部分である。出力装置
3としては、ディスプレイ装置やディスク装置等が使用
される。The output means 14 is a part for outputting the product Q stored in the output memory 17 to the output device 3. A display device, a disk device, or the like is used as the output device 3.
【0063】次に本前提例の動作を説明する。なお、本
発明は巨大数の乗算を誤差なく計算し得るものである
が、以下では、説明の便宜上、10進数4桁の被乗数X
「6957」と乗数Y「8134」を乗算し、積Q「5
6588238」を求める場合を例にする。Next, the operation of this premise example will be described. It should be noted that the present invention is capable of calculating multiplication of a huge number without error, but in the following, for convenience of explanation, a multiplicand X of four decimal digits is used.
The product Q “5” is obtained by multiplying “6957” by the multiplier Y “8134”.
For example, a case of calculating “6588238” will be described.
【0064】入力装置2から被乗数X及び乗数Yが入力
されると、入力手段11は、被乗数Xおよび乗数Yの桁
数を調べ、入力メモリ15に、図2に示すように被乗数
Xの桁数N「4」、乗数Yの桁数M「4」を格納すると
共に、被乗数Xの配列xおよび乗数Yの配列yを格納す
る。そして、部分積算出手段12を起動する。When the multiplicand X and the multiplier Y are input from the input device 2, the input means 11 checks the number of digits of the multiplicand X and the multiplier Y, and the input memory 15 stores the number of digits of the multiplicand X as shown in FIG. N “4”, the digit number M “4” of the multiplier Y are stored, and the array x of the multiplicand X and the array y of the multiplier Y are also stored. Then, the partial product calculating means 12 is activated.
【0065】部分積算出手段12は、入力メモリ15か
らMの値を得て、M個分の配列p[0]〜p[M−1]
の領域をワークメモリ16に確保した後、図3に示す処
理を開始する。なお、各配列p[0]〜p[M−1]の
配列要素数は全て同じN+1であり、1つの配列要素の
容量は2桁の数値を格納できる容量である。例えば、1
0進数1桁の数値を2進化10進コード(BCD)で表
現する場合、4ビット×2=8ビットのサイズを各配列
要素が持つ。The partial product calculating means 12 obtains the value of M from the input memory 15 and arranges M arrays p [0] to p [M-1].
After allocating the area of 3 to the work memory 16, the processing shown in FIG. 3 is started. The number of array elements in each array p [0] to p [M-1] is the same N + 1, and the capacity of one array element is a capacity capable of storing a 2-digit numerical value. For example, 1
When a 1-digit number in the 0-ary number is represented by a binary coded decimal code (BCD), each array element has a size of 4 bits × 2 = 8 bits.
【0066】図3を参照すると、部分積算出手段12
は、先ず、内部変数iを0に初期化し(ステップS
1)、次にステップS2〜S9のループ処理を変数iが
M−1を越えるまで繰り返し、その後にペアダウン演算
手段13を起動し(ステップS10)、処理を終える。Referring to FIG. 3, the partial product calculating means 12
First initializes the internal variable i to 0 (step S
1) Next, the loop processing of steps S2 to S9 is repeated until the variable i exceeds M-1, and then the pair-down calculation means 13 is activated (step S10), and the processing ends.
【0067】ステップS2〜S9のループ処理は、乗数
Yにおけるそれぞれの桁の数値毎に、当該数値と被乗数
Xとの乗算値であるN+1桁の部分積を算出し、この算
出した部分積を該当する配列に格納する処理に相当し、
1回のループで1つの部分積が処理される。具体的に
は、以下のような処理となる。The loop processing of steps S2 to S9 calculates, for each numerical value of each digit in the multiplier Y, a partial product of N + 1 digits which is a multiplication value of the numerical value and the multiplicand X, and applies the calculated partial product. Corresponding to the process of storing in the array
One partial product is processed in one loop. Specifically, the processing is as follows.
【0068】先ず、内部変数kを0に初期化し(ステッ
プS2)、x[0]とy[0]を掛け合わせた値を10
で割った余り(%lo)を、配列p[0]の配列要素u
[0][0]に格納する(ステップS3)。x[0]=
7、y[0]=4なので、4×7=28÷10=余り8
となり、u[0][0]=8である。First, the internal variable k is initialized to 0 (step S2), and the value obtained by multiplying x [0] and y [0] is 10
The remainder (% lo) divided by is the array element u of array p [0]
Stored in [0] [0] (step S3). x [0] =
Since 7, y [0] = 4, 4 × 7 = 28/10 = remainder 8
And u [0] [0] = 8.
【0069】次に、x[0]とy[0]とを掛け合わせ
た値を10で割った商(/lo)と、x[1]とy
[0]とを掛け合わせた値を10で割った余りとを加算
した値を、配列p[0]の配列要素u[0][1]に格
納する(ステップS5)。x[0]=7、x[1]=
5、y[0]=4なので、4×7=28÷10=商2、
4×5=20÷10=余り0なので、u[0][1]=
2である。次に、kを+1して1とし(ステップS
6)、再びステップS5を実行してu[0][2]=8
とする。次にkを+1して2とし(ステップS6)、再
びステップS5を実行してu[0][3]=7とする
(ステップS5)。次にkを+1すると(ステップS
6)、k=3になり、k≧N−2=2の継続条件を満た
さないため、ステップS4からステップS7へ進む。Next, the product of x [0] and y [0] divided by 10 is the quotient (/ lo), and x [1] and y
The value obtained by adding the remainder obtained by multiplying [0] by 10 is stored in the array element u [0] [1] of the array p [0] (step S5). x [0] = 7, x [1] =
5, y [0] = 4, so 4 × 7 = 28/10 = quotient 2,
4 × 5 = 20/10 = remainder 0, so u [0] [1] =
It is 2. Next, k is incremented by 1 to 1 (step S
6), step S5 is executed again, and u [0] [2] = 8
And Next, k is incremented by 1 to 2 (step S6), and step S5 is executed again to set u [0] [3] = 7 (step S5). Next, if k is incremented by 1 (step S
6), k = 3, and the continuation condition of k ≧ N−2 = 2 is not satisfied, so the process proceeds from step S4 to step S7.
【0070】ステップS7では、x[3]とy[0]と
を掛け合わせた値=24を10で割った商=2を、配列
p[0]の配列要素u[0][4]に格納する。In step S7, the quotient = 2 obtained by dividing x = [3] by y [0] = 24 by 10 is set to the array element u [0] [4] of the array p [0]. Store.
【0071】以上の処理で、乗数Yの0桁目の数値4と
被乗数Xとの部分積の値が、図4に示すように、ワーク
メモリ16上の配列p[0]に格納されたことになる。By the above processing, the value of the partial product of the 0th digit 4 of the multiplier Y and the multiplicand X is stored in the array p [0] on the work memory 16 as shown in FIG. become.
【0072】部分積算出手段12は、次に変数iを+1
して1とし(ステップS8)、乗数Yの1桁目の数値
「3」にかかる部分積を算出すべくステップS2に処理
を戻す。こうして、乗数Yの1桁目の数値「3」に対応
する部分積、2桁目の数値「1」に対応する部分積、3
桁目の数値「8」に対応する部分積を順次に求め、iが
4となった時点でステップS9において、ループ処理か
ら抜け出る。この時点で、図4に示すように、ワークメ
モリ16上に、乗数Yの0桁目の数値「4」から3桁目
の数値「8」までの各部分積に対応する配列pの各配列
要素の値が確定する。The partial product calculating means 12 then sets the variable i to +1.
Then, the value is set to 1 (step S8), and the process is returned to step S2 in order to calculate the partial product of the first digit "3" of the multiplier Y. Thus, the partial product corresponding to the first digit "3" of the multiplier Y, the partial product corresponding to the second digit "1", 3
The partial products corresponding to the digit number “8” are sequentially obtained, and when i reaches 4, the loop processing is exited in step S9. At this point, as shown in FIG. 4, in the work memory 16, each array of the array p corresponding to each partial product from the numerical value “4” of the 0th digit of the multiplier Y to the numerical value “8” of the third digit The element value is fixed.
【0073】なお、配列p[1]の配列要素u[1]
[3]の値は10、配列p[3]の配列要素u[3]
[3]の値は15で、共に2桁になっているが、本前提
例では桁上げ処理を省略し、2桁のままとしている。そ
の理由は、後述するペアダウン演算手段13の処理で1
桁化が実施されるため、敢えてこの段階で1桁化する必
要がないからである。勿論、この段階で1桁化するよう
にしても良い。The array element u [1] of the array p [1]
The value of [3] is 10, array element u [3] of array p [3]
The value of [3] is 15 and both have two digits, but in the present precondition example, the carry process is omitted and the two digits are left as they are. The reason is that the processing of the pair-down calculation means 13 described later is 1
This is because it is not necessary to dare digitize at this stage because digitization is performed. Of course, the digit may be digitized at this stage.
【0074】また、乗算プログラムを例えばC++言語
で記述する場合、ステップS2〜S9はDO文により、
ステップS4〜S6はfor文により、それぞれ容易に
記述できる。When the multiplication program is described in, for example, C ++ language, steps S2 to S9 are executed by the DO statement.
Each of steps S4 to S6 can be easily described by a for sentence.
【0075】次にペアダウン演算手段13について説明
する。ペアダウン演算手段13は、部分積算出手段12
から起動されると、入力メモリ15からN,Mの値を得
て、N+M個の配列要素q[0]〜q[N+M−1]を
持つ配列qの領域を出力メモリ17に確保した後、図5
に示す処理を開始する。Next, the pair-down calculation means 13 will be described. The pair-down calculation means 13 is a partial product calculation means 12
When the values of N and M are obtained from the input memory 15 and the area of the array q having N + M array elements q [0] to q [N + M−1] is secured in the output memory 17, Figure 5
The process shown in is started.
【0076】図5を参照すると、ペアダウン演算手段1
3は、先ず、内部変数iを0に初期化し(ステップS1
1)、次にステップS12〜S25のループ処理を変数
iがM−3を越えるまで繰り返し、その後に、内部変数
kをM−1に初期化し(ステップS26)、次にステッ
プS27〜S29のループ処理を変数kがN+M−1を
越えるまで繰り返し、そして、出力手段14を起動して
(ステップS30)、処理を終える。Referring to FIG. 5, the pair-down calculation means 1
3 first initializes the internal variable i to 0 (step S1
1) Next, the loop processing of steps S12 to S25 is repeated until the variable i exceeds M-3, after which the internal variable k is initialized to M-1 (step S26), and then the loop of steps S27 to S29. The processing is repeated until the variable k exceeds N + M-1, and the output means 14 is activated (step S30), and the processing is ended.
【0077】ステップS12〜S25のループ処理は、
乗数Yの0桁目の数値に対応する部分積からM−1桁目
の数値に対応する部分積まで順に隣接する部分積2つを
ペアにして斜め加算処理と桁上げ処理によって積Qを構
成する各桁の数値を順次に導出する処理に相当し、1回
のループで、積Qを構成する1つの桁の数値が導出され
る。具体的には、以下のような処理となる。The loop process of steps S12 to S25 is
The partial product corresponding to the 0th digit of the multiplier Y to the partial product corresponding to the M-1st digit is paired with two adjacent partial products to form a product Q by diagonal addition processing and carry processing. This is equivalent to the process of sequentially deriving the numerical value of each digit, and the numerical value of one digit forming the product Q is derived by one loop. Specifically, the processing is as follows.
【0078】先ず、内部変数kを0にセットし(ステッ
プS12)、ワークメモリ16上の配列p[0]の配列
要素u[0][0]の値を、積Qの0桁目の値q[0]
として出力メモリ17に出力する(ステップS13)。First, the internal variable k is set to 0 (step S12), and the value of the array element u [0] [0] of the array p [0] on the work memory 16 is set to the value of the 0th digit of the product Q. q [0]
Is output to the output memory 17 (step S13).
【0079】次に、内部変数kを1に初期化し(ステッ
プS14)、ステップS15〜S17のループ処理を変
数kがNを越えるまで続け、その後、変数kを0に初期
化し(ステップS18)、ステップS20〜S23のル
ープ処理を変数kがNを越えるまで続ける。Then, the internal variable k is initialized to 1 (step S14), the loop processing of steps S15 to S17 is continued until the variable k exceeds N, and then the variable k is initialized to 0 (step S18). The loop process of steps S20 to S23 is continued until the variable k exceeds N.
【0080】ステップS15〜S17のループ処理は、
隣接する部分積2つをペアにして斜め加算処理を行う部
分であり、変数i=0の条件の下では、具体的には以下
のような処理となる。The loop process of steps S15 to S17 is
This is a part for performing diagonal addition processing by pairing two adjacent partial products, and specifically under the condition of variable i = 0, the following processing is performed.
【0081】配列p[0]の配列要素u[0][1]の
値と、配列p[1]の配列要素u[1][0]の値とを
加算した値を、配列p[1]の配列要素u[1][0]
に書き戻す(ステップS16)。図4を参照すると、u
[0][1]=2、u[1][0]=1であるため、u
[1][0]は3に更新される。次に、kを+1して2
とし(ステップS17)、再びステップS16を実行し
て、配列p[0]の配列要素u[0][2]の値と、配
列p[1]の配列要素u[1][2]の値とを加算した
値を、配列p[1]の配列要素u[1][2]に書き戻
す。図4を参照すると、u[0][2]=8、u[1]
[1]=7であるため、u[1][1]は15に更新さ
れる。以下同様に、配列要素u[0][3]の値「7」
と配列要素u[1][2]の値「8」とを加算した値
「15」を配列要素u[1][2]に書き戻し、配列要
素u[0][4]の値「2」と配列要素u[1][3]
の値「10」とを加算した値「12」を配列要素u
[1][3]に書き戻す。そして、kを+1すると、5
となり、k≦Nの継続条件を満足しなくなるので、ステ
ップS15からステップS18へと進む。The value obtained by adding the value of the array element u [0] [1] of the array p [0] and the value of the array element u [1] [0] of the array p [1] to the array p [1 ] Array element u [1] [0]
(Step S16). Referring to FIG. 4, u
Since [0] [1] = 2 and u [1] [0] = 1, u
[1] and [0] are updated to 3. Next, increment k by 2
(Step S17), step S16 is executed again, and the value of the array element u [0] [2] of the array p [0] and the value of the array element u [1] [2] of the array p [1] are set. The value obtained by adding and is written back to the array element u [1] [2] of the array p [1]. Referring to FIG. 4, u [0] [2] = 8, u [1]
Since [1] = 7, u [1] [1] is updated to 15. Similarly, the value "7" of the array elements u [0] [3]
And the value “8” of the array element u [1] [2] are added to write back the value “15” to the array element u [1] [2], and the value “2” of the array element u [0] [4]. ] And array element u [1] [3]
The value "12" obtained by adding the value "10" of the array element u
Write back to [1] and [3]. Then, if k is incremented by 1, then 5
Since the continuation condition of k ≦ N is not satisfied, the process proceeds from step S15 to step S18.
【0082】図6に、ステップS15〜S17のループ
処理による部分積間の斜め加算の様子を模式的に示す。
図中、斜めに引いた線は斜め加算記号と呼び、加算の対
象となる配列要素の対を指し示している。対となる配列
要素は、本前提例の場合、その第1添字と第2添字の合
計値が同じものどうしである。つまり、当該ループ処理
は、2つの部分積の和を求めていることに相当する。し
かし、桁合わせのためにシフト動作などは行っておら
ず、模式図に示されるように、斜め方法、つまり同一配
列要素数を持つ2つの配列間でk−1番目の配列要素と
k番目の配列要素間で加算しているに過ぎない。このよ
うな加算を本明細書では斜め加算と呼ぶ。部分積算出時
点で1桁化した場合、斜め加算は0〜9の2数加算に限
定される故に和は18を超えず、ペア動作の後のダウン
動作では10〜18の和を1桁化すればよいので、通常
のシフトをともない垂直方向加算の和の何百、何千、何
万、…の加算はないので、膨大なキャリの発生はなく、
高速高精度の乗算がペアダウンの斜め加算で得られる。FIG. 6 schematically shows a state of diagonal addition between partial products by the loop processing of steps S15 to S17.
In the figure, diagonally drawn lines are called diagonal addition symbols and indicate pairs of array elements to be added. In the case of the present premised example, the paired array elements have the same total value of the first subscript and the second subscript. That is, the loop process corresponds to obtaining the sum of two partial products. However, the shift operation is not performed for digit alignment, and as shown in the schematic diagram, the diagonal method, that is, the k−1th array element and the kth array element between two arrays having the same number of array elements are used. It just adds between the array elements. Such addition is referred to as diagonal addition in this specification. When digitizing at the time of partial product calculation, the diagonal addition is limited to the binary addition of 0 to 9 and therefore the sum does not exceed 18. In the down operation after the pair operation, the sum of 10 to 18 is digitized. Since there is no addition of hundreds, thousands, tens of thousands, etc. of the vertical direction addition that accompanies the normal shift, a huge carry does not occur,
High-speed and high-precision multiplication can be obtained by pair-down diagonal addition.
【0083】次にステップS19〜S23のループ処理
について説明する。このループ処理は、斜め加算で更新
された配列p[1]の各配列要素の値を1桁化する処理
に相当する。先ず、配列p[1]の配列要素u[1]
[0]の値を10で割った商が0かどうかによって、当
該配列要素の値が2桁か、1桁かを調べる(ステップS
20)。1桁であれば、当該配列要素は1桁化の必要が
ないので、次の配列要素u[1][1]を処理すべくk
を+1して1とする(ステップS23)。2桁であれ
ば、この配列要素u[1][0]の値を10で割った商
と、その隣の配列要素u[1][1]の値とを足し合わ
せた値を、当該隣の配列要素u[1][1]に上書きし
(ステップS21)、配列要素u[1][0]について
は、その値を10で割った余りで上書きする(ステップ
S22)。つまり、配列要素u[1][0]の桁上げ処
理を行うわけである。そして、次の配列要素u[1]
[1]を処理すべくkを+1して1とする(ステップS
23)。図6の場合、斜め加算後のu[1][0]の値
は「3」で1桁なので、ステップS21、S22は実行
されない。Next, the loop processing of steps S19 to S23 will be described. This loop processing corresponds to processing for converting the value of each array element of the array p [1] updated by diagonal addition into one digit. First, the array element u [1] of the array p [1]
Depending on whether the quotient obtained by dividing the value of [0] by 10 is 0, it is determined whether the value of the array element is 2 digits or 1 digit (step S
20). If it is 1 digit, the array element does not need to be converted to 1 digit, and therefore k to process the next array element u [1] [1].
Is incremented by 1 to 1 (step S23). If it has two digits, the value obtained by adding the quotient obtained by dividing the value of the array element u [1] [0] by 10 and the value of the adjacent array element u [1] [1] is the adjacent The array element u [1] [1] is overwritten (step S21), and the array element u [1] [0] is overwritten by the remainder obtained by dividing the value by 10 (step S22). That is, carry processing of the array elements u [1] [0] is performed. Then, the next array element u [1]
In order to process [1], k is incremented by 1 to 1 (step S
23). In the case of FIG. 6, since the value of u [1] [0] after the diagonal addition is “3”, which is one digit, steps S21 and S22 are not executed.
【0084】次の配列要素u[1][1]は、値が「1
5」なので、桁上げ処理が行われ、図6の下の配列p
[1]に示すように値「5」とされる。なお、この時点
では、配列要素u[1][2]の値は「16」となって
いるが、桁上げ処理されることにより値「6」となる。
こうして、順番に桁上げ処理されることにより、配列p
[1]の全ての配列要素u[1][0]〜u[1]
[4]が図6の下の配列pに示すように1桁化される。The value of the next array element u [1] [1] is "1".
5 ", so carry processing is performed and the array p at the bottom of FIG.
The value is set to "5" as shown in [1]. At this point, the values of the array elements u [1] [2] are “16”, but the value is “6” due to the carry process.
In this way, the carry process is performed in order, and the array p
All array elements u [1] [0] to u [1] of [1]
[4] is converted into a single digit as shown in the array p at the bottom of FIG.
【0085】配列p[0]と配列p[1]とをペアとす
る処理が終了すると、変数iを+1して1とし(ステッ
プS25)、ステップS12に戻って、今度は、1桁化
処理を終えた配列p[1]と次の配列p[2]とをペア
として、配列p[0]と配列p[1]のペアに対する処
理と同様の処理を繰り返す。この処理におけるステップ
S13で、配列p[1]のu[1][0]が積Qの1桁
目の値として配列qのq[1]に格納され、ステップS
15〜S17のループ処理で、配列p[1]と配列p
[2]の第1添字と第2添字の和が等しい配列要素の値
が加算されて、配列p[2]に上書きされる斜め加算が
行われ、ステップS19〜S23の処理で配列p[2]
の各配列要素の1桁化が行われる。When the process of pairing the array p [0] and the array p [1] is completed, the variable i is incremented by 1 to 1 (step S25), the process returns to step S12, and the digitizing process is performed this time. The array p [1] that has completed the above is paired with the next array p [2], and the same processing as the processing for the pair of the array p [0] and the array p [1] is repeated. In step S13 in this process, u [1] [0] of the array p [1] is stored in q [1] of the array q as the first digit value of the product Q.
In the loop processing of 15 to S17, the array p [1] and the array p
The values of array elements in which the sum of the first subscript and the second subscript of [2] are equal are added, and diagonal addition is performed to overwrite the array p [2], and the array p [2 is processed in steps S19 to S23. ]
Each array element of is converted into a single digit.
【0086】こうして、ペアを順番に切り替えつつ、同
じ処理が繰り返され、1桁化処理を終えた配列p[M−
2]と最後の配列p[M−1]をペアとする処理まで完
了すると、変数iの値は2であり、i≦M−3の条件を
満足しなくなるため、ステップS12〜S25のループ
を抜け出て、ステップS26の処理へと進む。この時点
で、積Qの0桁目からM−2桁目までの桁の数値が導出
されて配列qのq[0]〜q[M−2]に格納されてお
り、また最後の配列p[M−1]の1桁化処理も終えて
いるため、配列p[M−1]に、積QのM−1桁目以上
の桁の値が格納されていることになる。従って、被乗数
X「6957」と乗数Y「8134」との乗算の例で
は、q[0]=8、q[1]=3、q[2]=2となっ
ており、また配列配列p[0]〜p[3]の状態は、図
7のようになり、配列p[3]に積Qの3桁目以上の桁
の値が格納されている。In this way, the same process is repeated while switching pairs in order, and the array p [M-
2] and the process of pairing the final array p [M−1] with each other, the value of the variable i is 2, and the condition of i ≦ M−3 is not satisfied. Therefore, the loop of steps S12 to S25 is performed. The process exits and the process proceeds to step S26. At this point, the numerical values of the digits from the 0th digit to the M-2nd digit of the product Q are derived and stored in q [0] to q [M-2] of the array q, and the last array p Since the digitizing process of [M-1] has been completed, the array p [M-1] stores the values of the M-1th digit and higher digits of the product Q. Therefore, in the example of the multiplication of the multiplicand X “6957” and the multiplier Y “8134”, q [0] = 8, q [1] = 3, q [2] = 2, and the array array p [ The states of 0] to p [3] are as shown in FIG. 7, and the value of the third digit or more of the product Q is stored in the array p [3].
【0087】そこで、ステップS26では、変数kをM
−1に初期化し、ステップS27〜S29のループ処理
を、変数kの値がN+M−1を越えるまで繰り返すこと
で、配列p[M−1]に格納された値を積Qを構成する
値として配列qに出力する。具体的には、先ず配列p
[M−1]のu[M−1][0]の値をq[M−1]に
格納し(ステップS28)、kを+1してMとし(ステ
ップS29)、次にはu[M−1][1]の値をq
[M]に格納する処理を、以後、u[M−1][N]を
q[N+M−1]とする処理まで繰り返す。これによ
り、q[3]=8、q[4]=8、q[5]=5、q
[6]=6、q[7]=5となる。その後、ペアダウン
演算手段13は出力手段14を起動する(ステップS3
0)。Therefore, in step S26, the variable k is set to M.
-1 and the loop process of steps S27 to S29 is repeated until the value of the variable k exceeds N + M-1, so that the value stored in the array p [M-1] is set as the value forming the product Q. Output to array q. Specifically, first, the sequence p
The value of u [M-1] [0] of [M-1] is stored in q [M-1] (step S28), k is incremented by 1 to be M (step S29), and then u [M]. −1] [1] is set to q
The process of storing in [M] is repeated thereafter until the process of changing u [M-1] [N] to q [N + M-1]. As a result, q [3] = 8, q [4] = 8, q [5] = 5, q
[6] = 6 and q [7] = 5. After that, the pair-down calculation means 13 activates the output means 14 (step S3).
0).
【0088】出力手段14は、出力メモリ17から配列
qを読み出し、出力装置3に出力する。なお、配列qの
q[N+M−1]の値が0のときは、当該配列要素の値
の出力は省略して良い。The output means 14 reads the array q from the output memory 17 and outputs it to the output device 3. When the value of q [N + M-1] of the array q is 0, the output of the value of the array element may be omitted.
【0089】次に本発明にかかる2進数ペアダウン乗算
方式の前提例を図1に示したコンピュータ1に適用した
際の動作を説明する。なお、本発明にかかる2進数ペア
ダウン乗算方式は巨大数の乗算を誤差なく計算し得るも
のであるが、以下では、説明の便宜上、2進数9桁の被
乗数X「111110111」と2進数4桁の乗数Y
「1111」を乗算し、積Q「11101011110
01」を求める場合を例に取り上げる。[0089] To explain the operation when applying the precondition technique of binary Peadaun multiplication method according to the present invention in the following on the computer 1 shown in FIG. The binary pair-down multiplication method according to the present invention is capable of calculating multiplication of a huge number without error. However, in the following, for convenience of explanation, a multiplicand X of 9 digits in binary number “111110111” and a binary number of 4 digits in binary number are used. Multiplier Y
The product Q “11101011110” is multiplied by “1111”.
Take "01" as an example.
【0090】入力装置2から被乗数X及び乗数Yが入力
されると、入力手段11は、被乗数Xおよび乗数Yの桁
数を調べ、入力メモリ15に、図11に示すように被乗
数Xの桁数N「9」、乗数Yの桁数M「4」を格納する
と共に、被乗数Xの配列xおよび乗数Yの配列yを格納
する。そして、部分積算出手段12を起動する。When the multiplicand X and the multiplier Y are input from the input device 2, the input means 11 checks the digit numbers of the multiplicand X and the multiplier Y, and stores the digit numbers of the multiplicand X in the input memory 15 as shown in FIG. N “9”, the number of digits M “4” of the multiplier Y, and the array x of the multiplicand X and the array y of the multiplier Y are stored. Then, the partial product calculating means 12 is activated.
【0091】部分積算出手段12は、入力メモリ15か
らMの値を得て、M個分の配列p[0]〜p[M−1]
の領域をワークメモリ16に確保した後、図12に示す
処理を開始する。なお、各配列p[0]〜p[M−1]
の配列要素数は全て同じN+1であり、1つの配列要素
の容量は2桁の数値を格納できる容量である。つまり、
2ビットのサイズを各配列要素が持つ。The partial product calculating means 12 obtains the value of M from the input memory 15 and arranges M arrays p [0] to p [M-1].
The area shown in FIG. 12 is secured in the work memory 16, and then the processing shown in FIG. 12 is started. Each array p [0] to p [M-1]
The number of array elements of N is the same N + 1, and the capacity of one array element is a capacity capable of storing a 2-digit numerical value. That is,
Each array element has a size of 2 bits.
【0092】図12を参照すると、部分積算出手段12
は、先ず、内部変数iを0に初期化し(ステップS30
1)、次にステップS302〜S308のループ処理を
変数iがM−1を越えるまで繰り返し、その後にペアダ
ウン演算手段13を起動し(ステップS309)、処理
を終える。Referring to FIG. 12, the partial product calculating means 12
First initializes the internal variable i to 0 (step S30
1) Next, the loop processing of steps S302 to S308 is repeated until the variable i exceeds M-1, and then the pair-down calculation means 13 is activated (step S309), and the processing is ended.
【0093】ステップS302〜S308のループ処理
は、乗数Yにおけるそれぞれの桁の数値毎に、当該数値
と被乗数Xとの乗算値であるN+1桁の部分積を算出
し、この算出した部分積を該当する配列に格納する処理
に相当し、1回のループで1つの部分積が処理される。
具体的には、以下のような処理となる。The loop process of steps S302 to S308 calculates, for each numerical value of each digit in the multiplier Y, a partial product of N + 1 digits which is a multiplication value of the numerical value and the multiplicand X, and applies the calculated partial product. Corresponding to the processing of storing in the array, and one partial product is processed in one loop.
Specifically, the processing is as follows.
【0094】先ず、内部変数kを0に初期化し(ステッ
プS302)、x[0]とy[0]とを掛け合わせた値
を配列p[0]の配列要素u[0][0]に格納する
(ステップS304)。x[0]=1、y[0]=1な
ので、u[0][0]=1である。次に、kを+1して
1とし(ステップS305)、再びステップS304を
実行してu[0][1]=1とする。以下、同様にu
[0][2]=1、u[0][3]=0、u[0]
[4]=1、u[0][5]=1、u[0][6]=
1、u[0][7]=1、u[0][8]=1とする。
次にkを+1すると(ステップS305)、k=7にな
り、k≧N−1=8の継続条件を満たさないため、ステ
ップS303からステップS306へ進む。First, the internal variable k is initialized to 0 (step S302), and the value obtained by multiplying x [0] and y [0] is set in the array element u [0] [0] of the array p [0]. It is stored (step S304). Since x [0] = 1 and y [0] = 1, u [0] [0] = 1. Next, k is incremented by 1 to 1 (step S305), and step S304 is executed again to set u [0] [1] = 1. Similarly, u
[0] [2] = 1, u [0] [3] = 0, u [0]
[4] = 1, u [0] [5] = 1, u [0] [6] =
1, u [0] [7] = 1 and u [0] [8] = 1.
Next, when k is incremented by 1 (step S305), k = 7 and the continuation condition of k ≧ N−1 = 8 is not satisfied, so the process proceeds from step S303 to step S306.
【0095】ステップS306では、配列p[0]の配
列要素u[0][9]に0を格納する。In step S306, 0 is stored in the array element u [0] [9] of the array p [0].
【0096】以上の処理で、乗数Yの0桁目の数値1と
被乗数Xとの部分積の値が、図13に示すように、ワー
クメモリ16上の配列p[0]に格納されたことにな
る。By the above processing, the value of the partial product of the 0th digit 1 of the multiplier Y and the multiplicand X is stored in the array p [0] on the work memory 16 as shown in FIG. become.
【0097】部分積算出手段12は、次に変数iを+1
して1とし(ステップS307)、乗数Yの1桁目の数
値「1」にかかる部分積を算出すべくステップS302
に処理を戻す。こうして、乗数Yの1桁目の数値「1」
に対応する部分積、2桁目の数値「1」に対応する部分
積、3桁目の数値「1」に対応する部分積を順次に求
め、iが4となった時点でステップS308において、
ループ処理から抜け出る。この時点で、図13に示すよ
うに、ワークメモリ16上に、乗数Yの0桁目の数値
「1」から3桁目の数値「1」までの各部分積に対応す
る配列pの各配列要素の値が確定する。The partial product calculating means 12 then sets the variable i to +1.
Is set to 1 (step S307), and a partial product for the numerical value "1" in the first digit of the multiplier Y is calculated in step S302.
Return processing to. Thus, the first digit of the multiplier Y is "1"
The partial product corresponding to the second digit, the partial product corresponding to the second digit "1", and the partial product corresponding to the third digit "1" are sequentially obtained, and when i becomes 4, in step S308,
Get out of the loop. At this point, as shown in FIG. 13, in the work memory 16, each array of the array p corresponding to each partial product from the 0th digit “1” of the multiplier Y to the 3rd digit “1” The element value is fixed.
【0098】乗算プログラムを例えばC++言語で記述
する場合、ステップS302〜S309はDO文によ
り、ステップS304〜S306はfor文により、そ
れぞれ容易に記述できる。When the multiplication program is described in the C ++ language, for example, steps S302 to S309 can be easily described by a DO statement, and steps S304 to S306 can be easily described by a for statement.
【0099】次にペアダウン演算手段13について説明
する。ペアダウン演算手段13は、部分積算出手段12
から起動されると、入力メモリ15からN,Mの値を得
て、N+M個の配列要素q[0]〜q[N+M−1]を
持つ配列qの領域を出力メモリ17に確保した後、図1
4に示す処理を開始する。Next, the pair-down calculation means 13 will be described. The pair-down calculation means 13 is a partial product calculation means 12
When the values of N and M are obtained from the input memory 15 and the area of the array q having N + M array elements q [0] to q [N + M−1] is secured in the output memory 17, Figure 1
The process shown in 4 is started.
【0100】図14を参照すると、ペアダウン演算手段
13は、先ず、内部変数iを0に初期化し(ステップS
311)、次にステップS312〜S325のループ処
理を変数iがM−1以上になるまで繰り返し、その後
に、内部変数kをM−1に初期化し(ステップS32
6)、次にステップS327〜S329のループ処理を
変数kがN+M−1を越えるまで繰り返し、そして、出
力手段14を起動して(ステップS330)、処理を終
える。Referring to FIG. 14, the pair-down computing means 13 first initializes the internal variable i to 0 (step S
311), and then the loop processing of steps S312 to S325 is repeated until the variable i becomes M-1 or more, and then the internal variable k is initialized to M-1 (step S32).
6) Next, the loop process of steps S327 to S329 is repeated until the variable k exceeds N + M-1, and the output means 14 is activated (step S330) to finish the process.
【0101】ステップS312〜S325のループ処理
は、乗数Yの0桁目の数値に対応する部分積からM−1
桁目の数値に対応する部分積まで順に隣接する部分積2
つをペアにして斜め加算処理と桁上げ処理によって積Q
を構成する各桁の数値を順次に導出する処理に相当し、
1回のループで、積Qを構成する1つの桁の数値が導出
される。具体的には、以下のような処理となる。The loop processing of steps S312 to S325 is performed from the partial product corresponding to the 0th digit of the multiplier Y to M-1.
Partial products 2 that are sequentially adjacent to the partial product corresponding to the digit in the second digit
The two products are paired and the product Q is obtained by the diagonal addition process and the carry process.
Corresponds to the process of sequentially deriving the numerical value of each digit that constitutes
In one loop, the numerical value of one digit forming the product Q is derived. Specifically, the processing is as follows.
【0102】先ず、内部変数kを0にセットし(ステッ
プS312)、ワークメモリ16上の配列p[0]の配
列要素u[0][0]の値を、積Qの0桁目の値q
[0]として出力メモリ17に出力する(ステップS3
13)。First, the internal variable k is set to 0 (step S312), and the value of the array element u [0] [0] of the array p [0] on the work memory 16 is set to the value of the 0th digit of the product Q. q
It is output to the output memory 17 as [0] (step S3).
13).
【0103】次に、内部変数kを1に初期化し(ステッ
プS314)、ステップS315〜S317のループ処
理を変数kがNを越えるまで続け、その後、変数kを0
に初期化し(ステップS318)、ステップS319〜
S323のループ処理を変数kがNを越えるまで続け
る。Next, the internal variable k is initialized to 1 (step S314), the loop processing of steps S315 to S317 is continued until the variable k exceeds N, and then the variable k is set to 0.
Is initialized (step S318), and steps S319-
The loop process of S323 is continued until the variable k exceeds N.
【0104】ステップS315〜S317のループ処理
は、隣接する部分積2つをペアにして斜め加算処理を行
う部分であり、変数i=0の条件の下では、具体的には
以下のような処理となる。The loop process of steps S315 to S317 is a part for performing an oblique addition process by pairing two adjacent partial products, and under the condition of the variable i = 0, specifically, the following process is performed. Becomes
【0105】配列p[0]の配列要素u[0][1]の
値と、配列p[1]の配列要素u[1][0]の値とを
加算した値を、配列p[1]の配列要素u[1][0]
に書き戻す(ステップS316)。図13を参照する
と、u[0][1]=1、u[1][0]=1であるた
め、u[1][0]は10に更新される。次に、kを+
1して2とし(ステップS317)、再びステップS3
16を実行して、配列p[0]の配列要素u[0]
[2]の値と、配列p[1]の配列要素u[1][2]
の値とを加算した値を、配列p[1]の配列要素u
[1][2]に書き戻す。図13を参照すると、u
[0][2]=1、u[1][1]=1であるため、u
[1][1]は10に更新される。以下同様の動作を繰
り返し、kが10となった時点で、k≦Nの継続条件を
満足しなくなるので、ステップS315からステップS
318へと進む。The value obtained by adding the value of the array element u [0] [1] of the array p [0] and the value of the array element u [1] [0] of the array p [1] to the array p [1 ] Array element u [1] [0]
(Step S316). Referring to FIG. 13, since u [0] [1] = 1 and u [1] [0] = 1, u [1] [0] is updated to 10. Next, add k
1 to 2 (step S317), and step S3 again
16 is executed and the array element u [0] of the array p [0] is executed.
Value of [2] and array element u [1] [2] of array p [1]
And the value of is added to the array element u of the array p [1].
Write back to [1] and [2]. Referring to FIG. 13, u
Since [0] [2] = 1 and u [1] [1] = 1, u
[1] [1] is updated to 10. The same operation is repeated thereafter, and when k reaches 10, the continuation condition of k ≦ N is no longer satisfied, and therefore steps S315 to S315 are performed.
Proceed to 318.
【0106】図15に、ステップS315〜S317の
ループ処理による部分積間の斜め加算の様子を模式的に
示す。図中、斜めに引いた線が斜め加算記号で、加算の
対象となる配列要素の対を指し示している。対となる配
列要素は、本前提例の場合、その第1添字と第2添字の
合計値が同じものどうしである。つまり、当該ループ処
理は、2つの部分積の和を求めていることに相当する。
しかし、桁合わせのためにシフト動作などは行っておら
ず、模式図に示されるように、斜め方法、つまり同一配
列要素数を持つ2つの配列間でk−1番目の配列要素と
k番目の配列要素間で加算しているに過ぎない。FIG. 15 schematically shows the state of diagonal addition between partial products by the loop processing of steps S315 to S317. In the figure, diagonally drawn lines are diagonal addition symbols, which indicate pairs of array elements to be added. In the case of the present premised example, the paired array elements have the same total value of the first subscript and the second subscript. That is, the loop process corresponds to obtaining the sum of two partial products.
However, the shift operation is not performed for digit alignment, and as shown in the schematic diagram, the diagonal method, that is, the k−1th array element and the kth array element between two arrays having the same number of array elements are used. It just adds between the array elements.
【0107】次にステップS319〜S323のループ
処理について説明する。このループ処理は、斜め加算で
更新された配列p[1]の各配列要素の値を1桁化する
処理に相当する。先ず、配列p[1]の配列要素u
[1][0]の値を2で割った商が0かどうかによっ
て、当該配列要素の値が2桁か、1桁かを調べる(ステ
ップS320)。1桁であれば、当該配列要素は1桁化
の必要がないので、次の配列要素u[1][1]を処理
すべくkを+1して1とする(ステップS323)。2
桁であれば、この配列要素u[1][0]の値を2で割
った商と、その隣の配列要素u[1][1]の値とを足
し合わせた値を、当該隣の配列要素u[1][1]に上
書きし(ステップS321)、配列要素u[1][0]
については、その値を2で割った余りで上書きする(ス
テップS322)。つまり、配列要素u[1][0]の
桁上げ処理を行うわけである。そして、次の配列要素u
[1][1]を処理すべくkを+1して1とする(ステ
ップS323)。Next, the loop processing of steps S319 to S323 will be described. This loop processing corresponds to processing for converting the value of each array element of the array p [1] updated by diagonal addition into one digit. First, the array element u of the array p [1]
Depending on whether the quotient obtained by dividing the values of [1] and [0] by 2 is 0, it is checked whether the value of the array element has 2 digits or 1 digit (step S320). If it is one digit, it is not necessary to digitize the array element, so k is incremented by 1 to be 1 in order to process the next array element u [1] [1] (step S323). Two
If it is a digit, the value obtained by dividing the value of the array element u [1] [0] by 2 and the value of the adjacent array element u [1] [1] is added to the adjacent value. Array element u [1] [1] is overwritten (step S321), and array element u [1] [0]
Is overwritten by the remainder obtained by dividing the value by 2 (step S322). That is, carry processing of the array elements u [1] [0] is performed. Then, the next array element u
[1] To process [1], k is incremented by 1 to 1 (step S323).
【0108】図15の場合、斜め加算後のu[1]
[0]の値は「10」で2桁なので、桁上げ処理が行わ
れ、図15の下の配列p[1]に示すように値「0」と
される。なお、この時点では、配列要素u[1][1]
の値は「11」となっているが、桁上げ処理されること
により値「1」となる。こうして、順番に桁上げ処理さ
れることにより、配列p[1]の全ての配列要素u
[1][0]〜u[1][9]が図15の下の配列pに
示すように1桁化される。In the case of FIG. 15, u [1] after diagonal addition
Since the value of [0] is “10” and has two digits, carry processing is performed and the value is set to “0” as shown in the array p [1] at the bottom of FIG. At this point, array element u [1] [1]
Has a value of "11", but the carry process results in a value of "1". In this way, carry processing is performed in order, so that all array elements u of the array p [1] are
[1] [0] to u [1] [9] are digitized into one digit as shown in the array p at the bottom of FIG.
【0109】配列p[0]と配列p[1]とをペアとす
る処理が終了すると、変数iを+1して1とし(ステッ
プS325)、ステップS312に戻って、今度は、1
桁化処理を終えた配列p[1]と次の配列p[2]とを
ペアとして、配列p[0]と配列p[1]のペアに対す
る処理と同様の処理を繰り返す。こうして、ペアを順番
に切り替えつつ、同じ処理が繰り返され、1桁化処理を
終えた配列p[M−2]と最後の配列p[M−1]をペ
アとする処理まで完了すると、変数iの値は4であり、
i<M−1の条件を満足しなくなるため、ステップS3
12〜S325のループを抜け出て、ステップS326
の処理へと進む。この時点で、積Qの0桁目からM−2
桁目までの桁の数値が導出されて配列qのq[0]〜q
[M−2]に格納されており、また最後の配列p[M−
1]の1桁化処理も終えているため、配列p[M−1]
に、積QのM−1桁目以上の桁の値が格納されているこ
とになる。従って、被乗数X「111110111」と
乗数Y「1111」との乗算の例では、q[0]=1、
q[1]=0、q[2]=0となっており、また配列配
列p[0]〜p[3]の状態は、図16のようになり、
配列p[3]に積Qの3桁目以上の桁の値が格納されて
いる。When the process of pairing the array p [0] and the array p [1] is completed, the variable i is incremented by 1 to 1 (step S325), the process returns to step S312, and this time is set to 1
The array p [1] that has undergone digitization processing and the next array p [2] are paired, and the same processing as that for the pair of the array p [0] and the array p [1] is repeated. In this way, the same process is repeated while switching the pairs in order, and when the process of forming a pair of the array p [M-2] and the final array p [M-1] that have completed the one-digitization process is completed, the variable i Has a value of 4,
Since the condition of i <M-1 is not satisfied, step S3
The loop from 12 to S325 is exited, and step S326 is executed.
Proceed to processing. At this point, from the 0th digit of the product Q, M-2
Numerical values of the digits up to the digit are derived and q [0] to q of the array q
It is stored in [M-2], and the last array p [M-
Since the 1-digitization processing of [1] has also been completed, the array p [M-1]
The value of the digit of the product Q at the (M-1) th digit or more is stored in. Therefore, in the example of multiplication of the multiplicand X “111110111” and the multiplier Y “1111”, q [0] = 1,
q [1] = 0, q [2] = 0, and the states of the array arrays p [0] to p [3] are as shown in FIG.
The value of the third digit or more of the product Q is stored in the array p [3].
【0110】そこで、ステップS326では、変数kを
M−1に初期化し、ステップS327〜S329のルー
プ処理を、変数kの値がN+M−1を越えるまで繰り返
すことで、配列p[M−1]に格納された値を積Qを構
成する値として配列qに出力する。具体的には、先ず配
列p[M−1]のu[M−1][0]の値をq[M−
1]に格納し(ステップS328)、kを+1してMと
し(ステップS29)、次にはu[M−1][1]の値
をq[M]に格納する処理を、以後、u[M−1]
[N]をq[N+M−1]とする処理まで繰り返す。こ
れにより、q[3]=1、q[4]=1、q[5]=
1、q[6]=1、q[7]=0、q[8]=1、q
[9]=0、q[10]=1、q[11]=1、q[1
2]=1となる。その後、ペアダウン演算手段13は出
力手段14を起動する(ステップS330)。Therefore, in step S326, the variable k is initialized to M−1, and the loop processing of steps S327 to S329 is repeated until the value of the variable k exceeds N + M−1. The value stored in is output to the array q as a value forming the product Q. Specifically, first, the value of u [M-1] [0] of the array p [M-1] is set to q [M-
1] (step S328), k is incremented by 1 to be M (step S29), and then the value of u [M−1] [1] is stored in q [M]. [M-1]
The process is repeated until [N] is set to q [N + M-1]. As a result, q [3] = 1, q [4] = 1, q [5] =
1, q [6] = 1, q [7] = 0, q [8] = 1, q
[9] = 0, q [10] = 1, q [11] = 1, q [1
2] = 1. After that, the pair-down calculation means 13 activates the output means 14 (step S330).
【0111】出力手段14は、出力メモリ17から配列
qを読み出し、出力装置3に出力する。なお、配列qの
q[N+M−1]の値が0のときは、当該配列要素の値
の出力は省略して良い。The output means 14 reads the array q from the output memory 17 and outputs it to the output device 3. When the value of q [N + M-1] of the array q is 0, the output of the value of the array element may be omitted.
【0112】[0112]
【実施例】次に本発明の実施例について図面を参照して
詳細に説明する。Embodiments of the present invention will now be described in detail with reference to the drawings.
【0113】前述した前提例では、部分積算出手段12
が乗数Yにおける全ての桁の数値に対応する部分積の配
列をワークメモリ16に格納後、ペアダウン演算手段1
3による処理を開始したが、本実施例では、部分積算出
手段12による部分積にかかる配列のワークメモリ16
への格納と、ペアダウン乗算手段13による処理とを同
期をとって交互に実行することにより、ワークメモリ1
6に一度に格納する必要のある配列の数を2つとし、必
要な記憶容量の削減を図る。なお、本実施例において
も、説明の便宜上、10進数4桁の被乗数X「695
7」と乗数Y「8134」を乗算し、積Q「56588
238」を求める場合を例にする。In the above-described precondition example, the partial product calculating means 12
After storing the array of partial products corresponding to the numerical values of all the digits in the multiplier Y in the work memory 16, the pair-down calculation means 1
Although the processing by 3 is started, in the present embodiment, the work memory 16 of the array related to the partial product by the partial product calculating means 12 is started.
To the work memory 1 by synchronizing and alternately executing the storage in the
The number of arrays that need to be stored at once in 6 is set to two, and the required storage capacity is reduced. Note that, also in the present embodiment, for convenience of explanation, a multiplicand X of four decimal digits X "695
7 ”and the multiplier Y“ 8134 ”are multiplied to obtain the product Q“ 56588 ”.
For example, the case of obtaining "238" is taken.
【0114】入力装置2から被乗数X及び乗数Yが入力
されると、入力手段11は、被乗数Xおよび乗数Yの桁
数を調べ、入力メモリ15に、図2に示すように被乗数
Xの桁数N「4」、乗数Yの桁数M「4」を格納すると
共に、被乗数Xの配列xおよび乗数Yの配列yを格納す
る。そして、部分積算出手段12を起動する。When the multiplicand X and the multiplier Y are input from the input device 2, the input means 11 checks the number of digits of the multiplicand X and the multiplier Y and stores the number of digits of the multiplicand X in the input memory 15 as shown in FIG. N “4”, the digit number M “4” of the multiplier Y are stored, and the array x of the multiplicand X and the array y of the multiplier Y are also stored. Then, the partial product calculating means 12 is activated.
【0115】部分積算出手段12は、入力メモリ15中
のMの値にかかわらず、2個分の配列p[0]、p
[1]の領域をワークメモリ16に確保した後、図8に
示す処理を開始する。ここで、各配列p[0]、p
[1]の配列要素数は全て同じN+1であり、1つの配
列要素の容量は2桁の数値を格納できる容量である。例
えば、10進数1桁の数値を2進化10進コード(BC
D)で表現する場合、4ビット×2=8ビットのサイズ
を各配列要素が持つ。The partial product calculating means 12, regardless of the value of M in the input memory 15, has two arrays p [0], p [0].
After allocating the area [1] in the work memory 16, the process shown in FIG. 8 is started. Here, each array p [0], p
The number of array elements in [1] is the same N + 1, and the capacity of one array element is a capacity capable of storing a 2-digit numerical value. For example, a binary digit decimal code (BC
When represented by D), each array element has a size of 4 bits × 2 = 8 bits.
【0116】図8に示す処理は図3に示した処理と基本
的には同じであるが、配列p[0]、p[1]を複数の
部分積で交互に使用する等のために、一部分が追加、修
正されている。追加したステップはS101〜S105
であり、修正したステップはS3、S5、S7、S9で
ある。ステップS101で操作される内部変数jは、配
列p[0]、配列p[1]の選択用であり、0か、1の
何れかの値をとる。また、ステップS102中に示され
るnotjの記号は、jの反転値をとる記号で、j=1
なら、notj=0、j=0なら、notj=1であ
る。この内部変数jは、具体的には、ステップS3、S
5、S7に見られるように、配列p[j]における配列
要素uの第1添字として現れる。The processing shown in FIG. 8 is basically the same as the processing shown in FIG. 3, but because the arrays p [0] and p [1] are alternately used in a plurality of partial products, Some parts have been added or modified. The added steps are S101 to S105.
And the corrected steps are S3, S5, S7, and S9. The internal variable j operated in step S101 is for selecting the array p [0] and the array p [1], and takes a value of either 0 or 1. The symbol notj shown in step S102 is a symbol that takes an inverted value of j, and j = 1.
Then, notj = 0, and if j = 0, notj = 1. This internal variable j is specifically, steps S3, S
5 and S7, it appears as the first subscript of the array element u in the array p [j].
【0117】部分積算出手段12は、図8に示すよう
に、内部変数jを0に初期化すると共に内部変数iを0
に初期化し(ステップS101、S1)、次にステップ
S2〜S9、S102のループ処理を2回繰り返すこと
で2つの部分積の算出とそのワークメモリ106への格
納を行い、ペアダウン演算手段13へ処理を要求する
(ステップS103)。その後、ペアダウン演算手段1
3から部分積を算出すべき旨の処理要求がある毎に(ス
テップS104)、次の1つの部分積を算出してワーク
メモリ106へ格納し、ペアダウン演算手段13へ処理
を要求する(ステップS102、S2〜S9、S10
3)。そして、ペアダウン演算手段13から終了要求が
あった時点(ステップS105)で、処理を終了する。As shown in FIG. 8, the partial product calculating means 12 initializes the internal variable j to 0 and sets the internal variable i to 0.
Is initialized (steps S101 and S1), and then the loop processing of steps S2 to S9 and S102 is repeated twice to calculate two partial products and store them in the work memory 106, and process them to the pair-down calculation means 13. Is requested (step S103). After that, the pair-down calculation means 1
Every time there is a processing request from 3 to calculate a partial product (step S104), the next one partial product is calculated and stored in the work memory 106, and the pair down calculation means 13 is requested to perform processing (step S102). , S2-S9, S10
3). Then, at the point of time when there is an end request from the pair-down calculation means 13 (step S105), the processing is ended.
【0118】他方、ペアダウン演算手段13は、部分積
算出手段12から最初の処理要求が出されたときに起動
し、入力メモリ15からN,Mの値を得て、N+M個の
配列要素q[0]〜q[N+M−1]を持つ配列qの領
域を出力メモリ17に確保した後、図9に示す処理を開
始する。On the other hand, the pair-down operation means 13 is activated when the first processing request is issued from the partial product calculation means 12, obtains the values of N and M from the input memory 15, and outputs N + M array elements q [ After securing the area of the array q having 0] to q [N + M−1] in the output memory 17, the process shown in FIG. 9 is started.
【0119】図9に示す処理は図5に示した処理と基本
的には同じであるが、配列p[0]、p[1]を複数の
部分積で交互に使用する等のために、一部分が追加、修
正されている。追加したステップはS201〜S205
であり、修正したステップはS16、S20〜S22、
S28である。この図9に示されるように、ペアダウン
演算手段13は、先ず、内部変数jを0に初期化すると
共に内部変数iを0に初期化し(ステップS201、S
11)、次にステップS12〜S25、S202の処理
を実行して1つのペアの斜め加算と1桁化処理を実行
し、部分積算出手段12に対して次の部分積の算出を要
求する(ステップS203)。そして、部分積算出手段
12からの処理の要求を待ち(ステップS204)、要
求があったらステップS12に戻って次のペアにかかる
斜め加算と1桁化処理を実行する。そして、最後のペア
まで処理を完了したら(ステップS24でNO)、内部
変数kをM−1に初期化し(ステップS26)、次にス
テップS27〜S29のループ処理を変数kがN+M−
1を越えるまで繰り返し、そして、部分積算出手段12
へ終了要求を通知すると共に出力手段14を起動し(ス
テップS205、S30)、処理を終える。The processing shown in FIG. 9 is basically the same as the processing shown in FIG. 5, but since the arrays p [0] and p [1] are alternately used in a plurality of partial products, Some parts have been added or modified. The added steps are S201 to S205.
And the corrected steps are S16, S20 to S22,
It is S28. As shown in FIG. 9, the pair-down operation means 13 first initializes the internal variable j to 0 and the internal variable i to 0 (steps S201 and S201).
11) Next, the processes of steps S12 to S25 and S202 are executed to perform the diagonal addition of one pair and the digitizing process, and request the partial product calculating means 12 to calculate the next partial product ( Step S203). Then, the process waits for a processing request from the partial product calculating means 12 (step S204), and if there is a request, the process returns to step S12 to execute the diagonal addition and the digitizing process for the next pair. When the processing is completed up to the last pair (NO in step S24), the internal variable k is initialized to M-1 (step S26), and then the loop processing of steps S27 to S29 is performed with the variable k being N + M-.
Repeat until it exceeds 1, and then the partial product calculating means 12
Is notified of the end request and the output means 14 is activated (steps S205, S30), and the process is ended.
【0120】図10に、被乗数X「6957」と乗数Y
「8134」との乗算過程におけるワークメモリ16上
の配列p[0]、p[1]の値の遷移を示す。FIG. 10 shows the multiplicand X "6957" and the multiplier Y.
The transition of the values of the arrays p [0] and p [1] on the work memory 16 in the multiplication process with "8134" is shown.
【0121】部分積算出手段12は、処理開始時点で変
数jを0に初期化するので、ステップS2〜S7の1回
目の実行(i=0の下での実行)で求められる乗数Yの
0桁目の数値「4」と被乗数X「6957」との部分積
「27828」は、配列p[0]の配列要素u[0]
[4]、u[0][3]、u[0][2]、u[0]
[1]、u[0][0]に格納される(図10の30
1)。また、ステップS2〜S7の2回目の実行(i=
1の下での実行)は、ステップS102でjを反転し、
1とした後に行われるので、乗数Yの1桁目の数値
「3」と被乗数X「6957」の部分積「110871」
は、配列p[1]の配列要素u[1][4]、u[1]
[3]、u[1][2]、u[1][1]、u[1]
[0]に格納される(図10の302)。この時点で、
部分積算出手段12からペアダウン演算手段13に処理
が要求される(ステップS103)。なお、当該処理要
求時点の部分積算出手段12における変数jの値は1で
ある。Since the partial product calculating means 12 initializes the variable j to 0 at the start of processing, the multiplier Y obtained in the first execution of steps S2 to S7 (execution under i = 0) is 0. The partial product “27828” of the digit value “4” and the multiplicand X “6957” is the array element u [0] of the array p [0].
[4], u [0] [3], u [0] [2], u [0]
It is stored in [1], u [0] [0] (30 in FIG. 10).
1). Further, the second execution of steps S2 to S7 (i =
Execution under 1) reverses j in step S102,
Since it is performed after setting it to 1, the partial product “110871” of the numerical value “3” of the first digit of the multiplier Y and the multiplicand X “6957”.
Are array elements u [1] [4], u [1] of array p [1]
[3], u [1] [2], u [1] [1], u [1]
It is stored in [0] (302 in FIG. 10). at this point,
The partial product calculation means 12 requests the pair-down calculation means 13 to perform processing (step S103). The value of the variable j in the partial product calculation means 12 at the time of the processing request is 1.
【0122】ペアダウン演算手段13は、処理開始時点
で変数jを0に初期化するので、ステップS12〜S2
3の1回目の実行(i=0の下での実行)では、先ず、
ステップS13で配列p[0]のu[0][0]の値
「8」をq[0]とする。またステップS14〜S17
の斜め加算処理は、図10の303に示すように行わ
れ、ステップS18〜S23の1桁化処理は配列p
[1]に対し実施される。その結果、配列p[1]は図
10の304のように遷移する。ペアダウン演算手段1
3は、その後、変数jを反転して1とし(ステップS2
02)、部分積算出手段12に対して次の部分積の算出
を要求する(ステップS203)。Since the pair-down calculation means 13 initializes the variable j to 0 at the time of starting the processing, the steps S12 to S2 are executed.
In the first execution of 3 (execution under i = 0), first,
In step S13, the value "8" of u [0] [0] of the array p [0] is set to q [0]. In addition, steps S14 to S17
The diagonal addition process is performed as indicated by 303 in FIG. 10, and the one-digit conversion process in steps S18 to S23 is performed in the array p.
It is performed for [1]. As a result, the array p [1] makes a transition as indicated by 304 in FIG. Pair-down calculation means 1
3 then reverses the variable j to 1 (step S2
02), and requests the partial product calculator 12 to calculate the next partial product (step S203).
【0123】部分積算出手段12は、上記の要求を受け
ると(ステップS104)、変数jを反転して0とす
る。この結果、ステップS2〜S7の3回目の実行(i
=2の下での実行)で求められた、乗数Yの2桁目の数
値「1」と被乗数X「6957」の部分積「0695
7」は、配列p[0]の配列要素u[0][4]、u
[0][3]、u[0][2]、u[0][1]、u
[0][0]に格納される(図10の305)。そし
て、ペアダウン演算手段13に処理が要求される(ステ
ップS103)。Upon receiving the above request (step S104), the partial product calculating means 12 inverts the variable j to 0. As a result, the third execution of steps S2 to S7 (i
= 2), the partial product “0695” of the second digit “1” of the multiplier Y and the multiplicand X “6957”.
7 "is the array element u [0] [4], u of the array p [0].
[0] [3], u [0] [2], u [0] [1], u
It is stored in [0] and [0] (305 in FIG. 10). Then, processing is requested of the pair-down calculation means 13 (step S103).
【0124】ペアダウン演算手段13は、現時点の変数
jの値が1なので、ステップS12〜S23の2回目の
実行(i=1の下での実行)では、先ず、ステップS1
3で配列p[1]のu[1][0]の値「3」をq
[1]とする。またステップS14〜S17の斜め加算
処理は、図10の306に示すように行われ、ステップ
S18〜S23の1桁化処理は配列p[0]に対し実施
される。その結果、配列p[0]は図10の307のよ
うに遷移する。ペアダウン演算手段13は、その後、変
数jを反転して0とし(ステップS202)、部分積算
出手段12に対して次の部分積の算出を要求する(ステ
ップS203)。Since the value of the variable j at the present time is 1, the pair-down computing means 13 first executes step S1 in the second execution of steps S12 to S23 (execution under i = 1).
In 3, the value “3” of u [1] [0] of the array p [1] is changed to q
[1]. The diagonal addition process of steps S14 to S17 is performed as indicated by 306 in FIG. 10, and the single digitizing process of steps S18 to S23 is performed on the array p [0]. As a result, the array p [0] makes a transition like 307 in FIG. After that, the pair-down calculation means 13 inverts the variable j to 0 (step S202), and requests the partial product calculation means 12 to calculate the next partial product (step S203).
【0125】部分積算出手段12は、上記の要求を受け
ると(ステップS104)、変数jを反転して1とす
る。この結果、ステップS2〜S7の4回目の実行(i
=3の下での実行)で求められた、乗数Yの3桁目の数
値「8」と被乗数X「6957」の部分積「41565
6」は、配列p[1]の配列要素u[1][4]、u
[1][3]、u[1][2]、u[1][1]、u
[1][0]に格納される(図10の308)。そし
て、ペアダウン演算手段13に処理が要求される(ステ
ップS103)。Upon receipt of the above request (step S104), the partial product calculating means 12 inverts the variable j and sets it to 1. As a result, the fourth execution of steps S2 to S7 (i
= 3), the partial product "41565" of the third digit number "8" of the multiplier Y and the multiplicand X "6957" is obtained.
6 "is the array element u [1] [4], u of the array p [1]
[1] [3], u [1] [2], u [1] [1], u
It is stored in [1] and [0] (308 in FIG. 10). Then, processing is requested of the pair-down calculation means 13 (step S103).
【0126】ペアダウン演算手段13は、現時点の変数
jの値が0なので、ステップS12〜S23の3回目の
実行(i=2の下での実行)では、先ず、ステップS1
3で配列p[0]のu[0][0]の値「2」をq
[2]とする。またステップS14〜S17の斜め加算
処理は、図10の309に示すように行われ、ステップ
S18〜S23の1桁化処理は配列p[1]に対し実施
される。その結果、配列p[1]は図10の310のよ
うに遷移する。ペアダウン演算手段13は、以上で全ペ
アの処理を完了したので(ステップS24でNO)、ス
テップS26以降の処理へと進む。Since the value of the variable j at the present time is 0, the pair-down calculating means 13 first executes step S1 in the third execution of steps S12 to S23 (execution under i = 2).
In step 3, the value “2” of u [0] [0] of the array p [0] is changed to q
[2]. The diagonal addition process of steps S14 to S17 is performed as indicated by 309 in FIG. 10, and the single digitizing process of steps S18 to S23 is performed on the array p [1]. As a result, the array p [1] makes a transition as indicated by 310 in FIG. Since the pair-down calculation means 13 has completed the processing of all pairs (NO in step S24), the processing proceeds to step S26 and subsequent steps.
【0127】現時点の変数jの値は0なので、ステップ
S27〜S29のループ処理では、図10の310の状
態にある配列p[1]に格納された値「56588」が
q[3]〜q[7]として出力される。Since the value of the variable j at the present time is 0, in the loop processing of steps S27 to S29, the value "56588" stored in the array p [1] in the state 310 of FIG. 10 is changed from q [3] to q. It is output as [7].
【0128】以上の実施例では10進数の乗算に本発明
を適用したが、2進数の乗算、8進数の乗算、16進数
の乗算等、一般にL(≧2)進数の乗算に適用可能であ
る。 [0128] While the present invention is applied to a multiplier decimal in the embodiment of the following, binary multiplication, multiplication of octal, hexadecimal or multiplication, generally applicable to multiply the L (≧ 2) Decimal Ah
It
【0129】[0129]
【発明の効果】以上説明したように本発明によれば、巨
大数どうしの乗算を誤差なく求める演算を、より高速に
実行することが可能となる。その理由は、演算結果であ
る乗算値の一部を順次に求めるペアダウン演算手段にお
ける処理の繰り返し数が従来の乗算装置に比べて半減す
ること、毎回、同じ桁数の部分積を扱うため画一的に処
理できること、シフト動作が不要になり斜め加算処理と
桁上げ処理で済むことによる。As described above, according to the present invention, it is possible to perform an operation for obtaining multiplication of huge numbers without error at a higher speed. The reason for this is that the number of repetitions of the processing in the pair-down arithmetic means for sequentially obtaining a part of the multiplication value which is the arithmetic result is halved compared to the conventional multiplication device, and a partial product with the same number of digits is handled every time, which is uniform. This is because the processing can be carried out dynamically and the shift operation is unnecessary and only the diagonal addition processing and the carry processing are required.
【0130】また、ペアダウン乗算手段による処理に同
期して部分積算出手段によって乗数Yの0桁目からM−
1桁目までの部分積を交互に2つの配列に格納する構成
であるため、乗数Yの桁数にかかわらず、2個の配列だ
けでペアダウン乗算処理を実行でき、演算処理の過程で
必要な記憶容量を大幅に削減することが可能となる。Further, in synchronization with the processing by the pair-down multiplication means, the partial product calculation means starts from the 0th digit of the multiplier Y to M-
A configuration in which partial products up to the first digit are stored alternately in two arrays
Because it is, regardless of the number of digits of the multiplier Y, only two sequences can perform Peadaun multiplication processing, it is possible to significantly reduce the required storage capacity in the course of processing.
【0131】本発明にては、乗数Yの0、1、…、M−
1の各桁の数値に対応して、等長のN+1桁の2次元部
分積配列p[0]…、p[M−1]を用いることを基本
としている。すべての配列が等長であるから、ペア構成
は上下同長で、斜め加算はN回いつも同じように行わ
れ、ペアの上行配列の右端は真積の下位桁を1個づつ送
出し、真積の上位桁はM回のペアダウンのダウン配列で
与えられる。In the present invention, the multiplier Y is 0, 1, ..., M-
Basically, a two-dimensional partial product array p [0] ... P [M-1] of N + 1 digits of equal length is used in correspondence with the numerical value of each digit of 1. Since all the arrays are of equal length, the pair configuration has the same length vertically, diagonal addition is always performed N times in the same way, and the right end of the ascending array of pairs sends out the lower digit of the true product one by one. The high-order digit of the product is given by a down array of M down pairs.
【図1】本発明を適用したコンピュータ1の一実施の形
態のブロック図である。FIG. 1 is a block diagram of an embodiment of a computer 1 to which the present invention has been applied.
【図2】入力メモリに格納されるデータの例を示す図で
ある。FIG. 2 is a diagram showing an example of data stored in an input memory.
【図3】本発明の前提例における部分積算出手段の処理
例を示すフローチャートである。FIG. 3 is a flowchart showing a processing example of a partial product calculating means in the premise example of the present invention.
【図4】本発明の前提例において、部分積算出手段の動
作終了時点でワークメモリに格納されている配列の状態
を示す図である。FIG. 4 is a diagram showing a state of an array stored in a work memory at the time when the operation of the partial product calculating means is completed in the precondition example of the present invention.
【図5】本発明の前提例におけるペアダウン演算手段の
処理例を示すフローチャートである。FIG. 5 is a flowchart showing a processing example of a pair-down calculation means in the premise example of the present invention.
【図6】ペアダウン演算手段が実行する斜め加算および
1桁化処理の説明図である。FIG. 6 is an explanatory diagram of diagonal addition and digitizing processing executed by a pair-down calculation means.
【図7】本発明の前提例において、ペアダウン演算手段
が全ペアについての処理を終えた時点でワークメモリに
格納されている配列の状態を示す図である。FIG. 7 is a diagram showing a state of an array stored in a work memory at the time when the pair-down calculation means finishes processing for all pairs in the precondition example of the present invention.
【図8】本発明の実施例における部分積算出手段の処理
例を示すフローチャートである。8 is a flowchart showing a process example of a partial product calculating means in real施例of the present invention.
【図9】本発明の実施例におけるペアダウン演算手段の
処理例を示すフローチャートである。9 is a flowchart showing a process example of Peadaun calculating means in real施例of the present invention.
【図10】本発明の実施例におけるワークメモリ上の配
列の状態遷移図である。10 is a state transition diagram of the sequence on the work memory in the real施例of the present invention.
【図11】本発明にかかる2進数ペアダウン乗算方式の
前提例において入力メモリに格納されるデータの例を示
す図である。FIG. 11 shows a binary pair-down multiplication system according to the present invention.
It is a figure which shows the example of the data stored in an input memory in a premise example .
【図12】本発明にかかる2進数ペアダウン乗算方式の
前提例における部分積算出手段の処理例を示すフローチ
ャートである。FIG. 12 illustrates a binary pair-down multiplication system according to the present invention.
It is a flowchart which shows the example of a process of the partial product calculation means in a premise example .
【図13】本発明にかかる2進数ペアダウン乗算方式の
前提例において、部分積算出手段の動作終了時点でワー
クメモリに格納されている配列の状態を示す図である。FIG. 13 shows a binary pair-down multiplication system according to the present invention.
FIG. 11 is a diagram showing a state of an array stored in a work memory at the time when the operation of the partial product calculating means is ended in the premise example .
【図14】本発明にかかる2進数ペアダウン乗算方式の
前提例におけるペアダウン演算手段の処理例を示すフロ
ーチャートである。FIG. 14 shows a binary pair-down multiplication system according to the present invention.
It is a flowchart which shows the example of a process of the pair down calculation means in a premise example .
【図15】本発明にかかる2進数ペアダウン乗算方式の
前提例におけるペアダウン演算手段が実行する斜め加算
および1桁化処理の説明図である。FIG. 15 shows a binary pair-down multiplication system according to the present invention.
It is explanatory drawing of the diagonal addition and digitization processing which the pair-down arithmetic means in a premise example performs.
【図16】本発明にかかる2進数ペアダウン乗算方式の
前提例において、ペアダウン演算手段が全ペアについて
の処理を終えた時点でワークメモリに格納されている配
列の状態を示す図である。FIG. 16 shows a binary pair-down multiplication system according to the present invention.
FIG. 8 is a diagram showing a state of an array stored in a work memory at the time when the pair-down calculation means finishes processing for all pairs in the premise example .
1…コンピュータ 11…入力手段 12…部分積算出手段 13…ペアダウン演算手段 14…出力手段 15…入力メモリ 16…ワークメモリ 17…出力メモリ 2…入力装置 3…出力装置 4…記録媒体 1 ... Computer 11 ... Input means 12 ... Partial product calculation means 13 ... Pair-down calculation means 14 ... Output means 15 ... Input memory 16 ... Work memory 17 ... Output memory 2 ... Input device 3 ... Output device 4 ... Recording medium
Claims (3)
2)の被乗数Xと、前記L進数で表されるM桁(M≧
2)の乗数Yとの積Qを求める乗算装置において、 前記乗数Yにおけるそれぞれの桁の数値毎に、当該数値
と前記被乗数Xとの乗算値であるN+1桁の部分積を算
出する部分積算出手段と、 該部分積算出手段で算出された部分積の最下位桁の数値
を格納する第0番目の配列要素から最上位桁の数値を格
納する第N番目の配列要素までのN+1個の配列要素を
含む複数の配列と、 前記乗数Yの0桁目の数値に対応する部分積における最
下位桁の数値を前記積Qの一部として出力すると共に、
前記乗数Yの1桁目の数値に対応する部分積からM−2
桁目の数値に対応する部分積まで順に隣接する部分積2
つをペアにして、i+1(i=1〜M−3)桁目の数値
に対応する部分積を格納する前記配列上の第k−1(k
=1〜N+1)番目の配列要素の値に、i桁目の数値に
対応する部分積を格納する前記配列上の第k番目の配列
要素の値を加算した後にi+1桁目の数値に対応する部
分積の隣接する配列要素間で加算結果の桁上げ処理を行
って各配列要素の値を1桁化した上で第0番目の配列要
素の数値を前記積Qの一部として出力する処理を繰り返
し、前記乗数YのM−1桁目の数値に対応する部分積に
ついては、当該部分積を格納する前記配列上の第k−1
(k=1〜N+1)番目の配列要素の値に、前記乗数Y
のM−2桁目の数値に対応する部分積を格納する前記配
列上の第k番目の配列要素の値を加算した後にM−1桁
目の数値に対応する部分積の隣接する配列要素間で加算
結果の桁上げ処理を行って各配列要素の値を1桁化した
上で当該配列に格納された数値を前記積Qの一部として
出力するペアダウン演算手段とを備え、 前記複数の配列として、前記ペアダウン乗算手段による
処理に同期して前記部分積算出手段によって前記乗数Y
の0桁目の数値に対応する部分積からM−1桁目の数値
に対応する部分積まで交互に部分積が格納される2個の
配列を備えることを特徴とするペアダウン乗算装置。1. N digits (N ≧ 2) represented by an L-adic number (L ≧ 2)
2) Multiplicand X and M digits represented by the L-adic number (M ≧
2) In a multiplication device for obtaining a product Q with a multiplier Y, for each numerical value of each digit in the multiplier Y, a partial product calculation for calculating a N + 1 digit partial product which is a multiplication value of the numerical value and the multiplicand X Means and N + 1 number of arrays from the 0th array element storing the numerical value of the least significant digit of the partial product calculated by the partial product calculating means to the Nth array element storing the numerical value of the most significant digit A plurality of arrays including elements, and the numerical value of the least significant digit in the partial product corresponding to the 0th digit of the multiplier Y is output as a part of the product Q,
From the partial product corresponding to the first digit of the multiplier Y, M-2
Partial products 2 that are sequentially adjacent to the partial product corresponding to the digit in the second digit
Pair, and stores the partial product corresponding to the numerical value of the i + 1 (i = 1 to M−3) digit, and the k−1th (k−1) th array on the array.
= 1 to N + 1) -th array element value is added to the value of the k-th array element on the array that stores the partial product corresponding to the i-th digit value, and then the i + 1-th digit value is obtained. Carry out the carry operation of the addition result between the adjacent array elements of the partial product, digitize the value of each array element to one digit, and then output the numerical value of the 0th array element as a part of the product Q. Repeatingly, for the partial product corresponding to the value of the M−1th digit of the multiplier Y, the k−1th array on the array in which the partial product is stored is stored.
The multiplier Y is added to the value of the (k = 1 to N + 1) th array element.
Between the adjacent array elements of the partial products corresponding to the numerical value of the M-1th digit after adding the value of the k-th array element on the array storing the partial product corresponding to the numerical value of the M-2nd digit of A carry-down process of the addition result to digitize the value of each array element and output the numerical value stored in the array as a part of the product Q. As the above, the multiplier Y is calculated by the partial product calculating means in synchronization with the processing by the pair-down multiplying means.
2. The pair-down multiplication device, comprising: two arrays in which partial products are alternately stored from the partial product corresponding to the 0th digit value to the M-1th digit value.
2)の被乗数Xと、前記L進数で表されるM桁(M≧
2)の乗数Yとの積Qを求める乗算方法において、 前記乗数Yにおけるi(i=0〜M−1)桁目の数値と
前記被乗数Xとの乗算値をi桁目対応部分積と呼ぶと
き、第0番目から第N番目までのN+1個の配列要素を
含む2個の配列の一方に、0桁目対応部分積を算出して
格納すると共に、他方の配列に、1桁目対応部分積を算
出して格納するステップと、 前記2個の配列のうち、0桁目対応部分積を格納する配
列の第0番目の配列要素の数値を前記積Qの一部として
出力すると共に、1桁目対応部分積を格納する配列上の
第k−1(k=1〜N+1)番目の配列要素の値に、0
桁目対応部分積を格納する配列上の第k番目の配列要素
の値を加算した後に1桁目対応部分積の隣接する配列要
素間で加算結果の桁上げ処理を行って各配列要素の値を
1桁化した上で第0番目の配列要素の数値を前記積Qの
一部として出力するステップと、 前記乗数Yにおける2桁目の数値からM−2桁目の数値
まで順に、i桁目対応部分積を算出して前記2個の配列
のうち、i−2桁目対応部分積を格納した方の配列に上
書きした後、該上書きした配列上の第k−1(k=1〜
N+1)番目の配列要素の値に、他方の配列上の第k番
目の配列要素の値を加算した後にi桁目対応部分積の隣
接する配列要素間で加算結果の桁上げ処理を行って各配
列要素の値を1桁化した上で第0番目の配列要素の数値
を前記積Qの一部として出力する処理を繰り返すステッ
プと、 M−1桁目対応部分積を算出して前記2個の配列のう
ち、M−3桁目対応部分積を格納した方の配列に上書き
した後、該上書きした配列上の第k−1(k=1〜N+
1)番目の配列要素の値に、他方の配列上の第k番目の
配列要素の値を加算した後にM−1桁目対応部分積の隣
接する配列要素間で加算結果の桁上げ処理を行って各配
列要素の値を1桁化した上で前記上書きした配列に格納
された数値を前記Qの一部として出力するステップとを
含むことを特徴とするペアダウン乗算方法。2. N digits (N ≧ 2) represented by an L-adic number (L ≧ 2)
2) Multiplicand X and M digits represented by the L-adic number (M ≧
2) In the multiplication method for obtaining the product Q with the multiplier Y, the product value of the i-th digit (i = 0 to M-1) in the multiplier Y and the multiplicand X is called an i-th digit corresponding partial product. At this time, the 0th digit corresponding partial product is calculated and stored in one of the two arrays including the N + 1th array elements from the 0th to the Nth, and the 1st digit corresponding portion is stored in the other array. Calculating and storing a product; outputting the numerical value of the 0th array element of the array storing the 0th digit corresponding partial product of the two arrays as a part of the product Q; 0 is added to the value of the k−1 (k = 1 to N + 1) th array element on the array that stores the digit-corresponding partial product.
The value of each array element is calculated by adding the value of the k-th array element on the array storing the digit-corresponding partial product, and then carrying the addition result between adjacent array elements of the first-digit corresponding partial product. And digitizing the numerical value of the 0-th array element as a part of the product Q, and the i-th digit in order from the second digit of the multiplier Y to the M−2nd digit. After calculating the eye-corresponding partial product and overwriting the one of the two arrays in which the i-2 digit corresponding partial product is stored, the k-1th (k = 1 to 1) on the overwritten array is calculated.
After adding the value of the (k + 1) th array element on the other array to the value of the (N + 1) th array element, carry processing of the addition result is performed between adjacent array elements of the i-th digit corresponding partial product. Repeating the process of converting the value of the array element into one digit and then outputting the numerical value of the 0th array element as a part of the product Q; and calculating the M-1 digit corresponding partial product Of the above array, the one storing the partial product corresponding to the M-3rd digit is overwritten, and the k−1th (k = 1 to N +) on the overwritten array is overwritten.
1) After adding the value of the k-th array element on the other array to the value of the 1st array element, carry the result of addition between adjacent array elements of the M-1 digit corresponding partial product And digitizing the value of each array element to one digit, and then outputting the numerical value stored in the overwritten array as a part of the Q, the pair-down multiplication method.
2)の被乗数Xと、前記L進数で表されるM桁(M≧
2)の乗数Yとの積Qを求める乗算プログラムを記録し
た機械読み取り可能な記録媒体であって、コンピュータ
に、 前記乗数Yにおけるi(i=0〜M−1)桁目の数値と
前記被乗数Xとの乗算値をi桁目対応部分積と呼ぶと
き、第0番目から第N番目までのN+1個の配列要素を
含む2個の配列の一方に、0桁目対応部分積を算出して
格納すると共に、他方の配列に、1桁目対応部分積を算
出して格納する処理、 前記2個の配列のうち、0桁目対応部分積を格納する配
列の第0番目の配列要素の数値を前記積Qの一部として
出力すると共に、1桁目対応部分積を格納する配列上の
第k−1(k=1〜N+1)番目の配列要素の値に、0
桁目対応部分積を格納する配列上の第k番目の配列要素
の値を加算した後に1桁目対応部分積の隣接する配列要
素間で加算結果の桁上げ処理を行って各配列要素の値を
1桁化した上で第0番目の配列要素の数値を前記積Qの
一部として出力する処理、 前記乗数Yにおける2桁目の数値からM−2桁目の数値
まで順に、i桁目対応部分積を算出して前記2個の配列
のうち、i−2桁目対応部分積を格納した方の配列に上
書きした後、該上書きした配列上の第k−1(k=1〜
N+1)番目の配列要素の値に、他方の配列上の第k番
目の配列要素の値を加算した後にi桁目対応部分積の隣
接する配列要素間で加算結果の桁上げ処理を行って各配
列要素の値を1桁化した上で第0番目の配列要素の数値
を前記積Qの一部として出力する処理を繰り返す処理、 M−1桁目対応部分積を算出して前記2個の配列のう
ち、M−3桁目対応部分積を格納 した方の配列に上書きした後、該上書きした配列上の第
k−1(k=1〜N+1)番目の配列要素の値に、他方
の配列上の第k番目の配列要素の値を加算した後にM−
1桁目対応部分積の隣接する配列要素間で加算結果の桁
上げ処理を行って各配列要素の値を1桁化した上で前記
上書きした配列に格納された数値を前記Qの一部として
出力する処理、 を実行させるプログラムを記録したコンピュータ可読記
録媒体。3. N digits (N ≧ 2) represented by an L-adic number (L ≧ 2)
2) Multiplicand X and M digits represented by the L-adic number (M ≧
2) A machine-readable recording medium in which a multiplication program for obtaining a product Q of the multiplier Y and the multiplier Y is stored in a computer, the numerical value at the i (i = 0 to M-1) digit of the multiplier Y and the multiplicand. When the multiplication value with X is called the i-th digit corresponding partial product, the 0-th digit corresponding partial product is calculated in one of the two arrays including N + 1 array elements from the 0th to the Nth. A process of calculating and storing the first digit corresponding partial product in the other array while storing the numerical value of the 0th array element of the array storing the 0th digit corresponding partial product in the two arrays Is output as a part of the product Q and the value of the (k−1) th (k = 1 to N + 1) th array element on the array storing the first digit corresponding partial product is 0.
The value of each array element is calculated by adding the value of the k-th array element on the array storing the digit-corresponding partial product, and then carrying the addition result between adjacent array elements of the first-digit corresponding partial product. In which the numerical value of the 0th array element is output as a part of the product Q after the digit is converted to a single digit, and the i-th digit is calculated in order from the second digit of the multiplier Y to the M-2 digit. After calculating the corresponding partial product and overwriting the one of the two arrays in which the i-2 digit corresponding partial product is stored, the k-1th (k = 1 to 1) on the overwritten array is calculated.
After adding the value of the (k + 1) th array element on the other array to the value of the (N + 1) th array element, carry processing of the addition result is performed between adjacent array elements of the i-th digit corresponding partial product. The process of repeating the process of converting the value of the array element into one digit and outputting the numerical value of the 0th array element as a part of the product Q, calculating the M-1 digit corresponding partial product, After overwriting the array storing the partial product corresponding to the M-3rd digit of the array, the value of the k-1 (k = 1 to N + 1) th array element on the overwritten array is set to the other one. After adding the value of the kth array element on the array, M-
The value stored in the overwritten array is digitized after carrying out a carry process of the addition result between adjacent array elements of the first digit corresponding partial product, and the value stored in the overwritten array is used as a part of the Q. A computer-readable recording medium that records a program that causes output processing to be executed.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2000163140A JP3535808B2 (en) | 1999-05-31 | 2000-05-29 | Pair-down multiplication method, pair-down multiplication device, and computer-readable recording medium |
Applications Claiming Priority (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP11-151448 | 1999-05-31 | ||
| JP15144899 | 1999-05-31 | ||
| JP2000163140A JP3535808B2 (en) | 1999-05-31 | 2000-05-29 | Pair-down multiplication method, pair-down multiplication device, and computer-readable recording medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2001051828A JP2001051828A (en) | 2001-02-23 |
| JP3535808B2 true JP3535808B2 (en) | 2004-06-07 |
Family
ID=26480699
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2000163140A Expired - Lifetime JP3535808B2 (en) | 1999-05-31 | 2000-05-29 | Pair-down multiplication method, pair-down multiplication device, and computer-readable recording medium |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3535808B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6933063B2 (en) * | 2017-09-07 | 2021-09-08 | 株式会社デンソー | Parallelization method, parallelization tool, in-vehicle device |
-
2000
- 2000-05-29 JP JP2000163140A patent/JP3535808B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JP2001051828A (en) | 2001-02-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5081573A (en) | Parallel processing system | |
| EP0736205B1 (en) | Method and apparatus for performing a fast hadamard transform | |
| US4635292A (en) | Image processor | |
| JPS6044696B2 (en) | floating point data processing device | |
| JPH02501601A (en) | 2D discrete cosine transform processor | |
| US5517437A (en) | Alpha blending calculator | |
| US5226002A (en) | Matrix multiplier circuit | |
| US6298368B1 (en) | Method and apparatus for efficient calculation of an approximate square of a fixed-precision number | |
| JP3535808B2 (en) | Pair-down multiplication method, pair-down multiplication device, and computer-readable recording medium | |
| JP2677969B2 (en) | Orthogonal transformer | |
| US5289399A (en) | Multiplier for processing multi-valued data | |
| JP2001101160A (en) | Data storage pattern for fast Fourier transform | |
| JPS6336614A (en) | Apparatus for converting data expressing residue number into data projecting mixed basic number | |
| CN118312133A (en) | Ultra-high-order binary polynomial multiplier based on Karatsuba | |
| JPH024944B2 (en) | ||
| JPH05173761A (en) | Binary integer multiplier | |
| CN107977314B (en) | A Method of Obtaining Process Task Block Dependencies Based on Matrix | |
| TWI918472B (en) | Operation device and operation method for flexibly performing number theory transformation | |
| JP3613466B2 (en) | Data arithmetic processing apparatus and data arithmetic processing program | |
| US20090292756A1 (en) | Large-factor multiplication in an array of processors | |
| JP3226823B2 (en) | High precision high digit multiplier | |
| JPH0535773A (en) | Method and system for vector division | |
| JP2777265B2 (en) | High radix square root arithmetic unit | |
| CN117492842A (en) | Optimization method of simd of low-bit arbitrary-size independent convolution | |
| JP2818512B2 (en) | Multiplier |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20040217 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20040312 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 3535808 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080319 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090319 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100319 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100319 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110319 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110319 Year of fee payment: 7 |
|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110319 Year of fee payment: 7 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110319 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120319 Year of fee payment: 8 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120319 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130319 Year of fee payment: 9 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130319 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140319 Year of fee payment: 10 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| EXPY | Cancellation because of completion of term |