JPH1185471A - Calculation method and calculation device - Google Patents
Calculation method and calculation deviceInfo
- Publication number
- JPH1185471A JPH1185471A JP10187061A JP18706198A JPH1185471A JP H1185471 A JPH1185471 A JP H1185471A JP 10187061 A JP10187061 A JP 10187061A JP 18706198 A JP18706198 A JP 18706198A JP H1185471 A JPH1185471 A JP H1185471A
- Authority
- JP
- Japan
- Prior art keywords
- bit
- precision
- double
- multiplier
- word
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明は、単精度乗算器を用
いて倍精度乗算を実行する演算方法および演算装置に関
するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a calculation method and a calculation device for performing double precision multiplication using a single precision multiplier.
【0002】[0002]
【従来の技術】従来の倍精度乗算方式としては、単精度
乗算器を用いて倍精度被乗数の上位ワード/下位ワード
と倍精度乗数の上位ワード/下位ワードの各々の積を求
め、この求めた積について各々桁合わせ加算を行い倍精
度乗算結果を得る方式がある。この方式は、例えば、特
開平8−30439号公報に示されている。この特開平
8−30439号公報に記載の従来例では、倍精度乗数
下位ワードの最上位ビットを保持する手段を設け、倍精
度乗数下位ワードの最上位ビットを倍精度乗数上位ワー
ドの符号化の際に用いることにより、倍精度乗数下位ワ
ードを符号付き2進数として扱っている。また倍精度被
乗数下位ワードの乗算を行うために、被乗数が符号無し
2進数の場合にも乗算が可能な機能を備えた乗算手段を
設けている。この従来例では以上のことにより倍精度乗
算を精度を落とすことなく実現している。2. Description of the Related Art As a conventional double precision multiplication method, a single precision multiplier is used to find the product of each of the upper word / lower word of the double precision multiplicand and the upper word / lower word of the double precision multiplier. There is a method of performing digit-matching addition on a product to obtain a double-precision multiplication result. This method is disclosed in, for example, Japanese Patent Application Laid-Open No. H8-30439. In the conventional example described in Japanese Patent Application Laid-Open No. Hei 8-30439, means for holding the most significant bit of the double precision multiplier lower word is provided, and the most significant bit of the double precision multiplier lower word is used for encoding the double precision multiplier upper word. In this case, the double precision multiplier lower word is treated as a signed binary number. Further, in order to perform multiplication of the double precision multiplicand lower word, a multiplication means having a function capable of performing multiplication even when the multiplicand is an unsigned binary number is provided. In this conventional example, the double precision multiplication is realized without lowering the precision by the above.
【0003】[0003]
【発明が解決しようとする課題】しかしながら、特開平
8−30439号公報に記載の従来例では、乗算手段で
被乗数を符号無し2進数として扱う際に、その被乗数の
最上位ビットより1ビット上位ビットに正数であること
を示す符号を想定する。そのため乗算結果の符号の桁位
置が符号付き2進数である被乗数との乗算結果と異な
る。そのために倍精度被乗数の上位ワード/下位ワード
と倍精度乗数の上位ワード/下位ワードの各々の積を加
算する際の桁合わせシフト数がそれぞれ異なり、桁合わ
せ手段の回路規模が大きくなるという問題点を有してい
た。However, in the conventional example described in Japanese Patent Application Laid-Open No. H8-30439, when a multiplicand is treated as an unsigned binary number by a multiplication means, one bit higher than the most significant bit of the multiplicand is used. Is assumed to be a positive number. Therefore, the digit position of the sign of the multiplication result is different from the multiplication result with the multiplicand, which is a signed binary number. For this reason, the number of shifts of the digit alignment when adding the products of the upper word / lower word of the double precision multiplicand and the upper word / lower word of the double precision multiplier is different, and the circuit scale of the digit alignment means becomes large. Had.
【0004】本発明は、上記問題点を解決するもので、
桁合わせ手段の回路規模を減らし効率良く倍精度乗算を
実現する演算方法および演算装置を提供することを目的
とする。[0004] The present invention solves the above problems,
It is an object of the present invention to provide an arithmetic method and an arithmetic device which realize a double-precision multiplication efficiently by reducing the circuit scale of the digit aligning means.
【0005】[0005]
【課題を解決するための手段】本発明の演算方法は、最
上位ビットを符号ビットとし、最上位ビットと1ビット
下位のビットの間を小数点位置とする2進固定小数点数
体系において、単精度乗算器を用いて倍精度被乗数の上
位ワード/下位ワードと倍精度乗数の上位ワード/下位
ワードとの各々の積を求め、この求めた積について各々
桁合わせ加算を行い倍精度乗算結果を得る際に、倍精度
被乗数の上位ワード/下位ワードと倍精度乗数の上位ワ
ード/下位ワードとの各々の積を、小数点位置より上位
に少なくとも2つ以上の桁をもつことにより倍精度のビ
ット幅より少なくとも1ビット多いビット幅で求めるこ
とを特徴とする(請求項1)。The arithmetic method according to the present invention provides a single-precision binary fixed-point number system in which the most significant bit is a sign bit and the decimal point position is between the most significant bit and one lower bit. When obtaining the product of each of the high-order word / low-order word of the double-precision multiplicand and the high-order word / low-order word of the double-precision multiplier using the multiplier, and performing digit-alignment addition on the obtained products to obtain a double-precision multiplication result The product of each of the high-order word / low-order word of the double precision multiplicand and the high-order word / low-order word of the double precision multiplicand has at least two or more digits above the decimal point position, so that It is obtained with a bit width that is one bit larger (claim 1).
【0006】このように、小数点位置より上位に少なく
とも2つ以上の桁をもつことにより倍精度のビット幅よ
り少なくとも1ビット多いビット幅で求めた各々の積の
桁合わせのためのシフト数は、相対的に同じビット幅に
限定され、桁合わせ手段の回路規模を減らし効率良く倍
精度乗算を実現することができる。ここで、倍精度被乗
数の上位ワード/下位ワードと倍精度乗数の上位ワード
/下位ワードとの各々の積を、小数点位置より上位に少
なくとも3つ以上の桁をもつことにより倍精度のビット
幅より2ビット、3ビット、あるいはそれ以上多いビッ
ト幅で求めることは、1ビット多いビット幅で求めた積
を符号拡張することに他ならず回路規模が大きくなるだ
けなので、通常は小数点位置より上位に2つの桁をもつ
ことにより倍精度のビット幅より1ビット多いビット幅
で求めれば十分である。以下では倍精度被乗数の上位ワ
ード/下位ワードと倍精度乗数の上位ワード/下位ワー
ドとの各々の積を、倍精度のビット幅より1ビット多い
ビット幅で求めるものとして本発明の演算方法を説明す
る。As described above, by having at least two or more digits higher than the decimal place, the shift number for digit alignment of each product obtained with a bit width at least one bit larger than the double precision bit width is as follows: The bit widths are relatively limited to the same bit width, and the circuit scale of the digit aligning means can be reduced, and the double precision multiplication can be efficiently realized. Here, the product of each of the high-order word / low-order word of the double precision multiplicand and the high-order word / low-order word of the double-precision multiplier is calculated from the bit width of the double precision by having at least three or more digits above the decimal point. Finding with a bit width of 2 bits, 3 bits, or more increases the sign scale of the product obtained with a bit width of 1 bit, which only increases the circuit size. It is sufficient to obtain a bit width one bit larger than the double precision bit width by having two digits. In the following, the calculation method of the present invention will be described on the assumption that the product of each of the upper word / lower word of the double precision multiplicand and the upper word / lower word of the double precision multiplier is obtained with a bit width one bit larger than the double precision bit width. I do.
【0007】この場合、上記の演算方法では、倍精度被
乗数下位ワードと倍精度乗数下位ワードの積を求める際
には、例えば、倍精度被乗数下位ワード最上位ビットよ
り1ビット上位に正数を示す符号ビットを付加したデー
タと、倍精度乗数下位ワードの最上位ビットを符号ビッ
トとしたデータとの乗算を行い、その乗算結果の最下位
ビットの1ビット下位に値“0”を付加したものを、求
める積として出力する(請求項2)。In this case, in the above calculation method, when obtaining the product of the double precision multiplicand lower word and the double precision multiplier lower word, for example, a positive number is indicated one bit higher than the most significant bit of the double precision multiplicand lower word. Multiplies the data to which the sign bit is added by the data in which the most significant bit of the double precision multiplier lower word is the sign bit, and adds a value “0” one bit lower than the least significant bit of the multiplication result. Is output as the product to be obtained (claim 2).
【0008】また、倍精度被乗数上位ワードと倍精度乗
数下位ワードの積を求める際には、例えば、倍精度被乗
数上位ワード最上位ビットの符号ビットを1ビット符号
拡張したデータと、倍精度乗数下位ワードの最上位ビッ
トを符号ビットとしたデータとの乗算を行い、その乗算
結果の最下位ビットの1ビット下位に値“0”を付加し
たものを、求める積として出力する(請求項3)。When calculating the product of the double-precision multiplicand upper word and the double-precision multiplier lower word, for example, data obtained by sign-extending the sign bit of the upper-order bit of the double-precision multiplicand upper word by one bit and double-precision multiplier lower The word is multiplied with the data having the most significant bit as the sign bit, and a value obtained by adding a value “0” to the least significant bit one bit lower than the least significant bit is output as a product to be obtained (claim 3).
【0009】また、倍精度被乗数下位ワードと倍精度乗
数上位ワードの積を求める際には、例えば、倍精度被乗
数下位ワード最上位ビットより1ビット上位に正数を示
す符号ビットを付加したデータと、倍精度乗数上位ワー
ドの最下位ビットの桁位置に倍精度乗数下位ワードの最
上位ビットと同じ値を持つデータを加えたデータとの乗
算を行い、その乗算結果の最下位ビットの1ビット下位
に値“0”を付加したものを、求める積として出力する
(請求項4)。When calculating the product of the double-precision multiplicand lower word and the double-precision multiplier upper word, for example, data obtained by adding a sign bit indicating a positive number one bit higher than the uppermost bit of the double-precision multiplicand lower word is used. Is multiplied by data obtained by adding data having the same value as the most significant bit of the double precision multiplier lower word to the digit position of the least significant bit of the double precision multiplier upper word, and one bit lower than the least significant bit of the multiplication result The value obtained by adding the value "0" to the output is output as the product to be obtained (claim 4).
【0010】また、倍精度被乗数上位ワードと倍精度乗
数上位ワードの積を求める際には、例えば、倍精度被乗
数上位ワード最上位ビットの符号ビットを1ビット符号
拡張したデータと、倍精度乗数上位ワードの最下位ビッ
トの桁位置に倍精度乗数下位ワードの最上位ビットと同
じ値を持つデータを加えたデータとの乗算を行い、その
乗算結果の最下位ビットの1ビット下位に値“0”を付
加したものを、求める積として出力する(請求項5)。When calculating the product of the double-precision multiplicand high-order word and the double-precision multiplier high-order word, for example, data obtained by sign-extending the sign bit of the double-precision multiplicand high-order word by 1 bit and double-precision multiplier high-order The multiplication is performed by multiplying the digit position of the least significant bit of the word by data having the same value as the most significant bit of the double precision multiplier low word, and adding the value “0” to the least significant bit of the multiplication result by one bit lower. Is output as the product to be obtained (claim 5).
【0011】ここで、通常用いられる単精度乗算器は2
つの単精度数の乗算を行い、乗算結果は倍精度より1ビ
ット少ないビット幅のデータとして得られるが、小数点
位置を揃えることと倍精度のビット幅で結果を出力する
ことのために、乗算結果の最下位ビットの1ビット下位
に値“0”を付加し、倍精度のデータを積として出力す
る。Here, the normally used single precision multiplier is 2
Multiplication of two single-precision numbers is performed, and the multiplication result is obtained as data having a bit width one bit less than double precision. However, since the decimal point is aligned and the result is output in double precision bit width, the multiplication result is obtained. The value “0” is added one bit lower than the least significant bit of, and double precision data is output as a product.
【0012】また、倍精度被乗数の上位ワード/下位ワ
ードと倍精度乗数の上位ワード/下位ワードとの各々の
積を求めるための単精度乗算器(請求項2,3,4,
5)は、被乗数の最上位ビットの1ビット上位に符号拡
張するか正数を示す符号ビットを付加するので、乗算結
果は倍精度と同じビット幅になる。しかしながら、符号
拡張や正数を示す符号ビットを付加しても被乗数の小数
点位置は変わらないので、上記の単精度乗算器で求めら
れた乗算結果は、従来の単精度乗算器の乗算結果と比べ
て小数点位置より上位に少なくとも2つ以上の桁をもつ
ことにより1ビット多くデータを持つものとして得られ
ることになる。そして、上記の単精度乗算器は、桁位置
の関係から先に記した様に乗算結果の最下位ビットの1
ビット下位に値“0”を付加し、小数点位置より上位に
2つの桁をもつことにより倍精度ビット幅より1ビット
多いビット幅で積を求める。Further, a single-precision multiplier for calculating the product of each of the upper word / lower word of the double precision multiplicand and the upper word / lower word of the double precision multiplier.
In 5), since the sign is extended one bit higher than the most significant bit of the multiplicand or a sign bit indicating a positive number is added, the multiplication result has the same bit width as double precision. However, even if sign extension or a sign bit indicating a positive number is added, the decimal point position of the multiplicand does not change, so that the multiplication result obtained by the above single precision multiplier is compared with the multiplication result of the conventional single precision multiplier. By having at least two or more digits higher than the decimal point position, it is possible to obtain data having one bit more data. The single-precision multiplier described above uses the least significant bit 1 of the multiplication result as described above from the relationship of the digit position.
A value “0” is added to the lower bits, and two digits are provided above the decimal point, thereby obtaining a product with a bit width one bit larger than the double precision bit width.
【0013】本発明の演算装置は、2つの符号付き2進
固定小数点数データの乗算を行う単精度乗算器を用いて
倍精度乗算を実行するもので、乗数の最上位ビットを保
持するMSB保持手段と、MSB保持手段の保持データ
および値“0”のうち一方を選択して出力するデータ選
択手段と、乗数とデータ選択手段の出力データとを用い
て乗数を符号化して出力する乗数エンコード手段と、被
乗数判別信号が非能動状態ならば被乗数の最上位ビット
である符号ビットを1ビット符号拡張して乗数エンコー
ド手段の出力データとの乗算結果を求め、被乗数判別信
号が能動状態ならば被乗数最上位ビットの1ビット上位
に正数であることを示す符号ビットを付加して乗数エン
コード手段の出力データとの乗算結果を求め、求めた乗
算結果を小数点位置より上位に少なくとも2つ以上の桁
をもつことにより倍精度のビット幅より少なくとも1ビ
ット多いビット幅で出力する乗算手段と、乗算手段の出
力データを加数とし、倍精度のビット幅より少なくとも
1ビット多いビット幅を持つ被加数との加算を行い、倍
精度のビット幅より少なくとも1ビット多いビット幅を
持つ加算結果を出力する加算手段と、加算手段の出力す
る加算結果を保持する加算結果保持手段と、加算結果保
持手段の保持データおよび値“0”のうち一方を選択
し、桁合わせ処理を行い加算手段の被加数として出力す
る桁合わせ手段とを備えたことを特徴とする(請求項
6)。The arithmetic unit according to the present invention executes double precision multiplication using a single precision multiplier for multiplying two signed binary fixed-point data, and holds an MSB holding the most significant bit of the multiplier. Means, a data selection means for selecting and outputting one of the data held by the MSB holding means and the value "0", and a multiplier encoding means for encoding and outputting the multiplier using the multiplier and the output data of the data selection means If the multiplicand determination signal is inactive, the sign bit, which is the most significant bit of the multiplicand, is extended by one bit to obtain the result of multiplication with the output data of the multiplier encoding means. A sign bit indicating a positive number is added to the upper bit of the upper bit to obtain a result of multiplication with the output data of the multiplier encoding means. Multiplying means having at least two or more higher-order digits to output at a bit width at least one bit larger than the double precision bit width; output data of the multiplication means being an addend, and being at least one bit greater than the double precision bit width; An adding means for performing addition with an addend having a bit width larger than a bit and outputting an addition result having a bit width at least one bit larger than the double precision bit width, and an addition result holding the addition result output from the adding means And a digit matching means for selecting one of the data held by the addition result holding means and the value “0”, performing a digit matching process, and outputting the result as an augend of the adding means. Claim 6).
【0014】この構成によれば、乗算手段が小数点位置
より上位に少なくとも2つ以上の桁をもつことにより倍
精度のビット幅より少なくとも1ビット多いビット幅で
乗算結果を出力することにより、各々の乗算結果の桁合
わせのためのシフト数は、相対的に同じビット幅に限定
され、桁合わせ手段の回路規模を減らし効率良く倍精度
乗算を実現することができる。According to this configuration, since the multiplying means has at least two digits higher than the decimal point, and outputs the multiplication result with a bit width at least one bit larger than the double precision bit width, The number of shifts for digit alignment of the multiplication result is relatively limited to the same bit width, so that the circuit scale of the digit alignment means can be reduced and double-precision multiplication can be efficiently realized.
【0015】この場合、上記の演算装置では、倍精度乗
算を実行する際のMSB保持手段の動作として、例え
ば、倍精度乗数下位ワードと倍精度被乗数上位ワード/
下位ワードとの積を求める際に倍精度乗数下位ワードの
最上位ビットを保持するようにしている(請求項7)。
また、上記の演算装置では、倍精度乗算を実行する際の
データ選択手段の動作として、例えば、倍精度乗数下位
ワードと倍精度被乗数上位ワード/下位ワードとの積を
求める際に値“0”を選択出力し、倍精度乗数上位ワー
ドと倍精度被乗数上位ワード/下位ワードとの積を求め
る際にMSB保持手段が保持している倍精度乗数下位ワ
ードの最上位ビットを選択出力するようにしている(請
求項8)。In this case, in the above-mentioned arithmetic unit, the operation of the MSB holding means at the time of performing the double precision multiplication includes, for example, a double precision multiplier lower word and a double precision multiplicand upper word /
When calculating the product with the lower word, the most significant bit of the double precision multiplier lower word is retained.
Further, in the above arithmetic device, as an operation of the data selecting means at the time of performing the double precision multiplication, for example, a value “0” is obtained when obtaining a product of a double precision multiplier lower word and a double precision multiplicand upper word / lower word. To select and output the most significant bit of the double precision multiplier lower word held by the MSB holding means when obtaining the product of the double precision multiplier upper word and the double precision multiplicand upper word / lower word. (Claim 8).
【0016】また、上記の演算装置では、倍精度乗算を
実行する際の乗数エンコード手段の動作として、例え
ば、倍精度乗数下位ワードと倍精度被乗数上位ワード/
下位ワードとの積を求める際に入力される倍精度乗数下
位ワードとデータ選択手段の選択した値“0”の出力デ
ータをブースのアルゴリズムで符号化して出力し、倍精
度乗数上位ワードと倍精度被乗数上位ワード/下位ワー
ドとの積を求める際にデータ選択手段の選択したMSB
保持手段が保持している倍精度乗数下位ワードの最上位
ビットの出力データをブースのアルゴリズムで符号化し
て出力するようにしている(請求項9)。In the above arithmetic unit, the operation of the multiplier encoding means when performing double precision multiplication includes, for example, a double precision multiplier lower word and a double precision multiplicand upper word / word.
The double precision multiplier lower word input when calculating the product of the lower word and the output data of the value “0” selected by the data selection means are encoded and output by the Booth algorithm, and the double precision multiplier upper word and the double precision multiplier are output. MSB selected by the data selection means when obtaining the product of the multiplicand upper word / lower word
The output data of the most significant bit of the double-precision multiplier low-order word held by the holding means is encoded by the Booth algorithm and output.
【0017】また、上記の演算装置では、乗算手段が、
例えば被乗数判別信号が能動状態ならば入力される被乗
数が倍精度被乗数の下位ワードであると判別し、被乗数
の最上位ビットの1ビット上位に正数を示す符号ビット
を付加して、乗数エンコード手段の出力データとの部分
積を求め、被乗数判別信号が非能動状態ならば入力され
る被乗数が倍精度被乗数の上位ワードであると判別し、
被乗数の最上位ビットである符号ビットを1ビット符号
拡張して、乗数エンコード手段の出力データとの部分積
を求める部分積生成手段を備えている(請求項10)。
上記の乗算手段は、部分積生成手段を少なくとも2つ備
え、複数の部分積生成手段の出力データである部分積を
桁位置を合わせて加算し、部分積加算結果の最下位ビッ
トの1ビット下位に値“0”のデータを付加して求める
積として出力するようにしてもよい(請求項11)。Further, in the above-described arithmetic unit, the multiplying means includes:
For example, if the multiplicand determination signal is active, the input multiplicand is determined to be the lower word of the double-precision multiplicand, and a sign bit indicating a positive number is added one bit higher than the most significant bit of the multiplicand, and the multiplier encode means Find the partial product with the output data of, if the multiplicand determination signal is inactive, determine that the input multiplicand is the upper word of the double precision multiplicand,
There is provided partial product generation means for extending the sign bit, which is the most significant bit of the multiplicand, by one bit and obtaining a partial product with output data of the multiplier encoding means.
The multiplying means includes at least two partial product generating means, adds the partial products, which are output data of the plurality of partial product generating means, at the same digit position, and adds one bit lower than the least significant bit of the partial product addition result. May be output as a product obtained by adding data of a value “0” to the data (claim 11).
【0018】また上記の演算装置では、乗算手段の出力
データを一時保持し、加算手段の加数として出力する乗
算結果保持手段を設け、乗算手段と加算手段とが並列に
動作可能としてもよい(請求項12)。これにより、演
算時間を短縮することができる。また、上記の演算装置
では、乗数エンコード手段は、入力データである乗数の
最下位ビットを強制的に値“0”にする機能を有してい
てもよく(請求項13)、乗算手段は、入力データであ
る被乗数の最下位ビットを強制的に値“0”にする機能
を有していてもよい(請求項14)。In the above arithmetic device, a multiplication result holding means for temporarily holding the output data of the multiplication means and outputting it as an addend of the addition means may be provided so that the multiplication means and the addition means can operate in parallel ( Claim 12). As a result, the operation time can be reduced. Further, in the arithmetic device described above, the multiplier encoding means may have a function of forcibly setting the least significant bit of the multiplier as input data to the value “0” (claim 13). A function may be provided for forcibly setting the least significant bit of the multiplicand, which is input data, to the value "0".
【0019】本発明では高精度の倍精度乗算を効率良く
実行することを目的としているが、現在実用化されてい
るアプリケーションでは低精度の倍精度乗算で規格が決
められているものがある。例えばデジタル携帯電話など
で用いられる音声符号化処理などがそうである。そこ
で、上述のように、それぞれ乗数と被乗数の最下位ビッ
トを強制的に値“0”にする機能(請求項13,14)
を有することにより、低精度の倍精度乗算を用いたアプ
リケーションとの互換性をとることができる。The purpose of the present invention is to efficiently perform high-precision double-precision multiplication. However, in some applications that are currently in practical use, the standard is determined for low-precision double-precision multiplication. For example, a voice coding process used in a digital mobile phone or the like is the same. Therefore, as described above, the function of forcibly setting the least significant bits of the multiplier and the multiplicand to the value “0” (claims 13 and 14)
Has compatibility with applications using low-precision double-precision multiplication.
【0020】ここで、低精度の倍精度乗算と呼んでいる
のは、倍精度乗算の実行において倍精度乗数下位ワード
や倍精度被乗数下位ワードのデータを用いた乗算を行う
際に、それぞれ倍精度乗数下位ワードや倍精度被乗数下
位ワードを1ビット右シフトし、最上位ビットの桁位置
に正数を示す符号ビットを挿入したデータをあらかじめ
作成して、それらのデータを倍精度乗数下位ワードや倍
精度被乗数下位ワードのデータの代わりに用いて乗算を
行う倍精度乗算である。倍精度乗数と倍精度被乗数の符
号ビットはそれぞれ倍精度乗数上位ワードと倍精度被乗
数上位ワードの最上位ビットにあたり、倍精度乗数下位
ワードと倍精度被乗数下位ワードは符号ビットを持たな
い全てデータビットのデータであることになる。Here, what is called low-precision double-precision multiplication is that, when performing double-precision multiplier lower word or double-precision multiplicand lower word data in double-precision multiplication, double-precision multiplication is performed. The multiplier lower word or double-precision multiplicand lower word is shifted one bit to the right, and data in which a sign bit indicating a positive number is inserted in the digit position of the most significant bit is created in advance, and the data is converted to the double-precision multiplier lower word or double. This is double-precision multiplication in which multiplication is performed using data of the lower word of the precision multiplicand. The sign bits of the double-precision multiplier and the double-precision multiplicand correspond to the most significant bits of the double-precision multiplier upper word and the double-precision multiplicand upper word, respectively.The double-precision multiplier lower-order word and double-precision multiplicand lower-order word are all data bits having no sign bit. It will be data.
【0021】符号付き2進固定小数点数を扱う通常の単
精度乗算器は全てデータビットであるデータを扱える構
成にはなっていない。そこで、倍精度乗数下位ワードと
倍精度被乗数下位ワードはそれぞれ正数のデータである
と考えられるので正数を示す符号ビットを付加すること
を考えるが、そのままではビット幅が単精度のビット幅
より1ビット多くなってしまうので、1ビット右シフト
することにより最下位ビットのデータを切り捨てて単精
度のビット幅に押さえている。つまり、倍精度乗数下位
ワードと倍精度被乗数下位ワードの最下位ビットのデー
タが切り捨てられるので、その分だけ精度が悪くなるこ
とになる。また、この1ビット右シフトにより発生する
桁位置のずれは、倍精度乗数上位ワード/下位ワードと
倍精度被乗数上位ワード/下位ワードのそれぞれの積を
加算するときの桁位置合わせ処理の中で吸収している。An ordinary single-precision multiplier that handles signed binary fixed-point numbers is not configured to handle all data bits. Therefore, since the double precision multiplier lower word and the double precision multiplicand lower word are considered to be positive data, respectively, it is considered to add a sign bit indicating a positive number. Since the number of bits is increased by one, the data of the least significant bit is truncated by shifting the data to the right by one bit, and the data width is reduced to a single precision bit width. In other words, since the data of the least significant bit of the double precision multiplier lower word and the double precision multiplicand lower word is discarded, the precision is deteriorated accordingly. The shift in the digit position caused by this one-bit right shift is absorbed in the digit alignment processing when adding the products of the double precision multiplier upper word / lower word and the double precision multiplicand upper word / lower word. doing.
【0022】また、上記の演算装置では、MSB保持手
段は、符号付き2進数である乗数の最上位ビットを保持
する手段に代えて、乗数の最上位ビットおよび値“0”
のうち一方を選択して保持する手段としてもよい(請求
項15)。これにより、倍精度データと倍精度データの
乗算を行う場合と、倍精度データと単精度データの乗算
を行う場合との命令の共通化が図れ、命令数を削減する
ことができる。Further, in the above arithmetic device, the MSB holding means replaces the means for holding the most significant bit of the multiplier, which is a signed binary number, but the most significant bit of the multiplier and the value “0”.
And means for selecting and holding one of them (claim 15). This makes it possible to use a common instruction for multiplication of double-precision data and double-precision data and for multiplication of double-precision data and single-precision data, thereby reducing the number of instructions.
【0023】[0023]
〔第1の実施の形態〕以下本発明の第1の実施の形態に
ついて、図面を参照しながら説明する。図1は本発明の
実施の形態における演算装置の構成を示す図である。図
1において、MSB保持手段10は符号付き2進固定小
数点数である乗数の最上位ビットを保持する。データ選
択手段11はMSB保持手段10の出力か値“0”を選
択して出力する。乗数エンコード手段12は乗数とデー
タ選択手段11の出力を2次のブースのアルゴリズムで
符号化する。[First Embodiment] Hereinafter, a first embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a diagram showing a configuration of an arithmetic unit according to an embodiment of the present invention. In FIG. 1, an MSB holding unit 10 holds the most significant bit of a multiplier that is a signed binary fixed-point number. The data selection means 11 selects and outputs the output of the MSB holding means 10 or the value "0". The multiplier encoding means 12 encodes the multiplier and the output of the data selecting means 11 by a secondary Booth algorithm.
【0024】乗算手段13は符号付き2進固定小数点数
である被乗数と乗数エンコード手段12の出力と被乗数
判別信号C1とを入力し、被乗数判別信号C1が値
“0”で非能動状態ならば被乗数を倍精度被乗数上位ワ
ードと判別し、被乗数の最上位ビットである符号ビット
を1ビット符号拡張して、乗数エンコード手段12の出
力データとの乗算結果を求める。一方、被乗数判別信号
C1が値“1”で能動状態ならば被乗数を倍精度被乗数
下位ワードと判別し、被乗数の最上位ビットの1ビット
上位に正数を示す符号として値“0”の符号ビットを付
加して、乗数エンコード手段12の出力データとの乗算
結果を求める。そして、求めた乗算結果の最下位ビット
の1ビット下位に値“0”のデータを付加したデータ
を、小数点位置より上位に少なくとも2つ以上の桁をも
つことにより倍精度のビット幅より少なくとも1ビット
多いビット幅を持つ積として出力する。The multiplying means 13 inputs the multiplicand which is a signed binary fixed-point number, the output of the multiplier encoding means 12 and the multiplicand discrimination signal C1, and if the multiplicand discrimination signal C1 is a value "0" and is in an inactive state, the multiplicand Is determined as the double precision multiplicand upper word, the sign bit that is the most significant bit of the multiplicand is sign-extended by 1 bit, and the result of multiplication with the output data of the multiplier encoding means 12 is obtained. On the other hand, if the multiplicand discrimination signal C1 is in the active state with the value “1”, the multiplicand is discriminated as the double precision multiplicand lower word, and the sign bit of the value “0” as a sign indicating a positive number one bit higher than the most significant bit of the multiplicand To obtain the result of multiplication with the output data of the multiplier encoding means 12. Then, the data obtained by adding the data of value “0” one bit lower than the least significant bit of the obtained multiplication result has at least two or more digits higher than the decimal point position, so that the data is at least one bit larger than the double precision bit width. Output as a product with more bits.
【0025】ここで、本発明では単精度データと倍精度
データの表現として、最上位ビットが符号ビットであ
り、最上位ビットと最上位ビットより1ビット下位のビ
ットとの間が小数点位置である2進固定小数点数体系を
考えている。通常小数点位置より上位には符号ビットと
なるビットが1つだけ存在する。つまり、上記「小数点
位置より上位に少なくとも2つ以上の桁をもつ」という
表現と「倍精度のビット幅より少なくとも1ビット多い
ビット幅をもつ」という表現は同じことを述べている。Here, in the present invention, as a representation of single precision data and double precision data, the most significant bit is a sign bit, and the decimal point position is between the most significant bit and one bit lower than the most significant bit. I am thinking of a binary fixed-point number system. Normally, there is only one bit serving as a sign bit above the decimal point position. In other words, the expression "having at least two or more digits higher than the decimal point position" and the expression "having a bit width at least one bit larger than the double precision bit width" state the same thing.
【0026】加算手段14は乗算手段13の出力を加数
とし、小数点位置より上位に少なくとも2つ以上の桁を
もつことにより倍精度のビット幅より少なくとも1ビッ
ト多いビット幅を持つ被加数との加算を行い、小数点位
置より上位に少なくとも2つ以上の桁をもつことにより
倍精度のビット幅より少なくとも1ビット多いビット幅
の加算結果を出力する加算手段である。加算結果保持手
段15は加算手段14の出力を保持する。桁合わせ手段
16は2ビットで表現される桁合わせ制御信号C2が
(C2-1,C2-0)=(0,1)のとき加算結果保持手
段15の出力をシフトせずに出力し、桁合わせ制御信号
C2が(C2-1,C2-0)=(1,0)のとき加算結果
保持手段15の出力を16ビット右シフトして出力し、
桁合わせ制御信号C2が(C2-1,C2-0)=(0,
0)のとき値“0”を選択し出力する。The adding means 14 uses the output of the multiplying means 13 as an addend. The addend has at least two digits higher than the decimal point, thereby adding an addend having a bit width at least one bit larger than the double precision bit width. And outputs an addition result having a bit width that is at least one bit larger than the double precision bit width by having at least two digits higher than the decimal point position. The addition result holding means 15 holds the output of the addition means 14. The digit aligning means 16 outputs the output of the addition result holding means 15 without shifting when the digit aligning control signal C2 expressed by 2 bits is (C2-1, C2-0) = (0, 1). When the alignment control signal C2 is (C2-1, C2-0) = (1, 0), the output of the addition result holding means 15 is shifted right by 16 bits and output.
When the digit adjustment control signal C2 is (C2-1, C2-0) = (0,
0), the value “0” is selected and output.
【0027】なお、記号C2-1,C2-0は、それぞれ桁
合わせ制御信号C2のビット構成要素を示す。符号20
は本実施の形態の演算装置で実行される各演算命令のソ
ースとデスティネーションになる記憶手段である。な
お、ここでは、乗算結果保持手段17および選択手段1
8,19は存在せず、乗算手段13の出力が加算手段1
4に直接入力され、加算結果保持手段15の出力が桁合
わせ手段16に直接入力されているものとして説明す
る。また、乗算結果保持手段17および選択手段18,
19については後述する。Symbols C2-1 and C2-0 denote bit components of the digit alignment control signal C2, respectively. Code 20
Is storage means serving as a source and a destination of each operation instruction executed by the operation device of the present embodiment. Here, the multiplication result holding means 17 and the selection means 1
8 and 19 do not exist, and the output of the multiplication means 13 is
4, the output of the addition result holding means 15 is directly input to the digit matching means 16. Further, the multiplication result holding means 17 and the selection means 18,
19 will be described later.
【0028】また、図1の中で、乗算エンコード手段1
2に入力される乗数制御信号C3および乗算手段13に
入力される被乗数制御信号C4は、第2の実施の形態に
おいて必要な信号であり、第1の実施の形態では不要で
ある。さらに、MSB保持手段10に入力される値
“0”および保持データ選択信号C5は、第3の実施の
形態において必要な信号であり、第1の実施の形態では
不要である。In FIG. 1, the multiplication encoding means 1
The multiplier control signal C3 input to 2 and the multiplicand control signal C4 input to the multiplying means 13 are necessary signals in the second embodiment, and are unnecessary in the first embodiment. Further, the value “0” and the held data selection signal C5 input to the MSB holding unit 10 are necessary signals in the third embodiment, and are not required in the first embodiment.
【0029】以上のように構成された演算装置につい
て、その動作を説明する。簡単のため16ビット幅の符
号付き2進固定小数点数を単精度データとし、32ビッ
ト幅の符号付き2進固定小数点数を倍精度データとす
る。倍精度データと倍精度データの乗算を行う場合につ
いて説明するが、倍精度被乗数は上位ワードXHと下位
ワードXLからなり、倍精度乗数は上位ワードYHと下
位ワードYLからなるものとする。また、データ選択手
段11は、ここでは倍精度乗数下位ワードYLについて
乗算を行う場合に値“0”を選択し、倍精度乗数上位ワ
ードYHについて乗算を行う場合にMSB保持手段10
の出力を選択するものとする。また、被乗数判別信号C
1は、倍精度被乗数下位ワードXLについて乗算を行う
場合に値“1”で能動状態となり、倍精度被乗数上位ワ
ードXHについて乗算を行う場合に値“0”で非能動状
態となる信号である。The operation of the arithmetic unit configured as described above will be described. For simplicity, a 16-bit signed binary fixed-point number is defined as single-precision data, and a 32-bit signed binary fixed-point number is defined as double-precision data. A case where multiplication of double-precision data and double-precision data is performed will be described. It is assumed that a double-precision multiplicand includes an upper word XH and a lower word XL, and a double-precision multiplier includes an upper word YH and a lower word YL. In this case, the data selecting means 11 selects the value "0" when performing the multiplication on the double precision multiplier lower word YL, and selects the MSB holding means 10 when performing the multiplication on the double precision multiplier upper word YH.
Shall be selected. The multiplicand determination signal C
1 is a signal which becomes active when the value is "1" when multiplication is performed on the double precision multiplicand lower word XL, and becomes inactive when the value is "0" when multiplication is performed on the double precision multiplicand upper word XH.
【0030】まず、倍精度被乗数下位ワードXLと倍精
度乗数下位ワードYLの積(以下XL×YL)を求め
る。倍精度乗数下位ワードYLは乗数エンコード手段1
2に入力され、その最上位ビットはMSB保持手段10
に保持される。データ選択手段11は値“0”を選択
し、乗数エンコード手段12へ出力する。乗数エンコー
ド手段12は倍精度乗数下位ワードYLとデータ選択手
段11の出力データをブースのアルゴリズムを用いて符
号化し、データ選択手段11の出力である値“0”は倍
精度乗数下位ワードYLの下位2ビットの符号化に用い
られる。被乗数判別信号C1は値“1”で能動状態であ
り入力された被乗数が倍精度被乗数下位ワードXLであ
ることを示す。乗算手段13は被乗数判別信号C1によ
り倍精度被乗数下位ワードXLの最上位ビットの1ビッ
ト上位に正数であることを示す符号として値“0”の符
号ビットを付加し、乗数エンコード手段12の出力との
積を求め33ビット幅で出力する。First, the product (hereinafter, XL × YL) of the double precision multiplicand lower word XL and the double precision multiplier lower word YL is obtained. The double precision multiplier lower word YL is a multiplier encoding means 1
2, the most significant bit of which is input to the MSB holding means 10
Is held. The data selector 11 selects the value “0” and outputs it to the multiplier encoder 12. The multiplier encoding means 12 encodes the double precision multiplier lower word YL and the output data of the data selection means 11 using the Booth algorithm, and the value “0” output from the data selection means 11 is lower than the double precision multiplier lower word YL. Used for 2-bit encoding. The multiplicand determination signal C1 is active at a value of "1", indicating that the input multiplicand is the double precision multiplicand lower word XL. The multiplication means 13 adds a sign bit of a value “0” as a sign indicating that it is a positive number to one bit higher than the most significant bit of the double precision multiplicand lower word XL based on the multiplicand discrimination signal C 1, And outputs it in a 33-bit width.
【0031】このとき、桁合わせ制御信号C2が(C2
-1,C2-0)=(0,0)で、桁合わせ手段16は値
“0”を選択し出力する。加算手段14は乗算手段13
の出力である積XL×YLと桁合わせ手段16の出力で
ある値“0”との加算結果を出力する。加算結果保持手
段15は加算手段14の出力である積XL×YLを保持
する。At this time, the digit alignment control signal C2 becomes (C2
(-1, C2-0) = (0, 0), and the digit matching means 16 selects and outputs the value "0". The adding means 14 is a multiplying means 13
The result of addition of the product XL × YL, which is the output of, and the value “0”, which is the output of the digit matching means 16, is output. The addition result holding means 15 holds the product XL × YL which is the output of the addition means 14.
【0032】次に、倍精度被乗数上位ワードXHと倍精
度乗数下位ワードYLの積(以下XH×YL)を求め
る。倍精度乗数下位ワードYLは倍精度乗数エンコード
手段12に入力され、その最上位ビットはMSB保持手
段10に保持される。データ選択手段11は値“0”を
選択し、乗数エンコード手段12へ出力する。乗数エン
コード手段12は倍精度乗数下位ワードYLとデータ選
択手段11の出力データをブースのアルゴリズムを用い
て符号化し、データ選択手段11の出力である値“0”
は倍精度乗数下位ワードYLの下位2ビットの符号化に
用いられる。被乗数判別信号C1は値“0”で非能動状
態であり入力された被乗数が倍精度被乗数上位ワードX
Hであることを示す。乗算手段13は被乗数判別信号C
1により倍精度被乗数上位ワードXHの最上位ビットで
ある符号ビットを1ビット符号拡張し、乗数エンコード
手段12の出力との積を求め33ビット幅で出力する。Next, the product of the double precision multiplicand upper word XH and the double precision multiplier lower word YL (hereinafter XH × YL) is determined. The double-precision multiplier lower word YL is input to the double-precision multiplier encoding unit 12, and the most significant bit thereof is held in the MSB holding unit 10. The data selector 11 selects the value “0” and outputs it to the multiplier encoder 12. The multiplier encoding means 12 encodes the double precision multiplier lower word YL and the output data of the data selecting means 11 using the Booth algorithm, and outputs the value “0” which is the output of the data selecting means 11.
Is used for encoding the lower 2 bits of the double precision multiplier lower word YL. The multiplicand determination signal C1 is inactive at a value "0", and the input multiplicand is the double precision multiplicand upper word X
H. The multiplication means 13 outputs the multiplicand determination signal C
The sign bit which is the most significant bit of the double precision multiplicand upper word XH is sign-extended by 1 bit by 1, and the product with the output of the multiplier encoding means 12 is obtained and output with a 33-bit width.
【0033】このとき、桁合わせ制御信号C2が(C2
-1,C2-0)=(1,0)で、桁合わせ手段16は加算
結果保持手段15が保持している積XL×YLを選択
し、桁合わせのために16ビット右シフトして出力す
る。加算手段14は乗算手段13の出力である積XH×
YLと桁合わせ手段16の出力である積XL×YLとの
加算結果を出力する。加算結果保持手段15は加算手段
14の出力であるXL×YL+XH×YLを保持する。At this time, the digit adjustment control signal C2 becomes (C2
(-1, C2-0) = (1, 0), and the digit matching means 16 selects the product XL × YL held by the addition result holding means 15 and shifts it by 16 bits to the right for digit alignment and outputs the result. I do. The adding means 14 outputs the product XH ×
An addition result of YL and a product XL × YL output from the digit matching means 16 is output. The addition result holding means 15 holds XL × YL + XH × YL output from the addition means 14.
【0034】次に、倍精度被乗数下位ワードXLと倍精
度乗数上位ワードYHの積(以下XL×YH)を求め
る。倍精度乗数上位ワードYHは乗数エンコード手段1
2に入力される。データ選択手段11はMSB保持手段
10の出力を選択し、MSB保持手段10が保持してい
る倍精度乗数下位ワードYLの最上位ビットのデータを
乗数エンコード手段12へ出力する。乗数エンコード手
段12は倍精度乗数上位ワードYHとデータ選択手段1
1の出力データをブースのアルゴリズムを用いて符号化
し、データ選択手段11の出力である倍精度乗数下位ワ
ードYLの最上位ビットのデータは倍精度乗数上位ワー
ドYHの下位2ビットの符号化に用いられる。被乗数判
別信号C1は値“1”で能動状態であり入力された被乗
数が倍精度被乗数下位ワードXLであることを示す。乗
算手段13は被乗数判別信号C1により倍精度被乗数下
位ワードXLの最上位ビットの1ビット上位に正数であ
ることを示す符号として値“0”の符号ビットを付加
し、乗数エンコード手段12の出力との積を求め33ビ
ット幅で出力する。Next, the product of the double precision multiplicand lower word XL and the double precision multiplier upper word YH (hereinafter, XL × YH) is obtained. Double precision multiplier upper word YH is multiplier encoding means 1
2 is input. The data selection means 11 selects the output of the MSB holding means 10 and outputs the data of the most significant bit of the double precision multiplier lower word YL held by the MSB holding means 10 to the multiplier encoding means 12. The multiplier encoding means 12 includes the double precision multiplier upper word YH and the data selecting means 1
1 is encoded using Booth's algorithm, and the data of the most significant bit of the double precision multiplier lower word YL output from the data selector 11 is used for encoding the lower 2 bits of the double precision multiplier upper word YH. Can be The multiplicand determination signal C1 is active at a value of "1", indicating that the input multiplicand is the double precision multiplicand lower word XL. The multiplication means 13 adds a sign bit of a value “0” as a sign indicating that it is a positive number to one bit higher than the most significant bit of the double precision multiplicand lower word XL based on the multiplicand discrimination signal C 1, And outputs it in a 33-bit width.
【0035】このとき、桁合わせ制御信号C2が(C2
-1,C2-0)=(0,1)で、桁合わせ手段16は加算
結果保持手段15が保持しているXL×YL+XH×Y
Lを選択し出力する。加算手段14は乗算手段13の出
力である積XL×YHと桁合わせ手段16の出力である
XL×YL+XH×YLとの加算結果を出力する。加算
結果保持手段15は加算手段14の出力であるXL×Y
L+XH×YL+XL×YHを保持する。At this time, the digit alignment control signal C2 becomes (C2
−1, C2−0) = (0, 1), and the digit aligning means 16 calculates XL × YL + XH × Y held by the addition result holding means 15.
Select and output L. The adding means 14 outputs the result of adding the product XL × YH output from the multiplying means 13 and XL × YL + XH × YL output from the digit matching means 16. The addition result holding means 15 is XL × Y which is the output of the addition means 14.
L + XH × YL + XL × YH is held.
【0036】最後に、倍精度被乗数上位ワードXHと倍
精度乗数上位ワードYHの積(以下XH×YH)を求め
る。倍精度乗数上位ワードYHは乗数エンコード手段1
2に入力される。データ選択手段11はMSB保持手段
10の出力を選択し、MSB保持手段10が保持してい
る倍精度乗数下位ワードYLの最上位ビットのデータを
乗数エンコード手段12へ出力する。乗数エンコード手
段12は倍精度乗数上位ワードYHとデータ選択手段1
1の出力データをブースのアルゴリズムを用いて符号化
し、データ選択手段11の出力である乗数下位ワードY
Lの最上位ビットのデータは乗数上位ワードYHの下位
2ビットの符号化に用いられる。被乗数判別信号C1は
値“0”で非能動状態であり入力された被乗数が倍精度
被乗数上位ワードXHであることを示す。乗算手段13
は被乗数判別信号C1により倍精度被乗数上位ワードX
Hの最上位ビットである符号ビットを1ビット符号拡張
し、乗数エンコード手段12の出力との積を求め33ビ
ット幅で出力する。Finally, the product of the double-precision multiplicand upper word XH and the double-precision multiplier upper word YH (hereinafter XH × YH) is obtained. Double precision multiplier upper word YH is multiplier encoding means 1
2 is input. The data selection means 11 selects the output of the MSB holding means 10 and outputs the data of the most significant bit of the double precision multiplier lower word YL held by the MSB holding means 10 to the multiplier encoding means 12. The multiplier encoding means 12 includes the double precision multiplier upper word YH and the data selecting means 1
1 is encoded using Booth's algorithm, and the multiplier lower word Y
The data of the most significant bit of L is used for encoding the lower two bits of the multiplier upper word YH. The multiplicand determination signal C1 is inactive at a value of "0", indicating that the input multiplicand is the double precision multiplicand upper word XH. Multiplication means 13
Is the double-precision multiplicand upper word X based on the multiplicand discrimination signal C1.
The sign bit which is the most significant bit of H is sign-extended by 1 bit, and the product of the sign bit and the output of the multiplier encoding means 12 is obtained and output with a 33-bit width.
【0037】このとき、桁合わせ制御信号C2が(C2
-1,C2-0)=(1,0)で、桁合わせ手段16は加算
結果保持手段15が保持しているXL×YL+XH×Y
L+XL×YHを選択し、桁合わせのために16ビット
右シフトして出力する。加算手段14は乗算手段13の
出力である積XH×YHと桁合わせ手段16の出力であ
るXL×YL+XH×YL+XL×YHの加算を行い加
算結果を出力する。この加算手段14の出力であるXL
×YL+XH×YL+XL×YH+XH×YHが倍精度
乗算の求める積となる。At this time, the digit alignment control signal C2 becomes (C2
−1, C2−0) = (1, 0), and the digit aligning means 16 stores XL × YL + XH × Y held by the addition result holding means 15.
L + XL × YH is selected, right-shifted by 16 bits for digit alignment, and output. The adding means 14 adds the product XH × YH output from the multiplying means 13 and XL × YL + XH × YL + XL × YH output from the digit matching means 16 and outputs an addition result. XL which is the output of the adding means 14
× YL + XH × YL + XL × YH + XH × YH is the product required for the double precision multiplication.
【0038】なお、上記実施の形態において、倍精度被
乗数上位ワードXH/下位ワードXLと倍精度乗数上位
ワードYH/下位ワードYLとの積をそれぞれ求め桁合
わせ加算を行う際に、倍精度乗数上位ワードYHの積を
求める前に少なくとも1つの倍精度乗数下位ワードYL
の積を求めMSB保持手段10に倍精度乗数下位ワード
YLの最上位ビットを保持すれば良く、本実施の形態で
は積XH×YLと積XL×YHを求める乗算と桁合わせ
加算を行う順序は入れ替わっても良い。倍精度データと
単精度データの乗算は単精度データを倍精度データの下
位ワードのデータが無いものと考え、その倍精度下位ワ
ードの積を求める過程を省けばよく、倍精度データと倍
精度データの乗算と同様にできる。In the above embodiment, when the product of the double-precision multiplicand upper word XH / lower word XL and the double-precision multiplier upper word YH / lower word YL are obtained and digit-alignment addition is performed, the double-precision multiplier upper word is used. At least one double-precision multiplier lower word YL before calculating the product of words YH
It is sufficient to hold the most significant bit of the double precision multiplier lower word YL in the MSB holding means 10. In this embodiment, the order in which the multiplication and the digit addition are performed to obtain the product XH × YL and the product XL × YH is as follows. May be interchanged. Multiplication of double-precision data and single-precision data is based on the assumption that single-precision data does not have data in the lower word of double-precision data, and the process of obtaining the product of the double-precision lower words can be omitted. Can be performed in the same way as
【0039】なお、上記説明では、前述したように、乗
算結果保持手段17および選択手段18,19は存在し
ないものとして説明したが、乗算手段13と加算手段1
4との間に乗算結果を保持する乗算結果保持手段17を
配置し、乗算処理と加算処理を並列に動作できるように
しても良い。なお、図1に示す選択手段18,19は、
それぞれ乗算器と倍精度加算器を単体で動作させる際
に、バスからデータを供給するために使用するものであ
り、本発明には直接関係はない。In the above description, as described above, the multiplication result holding means 17 and the selection means 18 and 19 are not provided.
The multiplication result holding means 17 for holding the multiplication result may be arranged between the control unit 4 and the control unit 4 so that the multiplication process and the addition process can be operated in parallel. The selecting means 18 and 19 shown in FIG.
These are used to supply data from the bus when the multiplier and the double-precision adder operate alone, and are not directly related to the present invention.
【0040】以下では、本実施の形態における構成要素
の内部構成と動作の詳細について、さらに図2〜図10
を参照しながら説明する。図2は倍精度乗算実行時の倍
精度乗数のデータ分割を説明するための模式図である。
図2中の波線はそのビットが負の重みを持つビットであ
ることを示す。上段に示してあるデータ列が倍精度乗数
を示している。ここでY31〜Y0 は各桁位置のデータを
示しており、最上位ビットであるY31が符号ビットであ
り、負の重みを持つ。「負の重みを持つ」という意味
は、そのビットが1ならば値“−1”であることを示
し、そのビットが0ならば値“0”であることを示すと
いうことである。中段に示してあるのは、倍精度乗数を
ブースのアルゴリズムに基づいて変形した場合の模式図
である。ここで、箱で囲まれた3つのデータが1つのブ
ースのエンコード値を示し、それぞれ偶数桁位置に−2
〜+2範囲の値をとる。ところが、本発明では単精度乗
算器を用いて高精度な倍精度乗算を効率良く行うことを
目的としており、倍精度乗数を一度にブースのアルゴリ
ズムで符号化することができない。そこで、倍精度乗数
上位ワードと下位ワードの境にあるデータに着目する
と、倍精度乗数下位ワードの最上位ビットにあたるY15
を倍精度乗数上位ワードの符号化に用いることができれ
ば、倍精度乗数の符号化を上手く実行することができる
ことが分かる。下段が本発明での倍精度乗数のデータ供
給を示している。先に倍精度乗数下位ワードの積を求め
る演算を行い、その際倍精度乗数下位ワードの最上位ビ
ットにあたるY15を保持しておく。次に倍精度乗数上位
ワードの積を求める際に、保持していた倍精度乗数下位
ワードの最上位ビットY15を倍精度乗数上位ワードの符
号化に用いるのである。ここで、図2中YHとYLはそ
れぞれ倍精度乗数上位ワードと下位ワードを示す。The details of the internal configuration and operation of the components in the present embodiment will be further described below with reference to FIGS.
This will be described with reference to FIG. FIG. 2 is a schematic diagram for explaining data division of a double precision multiplier when performing double precision multiplication.
The dashed line in FIG. 2 indicates that the bit is a bit having a negative weight. The data sequence shown in the upper row indicates a double precision multiplier. Here, Y31 to Y0 indicate data at each digit position, and the most significant bit, Y31, is a sign bit and has a negative weight. The meaning of “having a negative weight” means that if the bit is 1, it indicates the value “−1”, and if the bit is 0, it indicates the value “0”. Shown in the middle is a schematic diagram when the double precision multiplier is transformed based on Booth's algorithm. Here, three data items enclosed by a box indicate the encoded values of one booth, and -2 is set at an even digit position.
Take a value in the range of +2. However, an object of the present invention is to efficiently perform high-precision double-precision multiplication using a single-precision multiplier, and it is not possible to encode a double-precision multiplier at a time by the Booth algorithm. Focusing on data at the boundary between the double precision multiplier upper word and the lower precision word, Y15, which is the most significant bit of the double precision multiplier lower word,
Can be used for encoding the double-precision multiplier high-order word, the encoding of the double-precision multiplier can be performed well. The lower part shows the data supply of the double precision multiplier in the present invention. First, an operation for obtaining the product of the double precision multiplier lower words is performed. At this time, Y15, which is the most significant bit of the double precision multiplier lower words, is held. Next, when obtaining the product of the double precision multiplier upper word, the most significant bit Y15 of the stored double precision multiplier lower word is used for encoding the double precision multiplier upper word. Here, YH and YL in FIG. 2 indicate a double precision multiplier upper word and a lower precision multiplier word, respectively.
【0041】図3は倍精度被乗数上位ワードXHと倍精
度乗数上位ワードYH/下位ワードYLとの乗算実行時
のデータ出力形式を説明するための図である。図3中の
波線はそのビットが負の重みを持つビットであることを
示し、記号Sは符号ビットを示すが、マスクされている
Sがある場合、マスクされた記号Sは符号拡張された符
号ビットを示し、その1ビット下位の記号Sは符号ビッ
トではなく符号ビットと同じ値をとるデータビットであ
ることを示すようになる。また、記号0はデータとして
値“0”が付加されていることを示しており、一番上に
示してある21,20 ,2-1,…,2-31 は各桁位置で
の位取りを示している。FIG. 3 is a diagram for explaining a data output format at the time of performing multiplication of the double precision multiplicand upper word XH and the double precision multiplier upper word YH / lower word YL. The dashed line in FIG. 3 indicates that the bit is a bit having a negative weight, and the symbol S indicates a sign bit, but if there is a masked S, the masked symbol S is a sign-extended code. A sign S, which is one bit lower, indicates that it is not a sign bit but a data bit having the same value as the sign bit. Further, 2 1 symbol 0 indicates that it is added the value "0" as the data is shown on top, 2 0, 2 -1, ..., 2 -31 is at each digit position Indicates the scale.
【0042】ここで、通常の2つの単精度データの乗算
をすると、求める乗算結果は20 の桁位置に符号ビット
を持ち、2-1から2-30 の桁位置にデータビットを持つ
31ビット幅のデータになる。そこで、2-31 の桁位置
に値“0”を付加し32ビット幅の倍精度データとして
出力する。本発明では被乗数上位ワードYHを1ビット
符号拡張してあり、求める乗算結果は20 の桁位置の符
号ビットを21 の桁位置に1ビット符号拡張したものと
して得られる。この結果を32ビットのビット幅で出力
するならば、先に説明した単精度データの乗算を実行し
たときのデータ出力と整合性をとるために、図3中に
「32ビット出力」と示している範囲で出力する方が良
い。このとき、20 の桁位置が符号ビットになる。本発
明では、小数点位置より上位に少なくとも2つ以上の桁
をもつことにより倍精度のビット幅より少なくとも1ビ
ット多いビット幅でデータを出力する。ここで、2ビッ
ト、3ビット、あるいはそれ以上多いビット幅で出力す
ることは、1ビット多いビット幅で求めた積を符号拡張
することに他ならず回路規模が大きくなるだけなので、
本実施の形態ではこれ以降、求める積を小数点位置より
上位に少なくとも2つ以上の桁をもつことにより倍精度
のビット幅より1ビット多い33ビット幅で求めるもの
として説明する。また、図2で示した様に倍精度乗数を
データ分割することにより、倍精度乗数下位ワードYL
の最上位ビットY15を負の重みを持つデータとして扱え
るので、倍精度被乗数上位ワードXHと倍精度乗数下位
ワードYLとの積を求める際に、倍精度乗数下位ワード
YLをそのままブースのアルゴリズムで符号化すること
ができる。一方、倍精度被乗数上位ワードXHと倍精度
乗数上位ワードYHとの積を求める際は、倍精度乗数上
位ワードYHの符号化に倍精度乗数下位ワードYLの最
上位ビットY15のデータを用いる。以上のことから、図
3中では倍精度乗数下位ワードYLは単精度の符号付き
2進固定小数点数と同様の表現にしてあり、倍精度乗数
上位ワードYHの乗算の場合は倍精度乗数下位ワードY
Lの最上位ビットY15のデータを図示しなければならな
いが、ここではデータ出力形式を説明するのが目的なの
で簡単のために省いている。[0042] Here, if the multiplication of the normal two single-precision data, obtains the multiplication results with the sign bit in the digit position of the 2 0, 31 bits with data bits from the 2 -1 digit position of the 2 -30 It becomes width data. Therefore, a value “0” is added to the digit position of 2 −31 and output as 32-bit width double precision data. In the present invention Yes and 1 bit sign extension multiplicand upper word YH, it obtains the multiplication result is obtained as a 1-bit sign-extended sign bit of the digit positions of 2 0 to 2 1 digit position. If this result is output with a bit width of 32 bits, "32-bit output" is shown in FIG. 3 to ensure consistency with the data output when the multiplication of the single precision data described above is executed. It is better to output within the range. At this time, 2 0 digit position is the sign bit. In the present invention, data is output with a bit width that is at least one bit larger than the double precision bit width by having at least two digits higher than the decimal point position. Here, outputting with a bit width of 2 bits, 3 bits, or more requires only sign expansion of the product obtained with a bit width of 1 bit more, which simply increases the circuit scale.
In the present embodiment, hereinafter, the description will be made assuming that the product to be obtained has a 33-bit width that is one bit larger than the double precision bit width by having at least two digits higher than the decimal point position. Also, by dividing the double precision multiplier into data as shown in FIG. 2, the double precision multiplier lower word YL
Can be treated as data having a negative weight, so when calculating the product of the double-precision multiplicand upper word XH and the double-precision multiplier lower word YL, the double-precision multiplier lower word YL is directly encoded by Booth's algorithm. Can be On the other hand, when calculating the product of the double precision multiplicand upper word XH and the double precision multiplier upper word YH, the data of the most significant bit Y15 of the double precision multiplier lower word YL is used to encode the double precision multiplier upper word YH. From the above, in FIG. 3, the double precision multiplier lower word YL is represented in the same manner as a single precision signed binary fixed point number, and in the case of multiplication of the double precision multiplier upper word YH, the double precision multiplier lower word is used. Y
Although the data of the most significant bit Y15 of L must be shown, it is omitted here for the sake of simplicity because the purpose is to explain the data output format.
【0043】図4は倍精度被乗数下位ワードXLと倍精
度乗数上位ワードYH/下位ワードYLとの乗算実行時
のデータ出力形式を説明するための模式図である。図4
中の波線はそのビットが負の重みを持つビットであるこ
とを示し、記号Sは符号ビットを示す。また、記号0は
データとして値“0”が付加されていることを示してお
り、一番上に示してある21 ,20 ,2-1,…,2-31
は各桁位置での位取りを示している。FIG. 4 is a schematic diagram for explaining a data output format at the time of performing multiplication of the double precision multiplicand lower word XL and the double precision multiplier upper word YH / lower word YL. FIG.
The middle dashed line indicates that the bit is a bit having a negative weight, and the symbol S indicates a sign bit. Symbol 0 indicates that a value “0” is added as data, and the uppermost 2 1 , 2 0 , 2 −1 ,..., 2 −31
Indicates the scale at each digit position.
【0044】本発明では、倍精度被乗数下位ワードの最
上位ビットがデータビットになるので1ビット上位に正
数を示す符号として値“0”の符号ビットを付加してお
り、求める乗算結果は21 の桁位置が符号ビットであ
り、20 から2-30 の桁位置にデータビットを持つ32
ビット幅のデータとして得られる。この結果を32ビッ
トのビット幅で出力するならば、図4中に「32ビット
出力」と示している範囲で出力しなければならない。こ
の出力範囲を図3中に示してある「32ビット出力」の
範囲と比較すると出力する桁位置が1桁ずれていること
が分かる。つまり、「32ビット出力」する場合は出力
範囲を切り替える手段が必要になることが分かる。一方
本発明では、小数点位置より上位に少なくとも2つ以上
の桁をもつことにより倍精度のビット幅より1ビット多
い33ビット幅でデータを出力するので、図3中に示し
てある「33ビット出力」と全く同じ桁位置の関係でデ
ータを出力することができる。ここで、図3の説明の中
でも述べたように2-31 の桁位置には乗算によって得ら
れるデータがないので、値“0”を付加して出力する。In the present invention, since the most significant bit of the double-precision multiplicand lower word is a data bit, a sign bit of a value "0" is added as a sign indicating a positive number one bit higher. 1 digit position is the sign bit, 32 with data bits from the 2 0 digit position of the 2 -30
Obtained as bit-width data. If this result is output with a bit width of 32 bits, it must be output in the range indicated as "32-bit output" in FIG. Comparing this output range with the range of "32-bit output" shown in FIG. 3, it can be seen that the output digit position is shifted by one digit. In other words, it can be seen that a means for switching the output range is required for “32-bit output”. On the other hand, in the present invention, data is output with a 33-bit width that is one bit larger than the double-precision bit width by having at least two digits higher than the decimal point position. Can be output in exactly the same digit position relationship as "." Here, as described in the description of FIG. 3, since there is no data obtained by multiplication at the digit position of 2-31 , a value "0" is added and output.
【0045】また、図3と同様に倍精度乗数下位ワード
YLは単精度の符号付き2進固定小数点数と同様の表現
にしてあり、倍精度乗数上位ワードYHの乗算の場合は
倍精度乗数下位ワードYLの最上位ビットY15のデータ
を図示しなければならないが、ここではデータ出力形式
を説明するのが目的なので簡単のために省いている。図
5は32ビット幅で乗算結果を出力する従来の桁合わせ
ビットシフトを説明するための模式図である。図3と図
4で示した様に32ビット幅でデータを出力すると、倍
精度被乗数上位ワードXHの積と倍精度被乗数下位ワー
ドXLの積の桁位置の関係が1ビットずれるので、図5
に示してあるように倍精度乗算結果を求める際の桁合わ
せのためのシフト数がそれぞれ異なってしまう。Also, as in FIG. 3, the double precision multiplier lower word YL is expressed in the same manner as a single precision signed binary fixed point number, and in the case of multiplication of the double precision multiplier upper word YH, the double precision multiplier lower word YL is used. Although the data of the most significant bit Y15 of the word YL must be shown, it is omitted here for the sake of simplicity because the purpose is to explain the data output format. FIG. 5 is a schematic diagram for explaining a conventional digit shift bit shift for outputting a multiplication result with a 32-bit width. When data is output with a 32-bit width as shown in FIGS. 3 and 4, the relationship between the digit positions of the product of the double-precision multiplicand upper word XH and the product of the double-precision multiplicand lower word XL is shifted by 1 bit.
As shown in (1), the shift numbers for digit alignment when obtaining the double precision multiplication result are different from each other.
【0046】図6は33ビット幅で乗算結果を出力する
本発明の桁合わせビットシフトを説明するための図であ
る。33ビット幅でデータを出力すると、倍精度被乗数
上位ワードXHの積と倍精度被乗数下位ワードXLの積
の桁位置の関係が相対的に同じになるので、図6に示し
てあるように倍精度乗算結果を求める際の桁合わせのた
めのシフト数が相対的に単精度のビット幅に限定される
ことが分かる。したがって、桁合わせ手段16の回路規
模を、32ビット幅でデータを出力する従来例と比べて
削減することができる。FIG. 6 is a diagram for explaining the digit shift bit shift of the present invention for outputting a multiplication result with a width of 33 bits. When the data is output in a 33-bit width, the relationship between the product of the double precision multiplicand upper word XH and the digit position of the product of the double precision multiplicand lower word XL becomes relatively the same, and as shown in FIG. It can be seen that the shift number for digit alignment when obtaining the multiplication result is relatively limited to a single precision bit width. Therefore, the circuit scale of the digit aligning means 16 can be reduced as compared with the conventional example which outputs data with a 32-bit width.
【0047】図7は乗数エンコード手段12の回路構成
を示す回路図である。図7中の200は1つのエンコー
ド値を生成するブースエンコード手段を示す。乗数は2
次のブースのアルゴリズムによりエンコードされる。エ
ンコード結果BEi は−2,−1,0,1,2の5つの値
をとり、その値は1Ei ,2Ei およびSEi の3ビットで表
現され、その値の絶対値を2Ei ,1Ei の2ビットで示
し、負のときに1が立つことによりその値の正負をSEi
で示す。ただし、NSEiは部分積を生成する際に使用する
ために出力するSEi の反転信号である。ここで、i は
0,2,4,6,8,10,12,14であり、Y-1は
データ選択手段11の出力が入力される。FIG. 7 is a circuit diagram showing a circuit configuration of the multiplier encoding means 12. Reference numeral 200 in FIG. 7 denotes Booth encoding means for generating one encoded value. The multiplier is 2
Encoded by the next Booth algorithm. The encoding result BEi takes five values of -2, -1, 0, 1, and 2, and the value is expressed by 3 bits of 1Ei, 2Ei and SEi, and the absolute value of the value is expressed by 2 bits of 2Ei and 1Ei. When the value is 1 when the value is negative, the sign of the value is SEi.
Indicated by Note that NSEi is an inverted signal of SEi that is output for use in generating a partial product. Here, i is 0, 2, 4, 6, 8, 10, 12, and 14, and the output of the data selecting means 11 is input to Y-1.
【0048】図8は乗算手段13の構成を示すブロック
図である。図8中の符号300は被乗数拡張手段を示
し、符号301は部分積生成手段を示し、符号302は
部分積加算手段を示している。被乗数拡張手段300
は、被乗数判別信号C1が値“0”をとるときは被乗数
の最上位ビットX[15]を出力し、被乗数判別信号C1が
値“1”をとるときは値“0”を出力する。部分積生成
手段301は乗数エンコード手段12の出力と被乗数拡
張手段300の出力と被乗数X とからそれぞれ部分積を
生成する。部分積加算手段302はそれぞれ部分積生成
手段301が生成した部分積の加算を行い乗算結果を求
め、最下位ビットとなるビット0の桁位置には乗算によ
り得られるデータがないので値“0”を付加して出力す
る。FIG. 8 is a block diagram showing the structure of the multiplying means 13. Reference numeral 300 in FIG. 8 indicates a multiplicand extension unit, reference numeral 301 indicates a partial product generation unit, and reference numeral 302 indicates a partial product addition unit. Multiplicand expansion means 300
Outputs the most significant bit X [15] of the multiplicand when the multiplicand determination signal C1 takes a value "0", and outputs the value "0" when the multiplicand determination signal C1 takes a value "1". The partial product generation means 301 generates a partial product from the output of the multiplier encoding means 12, the output of the multiplicand expansion means 300, and the multiplicand X. The partial product addition means 302 adds the partial products generated by the partial product generation means 301 to obtain a multiplication result. Since there is no data obtained by multiplication at the digit position of bit 0 which is the least significant bit, the value "0" is obtained. Is added and output.
【0049】図9は乗算手段13の被乗数拡張手段30
0と部分積生成手段301の回路構成を示す回路図であ
る。図9中の符号303は生成される部分積の符号ビッ
トのビット反転を生成する部分積符号ビット反転生成回
路を示し、符号304は1ビット当りの部分積生成回路
を示し、符号305は補正項PPHを生成する部分積補
正項生成回路を示している。被乗数の最上位ビットの1
ビット上位に、被乗数判別信号C1が値“0”のときは
被乗数の符号ビットをそのまま出力し、被乗数判別信号
C1が値“1”のときは値“0”を出力する。エンコー
ド結果BEi が正のときは符号拡張した被乗数をそのまま
選択し、負のときはビット反転を選択する。複合ゲート
はエンコード結果BEi が1か−1のときは各々のビット
の選択値を出力し、エンコード結果BEi が2か−2のと
きは1ビット下位の選択値を出力し、エンコード結果BE
i が0のときは0を出力する。複合ゲートの出力が生成
される部分積のビットnの出力PPOn になる。2の補
数化のための補正項PPHは制御信号NSEiと2Ei と1Ei
の否定の論理積をとることにより生成される。これはエ
ンコード結果BEi が−1か−2のときに成り立ち、生成
する部分積の最下位ビットの桁位置に出力される。FIG. 9 shows the multiplicand expanding means 30 of the multiplying means 13.
FIG. 3 is a circuit diagram showing a circuit configuration of a zero and partial product generation means 301. Reference numeral 303 in FIG. 9 denotes a partial product sign bit inversion generating circuit that generates a bit inversion of the sign bit of the generated partial product, reference numeral 304 denotes a partial product generation circuit per bit, and reference numeral 305 denotes a correction term. 5 shows a partial product correction term generation circuit that generates PPH. 1 of the most significant bit of the multiplicand
When the multiplicand discrimination signal C1 has a value "0", the sign bit of the multiplicand is output as it is, and when the multiplicand discrimination signal C1 has a value "1", a value "0" is output. When the encoding result BEi is positive, the sign-extended multiplicand is selected as it is, and when it is negative, bit inversion is selected. The composite gate outputs the selected value of each bit when the encoding result BEi is 1 or -1, and outputs the selected value one bit lower when the encoding result BEi is 2 or -2.
When i is 0, 0 is output. The output of the composite gate is the output PPOn of bit n of the partial product to be generated. The correction term PPH for two's complement is calculated by the control signals NSEi, 2Ei and 1Ei
It is generated by taking the logical AND of negation. This is true when the encoding result BEi is -1 or -2, and is output at the least significant bit digit position of the generated partial product.
【0050】図10は乗算処理を説明するための模式図
である。図10中において記号D,E,F,G,H,
I,J,Kは生成される8個の部分積をそれぞれ示して
おり、記号Zは被乗数Xと乗数Yの積である。図10中
の一番上に示してある21 ,2 0 ,2-1,…,2-31 は
各桁位置での位取りを示している。また、データを示す
記号の上の傍線はビット反転を示している。ここで、図
10中に示されている値“1”は符号拡張の替わりに加
算されるデータである。FIG. 10 is a schematic diagram for explaining the multiplication process.
It is. In FIG. 10, symbols D, E, F, G, H,
I, J, and K indicate the generated eight partial products, respectively.
The symbol Z is the product of the multiplicand X and the multiplier Y. In FIG.
2 shown at the top of1, 2 0, 2-1, ..., 2-31Is
The scale at each digit position is shown. Also show the data
The horizontal line above the symbol indicates bit inversion. Where the figure
The value “1” shown in 10 is added in place of sign extension.
It is the data to be calculated.
【0051】先の傍線で示される各部分積の符号ビット
のビット反転と図10中に示されている値“1”を加え
ることで、部分積を足しあわせるときに符号ビットの桁
位置を合わせるために行う必要がある符号拡張と同等の
処理を行っている。これは通常良く用いられる方法であ
り、ここでは詳細は説明しない。乗算手段13では、図
10に示されているように部分積生成手段301によっ
て部分積が生成され、それらは部分積加算手段302に
よって加算される。なお、小数点位置の関係で図10中
の各部分積構成要素に付けてある番号と出力データZの
構成要素に付けてある番号の関係が1ビットずれてい
る。さらに、それぞれの部分積は2-31 の桁位置にはデ
ータを持たないのでZ0には常に値“0”が出力される。By adding the value "1" shown in FIG. 10 to the bit inversion of the sign bit of each partial product indicated by the preceding line, the digit position of the sign bit is adjusted when the partial products are added. Processing equivalent to the sign extension that needs to be performed. This is a commonly used method and will not be described in detail here. In the multiplication means 13, partial products are generated by a partial product generation means 301 as shown in FIG. 10, and they are added by a partial product addition means 302. Note that the relationship between the numbers assigned to the respective partial product components in FIG. 10 and the numbers assigned to the components of the output data Z is shifted by one bit due to the position of the decimal point. Furthermore, each of the partial products to digit position of 2 -31 is output is always the value "0" in Z0 since no data.
【0052】ここで、乗算手段13と加算手段14の間
に乗算結果を保持する乗算結果保持手段17を配置した
本実施の形態の演算装置で、倍精度データと倍精度デー
タの乗算と、倍精度データと単精度データの乗算を実行
する際の命令を表1に示す。Here, in the arithmetic unit of this embodiment in which the multiplication result holding means 17 for holding the multiplication result is arranged between the multiplication means 13 and the addition means 14, the multiplication of the double precision data by the double precision data Table 1 shows instructions for executing multiplication of precision data and single precision data.
【0053】[0053]
【表1】表1に示すAからDの命令を順次実行すること
により4つの積XL×YL、XH×YL、XL×YH、
XH×YHを順次求め、これらを桁合わせ加算すること
により倍精度データと倍精度データの乗算は実行され
る。また、表1に示すE,Fの命令を順次実行すること
により2つの積XL×YH、XH×YHを順次求め、桁
合わせ加算することにより倍精度データと単精度データ
の乗算は実行される。表1はMSB保持手段10とデー
タ選択手段11と乗数エンコード手段12による乗数エ
ンコード処理と、乗算手段13による乗算処理と、加算
手段14と桁合わせ手段16による加算処理におけるデ
ータの流れと処理内容を示している。ここで、表1中の
R0はMSB保持手段10を示し、R1は乗算結果保持
手段17を示し、R2は加算結果保持手段15を示して
いる。[Table 1] By sequentially executing the instructions A to D shown in Table 1, four products XL × YL, XH × YL, XL × YH,
XH × YH are sequentially obtained, and the multiplication of the double-precision data and the double-precision data is performed by digit-aligning and adding them. Further, by sequentially executing the instructions of E and F shown in Table 1, two products XL × YH and XH × YH are sequentially obtained, and multiplication of the double precision data and the single precision data is performed by adding digits. . Table 1 shows data flows and processing contents in the multiplier encoding process by the MSB holding unit 10, the data selection unit 11, and the multiplier encoding unit 12, the multiplication process by the multiplication unit 13, and the addition process by the addition unit 14 and the digit matching unit 16. Is shown. Here, R0 in Table 1 indicates the MSB holding unit 10, R1 indicates the multiplication result holding unit 17, and R2 indicates the addition result holding unit 15.
【0054】表1において、それぞれの命令は2サイク
ル命令である。エンコード処理の欄では、MSB保持手
段10へのデータ格納とデータ選択手段11の選択する
データを示し、括弧内の記述(命令C,DにおけるYL
[15])はその命令実行時にMSB保持手段10に保持さ
れているデータを示している。乗算処理の欄では、乗算
手段13で求める乗算結果を示している。加算処理の欄
では、桁合わせ手段16で選択されるデータと桁合わせ
のための16ビット右シフト処理の有無と、加算手段1
4で求める加算結果を示している。In Table 1, each instruction is a two-cycle instruction. In the column of the encoding process, data stored in the MSB holding unit 10 and data selected by the data selecting unit 11 are shown, and the description in parentheses (YL in the instructions C and D) is shown.
[15]) indicates data held in the MSB holding means 10 at the time of execution of the instruction. In the column of the multiplication process, the multiplication result obtained by the multiplication means 13 is shown. In the column of addition processing, the data selected by the digit alignment means 16 and the presence / absence of 16-bit right shift processing for digit alignment,
4 shows the addition result obtained.
【0055】以上のように第1の実施の形態によれば、
乗算手段13の乗算結果を小数点位置より上位に少なく
とも2つ以上の桁をもつことにより倍精度のビット幅よ
り少なくとも1ビット多いビット幅で出力する、例えば
33ビット幅で出力することにより、桁合わせのための
シフト数が相対的に単精度のビット幅に限定されるとい
うように、従来例に対し、桁合わせ手段16の回路規模
が小さくなり、被乗数下位ワードをソースとする乗算を
実行したときに乗算結果を32ビット精度で出力するた
めに必要な1ビット右シフト手段が不要になる。As described above, according to the first embodiment,
The multiplication result of the multiplication means 13 is output with a bit width at least one bit larger than the double precision bit width by having at least two or more digits higher than the decimal point position. When the multiplication using the multiplicand lower word as the source is performed, the circuit scale of the digit aligning means 16 is smaller than that of the conventional example such that the shift number for Therefore, the 1-bit right shift means required to output the multiplication result with 32-bit precision becomes unnecessary.
【0056】また、乗算結果保持手段17を設け、乗算
手段13と加算手段14とを並列に動作させることによ
り、演算時間の短縮を図ることができる。 〔第2の実施の形態〕以下本発明の第2の実施の形態に
ついて説明する。第2の実施の形態の構成は、第1の実
施の形態において、乗数エンコード手段12が、乗数制
御信号C3が値“1”をとるときに入力される乗数の最
下位ビットを強制的に値“0”に設定する機能を有する
ように構成され、乗算手段13が、被乗数制御信号C4
が値“1”をとるときに入力される被乗数の最下位ビッ
トを強制的に値“0”に設定する機能を有するように構
成される。Further, by providing the multiplication result holding means 17 and operating the multiplication means 13 and the addition means 14 in parallel, the calculation time can be reduced. [Second Embodiment] A second embodiment of the present invention will be described below. The configuration of the second embodiment is different from the first embodiment in that the multiplier encoding means 12 forcibly sets the least significant bit of the multiplier input when the multiplier control signal C3 takes the value "1" to the value. The multiplication means 13 is configured to have a function of setting to “0”, and the multiplication means 13
Has a function of forcibly setting the least significant bit of the multiplicand that is input when takes a value “1” to a value “0”.
【0057】図11は第2の実施の形態における乗数エ
ンコード手段12の回路構成を示す図である。図11中
の符号201は乗数制御信号C3が値“1”をとると
き、乗数の最下位ビットを強制的に値“0”に設定する
乗数制御手段である。この乗数制御手段201は、乗数
の最下位ビットであるY0と乗数制御信号C3の論理反
転との論理積をとることにより、乗数制御信号C3が値
“1”をとるとき、乗数の最下位ビットY0を強制的に
値“0”に設定している。FIG. 11 is a diagram showing a circuit configuration of the multiplier encoding means 12 according to the second embodiment. Reference numeral 201 in FIG. 11 denotes multiplier control means for forcibly setting the least significant bit of the multiplier to a value "0" when the multiplier control signal C3 takes a value "1". When the multiplier control signal C3 takes a value "1", the multiplier control means 201 performs a logical product of the least significant bit Y0 of the multiplier and the logical inversion of the multiplier control signal C3. Y0 is forcibly set to the value "0".
【0058】図12は第2の実施の形態における乗算手
段13の構成を示すブロック図である。図12中の符号
306は被乗数制御信号C4が値“1”をとるときに、
被乗数の最下位ビットを強制的に値“0”に設定する被
乗数制御手段である。この被乗数制御手段306は、被
乗数の最下位ビットであるX0 と被乗数制御信号C4の
論理反転との論理積をとることにより、被乗数制御信号
C4が値“1”をとるとき被乗数の最下位ビットX0 を
強制的に値“0”に設定している。FIG. 12 is a block diagram showing a configuration of the multiplying means 13 in the second embodiment. Reference numeral 306 in FIG. 12 indicates that when the multiplicand control signal C4 takes a value “1”,
The multiplicand control means forcibly sets the least significant bit of the multiplicand to a value “0”. The multiplicand control means 306 calculates the logical product of the least significant bit X0 of the multiplicand and the logical inversion of the multiplicand control signal C4, so that when the multiplicand control signal C4 takes the value "1", the least significant bit X0 of the multiplicand. Is forcibly set to the value “0”.
【0059】以上のように構成された演算装置につい
て、その動作を説明する。単精度乗算器を用いて倍精度
乗算を行う方法として以下の方法がよく用いられる。そ
れぞれ乗数下位ワードと被乗数下位ワードを単精度の符
号付き2進固定小数点数として扱うために、1ビット右
シフトして最上位ビットに正数を示す符号として値
“0”の符号ビットを付加し、最下位ビットを切り捨て
るのである。このため倍精度データと倍精度データの乗
算結果は31ビット×31ビット精度になり、倍精度デ
ータと単精度データの乗算結果は31ビット×16ビッ
ト精度になる。The operation of the arithmetic unit configured as described above will be described. The following method is often used as a method for performing double precision multiplication using a single precision multiplier. In order to treat the multiplier lower word and the multiplicand lower word as single-precision signed binary fixed-point numbers, respectively, shift right by one bit and add a sign bit of a value “0” to the most significant bit as a sign indicating a positive number. , The least significant bit is truncated. For this reason, the result of multiplication of the double precision data and the double precision data is 31 bits × 31 bits, and the result of multiplication of the double precision data and the single precision data is 31 bits × 16 bits.
【0060】第1の実施の形態では、倍精度データと倍
精度データの乗算を32ビット×32ビット精度で、倍
精度データと単精度データの乗算を32ビット×16ビ
ット精度で実行することができる。この第2の実施の形
態によれば、第1の実施の形態の構成に対し、乗数エン
コード手段12に乗数制御手段201を、乗算手段13
に被乗数制御手段306を設けるというわずかな回路を
付加することにより、31ビット×31ビット精度と3
1ビット×16ビット精度の倍精度乗算を実行できる。In the first embodiment, the multiplication of double-precision data and double-precision data can be performed with 32-bit × 32-bit precision, and the multiplication of double-precision data with single-precision data can be performed with 32-bit × 16-bit precision. it can. According to the second embodiment, in the configuration of the first embodiment, the multiplier encoding means 12 is provided with the multiplier control means 201 and the multiplier means 13 is provided with the multiplier means 13.
By adding a small circuit of providing a multiplicand control means 306 to the
Double precision multiplication of 1 bit × 16 bit precision can be executed.
【0061】第2の実施の形態を用いることにより、本
発明の演算装置は、それぞれ乗数と被乗数の最下位ビッ
トを強制的に値“0”にする機能を有することにより、
低精度の倍精度乗算を用いたアプリケーションとの互換
性をとることができる。 〔第3の実施の形態〕以下本発明の第3の実施の形態に
ついて説明する。By using the second embodiment, the arithmetic unit of the present invention has the function of forcibly setting the least significant bits of the multiplier and the multiplicand to the value "0", respectively.
Compatibility with applications using low-precision double-precision multiplication can be achieved. [Third Embodiment] A third embodiment of the present invention will be described below.
【0062】第3の実施の形態の構成は、第1の実施の
形態において、MSB保持手段10が、保持データ選択
信号C5が値“1”をとるときは乗数の最上位ビットを
選択保持し、保持データ選択信号C5が値“0”をとる
ときは値“0”を選択保持する機能を有するように構成
される。ここで、乗算手段13と加算手段14の間に乗
算結果を保持する乗算結果保持手段17を配置した本実
施の形態の演算装置で、倍精度データと倍精度データの
乗算と、倍精度データと単精度データの乗算を実行する
際の命令を表2に示す。The configuration of the third embodiment is different from that of the first embodiment in that the MSB holding means 10 selects and holds the most significant bit of the multiplier when the held data selection signal C5 takes the value "1". When the held data selection signal C5 takes the value "0", the function of selecting and holding the value "0" is provided. Here, in the arithmetic device of the present embodiment in which the multiplication result holding means 17 for holding the multiplication result is arranged between the multiplication means 13 and the addition means 14, the multiplication of the double precision data and the double precision data, Table 2 shows instructions for executing multiplication of single precision data.
【0063】[0063]
【表2】表2に示すAからDの命令を順次実行すること
により4つの積XL×YL、XH×YL、XL×YH、
XH×YHを順次求め、これらを桁合わせ加算すること
により倍精度データと倍精度データの乗算は実行され
る。また、表2に示すA(E),D(F)の命令を順次
実行することにより2つの積XL×YH、XH×YHを
順次求め、桁合わせ加算することにより倍精度データと
単精度データの乗算は実行される。表2はMSB保持手
段10とデータ選択手段11と乗数エンコード手段12
による乗数エンコード処理と、乗算手段13による乗算
処理と、加算手段14と桁合わせ手段16による加算処
理におけるデータの流れと処理内容を示している。ここ
で、表2中のR0はMSB保持手段10を示し、R1は
乗算結果保持手段17を示し、R2は加算結果保持手段
15を示している。[Table 2] By sequentially executing the instructions A to D shown in Table 2, the four products XL × YL, XH × YL, XL × YH,
XH × YH are sequentially obtained, and the multiplication of the double-precision data and the double-precision data is performed by digit-aligning and adding them. Further, by sequentially executing the instructions of A (E) and D (F) shown in Table 2, two products XL × YH and XH × YH are sequentially obtained, and double-precision data and single-precision data are obtained by adding digits. Is performed. Table 2 shows MSB holding means 10, data selecting means 11, multiplier encoding means 12
2 shows the flow of data and the contents of processing in the multiplier encoding process by the multiplication unit 13, the multiplication process by the multiplication unit 13, and the addition process by the addition unit 14 and the digit matching unit 16. Here, R0 in Table 2 indicates the MSB holding unit 10, R1 indicates the multiplication result holding unit 17, and R2 indicates the addition result holding unit 15.
【0064】表2において、それぞれの命令は2サイク
ル命令である。エンコード処理の欄では、MSB保持手
段10へのデータ格納とデータ選択手段11の選択する
データを示し、括弧内の記述(命令C,DにおけるYL
[15]と命令D(F)における0)はその命令実行時にM
SB保持手段10に保持されているデータを示してい
る。乗算処理の欄では、乗算手段13で求める乗算結果
を示している。加算処理の欄では、桁合わせ手段16で
選択されるデータと桁合わせのための16ビット右シフ
ト処理の有無と、加算手段14で求める加算結果を示し
ている。In Table 2, each instruction is a two-cycle instruction. In the column of the encoding process, data stored in the MSB holding unit 10 and data selected by the data selecting unit 11 are shown, and the description in parentheses (YL in the instructions C and D) is shown.
[15] and 0) in the instruction D (F)
2 shows data held in the SB holding unit 10. In the column of the multiplication process, the multiplication result obtained by the multiplication means 13 is shown. In the column of the addition processing, the data selected by the digit alignment means 16, the presence / absence of 16-bit right shift processing for digit alignment, and the addition result obtained by the addition means 14 are shown.
【0065】ここで、先に示した表1と比較すると、表
2では、命令Aで、MSB保持手段10に格納するデー
タを値“0”にしている。このことにより、命令Aと命
令Dの組み合わせで倍精度データと単精度データの乗算
を実現することができる。したがって、第3の実施の形
態によれば、倍精度データと倍精度データの乗算と、倍
精度データと単精度データの乗算とを実行するために必
要な命令数を命令の共通化によって削減できる。Here, in comparison with Table 1 shown above, in Table 2, the data stored in the MSB holding means 10 by the instruction A is set to the value “0”. Thus, the multiplication of the double precision data and the single precision data can be realized by the combination of the instruction A and the instruction D. Therefore, according to the third embodiment, the number of instructions required to execute multiplication of double-precision data and double-precision data and multiplication of double-precision data and single-precision data can be reduced by sharing instructions. .
【0066】[0066]
【発明の効果】本発明の演算方法によれば、小数点位置
より上位に少なくとも2つ以上の桁をもつことにより倍
精度のビット幅より少なくとも1ビット多いビット幅で
求めた各々の積の桁合わせのためのシフト数は、相対的
に同じビット幅に限定され、桁合わせ手段の回路規模を
減らし効率良く倍精度乗算を実現することができる。According to the operation method of the present invention, the digit alignment of each product obtained with a bit width at least one bit larger than the double precision bit width by having at least two digits higher than the decimal point position. The number of shifts is relatively limited to the same bit width, so that the circuit scale of the digit aligning means can be reduced and double precision multiplication can be realized efficiently.
【0067】本発明の演算装置によれば、乗算手段が小
数点位置より上位に少なくとも2つ以上の桁をもつこと
によって倍精度のビット幅より少なくとも1ビット多い
ビット幅で乗算結果を出力することにより、各々の乗算
結果の桁合わせのためのシフト数は、相対的に同じビッ
ト幅に限定され、桁合わせ手段の回路規模を減らし効率
良く倍精度乗算を実現することができる。According to the arithmetic unit of the present invention, since the multiplication means has at least two or more digits higher than the decimal place, the multiplication means outputs the multiplication result with a bit width at least one bit larger than the double precision bit width. The number of shifts for digit alignment of each multiplication result is relatively limited to the same bit width, so that the circuit scale of the digit alignment means can be reduced and efficient double precision multiplication can be realized.
【図1】本発明の第1の実施の形態の演算装置の構成を
示すブロック図である。FIG. 1 is a block diagram illustrating a configuration of an arithmetic device according to a first embodiment of this invention.
【図2】倍精度乗数のデータ分割を説明するための模式
図である。FIG. 2 is a schematic diagram for explaining data division of a double precision multiplier.
【図3】被乗数上位ワードと乗数上位ワード/下位ワー
ドとの積のデータ出力形式を説明するための模式図であ
る。FIG. 3 is a schematic diagram for explaining a data output format of a product of a multiplicand upper word and a multiplier upper word / lower word.
【図4】被乗数下位ワードと乗数上位ワード/下位ワー
ドとの積のデータ出力形式を説明するための模式図であ
る。FIG. 4 is a schematic diagram for explaining a data output format of a product of a multiplicand lower word and a multiplier upper word / lower word.
【図5】従来の桁合わせビットシフトを説明するための
模式図である。FIG. 5 is a schematic diagram for explaining a conventional digit alignment bit shift.
【図6】本発明の第1の実施の形態の桁合わせビットシ
フトを説明するための模式図である。FIG. 6 is a schematic diagram for explaining a digit alignment bit shift according to the first embodiment of this invention.
【図7】乗数エンコード手段の回路構成を示す回路図で
ある。FIG. 7 is a circuit diagram showing a circuit configuration of multiplier encoding means.
【図8】乗算手段の構成を示すブロック図である。FIG. 8 is a block diagram illustrating a configuration of a multiplication unit.
【図9】乗算手段の被乗数拡張手段と部分積生成手段の
回路構成を示す回路図である。FIG. 9 is a circuit diagram showing a circuit configuration of a multiplicand expansion unit and a partial product generation unit of the multiplication unit.
【図10】乗算処理を説明するための模式図である。FIG. 10 is a schematic diagram for explaining a multiplication process.
【図11】本発明の第2の実施の形態における乗数エン
コード手段の回路構成を示す回路図である。FIG. 11 is a circuit diagram showing a circuit configuration of multiplier encoding means according to the second embodiment of the present invention.
【図12】本発明の第2の実施の形態における乗算手段
の構成を示すブロック図である。FIG. 12 is a block diagram illustrating a configuration of a multiplying unit according to a second embodiment of the present invention.
10 MSB保持手段 11 データ選択手段 12 乗数縁コード手段 13 乗算手段 14 加算手段 15 加算結果保持手段 16 桁合わせ手段 17 乗算結果選択手段 18,19 選択手段 20 記憶手段 200 ブースエンコード手段 201 乗数制御手段 300 被乗数拡張手段 301 部分積生成手段 302 部分積加算手段 303 部分積符号ビット反転生成回路 304 部分積生成回路 305 部分積補正項生成回路 306 被乗数制御手段 DESCRIPTION OF SYMBOLS 10 MSB holding means 11 Data selection means 12 Multiplier edge code means 13 Multiplication means 14 Addition means 15 Addition result holding means 16 Digit alignment means 17 Multiplication result selection means 18, 19 Selection means 20 Storage means 200 Booth encoding means 201 Multiplier control means 300 Multiplicand expansion means 301 Partial product generation means 302 Partial product addition means 303 Partial product sign bit inversion generation circuit 304 Partial product generation circuit 305 Partial product correction term generation circuit 306 Multiplicand control means
─────────────────────────────────────────────────────
────────────────────────────────────────────────── ───
【手続補正書】[Procedure amendment]
【提出日】平成10年9月10日[Submission date] September 10, 1998
【手続補正1】[Procedure amendment 1]
【補正対象書類名】明細書[Document name to be amended] Statement
【補正対象項目名】0053[Correction target item name] 0053
【補正方法】変更[Correction method] Change
【補正内容】[Correction contents]
【0053】[0053]
【表1】 表1に示すAからDの命令を順次実行することにより4
つの積XL×YL、XH×YL、XL×YH、XH×Y
Hを順次求め、これらを桁合わせ加算することにより倍
精度データと倍精度データの乗算は実行される。また、
表1に示すE,Fの命令を順次実行することにより2つ
の積XL×YH、XH×YHを順次求め、桁合わせ加算
することにより倍精度データと単精度データの乗算は実
行される。表1はMSB保持手段10とデータ選択手段
11と乗算エンコード手段12による乗数エンコード処
理と、乗算手段13による乗算処理と、加算手段14と
桁合わせ手段16による加算処理におけるデータの流れ
と処理内容を示している。ここで、表1中のR0はMS
B保持手段10を示し、R1は乗算結果保持手段17を
示し、R2は加算結果保持手段15を示している。[Table 1] By sequentially executing the instructions A to D shown in Table 1, 4
Product XL × YL, XH × YL, XL × YH, XH × Y
By multiplying the double precision data and the double precision data by sequentially obtaining H and digit-aligning and adding them, multiplication is performed. Also,
By sequentially executing the instructions E and F shown in Table 1, two products XL × YH and XH × YH are sequentially obtained, and multiplication of the double precision data and the single precision data is performed by adding digits. Table 1 shows the data flow and processing contents in the multiplier encoding process by the MSB holding unit 10, the data selection unit 11, and the multiplication encoding unit 12, the multiplication process by the multiplication unit 13, and the addition process by the addition unit 14 and the digit matching unit 16. Is shown. Here, R0 in Table 1 is MS
The B holding means 10 is shown, R1 is the multiplication result holding means 17, and R2 is the addition result holding means 15.
【手続補正2】[Procedure amendment 2]
【補正対象書類名】明細書[Document name to be amended] Statement
【補正対象項目名】0063[Correction target item name] 0063
【補正方法】変更[Correction method] Change
【補正内容】[Correction contents]
【0063】[0063]
【表2】 表2に示すAからDの命令を順次実行することにより4
つの積XL×YL、XH×YL、XL×YH、XH×Y
Hを順次求め、これらを桁合わせ加算することにより倍
精度データと倍精度データの乗算は実行される。また、
表2に示すA(E),D(F)の命令を順次実行するこ
とにより2つの積XL×YH、XH×YHを順次求め、
桁合わせ加算することにより倍精度データと単精度デー
タの乗算は実行される。表2はMSB保持手段10とデ
ータ選択手段11と乗算エンコード手段12による乗数
エンコード処理と、乗算手段13による乗算処理と、加
算手段14と桁合わせ手段16による加算処理における
データの流れと処理内容を示している。ここで、表2中
のR0はMSB保持手段10を示し、R1は乗算結果保
持手段17を示し、R2は加算結果保持手段15を示し
ている。[Table 2] By sequentially executing the instructions A to D shown in Table 2, 4
Product XL × YL, XH × YL, XL × YH, XH × Y
By multiplying the double precision data and the double precision data by sequentially obtaining H and digit-aligning and adding them, multiplication is performed. Also,
By sequentially executing the instructions of A (E) and D (F) shown in Table 2, two products XL × YH and XH × YH are sequentially obtained.
The multiplication of the double precision data and the single precision data is performed by performing the digit addition. Table 2 shows the data flow and processing contents in the multiplier encoding process by the MSB holding unit 10, the data selection unit 11, and the multiplication encoding unit 12, the multiplication process by the multiplication unit 13, and the addition process by the addition unit 14 and the digit matching unit 16. Is shown. Here, R0 in Table 2 indicates the MSB holding unit 10, R1 indicates the multiplication result holding unit 17, and R2 indicates the addition result holding unit 15.
Claims (15)
上位ビットと前記最上位ビットより1ビット下位ビット
との間を小数点位置とする2進固定小数点数体系におい
て、単精度乗算器を用いて倍精度被乗数の上位ワード/
下位ワードと倍精度乗数の上位ワード/下位ワードとの
各々の積を求め、この求めた積について各々桁合わせ加
算を行い倍精度乗算結果を得る演算方法であって、 前記倍精度被乗数の上位ワード/下位ワードと倍精度乗
数の上位ワード/下位ワードとの各々の積を、小数点位
置より上位に少なくとも2つ以上の桁をもつことにより
倍精度ビット幅より少なくとも1ビット多いビット幅で
求めることを特徴とする演算方法。1. A binary fixed-point number system in which a most significant bit is a sign bit and a decimal point position is between the most significant bit and one bit lower than the most significant bit, using a single precision multiplier. High-order word of double precision multiplicand /
An arithmetic method for obtaining a product of each of a lower word and an upper word / lower word of a double precision multiplier, and performing a digit-matching addition on each of the obtained products to obtain a double precision multiplication result, wherein the upper word of the double precision multiplicand is obtained. The product of each of the / lower word and the upper word / lower word of the double precision multiplier has a bit width at least one bit larger than the double precision bit width by having at least two digits higher than the decimal point position. Characteristic calculation method.
下位ワードと前記倍精度乗数の下位ワードの積を求める
際に、 前記倍精度被乗数の下位ワード最上位ビットの1ビット
上位に正数であることを示す符号ビットを持つ、単精度
ビット幅より1ビット多いビット幅のデータと、 前記倍精度乗数の下位ワード最上位ビットを符号ビット
とした、単精度ビット幅のデータとの乗算を行い、 倍精度ビット幅を持つ乗算結果の最下位ビットの1ビッ
ト下位に値“0”のデータを付加し、倍精度ビット幅よ
り1ビット多いビット幅のデータを前記倍精度被乗数の
下位ワードと前記倍精度乗数の下位ワードの積として出
力することを特徴とする請求項1に記載の演算方法。2. The single-precision multiplier, when calculating the product of the lower word of the double-precision multiplicand and the lower word of the double-precision multiplicand, adds a positive number one bit higher than the most significant bit of the lower word of the double-precision multiplicand. The multiplication of data having a bit width that is one bit larger than the single precision bit width and a single precision bit width data having the most significant bit of the lower word of the double precision multiplier as a sign bit having a sign bit indicating that Then, data of a value “0” is added to the lower bit of the least significant bit of the multiplication result having the double precision bit width, and data having a bit width one bit larger than the double precision bit width is added to the lower word of the double precision multiplicand. 2. The method according to claim 1, wherein the output is performed as a product of lower words of the double precision multiplier.
上位ワードと前記倍精度乗数の下位ワードの積を求める
際に、 前記倍精度被乗数の上位ワード最上位ビットの符号ビッ
トを1ビット符号拡張した、単精度ビット幅より1ビッ
ト多いビット幅のデータと、 前記倍精度乗数の下位ワード最上位ビットを符号ビット
とした、単精度ビット幅のデータとの乗算を行い、 倍精度ビット幅を持つ乗算結果の最下位ビットの1ビッ
ト下位に値“0”のデータを付加し、倍精度ビット幅よ
り1ビット多いビット幅のデータを前記倍精度被乗数の
上位ワードと前記倍精度乗数の下位ワードの積として出
力することを特徴とする請求項1に記載の演算方法。3. The single-precision multiplier, when calculating a product of an upper word of the double-precision multiplicand and a lower word of the double-precision multiplicand, encodes a sign bit of an upper-order word of the double-precision multiplicand by a one-bit code. Multiplying the expanded data having a bit width one bit larger than the single precision bit width and single precision bit width data having the most significant bit of the lower word of the double precision multiplier as a sign bit, The data having a value “0” is added to the lower one bit of the least significant bit of the multiplication result, and the data having a bit width one bit larger than the double precision bit width is transferred to the upper word of the double precision multiplicand and the lower word of the double precision multiplier The method according to claim 1, wherein the output is a product of
下位ワードと前記倍精度乗数の上位ワードの積を求める
際に、 前記倍精度被乗数の下位ワード最上位ビットの1ビット
上位に正数であることを示す符号ビットを持つ、単精度
ビット幅より1ビット多いビット幅のデータと、 前記倍精度乗数の上位ワード最下位ビットの桁位置に前
記倍精度乗数の下位ワード最上位ビットと同じ値を持つ
データを加えた、単精度ビット幅のデータとの乗算を行
い、 倍精度ビット幅を持つ乗算結果の最下位ビットの1ビッ
ト下位に値“0”のデータを付加し、倍精度ビット幅よ
り1ビット多いビット幅のデータを前記倍精度被乗数の
下位ワードと前記倍精度乗数の上位ワードの積として出
力することを特徴とする請求項1に記載の演算方法。4. When calculating the product of the lower word of the double-precision multiplicand and the upper word of the double-precision multiplier, the single-precision multiplier adds a positive number one bit higher than the most significant bit of the lower word of the double-precision multiplicand. Having a sign bit indicating that the bit width is one bit larger than the single precision bit width, and the same as the least significant bit of the lower word of the double precision multiplier at the digit position of the lower word of the upper word of the double precision multiplier Multiplies data with a single-precision bit width to which data having a value is added, and adds data with a value “0” to the lower bit of the multiplication result having a double-precision bit width, and adds data with a value “0” to the double-precision bit The method according to claim 1, wherein data having a bit width one bit larger than the width is output as a product of a lower word of the double precision multiplicand and an upper word of the double precision multiplier.
上位ワードと前記倍精度乗数の上位ワードの積を求める
際に、 前記倍精度被乗数の上位ワード最上位ビットの符号ビッ
トを1ビット符号拡張した、単精度ビット幅より1ビッ
ト多いビット幅のデータと、 前記倍精度乗数の上位ワード最下位ビットの桁位置に前
記倍精度乗数の下位ワード最上位ビットと同じ値を持つ
データを加えた、単精度ビット幅のデータとの乗算を行
い、 倍精度ビット幅を持つ乗算結果の最下位ビットの1ビッ
ト下位に値“0”のデータを付加し、倍精度ビット幅よ
り1ビット多いビット幅のデータを前記倍精度被乗数の
上位ワードと前記倍精度乗数の上位ワードの積として出
力することを特徴とする請求項1に記載の演算方法。5. The single-precision multiplier, when calculating the product of the high-order word of the double-precision multiplicand and the high-order word of the double-precision multiplicand, codes the sign bit of the high-order word of the double-precision multiplicand by one bit. Expanded data having a bit width one bit larger than the single precision bit width, and data having the same value as the least significant bit of the lower word of the double precision multiplier are added to the digit position of the lower word of the upper word of the double precision multiplier. , Multiplies with single precision bit width data, adds the value “0” to the least significant bit one bit lower than the least significant bit of the multiplication result having double precision bit width, and increases the bit width by one bit larger than the double precision bit width 2. The method according to claim 1, wherein the data is output as a product of an upper word of the double precision multiplicand and an upper word of the double precision multiplier.
の乗算を行う単精度乗算器を用いて倍精度乗算を実行す
る演算装置であって、 乗数の最上位ビットを保持するMSB保持手段と、 前記MSB保持手段の保持データおよび値“0”のうち
一方を選択して出力するデータ選択手段と、 前記乗数と前記データ選択手段の出力データとを用いて
前記乗数を符号化して出力する乗数エンコード手段と、 被乗数と前記乗数エンコード手段の出力データと被乗数
判別信号とを入力し、前記被乗数判別信号が非能動状態
ならば前記被乗数の最上位ビットである符号ビットを1
ビット符号拡張して、前記乗数エンコード手段の出力デ
ータとの乗算結果を求め、前記被乗数判別信号が能動状
態ならば前記被乗数の最上位ビットの1ビット上位に正
数であることを示す符号ビットを付加して、前記乗数エ
ンコード手段の出力データとの乗算結果を求め、求めた
乗算結果を小数点位置より上位に少なくとも2つ以上の
桁をもつことにより倍精度のビット幅より少なくとも1
ビット多いビット幅で出力する乗算手段と、 前記乗算手段の出力データを加数とし、小数点位置より
上位に少なくとも2つ以上の桁をもつことにより倍精度
のビット幅より少なくとも1ビット多いビット幅を持つ
被加数との加算を行い、小数点位置より上位に少なくと
も2つ以上の桁をもつことにより倍精度のビット幅より
少なくとも1ビット多いビット幅を持つ加算結果を出力
する加算手段と、 前記加算手段の出力する加算結果を保持する加算結果保
持手段と、 前記加算結果保持手段の保持データおよび値“0”のう
ち一方を選択し、桁合わせ処理を行い前記加算手段の被
加数として出力する桁合わせ手段とを設けたことを特徴
とする演算装置。6. An arithmetic unit for performing double-precision multiplication using a single-precision multiplier for multiplying two signed binary fixed-point data, comprising: MSB holding means for holding the most significant bit of the multiplier; A data selecting means for selecting and outputting one of the data held by the MSB holding means and a value “0”; and a multiplier for encoding and outputting the multiplier using the multiplier and output data of the data selecting means. Encoding means, a multiplicand, output data of the multiplier encoding means, and a multiplicand discrimination signal are input, and if the multiplicand discrimination signal is in an inactive state, the most significant bit of the multiplicand is set to 1
The bit code is extended to obtain a result of multiplication with the output data of the multiplier encoding means. If the multiplicand discrimination signal is in an active state, a sign bit indicating that it is a positive number one bit higher than the most significant bit of the multiplicand is added. In addition, a multiplication result with the output data of the multiplier encoding means is obtained, and the obtained multiplication result has at least two or more digits higher than the decimal point position, so that at least one digit is larger than the double precision bit width.
A multiplication means for outputting with a bit width larger than a bit, an output data of the multiplication means being an addend, and having at least two or more digits higher than the decimal point, thereby providing a bit width at least one bit larger than the double precision bit width. An addition means for performing addition with the augend to have the addition and outputting an addition result having a bit width at least one bit larger than a double precision bit width by having at least two digits higher than the decimal point position; An addition result holding means for holding the addition result output by the means; and one of the data held by the addition result holding means and the value "0" is selected, digit alignment processing is performed, and the result is output as the augend of the addition means. An arithmetic unit comprising a digit matching unit.
おいて倍精度乗数下位ワードと倍精度被乗数上位ワード
/下位ワードとの積を求める際に倍精度乗数下位ワード
の最上位ビットを保持することを特徴とする請求項6記
載の演算装置。7. The MSB holding means holds the most significant bit of the double-precision multiplier low word when calculating the product of the double-precision multiplier low word and the double-precision multiplicand high word / low word in the execution of double-precision multiplication. The arithmetic device according to claim 6, wherein:
おいて倍精度乗数下位ワードと倍精度被乗数上位ワード
/下位ワードとの積を求める際に値“0”を選択出力
し、倍精度乗数上位ワードと倍精度被乗数上位ワード/
下位ワードとの積を求める際に前記MSB保持手段が保
持している倍精度乗数下位ワードの最上位ビットを選択
出力すること特徴とする請求項6記載の演算装置。8. The data selecting means selects and outputs the value “0” when calculating the product of the double precision multiplier lower word and the double precision multiplicand upper word / lower word in the execution of the double precision multiplication, and outputs the value “0”. Word and double precision multiplicand high word /
7. The arithmetic unit according to claim 6, wherein when calculating the product with the lower word, the most significant bit of the double precision multiplier lower word held by the MSB holding means is selectively output.
行において倍精度乗数下位ワードと倍精度被乗数上位ワ
ード/下位ワードとの積を求める際に入力される倍精度
乗数下位ワードと前記データ選択手段の選択した値
“0”の出力データをブースのアルゴリズムで符号化し
て出力し、倍精度乗数上位ワードと倍精度被乗数上位ワ
ード/下位ワードとの積を求める際に前記データ選択手
段が選択した前記MSB保持手段が保持している倍精度
乗数下位ワードの最上位ビットの出力データをブースの
アルゴリズムで符号化して出力することを特徴とする請
求項6記載の演算装置。9. The multiplier encoding means includes: a double-precision multiplier low-order word input when calculating a product of a double-precision multiplier low-order word and a double-precision multiplicand high-order word / low-order word in performing double-precision multiplication; The output data of the selected value “0” is encoded and output by Booth's algorithm, and the data selected by the data selection means when the product of the double precision multiplier upper word and the double precision multiplicand upper word / lower word is obtained. 7. The arithmetic unit according to claim 6, wherein the output data of the most significant bit of the double precision multiplier low-order word held by the MSB holding means is encoded by a Booth algorithm and output.
て前記被乗数判別信号が能動状態ならば入力される被乗
数が倍精度被乗数の下位ワードであると判別し、前記被
乗数の最上位ビットの1ビット上位に正数を示す符号ビ
ットを付加して、前記乗数エンコード手段の出力データ
との部分積を求め、前記被乗数判別信号が非能動状態な
らば入力される被乗数が倍精度被乗数の上位ワードであ
ると判別し、前記被乗数の最上位ビットである符号ビッ
トを1ビット符号拡張して、前記乗数エンコード手段の
出力データとの部分積を求める部分積生成手段を備える
ことを特徴とする請求項6記載の演算装置。10. The multiplication means determines that the input multiplicand is the lower word of the double precision multiplicand if the multiplicand discrimination signal is active in the execution of the double precision multiplication, and outputs one bit of the most significant bit of the multiplicand. A sign bit indicating a positive number is added to the upper part to obtain a partial product with the output data of the multiplier encoding means. If the multiplicand discrimination signal is inactive, the input multiplicand is the upper word of the double precision multiplicand. 7. A partial product generation means for determining a partial product with output data of the multiplier encoding means by performing one-bit sign extension of a code bit which is a most significant bit of the multiplicand. Arithmetic unit.
なくとも2つ備え、複数の前記部分積生成手段の出力デ
ータである部分積を桁位置を合わせて加算し、加算結果
の最下位ビットの1ビット下位に値“0”のデータを付
加して求める積として出力することを特徴とする請求項
6記載の演算装置。11. The multiplication means includes at least two of the partial product generation means, adds partial products, which are output data of the plurality of partial product generation means, at the same digit positions, and adds the least significant bit of the addition result. 7. The arithmetic unit according to claim 6, wherein data of a value "0" is added one bit lower and output as a product.
加算手段の加数として出力する乗算結果保持手段を設
け、前記乗算手段と前記加算手段とが並列に動作可能と
したことを特徴とする請求項6記載の演算装置。12. The output data of the multiplication means is temporarily stored,
7. The arithmetic unit according to claim 6, further comprising a multiplication result holding unit that outputs the result as an addend of the addition unit, wherein the multiplication unit and the addition unit can operate in parallel.
ある乗数の最下位ビットを強制的に値“0”にする機能
を有したことを特徴とする請求項6記載の演算装置。13. The arithmetic unit according to claim 6, wherein the multiplier encoding means has a function of forcibly setting a least significant bit of the multiplier as input data to a value “0”.
の最下位ビットを強制的に値“0”にする機能を有した
ことを特徴とする請求項6記載の演算装置。14. The arithmetic unit according to claim 6, wherein the multiplying means has a function of forcibly setting the least significant bit of the multiplicand as input data to a value “0”.
トを保持する手段に代えて、前記乗数の最上位ビットお
よび値“0”のうち一方を選択して保持する手段とした
ことを特徴とする請求項6記載の演算装置。15. The MSB holding means is means for selecting and holding one of the most significant bit of the multiplier and a value “0” instead of the means for holding the most significant bit of the multiplier. The arithmetic unit according to claim 6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10187061A JPH1185471A (en) | 1997-07-09 | 1998-07-02 | Calculation method and calculation device |
Applications Claiming Priority (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP18388097 | 1997-07-09 | ||
| JP9-183880 | 1997-07-09 | ||
| JP10187061A JPH1185471A (en) | 1997-07-09 | 1998-07-02 | Calculation method and calculation device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH1185471A true JPH1185471A (en) | 1999-03-30 |
Family
ID=26502148
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP10187061A Pending JPH1185471A (en) | 1997-07-09 | 1998-07-02 | Calculation method and calculation device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH1185471A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2008544344A (en) * | 2005-05-09 | 2008-12-04 | サンディスク アイエル リミテッド | Large number multiplication method and device |
-
1998
- 1998-07-02 JP JP10187061A patent/JPH1185471A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2008544344A (en) * | 2005-05-09 | 2008-12-04 | サンディスク アイエル リミテッド | Large number multiplication method and device |
| KR101247164B1 (en) * | 2005-05-09 | 2013-03-25 | 샌디스크 아이엘 엘티디 | Large number multiplication method and device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6233597B1 (en) | Computing apparatus for double-precision multiplication | |
| JP3139466B2 (en) | Multiplier and product-sum operator | |
| JPH09269891A (en) | Partial product addition method and device, floating point multiplication method and device, floating point product sum operation method and device | |
| US10768898B2 (en) | Efficient modulo calculation | |
| KR20080094813A (en) | Power-Efficient Sign Extension for Booth Multiplication Methods and Systems | |
| US5195051A (en) | Computation of sign bit and sign extension in the partial products in a floating point multiplier unit | |
| JP4273071B2 (en) | Divide and square root calculator | |
| JP2001222410A (en) | Divider | |
| US4677583A (en) | Apparatus for decimal multiplication | |
| GB2549153B (en) | Apparatus and method for supporting a conversion instruction | |
| KR100317767B1 (en) | Floating point binary quad word format multiply instruction unit | |
| US5870322A (en) | Multiplier to selectively perform unsigned magnitude multiplication or signed magnitude multiplication | |
| JPH1185471A (en) | Calculation method and calculation device | |
| JPH04256016A (en) | Method and apparatus for correcting multiplier for complement of 2 so that multiplication of non-signed number is performed | |
| JP2645422B2 (en) | Floating point processor | |
| JP2578482B2 (en) | Floating point arithmetic unit | |
| JPH04172526A (en) | Floating point divider | |
| JP2682142B2 (en) | Multiplier | |
| JP3019796B2 (en) | Multiplier | |
| JP2777265B2 (en) | High radix square root arithmetic unit | |
| JP2991788B2 (en) | Decoder | |
| JP2001134556A (en) | Repetitive multiplier and array multiplier | |
| JP3100868B2 (en) | Arithmetic unit for floating point numbers | |
| JP2006338215A (en) | Vector product-sum operation circuit | |
| JPH0285922A (en) | Arithmetic circuit |