JP2007073061A - Data processing apparatus - Google Patents

Data processing apparatus Download PDF

Info

Publication number
JP2007073061A
JP2007073061A JP2006275032A JP2006275032A JP2007073061A JP 2007073061 A JP2007073061 A JP 2007073061A JP 2006275032 A JP2006275032 A JP 2006275032A JP 2006275032 A JP2006275032 A JP 2006275032A JP 2007073061 A JP2007073061 A JP 2007073061A
Authority
JP
Japan
Prior art keywords
digit
addend
product
unit
sum
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.)
Withdrawn
Application number
JP2006275032A
Other languages
Japanese (ja)
Inventor
Fumio Arakawa
文男 荒川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Technology Corp
Original Assignee
Renesas Technology Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2006275032A priority Critical patent/JP2007073061A/en
Publication of JP2007073061A publication Critical patent/JP2007073061A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a multiply-add unit which can fast carry out a multiply-add operation instruction to normalize the computing result. <P>SOLUTION: This product-sum computing unit includes a digit alignment shift number and exponent generator unit, an addend digit alignment and sign adjusting unit, a multiplier array, a sticky-bit for addend lower digits generator unit, a most significant digit detector unit, a carry propagate adder, an exponent normalizing unit, an addend higher digit incrementer unit, a sticky-bit generator unit, a normalizing shifter, a positive number conversion and rounder unit, and an exponent correction unit. The multiplier array comprises an array of carry save adders. The most significant digit detector unit receives the two terms of carry and sum parts from the multiplier array, sequentially checks a digit pair of "0" to "1" at each corresponding digit position from the highest digit, and detects the most significant non-zero digit of the absolute values depending upon digit pair values (11, 00, 10, 01) from higher to lower digit position. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明はマイクロプロセッサ等のデータ処理装置における積和演算器に係り、特に演算結果を正規化する積和演算命令を高速に実行する積和演算器および該積和演算器を備えるデータ処理装置に関する。   The present invention relates to a product-sum operation unit in a data processing apparatus such as a microprocessor, and more particularly to a product-sum operation unit that executes a product-sum operation instruction that normalizes an operation result at high speed, and a data processing device that includes the product-sum operation unit. .

従来のマイクロプロセッサで演算結果を正規化する積和演算命令を実行している例としては、PowerPC 603が挙げられる(例えば、非特許文献1参照)。
該プロセッサはキャリー伝搬加算後の値から最上位桁の検出を行っている。また、加数が積よりも上位にはみ出した場合に、このはみ出した加数を下位の部分に桁位置を合わせて、下位からのキャリーによってインクリメントしている。
An example of executing a product-sum operation instruction that normalizes an operation result with a conventional microprocessor is PowerPC 603 (see, for example, Non-Patent Document 1).
The processor detects the most significant digit from the value after carry propagation addition. Further, when the addend protrudes above the product, the added addend is incremented by carry from the lower position with the digit position aligned with the lower portion.

The PowerPC 603 Microprocessor: A High Performance, Low Power, Superscalar RISC Microprocessor(digest of papers SPRING COMPCON 94 pp300−306)The PowerPC 603 Microprocessor: A High Performance, Low Power, Superscalar RISC Microprocessor (Digest of papers SPRING COMPCON 94 pp300-306)

上記文献のプロセッサは、上記したようにキャリー伝搬加算後に該キャリー伝搬加算で得た値に基づき最上位検出を行っているため、キャリー伝搬加算と最上位検出の処理に必要な時間がこれらの合計の処理時間となり、積和演算命令を高速に実行できなかった。
また、加数が積よりも上位にはみ出した場合に、このはみ出した加数を下位の部分に桁合わせして、下位からのキャリーによってインクメントとしているため、最上位桁検出及び正規化の桁数が大きくなっている。
本発明の目的は、演算結果を正規化する積和演算命令を高速に実行する積和演算器および該積和演算器を備えるデータ処理装置を提供することにある。
As described above, the processor of the above document performs the top detection based on the value obtained by carry propagation addition after carry propagation addition as described above, so the time required for the processing of carry propagation addition and top detection is the sum of these times. The product-sum operation instruction could not be executed at high speed.
Also, when the addend protrudes higher than the product, the extended addend is aligned with the lower part and is incremented by carry from the lower order, so the most significant digit is detected and normalized. The number is getting bigger.
An object of the present invention is to provide a product-sum operation unit that executes a product-sum operation instruction that normalizes an operation result at high speed, and a data processing device that includes the product-sum operation unit.

上記目的を達成するため、本発明は、
積和演算の最後に乗算アレイの2項の演算出力に基づきキャリー伝搬加算を行い、該演算結果の絶対値の0でない最上位桁を検出して正規化を行う積和演算器において、
前記乗算アレイの2項の演算出力を入力とし、キャリー伝搬加算前の該2項の演算出力に基づき絶対値の0でない最上位桁を検出する最上位桁検出回路を備え、キャリー伝搬加算と前記最上位桁の検出を並列に実行するようにしている。
また、前記最上位桁検出回路を検出精度に1桁の誤差を許す最上位桁検出回路とし、該最上位桁検出回路出力に基づく正規化出力に対して1桁の補正を行う手段を備えるようにしている。
また、正規化を行う積和演算器において、該積和演算器における桁合せシフト数指数生成出力部の出力である桁合せシフト数と加数仮数部を入力とする加数桁合せ符号合せ部は、積よりも上位にはみ出した加数部分を出力する構成とし、該加数部分を最上位桁位置を動かさないで処理する手段を設け、前記加数部分の正規化を不要とし、該加数部分の処理と他の部分の正規化を並列に実行するようにしている。
また、データ処理装置に前記いずれかの積和演算器を備えるようにしている。
In order to achieve the above object, the present invention provides:
In a product-sum operation unit that performs carry propagation addition based on the operation output of the two terms of the multiplication array at the end of the product-sum operation, detects the highest non-zero digit of the absolute value of the operation result, and performs normalization,
An arithmetic output of the second term of the multiplication array is provided as an input, and a most significant digit detection circuit that detects the most significant digit that is not zero of the absolute value based on the arithmetic output of the two terms before carry propagation addition, The detection of the most significant digit is executed in parallel.
The most significant digit detection circuit may be a most significant digit detection circuit that allows an error of one digit in detection accuracy, and a means for correcting the normalized output based on the output of the most significant digit detection circuit by one digit is provided. I have to.
In addition, in a sum-of-products calculator that performs normalization, an addend digit-matching code matching unit that receives as input a digit-shift number and an addend mantissa part that are output from the digit-shift-number exponent generation output unit in the sum-of-products calculator Is configured to output an addend part that protrudes above the product, and is provided with means for processing the addend part without moving the most significant digit position. Several parts of processing and other parts of normalization are executed in parallel.
Further, any one of the product-sum calculators is provided in the data processing apparatus.

本発明により、キャリー伝搬加算前の値からキャリー伝搬加算後の値の絶対値の0でない最上位桁の検出を行って、キャリー伝搬加算と最上位桁の検出を並列に実行することが可能となる。そして、キャリー伝搬加算と最上位桁の検出のうち、所要時間の短い方がもう一方の時間に隠れる。また、積よりも上位にはみ出した加数のインクリメントを他の部分の正規化終了までに完了すればよくなる。そして、下位からのキャリーが生成されてからインクリメントを完了するまでの時間と正規化の時間のうち、所要時間の短い方がもう一方の時間に隠れる。以上により、積和演算が高速化される。   According to the present invention, it is possible to detect the most significant digit that is not 0 of the absolute value of the value after carry propagation addition from the value before carry propagation addition, and to perform carry propagation addition and detection of the most significant digit in parallel. Become. Of the carry propagation addition and the detection of the most significant digit, the shorter required time is hidden in the other time. Further, it is only necessary to complete the increment of the addend that protrudes above the product by the end of normalization of the other part. Of the time from the generation of the carry from the lower order to the completion of the increment and the normalization time, the shorter one is hidden in the other time. As described above, the product-sum operation is speeded up.

本発明の一実施例を図によって、説明する。   An embodiment of the present invention will be described with reference to the drawings.

本発明による積和演算器の各実施例を添付図面を参照して詳細に説明する。
以下の実施例においては、同一機能を有するものには同一符号を付し、その重複説明を省略する。
本発明における積和演算とは(被乗数)×(乗数)+(加数)を計算する浮動小数演算である。また、正規化とは小数点を0でない最上位桁の右側にすることである。例えば、0.001×22を1.000×2~1とすることである。
図1は本発明による積和演算を高速化した積和演算器の一実施例の構成図であり、桁合せシフト数指数生成部1、加数桁合せ符号合せ部2、加数下位スティッキービット生成部3、乗算アレイ(積和演算アレイ)4、最上位桁検出部5、キャリー伝搬加算器6、加数上位インクリメンタ7、指数正規化部8、スティッキービット生成部9、正規化シフタ10、正数化丸め部11、指数補正部12からなる。
Embodiments of the product-sum calculator according to the present invention will be described in detail with reference to the accompanying drawings.
In the following embodiments, components having the same function are denoted by the same reference numerals, and redundant description thereof is omitted.
The product-sum operation in the present invention is a floating point operation for calculating (multiplicand) × (multiplier) + (addend). Normalization means to set the decimal point to the right of the highest digit other than 0. For example, 0.001 × 22 is set to 1.000 × 2 to 1.
FIG. 1 is a block diagram of an embodiment of a multiply-accumulate arithmetic unit that speeds up a multiply-accumulate operation according to the present invention, and includes a digit shift number exponent generation unit 1, an addend digit alignment code match unit 2, and an addend lower sticky bit. Generation unit 3, multiplication array (product-sum operation array) 4, most significant digit detection unit 5, carry propagation adder 6, addend higher incrementer 7, exponent normalization unit 8, sticky bit generation unit 9, normalization shifter 10 , A positive number rounding unit 11 and an exponent correction unit 12.

次に、図1の各部の構成及び動作を説明する。
桁合せシフト数指数生成部1は、加数、被乗数、および乗数の指数部を入力とし、桁合せシフト数D1および正規化前の積和演算結果の指数D2を生成して、それぞれ加数桁合せ符号合せ部2および指数正規化部8へ出力する。
桁合せシフト数は、ここでは被乗数の指数部と乗数の指数部の和すなわち積の指数部から加数指数部を引いて生成する。
指数正規化部8へ出力する指数D2は、桁合せシフト数が−3以下の場合、即ち、最上位桁が必ず加数上位にある場合は加数指数部を、桁合せシフト数が−2以上の場合、即ち、最上位桁が必ずしも加数上位にない場合は積の指数部を選択する。
加数桁合せ符号合せ部2は、加数仮数部および桁合せシフト数D1を入力とし、加数の桁合せおよび符号合せを行い、積に対応する桁を加数中位として乗算アレイ4に、加数中位より上位にはみ出した部分を加数上位として加数上位インクリメンタ9に、下位にはみ出した部分を加数下位として加数下位スティッキービット生成部3に出力する。
符号合せは、加数の符号および乗数と被乗数との積の符号を比較して符号が互いに異なる場合に、加数部を符号反転して2の補数にするために、各ビットの0、1の反転を行い、1を加算することである。しかし、ここでは加数上位および加数中位の0、1の反転のみ行う。加数上位は正規化シフタ10での正規化シフトが不要となるように桁合せ時に下位側にシフトしない。加数上位を下位側にシフトしない場合、加数上位の桁数に応じて加数上位の最下位桁位置が変化する。そこで、加数上位最下位も加数上位インクリメンタ9に出力する。加数上位最下位とは加数上位の最下位桁位置に1を立てた値で、加数上位と加算すると加数上位のインクリメントが行える値である。
Next, the configuration and operation of each unit in FIG. 1 will be described.
Digit shift number exponent generation unit 1 receives an addend, a multiplicand, and an exponent part of the multiplier, generates digit shift number D1 and exponent D2 of the product-sum operation result before normalization, and each addend digit The data is output to the matching code matching unit 2 and the exponent normalization unit 8.
The digit shift number is generated by subtracting the addend exponent from the sum of the exponent part of the multiplicand and the exponent part of the multiplier, that is, the exponent part of the product.
The exponent D2 output to the exponent normalization unit 8 is an addend exponent when the digit shift number is -3 or less, that is, when the most significant digit is always higher in the addend, and the digit shift number is -2. In the above case, that is, when the most significant digit is not necessarily higher in the addend, the exponent part of the product is selected.
The addend digit matching code matching unit 2 receives the addend mantissa part and the digit shift number D1, performs digit addition and sign matching, and sets the digit corresponding to the product to the multiplication array 4 with the addend middle. The portion that protrudes from the middle of the addend is output to the addend high incrementer 9 as the addend high, and the portion that protrudes from the low addend is output to the addend low sticky bit generation unit 3 as the addend low.
In the sign matching, when the sign of the addend and the sign of the product of the multiplier and multiplicand are compared and the signs are different from each other, in order to invert the addend part to 2's complement, Is inverted and 1 is added. However, only the reversal of 0 and 1 in the upper and middle addends is performed here. The upper part of the addend is not shifted to the lower side at the time of digit alignment so that the normalization shift in the normalization shifter 10 becomes unnecessary. When the upper part of the addend is not shifted to the lower side, the lowest digit position of the upper part of the addend changes according to the number of digits of the upper part of the addend. Therefore, the addend upper / lower order is also output to the addend upper incrementer 9. The addend high-order least significant is a value obtained by setting 1 at the least significant digit position of the addend high, and can be incremented by adding the high-order addend when added to the high-order addend.

加数下位スティッキービット生成部3は、加数桁合せ符号合せ部2からの加数下位を入力とし、加数下位スティッキービットD5を生成してキャリー伝搬加算器6およびスティッキービット生成部9へ出力する。
スティッキービットとは演算結果の丸めの際に使用する値で、入力データの桁数および丸め後の桁数をnとすると、丸め前の演算結果の上位n+1桁以外の値が0でない場合に立てるビットである。
加数下位が0桁でない場合、積和演算による桁落ちは最大1桁であるため、キャリー伝搬加算器6出力は少なくとも2n−2桁ある。
尚、2桁以上の桁落ちが発生するのは桁合せシフト数が−2〜1の場合であり、この時、加数下位は0桁である。したがって、加数下位は常にスティッキービット生成にのみ用いられるので、加数下位の値自身は不要であり、加数下位が0でない場合に1となる加数下位スティッキービットとして残しておけばよい。
加数桁合せ符号合せ部2で加数下位の符号合せを行っていないが、符号合せしてもしなくても0か0でないかは変らないので、加数下位スティッキービットの値は変らない。
The addend lower sticky bit generation unit 3 receives the addend lower order from the addend digit alignment code matching unit 2, generates an addend lower sticky bit D5, and outputs it to the carry propagation adder 6 and the sticky bit generation unit 9 To do.
The sticky bit is a value used when rounding the operation result. If the number of digits of the input data and the number of digits after rounding are n, the sticky bit is set when the value other than the upper n + 1 digits of the operation result before rounding is not 0. Is a bit.
When the lower part of the addend is not 0 digit, the carry-out by the product-sum operation is 1 digit at the maximum, so that the carry propagation adder 6 output has at least 2n-2 digits.
Note that a digit loss of two or more digits occurs when the digit shift number is -2 to 1, and at this time, the lower part of the addend is 0 digits. Therefore, since the addend low is always used only for sticky bit generation, the addend low value itself is not necessary, and may be left as an addend low sticky bit that becomes 1 when the addend low is not 0.
The addend digit matching code matching unit 2 does not perform addend lower sign matching, but it does not change whether the sign addition is performed or not, so the value of the addend lower sticky bit does not change.

乗算アレイ4は被乗数仮数部、乗数仮数部、および加数桁合せ符号合せ部2からの加数中位を入力とし、被乗数仮数部と乗数仮数部の積と加数中位の和を、キャリー保存加算器、冗長2進加算器等のアレイを用いて計算し、結果を最上位桁検出部5およびキャリー伝搬加算器6に出力する。
乗算アレイ4の出力は、キャリー伝搬加算器6で加算すると正規化前の積和演算結果の仮数部となる2つの値(2つの項)である。この2つの項は例えば、乗算アレイがキャリー保存加算器ならばキャリー部分と和の部分、冗長2進加算器ならば正数部分と負数部分である。
The multiplication array 4 receives the multiplicand mantissa part, the multiplier mantissa part, and the addend middle order from the addend digit alignment code matching section 2, and carries the product of the multiplicand mantissa part and the multiplier mantissa part and the sum of the addend middle order as a carry. The calculation is performed using an array such as a storage adder or a redundant binary adder, and the result is output to the most significant digit detector 5 and the carry propagation adder 6.
The outputs of the multiplication array 4 are two values (two terms) that become the mantissa part of the product-sum operation result before normalization when added by the carry propagation adder 6. The two terms are, for example, a carry part and a sum part if the multiplication array is a carry save adder, and a positive part and a negative part if the multiplication array is a redundant binary adder.

最上位桁検出部5は、桁合せシフト数指数生成部1からの桁合せシフト数S1、および乗算アレイ4の出力から、正規化前の積和演算結果の仮数部の絶対値のうち0でない最上位桁を検出し、検出結果に基づいて、指数正規化部8へは指数正規化値D7、スティッキービット生成部9へはスティッキービット生成用のマスクD8、そして正規化シフタ10へは正規化シフト数D9を出力する。該最上位桁検出は以下のように行う。
桁合せシフト数が−3以下の場合は、該最上位桁は加数上位にある。そして、積と加数が同符号ならば1桁の桁上がりが、異符号ならば1桁の桁落ちが生じる可能性がある。
そこで、該最上位桁検出に上位側への1桁の誤差を認めることにして、この桁上がりおよび桁落ちの有無を使用せずに該最上位桁を決められるようにすると、該最上位桁は積と加数が同符号の場合は加数上位の最上位桁、異符号の場合は加数上位の最上位桁の1桁下位となる。
桁合せシフト数が−3以下の場合の桁合せシフト数指数生成部1の出力する指数は加数指数部である。したがって、指数正規化値は、積と加数が同符号ならば加数を基準にすると最上位桁が動かないので0であり、異符号ならば1桁上位に動くので−1である。また、正規化シフト数は、積と加数が同符号ならば桁合せシフト時の加数の左シフト数だけ右シフトすればよいので、桁合せシフト数を符号反転した値になり、異符号ならば同符号の場合より1桁上位にずれるので、桁合せシフト数に1を加算して符号反転した値となる。
丸め後の桁数をnとすると、正規化シフタ10では該最上位桁の1桁上位からn+2桁を抽出する。そして、抽出した値より下位の桁からスティッキービットを生成する。したがって、スティッキービット生成用のマスクは該最上位桁より下位方向に数え始めてn+2桁目以降、即ち、最上位桁のn+1桁下位の桁以降に全て“1”を立てればよい。
The most significant digit detection unit 5 is not 0 out of the absolute value of the mantissa part of the product-sum operation result before normalization from the digitization shift number S1 from the digitization shift number exponent generation unit 1 and the output of the multiplication array 4 The most significant digit is detected, and based on the detection result, the exponent normalization unit 8 normalizes to the exponent normalization value D7, the sticky bit generation unit 9 to the sticky bit generation mask D8, and the normalization shifter 10 to normalize The shift number D9 is output. The most significant digit detection is performed as follows.
When the digit shift number is -3 or less, the most significant digit is higher in the addend. If the product and addend have the same sign, a carry of one digit may occur, and if the product has a different sign, a drop of one digit may occur.
Therefore, when the most significant digit is detected without allowing the use of the carry or the carry loss, the most significant digit can be determined by allowing an error of one digit to the upper side in the most significant digit detection. When the product and the addend have the same sign, the uppermost digit of the addend is one digit lower than the uppermost digit of the addend.
The exponent output by the digit shift number exponent generation unit 1 when the digit shift number is -3 or less is an addend exponent part. Therefore, the exponent normalization value is 0 because the most significant digit does not move on the basis of the addend if the product and the addend have the same sign, and is -1 if the product and the addend move one digit higher if the sign is different. Also, if the product and addend have the same sign, the normalized shift number can be shifted to the right by the left shift number of the addend at the time of the digit shift. Then, since it is shifted one digit higher than the case of the same sign, the value is obtained by adding 1 to the digit shift number and inverting the sign.
If the number of digits after rounding is n, the normalization shifter 10 extracts n + 2 digits from the uppermost digit of the most significant digit. Then, a sticky bit is generated from a lower digit than the extracted value. Therefore, the sticky bit generation mask may be set to all “1” s after the (n + 2) th digit starting from the least significant digit, that is, after the (n + 1) th digit lower digit of the most significant digit.

桁合せシフト数が−2以上の場合は、絶対値の0でない最上位桁はキャリー伝搬加算器6出力または加数上位の下位2桁にある。この場合の詳細な処理は後述する。指数正規化値および正規化シフト数は求めた最上位桁と正規化前の小数点位置との差で決る。スティッキービット生成用のマスクは前述の場合と同様に該最上位桁の下位n+1桁目以降を全て立てればよい。   When the digit shift number is -2 or more, the most significant non-zero digit is in the carry propagation adder 6 output or the lower two digits of the upper part of the addend. Detailed processing in this case will be described later. The exponent normalization value and the normalized shift number are determined by the difference between the most significant digit obtained and the decimal point position before normalization. As in the case described above, the sticky bit generation mask may be all set after the lowest n + 1 digit of the most significant digit.

キャリー伝搬加算器6は乗算アレイ4出力の2つの値を加算して正規化前の積和演算結果の仮数部を生成し、スティッキービット生成部9および正数化丸め部11へ出力する。この時、積と加数が異符号かつ加数下位スティッキービットが0の場合は加算の際に最下位に1を加算する。
加数桁合せ符号合せ部2では、符号反転処理のうち加数中位と加数上位の0、1の反転のみを行ったので、最下位への1の加算により符号反転処理が完了する。
加数下位スティッキービットが0の場合のみ1を加算するのは以下の理由による。仮に、加数下位を0、1反転して最下位に1を加算したとすると加数中位までキャリーが伝わるのは、反転後に加数下位が全て1になった場合、すなわち、反転前に加数下位が0の場合である。これは加数下位スティッキービットが0の場合に相当する。キャリーが伝わらなければ1を加算する必要はない。
Carry propagation adder 6 adds the two values of multiplication array 4 output to generate the mantissa part of the product-sum operation result before normalization, and outputs the result to sticky bit generation unit 9 and positive number rounding unit 11. At this time, when the product and the addend have different signs and the addend lower sticky bit is 0, 1 is added to the lowest order at the time of addition.
In the addend digit matching code matching unit 2, only the middle of the addend and the upper 0 and 1 of the addend are inverted in the sign inversion processing, so the sign inversion processing is completed by adding 1 to the lowest order.
The reason why 1 is added only when the addend lower sticky bit is 0 is as follows. If the lower order of the addend is 0 and 1 is inverted and 1 is added to the lowest order, the carry is transmitted to the middle of the addend when all the lower addends become 1 after the inversion, that is, before the inversion. This is the case when the lower addend is 0. This corresponds to the case where the addend lower sticky bit is 0. There is no need to add 1 if the carry is not transmitted.

加数上位インクリメンタ7は、加数桁合せ符号合せ部2からの加数上位および加数上位最下位並びにキャリー伝搬加算器6からのキャリーを入力とし、キャリーが1の場合には加数上位と加数上位最下位を加算した値、キャリーが0の場合には加数上位を選択する。
さらに、正規化シフタ10の抽出値と桁位置が合うように、積と加数が同符号および異符号の場合に、加数上位の最上位桁が加数上位インクリメンタ7出力のそれぞれ最上位桁の1桁下位および最上位桁になるようにして正規化シフタ10に出力する。
桁合せシフト数が−2以上の場合、上記処理では正規化シフタ10の抽出値と桁位置が合わない可能性がある。そこで、最上位桁検出部5から正規化シフト数の情報をもらって、正規化シフト数が1および2の場合に、加数上位の最上位桁が加数上位インクリメンタ7出力のそれぞれ最上位桁および最上位桁の1桁下位になるようにする。そして、正規化シフト数が上記以外の場合は加数上位インクリメンタ7出力を0とする。
The addend high incrementer 7 receives the addend high and the addend high least significant from the addend digit matching code matching unit 2 and the carry from the carry propagation adder 6, and when the carry is 1, the addend high When the carry is 0, the higher addend is selected.
Further, when the product and the addend have the same sign and different signs so that the extracted value of the normalized shifter 10 matches the digit position, the most significant digit of the addend is the most significant of the addend higher incrementer 7 output. The result is output to the normalization shifter 10 so as to be one digit lower and most significant digit.
When the digit shift number is −2 or more, the extracted value of the normalization shifter 10 and the digit position may not match in the above process. Therefore, when the information on the normalized shift number is obtained from the most significant digit detection unit 5 and the normalized shift numbers are 1 and 2, the most significant digit of the addend is the most significant digit of the addend significant incrementer 7 output. And one digit lower than the most significant digit. If the normalized shift number is other than the above, the addend higher incrementer 7 output is set to zero.

指数正規化部8は桁合せシフト数指数生成部1からの指数、即ち、正規化前の積和演算結果の指数と最上位桁検出部5からの指数正規化値を加算し、加算結果を正規化された指数D11として指数補正部12へ出力する。
スティッキービット生成部9は、キャリー伝搬加算器6からの正規化前の積和演算結果の仮数部を最上位桁検出部5からのマスクでマスクして論理和をとり、さらに加数下位スティッキービットとの論理和をとって、結果をスティッキービットとして正数化丸め部11へ出力する。
正規化シフタ10は、キャリー伝搬加算器6からの正規化前の積和演算結果の仮数部を最上位桁検出部5からの正規化シフト数を用いて正規化し、加数上位インクリメンタ7出力との論理和をとって、結果を正数化丸め部11へ出力する。
正数化丸め部11は、正規化シフタ10の出力を入力とし、正数化、丸めを行って、最終的な正規化された積和演算結果の仮数部を出力する。正数化処理は加数上位が負または加数上位が0かつキャリー伝搬加算器6出力が負の場合に行い、0、1反転の後、キャリー伝搬加算器6の場合と同様にスティッキービットが0の場合のみ1を加算する。
指数補正部12は正数化、丸めによって生じる桁上がりによる指数部の補正を行い、最終的な正規化された積和演算結果の指数部を出力する。
The exponent normalization unit 8 adds the exponent from the digit shift number exponent generation unit 1, that is, the exponent of the product-sum operation result before normalization and the exponent normalization value from the most significant digit detection unit 5, and the addition result is obtained. The normalized exponent D11 is output to the exponent correction unit 12.
The sticky bit generation unit 9 masks the mantissa part of the product-sum operation result before normalization from the carry propagation adder 6 with the mask from the most significant digit detection unit 5 to obtain a logical sum, and further performs the addend lower sticky bit. And outputs the result as a sticky bit to the positive number rounding unit 11.
The normalization shifter 10 normalizes the mantissa part of the product-sum operation result before normalization from the carry propagation adder 6 using the normalization shift number from the most significant digit detection part 5 and outputs the addend higher incrementer 7 output. And the result is output to the positive number rounding unit 11.
The positive number rounding unit 11 receives the output of the normalization shifter 10, performs positive numbering and rounding, and outputs the final normalized mantissa part of the product-sum operation result. The positive number processing is performed when the upper part of the addend is negative or the upper part of the addend is 0 and the output of the carry propagation adder 6 is negative. After 0 and 1 inversion, the sticky bit is set as in the case of the carry propagation adder 6. Add 1 only if 0.
The exponent correction unit 12 corrects the exponent part by the carry generated by the positive number and rounding, and outputs the exponent part of the final normalized product-sum operation result.

次に、上記積和演算器の動作を仮数部が4ビットの具体的な数値を用いて図1−図3を参照して説明する。
ここでは、先ず以下の式(1)を計算する場合について図1,2を参照して説明する。図2は図1の積和演算器によりこの式(1)を計算する場合の図1の各構成要素での処理の流れを示す動作説明図である。
(1.110×22)×(1.101×23)+(1.011×2~1)…(1)
まず、桁合せシフト数指数生成部1で積の結果と加数との間で桁合わせに必要なシフト数(桁合せシフト数)として2+3−(−1)=6を生成する。
この場合、桁合せシフト数6は−2以上なので、指数として、積部の指数の和(2+3=5)と仮数部の指数−1とのうち積部の指数の和5を選択して出力する(図2のステップS1)。
次に、加数桁合せ符号合せ部2で、ステップS1で得られた桁合わせシフト数6に従い、加数の仮数部1.011を6桁右(下位側)にシフトして0.000001010を得る。
先ず、これから加数中位00.000001(4桁×4桁の乗算なので8桁を有効数字とする)を得る(ステップS2)。
さらに、加数の仮数部1.011とマスク0.000(6桁右シフトにより仮数部1.011が上位にはみ出したビットはないのでマスクビットは全て0であるとの論理積から)加数上位0.000を得(ステップS3)、
またさらに加数の仮数部1.011とますく0.111(6桁右シフトにより仮数部1.011が下位にはみ出したビットは仮数部の下位側3ビットなので、この下位側3ビットを有効とすべくマスクビットは0.111となる)との論理積から加数下位0011を得る(ステップS4)。
さらに、この場合上位は0しかないため下位からの桁上がりが考えられるために加数上位最下位として少数点の左に1を立てて1.000を得る(ステップS5)。
Next, the operation of the product-sum calculator will be described with reference to FIG. 1 to FIG. 3 using specific numerical values having a mantissa part of 4 bits.
Here, the case where the following formula (1) is calculated will be described with reference to FIGS. FIG. 2 is an operation explanatory diagram showing the flow of processing in each component of FIG. 1 when the equation (1) is calculated by the product-sum calculator of FIG.
(1.110 × 22) × (1.101 × 23) + (1.011 × 2 to 1) (1)
First, the digit shift number index generation unit 1 generates 2 + 3-(− 1) = 6 as the shift number (digit shift number) necessary for digit alignment between the product result and the addend.
In this case, since the digit shift number 6 is -2 or more, the sum of the exponents of the product part (2 + 3 = 5) and the sum of the exponents of the mantissa part 5 are selected as the exponents and output. (Step S1 in FIG. 2).
Next, in the addend digit matching code matching unit 2, the mantissa part 1.011 of the addend is shifted 6 digits to the right (lower side) in accordance with the digit shift number 6 obtained in step S1, and 0.000001010 is set. obtain.
First, the addend middle 00.000001 is obtained (8 digits are significant because it is a multiplication of 4 digits × 4 digits) (step S2).
Furthermore, the mantissa part 1.011 of the addend and the mask 0.000 (from the logical product that the mantissa part 1.011 is not over-exposed due to a 6-digit right shift and the mask bits are all 0) Get the top 0.000 (step S3),
Further, the mantissa part of the addend is 1.011 and 0.111 (the bit that the mantissa part 1.011 protrudes to the lower order by 6-digit right shift is the lower 3 bits of the mantissa part, so this lower 3 bits are valid. Therefore, the addend low-order 0011 is obtained from the logical product of (the mask bit is 0.111) (step S4).
Further, in this case, since the upper order is only 0, a carry from the lower order can be considered. Therefore, 1 is set to the left of the decimal point as the addend uppermost order to obtain 1.000 (step S5).

次に、加数下位スティッキービット生成部3において加数下位に基づき加数下位スティッキービットを生成するが、この場合、加数下位0011は全てが0ではないので加数下位スティッキービットとして1を生成する(ステップS6)。
また、積の結果と加数が同符号(共に+)なので(即ち、図2のexclusixe OR(以下、EORと称す)ゲートEOR1出力が0なので)、ANDゲートAND1の出力は0であり、この値0はキャリー伝搬加算部6に与えられる。これは積の結果と加数が同符号の時はnegateする必要がないからである。なお、ゲートEOR1は桁合わせシフト数指数生成部1に含ませても良い。
これらの操作により、(1)式は次式(2)のようになる。
{(1.110×1.101+加数中位)×25}+加数下位スティッキー
ビット={(1.110×1.101+00.000001)×25}+加 数下位スティッキービット……(2)
次に、乗算アレイ4において、上式(2)の
(1.110×1.101+00.000001)内の計算を行うが、先ずその乗算部分を加算部(3−1)〜(3−4)に直して以下のようにする。
Next, the addend lower sticky bit generation unit 3 generates the addend lower sticky bit based on the addend lower, but in this case, the addend lower 0011 is not all 0, so 1 is generated as the addend lower sticky bit. (Step S6).
Further, since the product and the addend have the same sign (both +) (that is, the output of the exclusive EOR1 (hereinafter referred to as EOR) gate EOR1 in FIG. 2 is 0), the output of the AND gate AND1 is 0. The value 0 is given to the carry propagation adder 6. This is because it is not necessary to negate when the product and addend have the same sign. The gate EOR1 may be included in the digit shift number generation unit 1.
By these operations, the equation (1) becomes the following equation (2).
{(1.110 × 1.101 + addend middle) × 25} + addend lower sticky bit = {(1.110 × 1.101 + 00.000001) × 25} + addend lower sticky bit (2)
Next, in the multiplication array 4, the calculation within (1.110 × 1.101 + 00.000001) of the above equation (2) is performed. First, the multiplication part is added to the addition units (3-1) to (3-4). Correct as follows.

0.001110 ……(3−1)
+ 0.00000 ……(3−2)
+ 0.1110 ……(3−3)
+ 1.110 ……(3−4)
+ 00.000001 ……(3−5)
値(3−5)は式(2)の加算部である。
乗算アレイ4は、ここでは例えばキャリー保存加算器とする。キャリー保存加算器は3つの数を加算してキャリー部分と和の部分の2つの数(2つの項)を出力する。キャリー部分は各桁に2つ以上1がある場合に次の桁に1を立てることによって生成する。和の部分は各桁に1つまたは3つ1がある場合にその桁に1を立てることによって生成する。
まず、最初の3項(3−1)〜(3−3)を加算すると、この部分がキャリー部分(3−6)と和の部分(3−7)の2つの項となって、
0.010000 ……(3−6)
+ 0.110110 ……(3−7)
+ 1.110 ……(3−4)
+ 00.000001 ……(3−5)
となる。
さらにこの結果の最初の3項(3−6),(3−7),(3−4)を加算すると、この部分が2項(3−8),(3−9)となって、
01.100000 ……(3−8)
+ 1.010110 ……(3−9)
+ 00.000001 ……(3−5)
となる。
さらにこの3項(3−8),(3−9),(3−5)を加算すると、
010.000000 ……(3−10)
+ 00.110111 ……(3−11)
\4+2桁/
となる。この2項が乗算アレイ4の出力であり、値(3−10)がキャリー部分、(3−11)が和の部分である(ステップS7)。
桁合せシフト数が−2以上の場合の最上位桁検出部5の動作の詳細は図5〜7等で詳細に後述する。
0.001110 (3-1)
+ 0.00000 ...... (3-2)
+ 0.1110 (3-3)
+ 1.110 (3-4)
+ 00.000001 (3-5)
The value (3-5) is an adding unit of the expression (2).
Here, the multiplication array 4 is, for example, a carry save adder. The carry save adder adds three numbers and outputs two numbers (two terms), a carry part and a sum part. The carry part is generated by setting 1 to the next digit when there are two or more 1s in each digit. The sum part is generated by setting 1 in each digit when there is one or three in each digit.
First, when the first three terms (3-1) to (3-3) are added, this part becomes two terms of the carry part (3-6) and the sum part (3-7).
0.010000 (3-6)
+ 0.110110 (3-7)
+ 1.110 (3-4)
+ 00.000001 (3-5)
It becomes.
Furthermore, when the first three terms (3-6), (3-7), (3-4) of this result are added, this part becomes two terms (3-8), (3-9),
0.11.00000 (3-8)
+ 1.010110 (3-9)
+ 00.000001 (3-5)
It becomes.
Furthermore, when these three terms (3-8), (3-9), and (3-5) are added,
010.000000 ...... (3-10)
+ 00.110111 ...... (3-11)
\ 4 + 2 digits /
It becomes. These two terms are the output of the multiplication array 4, the value (3-10) is the carry part, and (3-11) is the sum part (step S7).
Details of the operation of the most significant digit detector 5 when the digit shift number is −2 or more will be described later in detail with reference to FIGS.

最上位桁検出部5は乗算アレイ4の出力(式(3−10),(3−11))および桁合せシフト数指数生成部16から桁合せシフト数に基づき、指数正規化値、スティッキービット生成用のマスク、正規化シフト数を生成する。
先ず、後述する図7の第1ステップにおいて、乗算アレイ4の出力の上位側に、即ち、乗算アレイ4の和部の上位側に加数上位の最上位桁“0”を付け加えて、キャリー部分と共に最上位桁検出部5に入力する。次いで、積と加数が同符号か、異符号か判定する。
上記したように積と加数とは同符号(EORゲートEOR1の出力が0)であるため、第3+ステップに進み、乗算アレイ4の出力(式(3−10),(3−11))の最初の桁“00”から下位に向かって“00”以外の桁を探すと2桁目に“10”があり、したがってこの桁が最上位桁となる。
The most significant digit detecting unit 5 is based on the output of the multiplication array 4 (formulas (3-10) and (3-11)) and the digitized shift number exponent generation unit 16 based on the digitized shift number and the exponent normalized value and the sticky bit. Generate mask and normalization shift number.
First, in the first step of FIG. 7 to be described later, the most significant digit “0” of the addend is added to the upper side of the output of the multiplication array 4, that is, the higher side of the sum of the multiplication array 4. At the same time, it is input to the most significant digit detector 5. Next, it is determined whether the product and the addend have the same sign or different signs.
As described above, since the product and the addend have the same sign (the output of the EOR gate EOR1 is 0), the process proceeds to the 3+ step and the output of the multiplication array 4 (expressions (3-10) and (3-11)) When a digit other than “00” is searched from the first digit “00” to the lower order, there is “10” in the second digit, and therefore this digit is the most significant digit.

従って、小数点から左に2桁目に最上位桁があるため、指数正規化値としては1を指数正規化部8へ出力する。(ステップS8)
尚、小数点から左に1桁目、2桁目、3桁目…に最上位桁がある場合は、それぞれ指数正規化値は0,1,2…となる。
一方、小数点から右に1桁目、2桁目、3桁目…に最上位桁がある場合は、それぞれ指数正規化値は−1,−2,−3…となる。
マスクとしては、最上位桁(小数点から左に2桁目)の下位n+1(=4+1=5桁目(小数点から右に4桁目)以下に“1”を立てて00.000111を得る(ステップS9)。
また、小数点から左に2桁目に最上位桁があるため、正規化シフト数としては1を正規化シフタ10へ出力する(ステップS10)。桁合わせシフト数−2以上の場合、正規化シフト数の値は指数正規化値と同じとなる。
Accordingly, since the most significant digit is the second digit to the left of the decimal point, 1 is output to the exponent normalization unit 8 as the exponent normalization value. (Step S8)
If the first digit, the second digit, the third digit,... Are on the left of the decimal point, the exponent normalized values are 0, 1, 2,.
On the other hand, when the first digit, the second digit, the third digit,... Are to the right of the decimal point, the exponent normalized values are -1, -2, -3,.
As a mask, “1” is set below the lowermost n + 1 (= 4 + 1 = 5th digit (fourth digit to the right of the decimal point)) of the most significant digit (second digit to the left of the decimal point) to obtain 0.0001111 (step S9).
Since the most significant digit is the second digit to the left of the decimal point, 1 is output to the normalization shifter 10 as the normalization shift number (step S10). When the digit shift number is -2 or more, the value of the normalized shift number is the same as the exponent normalized value.

尚、図7の第1ステップにおいて積の結果と加数とは同符号と判定されると符号反転(sign change)信号として0がEORゲートEOR2及び正数化丸め部11に出力される。
また、第1ステップにおいて、積の結果と加数とが異符号と判定されると、図6の第2ステップに進み、該第2ステップにおいて下位の桁に“00”が発見されると加算結果は負であるので符号反転信号として0をそれぞれ出力する(ステップS22)。従って、本例の場合は同符号であるので符号反転信号として0を出力する。
正数化丸め部11においては符号反転信号が1の場合に正規化シフタ10の出力を符号反転する。
If it is determined in the first step of FIG. 7 that the product result and the addend have the same sign, 0 is output to the EOR gate EOR2 and the positive number rounding unit 11 as a sign change signal.
Further, if it is determined in the first step that the product result and the addend are different signs, the process proceeds to the second step of FIG. 6 and is added when “00” is found in the lower digit in the second step. Since the result is negative, 0 is output as the sign inversion signal (step S22). Therefore, in this example, since it is the same sign, 0 is output as the sign inversion signal.
The positive rounding unit 11 inverts the sign of the output of the normalization shifter 10 when the sign inversion signal is 1.

キャリー伝搬加算器6では、乗算アレイ4の出力のキャリー部(3−10)と加算部(3−11)とANDゲートAND1の出力とを加算して10.110111を生成し(ステップS11)、スティッキービット生成部9及び正規化シフタ10へ出力する。また、ステップS11で得た加算値10.110111の最上位からのキャリー0を加数上位インクリメンタ7へ出力する(ステップS12)。
加数上位インクリメンタ7では加数上位0.000と加数上位最下位1.000とキャリーを入力し、キャリーに応じて加数上位0.000と加数上位最下位1.000の和01.000と加数上位0.000の一方を選択する。さらに、選択した出力を図2のEORゲートEOR1の出力に応じてシフトして出力する。
このケースでは、キャリーが0なので加数上位00.000を選択し、また積の結果と加数が同符号なので(即ち、EORゲートEOR1の出力が0なので)シフトを行わずにそのまま加数上位00.000を出力する(ステップS13)。
この時、式(1)は、ステップS11で得られた加算値、ステップS1で得られた指数5から以下の式(4)のように表わされる。
(10.110111×25)+加数下位スティッキービット ……(4)
次に、指数正規化部8で、桁合せシフト数指数生成部1からの指数5と最上位桁検出部5からの指数正規化値1を加算して6を出力する(ステップS14)。
The carry propagation adder 6 adds the carry part (3-10), adder part (3-11) of the output of the multiplication array 4 and the output of the AND gate AND1 to generate 10.1011111 (step S11). The data is output to the sticky bit generation unit 9 and the normalization shifter 10. Further, the carry 0 from the most significant value of the addition value 10.1011111 obtained in step S11 is output to the addend high incrementer 7 (step S12).
The addend high incrementer 7 inputs the addend high 0.000 and the addend high lowest 1.000 and the carry, and the sum 01 of the addend high 0.000 and the addend high lowest 1.000 according to the carry. Select one of .000 and the upper addend 0.000. Further, the selected output is shifted according to the output of the EOR gate EOR1 in FIG.
In this case, since the carry is 0, the upper addend is selected as 0.0000, and since the addend is the same sign as the product (that is, the output of the EOR gate EOR1 is 0), the addend is higher without performing the shift. 00.000 is output (step S13).
At this time, the expression (1) is expressed as the following expression (4) from the addition value obtained in step S11 and the index 5 obtained in step S1.
(10.101111 × 25) + addend lower sticky bit (4)
Next, the exponent normalization unit 8 adds the exponent 5 from the digit shift number exponent generation unit 1 and the exponent normalization value 1 from the most significant digit detection unit 5 to output 6 (step S14).

スティッキービット生成部9では、キャリー伝搬加算器6の出力10.110111を最上位桁検出部5からの出力であるマスクビット00.000111でマスクしてそれらの論理和をとり(ステップS15)、さらに該論理和と加数下位スティッキービット生成部からの1と論理和をとった値1を出力する(ステップS16)。
正規化シフタ10では、ステップS10で得られた最上位桁検出部5からの正規化シフト数が1であるからキャリー伝搬加算器6の出力10.110111を1桁右シフトして上位6ビットの01.0110を抽出し(ステップS17)、加数上位インクリメンタ7の出力00.000と論理和をとって、01.0110を得て出力する(ステップS18)。
この時、最初の式(1)は
(01.0110×26)+スティッキービット ……(5)
となっている。
正数化丸め部11は丸めモードによって動作が異なる。ここでは、値の近い方または偶数方向に丸めるものとすると、正規化シフタ10の出力が01.0110でスティッキービット生成部9からのスティッキービットが1であるから、正数化丸め部11の出力は1.011である(ステップS19)。
指数補正部12では、正数化丸め部11で最上位桁位置の補正が不要だったので、指数正規化部8の出力6をそのまま出力する(ステップS20)。
この結果、演算結果は1.011×26となる(ステップS21)。
The sticky bit generation unit 9 masks the output 10.1011111 of the carry propagation adder 6 with the mask bit 00.000111 which is the output from the most significant digit detection unit 5 and takes the logical sum thereof (step S15). A value 1 obtained by logically summing the logical sum and 1 from the addend lower sticky bit generation unit is output (step S16).
In the normalization shifter 10, since the normalization shift number from the most significant digit detection unit 5 obtained in step S10 is 1, the output 10.1011111 of the carry propagation adder 6 is shifted one digit to the right and the upper 6 bits are changed. 01.0110 is extracted (step S17), and ORed with the output 0.0000 of the addend higher incrementer 7 to obtain 01.0110 and output (step S18).
At this time, the first equation (1) is (01.0110 × 26) + sticky bit (5)
It has become.
The positive rounding unit 11 operates differently depending on the rounding mode. Here, assuming that the value is rounded toward the closer or even direction, the output of the normalization shifter 10 is 01.0110, and the sticky bit from the sticky bit generation unit 9 is 1. Therefore, the output of the positive number rounding unit 11 Is 1.011 (step S19).
The exponent correction unit 12 outputs the output 6 of the exponent normalization unit 8 as it is because the positive digit rounding unit 11 does not need to correct the most significant digit position (step S20).
As a result, the calculation result is 1.011 × 26 (step S21).

次に、以下の式(6)を計算する場合について図1、図3を参照して説明する。
図3は図1の積和演算器によりこの式(6)を計算する場合の図1の各構成要素での演算の流れを示す動作説明図である。
(−1.110×2~1)×(1.101×2~2)+(1.011×21)
……(6)
先ず、桁合せシフト数指数生成部1で、桁合せシフト数として(6)式の指数に基づき−1+(−2)−1=−4を生成する(ステップS30)。
この場合、桁合せシフト数−4は−3以下なので、指数として、積部の指数の和(−1+(−2)=−3)と加数部の指数1とのうち加数部の指数の値1を選択して出力する(図3のステップS31)。
次に、加数桁合せ符号合せ部2で、ステップS30で得られた桁合せシフト数−4に従い、加数の仮数部1.011を4桁左(上位側)にシフトして10110.000000を得る。
先ず、加数中位10.000000(4桁×4桁の乗算なので8桁を有効数字とする)を得(ステップS32)。
ここで、式(6)の積の結果と加数が異符号なのでEORゲートEOR1の出力は1であり、従ってステップS32で得られた加数中位10.000000を反転して01.111111を得て乗算アレイ4に出力する(ステップS33)。
さらに、加数の仮数部1.011を反転したもの0.100とマスク1.110(4桁左シフトにより仮数部1.011が上位にはみ出したビットは3ビットなので、この上位側3ビットを有効とすべくマスクビットは1.110である)との論理積から加数上位0.100を得て加数上位インクリメント部7に出力する(ステップS34)。
また、さらに加数の仮数部1.011とマスク0.000(4桁左シフトにより仮数部1.011が下位にはみ出したビットはないのでマスクビットは全て0となる)との論理積から加数下位0.000を得て加数下位スティッキービット生成部3に出力する(ステップS35)。
さらに、上記のように加数上位は上位側3ビットが有効なので、上位から3ビット目が加数上位の最下位にに対応するため、その位置に1を立てて加数上位最下位として0.010を得て、加数上位インクリメント部7に出力する(ステップS36)。
尚、加数上位の2の補数は10.100であるが、最上位桁は符号を表していて計算には不要なので省く。
Next, the case where the following formula (6) is calculated will be described with reference to FIGS.
FIG. 3 is an operation explanatory diagram showing the flow of calculation in each component of FIG. 1 when the equation (6) is calculated by the product-sum calculator of FIG.
(−1.110 × 2 to 1) × (1.101 × 2 to 2) + (1.011 × 21)
...... (6)
First, the digit shift number index generation unit 1 generates −1 + (− 2) −1 = −4 based on the index of the equation (6) as the digit shift number (step S30).
In this case, since the digit shift number −4 is −3 or less, the exponent of the addend part of the sum of the exponents of the product part (−1 + (− 2) = − 3) and the exponent 1 of the addend part is used as the exponent. 1 is selected and output (step S31 in FIG. 3).
Next, the mantissa part 1.011 of the addend is shifted 4 digits to the left (upper side) in accordance with the digit shift number -4 obtained in step S30 in the addend digit matching code matching unit 2 to 1011.0000000 Get.
First, an addend middle 10.000.000 is obtained (8 digits are significant because it is a multiplication of 4 digits × 4 digits) (step S32).
Here, since the result of the product of Equation (6) and the addend are different in sign, the output of the EOR gate EOR1 is 1, so that the addend middle 10.000.000 obtained in step S32 is inverted and 01.111111 is set. Obtained and output to the multiplication array 4 (step S33).
Further, an inverted version of the mantissa part 1.011 of the addend and 0.100 and mask 1.110 (the bits that the mantissa part 1.011 protrudes to the upper side due to 4-digit left shift are 3 bits, so the upper 3 bits are The addend upper 0.100 is obtained from the logical product with the mask bit of 1.110 to be valid) and output to the addend upper increment unit 7 (step S34).
Further, it is added from the logical product of the mantissa part 1.011 of the addend and the mask 0.000 (the mask bits are all 0 because there is no bit in which the mantissa part 1.011 protrudes to the lower order due to the 4-digit left shift). The number lower order 0.000 is obtained and output to the addend lower sticky bit generation unit 3 (step S35).
Furthermore, since the upper 3 bits are valid for the upper part of the addend as described above, the third bit from the upper part corresponds to the lowest order of the addend high. .010 is obtained and output to the addend upper increment unit 7 (step S36).
The 2's complement of the upper part of the addend is 10.100, but it is omitted because the most significant digit represents a sign and is not necessary for calculation.

次に、加数下位スティッキービット生成部3において加数下位に基づき加数下位スティッキービットを生成するが、この場合加数下位が0000で全て0であるため加数下位スティッキービットとして0を生成してスティッキービット生成部9に出力する(ステップS37)。
また、積の結果と加数が異符号(−と+)(即ち、図2のEORゲートEOR1の出力が1)であり、かつスティッキービットが0なので、ANDゲートAND1(スティッキービットは反転されてAND1に入力されるので)であり、この値1はキャリー伝搬加算部6に与えられる(ステップS38)。これは積の結果と加数が異符号の時はnegateする必要があるからである。
Next, the addend lower sticky bit is generated in the addend lower sticky bit generation unit 3 based on the addend lower. In this case, the addend lower sticky is 0000 and all 0s, so 0 is generated as the addend lower sticky bit. To the sticky bit generation unit 9 (step S37).
Also, since the product and the addend have different signs (-and +) (ie, the output of the EOR gate EOR1 in FIG. 2 is 1) and the sticky bit is 0, the AND gate AND1 (the sticky bit is inverted) This value 1 is given to the carry propagation adder 6 (step S38). This is because it is necessary to negate when the product and the addend have different signs.

これらの操作により、(6)式は次式(7)のようになる。
−(0.100×21)+{(1.110×1.101+01.111111)×2~3} ……(7)
次に、乗算アレイ4において、上式(7)の
(1.110×1.101+01.111111)内の計算を行うが、先ず乗算部分を加算部に直して上記の場合と同様に3項ずつ加算して以下の様にキャリー部(8−1)と和の部(8−2)を得る(ステップS39)。
011.101100 ……(8−1)
+ 01.001001 ……(8−2)
この2項が(8−1),(8−2)が乗算アレイ4出力である。
By these operations, the equation (6) becomes the following equation (7).
− (0.100 × 21) + {(1.110 × 1.101 + 01.111111) × 2-3} (7)
Next, in the multiplication array 4, the calculation within (1.110 × 1.101 + 01.111111) of the above equation (7) is performed. First, the multiplication part is changed to the addition unit, and three terms are used as in the above case. Addition is performed to obtain a carry part (8-1) and a sum part (8-2) as follows (step S39).
011.101100 (8-1)
+ 01.001001 (8-2)
The two terms are (8-1) and (8-2) are the outputs of the multiplication array 4.

最上位桁検出部5は乗算アレイ4の出力(式(8−1),(8−2))及び桁合せシフト数指数生成部1からの桁合せシフト数に基づき、指数正規化値、スティッキービット生成用のマスク、正規化シフト数を生成する。
上記したように、桁合せシフト数が−3以下であり、またこの場合、乗数と被乗数との積の結果とは異符号であるので最上位桁は加数上位の最上位桁の1桁下位となる。また、積の結果と加数とが異符号であるため、指数正規化値としては−1を指数正規化部8へ出力する(ステップS40)。
マスクとしては、最上位桁(小数点から左に4桁目)の下位n+1(=4+1=5)桁目(小数点から右に2桁目)以下に“1”を立てて00.011111を得る(ステップS40)。
また、正規化シフト数としては、桁合せシフト数−4に1を加算して符号反転した値3であり、この値を正規化シフタ10へ出力する(ステップS41)。
また、桁合せシフト数が−3以下の場合、積の結果と加数とが同符号の場合は符号反転信号として0を、異符号の場合は符号反転信号として1を出力する。従って、この場合は異符号のため1を出力する(ステップS48)。
The most significant digit detecting unit 5 is based on the output of the multiplication array 4 (formulas (8-1) and (8-2)) and the digitized shift number from the digitized shift number exponent generating unit 1 and the exponent normalized value, sticky Generates a mask for generating bits and a normalized shift number.
As described above, the number of digit shifts is -3 or less, and in this case, the product of the multiplier and multiplicand has a different sign, so the most significant digit is one digit lower than the most significant digit of the addend. It becomes. Further, since the product result and the addend have different signs, −1 is output to the exponent normalization unit 8 as the exponent normalization value (step S40).
As a mask, “0” is set to 00.011111 below the lowermost n + 1 (= 4 + 1 = 5) digit (second digit to the right of the decimal point) of the most significant digit (fourth digit to the left of the decimal point) ( Step S40).
The normalized shift number is a value 3 obtained by adding 1 to the digit shift number -4 and inverting the sign, and outputs this value to the normalized shifter 10 (step S41).
When the digit shift number is -3 or less, 0 is output as the sign inversion signal when the product result and the addend have the same sign, and 1 is output as the sign inversion signal when the sign is different. Therefore, in this case, 1 is output because of the different code (step S48).

キャリー伝搬加算器6では、乗算アレイ4の出力のキャリー部(8−1)と加算部(8−2)とANDゲートAND1の出力1を加算して100.110110を生成し(ステップS42)、スティッキービット生成部9および正規化シフタ10へ出力する。また、ステップS42で得た加算値100.110110の最上位からのキャリー1を加数上位インクリメンタ7へ出力する(ステップS43)。   The carry propagation adder 6 adds the carry part (8-1), the adder part (8-2) of the output of the multiplication array 4 and the output 1 of the AND gate AND1 to generate 100.110110 (step S42). It outputs to the sticky bit generation unit 9 and the normalization shifter 10. Further, the carry 1 from the top of the added value 100.110110 obtained in step S42 is output to the addend higher incrementer 7 (step S43).

加数上位インクリメンタ7では、加数上位0.100と加数上位最下位0.010とキャリー1を入力し、キャリーに応じて、加数上位と加数上位最下位の和00.110と加数上位0.100の一方を選択する。
このケースでは、キャリーが1なので、和00.110を選択し、また、積の結果と加数が異符号なので(即ち、図2のEORゲートEOR1の出力が1なので)左に1桁シフトを行って(即ち、桁合わせを行って)シフト後の値01.100を正規化シフタ10に出力する(ステップS44)。
In the addend high incrementer 7, the addend high 0.100, the addend high lowest 0.010 and the carry 1 are input, and according to the carry, the addend high and the addend high lowest sum 0.0110 Select one of the higher addends 0.100.
In this case, the carry is 1, so the sum of 0.110 is selected, and the result of the product and the addend are different signs (that is, the output of the EOR gate EOR1 in FIG. 2 is 1). After performing (that is, performing digit alignment), the shifted value 01.100 is output to the normalization shifter 10 (step S44).

指数正規化部8では、桁合せシフト数指数生成部1からの指数1と最上位桁検出部5からの指数正規化値−1を加算して0を出力する(ステップS45)。
この時、最初の式は
−{(01.10×20)+(00.110110×2~3)} ……(8)
となっている。
次に、スティッキービット生成部9で、キャリー伝搬加算器6の出力00.110110を最上位桁検出部5からの出力であるマスクビット00.011111でマスクしてそれらの論理和をとり、さらに該論理和と加数下位スティッキービット生成部からの0との論理和をとった値1を出力する(ステップS46)。
正規化シフタ10では、正規化シフト数が3であるからキャリー伝搬加算器6出力00.110101を3桁右シフトして上位6ビットの00.0001を抽出し、加数上位インクリメンタ7の出力01.100と論理和をとって、01.1001として出力する(ステップS47)。
この時、最初の式(6)は
−((01.1001×20)+スティッキービット) ……(9)
となっている。
正数化丸め部11では、まず、加数上位が負であるから、最上位桁検出部5からの符号反転信号1に応答して正数化のために正規化シフタ10の出力01.1001をその0、1を反転して10.0110とする(ステップS49)。
スティッキービットが0でないので正数化のために1を加算する必要はない。さらに、正規化すべく最上位桁位置を補正して1.00110とする(ステップS50)。
値の近い方または偶数方向に丸めるものとすると、スティッキービットが1であるから、正数化丸め部11出力は1.010である(ステップS51)。
指数補正部12では、正数化丸め部11で1桁補正したので、指数正規化部8出力0に1を加算して1を出力する(ステップS52)。
この結果、最終的な演算結果は1.010×21となる(ステップS53)。
The exponent normalization unit 8 adds the exponent 1 from the digit shift number exponent generation unit 1 and the exponent normalization value −1 from the most significant digit detection unit 5 to output 0 (step S45).
At this time, the first expression is − {(01.10 × 20) + (10.110110 × 2 to 3)} (8)
It has become.
Next, the sticky bit generation unit 9 masks the output 00.1110110 of the carry propagation adder 6 with the mask bit 00.011111 which is the output from the most significant digit detection unit 5 to obtain the logical sum of them. A value 1 obtained by logically summing the logical sum and 0 from the addend lower sticky bit generation unit is output (step S46).
In the normalization shifter 10, since the normalized shift number is 3, the output of the carry propagation adder 6 output 0.110101 is shifted right by 3 digits to extract the upper 6 bits of 0.0001, and the output of the addend upper incrementer 7 is output. The logical sum of 01.100 is taken and output as 01.1001 (step S47).
At this time, the first equation (6) is − ((01.1001 × 20) + sticky bit) (9)
It has become.
In the positive number rounding unit 11, first, since the upper part of the addend is negative, the output 01.1001 of the normalization shifter 10 is used for positive number in response to the sign inversion signal 1 from the most significant digit detection unit 5. Is inverted to 0.11010 (step S49).
Since the sticky bit is not 0, it is not necessary to add 1 to make it positive. Further, the most significant digit position is corrected to be normalized to be 1.00110 (step S50).
If rounding is performed in the direction closer to the value or in the even direction, the sticky bit is 1, and therefore the output of the rounding unit 11 is 1.010 (step S51).
Since the exponent correction unit 12 corrects one digit by the positive number rounding unit 11, 1 is added to the output 0 of the exponent normalization unit 8 to output 1 (step S52).
As a result, the final calculation result is 1.010 × 21 (step S53).

このように、本例では、積より加数の方が大きい場合に、積より上位にはみ出した加数上位部分を最上位桁を動かさずに処理し、該はみ出した部分以外の加数と積との積和演算結果を正規化したものと最終的に加算を行って最終的な正規化した積和演算結果を得ている。従って、上記積より上位にはみ出した加数上位部分の正規化が不要なため、積和演算が高速化される。   Thus, in this example, when the addend is larger than the product, the upper part of the addend that protrudes higher than the product is processed without moving the most significant digit, and the addend and product other than the protruded part are multiplied. The final product-sum operation result is obtained by adding the normalized product-sum operation result and the final sum. Accordingly, normalization of the upper part of the addend that protrudes above the product is not required, so that the product-sum operation is speeded up.

ここで、最上位桁検出部5において、乗算アレイ4の出力である2項から、正規化前の積和演算結果の仮数部の絶対値のうち0でない最上位桁を求める処理を図4のフローチャートを用いて説明する。
先ず、ステップ401において、桁合わせシフト数が−3以下か−2以上かを判断し、−2以上の場合は図5〜図7の処理(本実施例では図7の処理)を行う。
一方、桁合わせシフト数が−3以下の場合は、ステップ402に進み、乗数と被乗数との積と加数とが異符号か同符号かを判定する。
同符号と判定された場合は、加数上位の最上位桁を上記正規化前の積和演算結果の仮数部の絶対値のうち0でない最上位桁と判定する(ステップ403)。
一方、異符号と判定された場合は、加数上位の最上位桁の1桁下位の桁を上記正規化前の積和演算結果の仮数部の絶対値のうち0でない最上位桁と判定する(ステップ404)。
Here, the most significant digit detection unit 5 obtains the most significant digit that is not 0 among the absolute values of the mantissa part of the product-sum operation result before normalization from the two terms output from the multiplication array 4 in FIG. This will be described with reference to a flowchart.
First, in step 401, it is determined whether the number of digit shifts is −3 or less or −2 or more. If it is −2 or more, the processing of FIGS. 5 to 7 (processing of FIG. 7 in this embodiment) is performed.
On the other hand, if the digit shift number is -3 or less, the process proceeds to step 402, where it is determined whether the product of the multiplier and multiplicand and the addend are different signs or signs.
If it is determined that the sign is the same, the most significant digit in the addend is determined to be the most significant digit that is not 0 among the absolute values of the mantissa part of the product-sum operation result before normalization (step 403).
On the other hand, when it is determined that the sign is different, the digit one digit lower than the most significant digit in the addend is determined to be the most significant digit that is not 0 in the absolute value of the mantissa part of the product-sum operation result before normalization. (Step 404).

次に、桁合せシフト数が−2以上の場合の、最上位桁検出部5において、乗算アレイ4の出力である2項から、正規化前の積和演算結果の仮数部の絶対値のうち0でない最上位桁を誤差なしで求める処理を説明する。
まず、最上位桁検出部5において、一般に2の補数表現の入力を検出部5の加算器に与え、それらの加算結果の絶対値の0でない最上位桁を誤差なしで求める方式を説明し、次に、1桁の誤差を認めることによってこの処理を簡素化し、最後に、実際に最上位桁検出部5に適用した場合について説明する。
図5は、加算器への入力から加算結果の絶対値のうち0でない最上位桁を誤差なしで求める処理である。
加算結果が正の場合は加算結果がそのまま絶対値であるので、加算結果の0でない最上位桁を求めればよい。これに対して、加算結果が負の場合は、絶対値にするために加算結果を0、1反転して1を加算する。この時、通常は最上位からみて最初の0の桁が、絶対値の0でない最上位桁となる。しかし、加算結果が最上位から途中まですべて1で残りが全て0の場合は、0、1反転して1を加算するとキャリーが伝わるので、最上位からみて最初の0の桁の1桁上位が0でない最上位桁となる。このことを踏まえると処理は以下のようになる。
Next, in the most significant digit detection unit 5 when the digit shift number is −2 or more, the absolute value of the mantissa part of the product-sum operation result before normalization is calculated from the two terms output from the multiplication array 4. A process for obtaining the highest digit other than 0 without error will be described.
First, in the most significant digit detecting unit 5, a method of generally giving an input of 2's complement expression to the adder of the detecting unit 5 and obtaining the most significant non-zero digit of the addition result without error will be described. Next, a case will be described in which this process is simplified by recognizing an error of one digit, and finally applied to the most significant digit detector 5.
FIG. 5 shows a process for obtaining the highest non-zero digit from the absolute value of the addition result from the input to the adder without error.
When the addition result is positive, since the addition result is an absolute value as it is, the most significant digit other than 0 may be obtained. On the other hand, when the addition result is negative, the addition result is inverted by 0 and 1 and 1 is added to obtain an absolute value. At this time, normally, the first 0 digit as viewed from the most significant digit is the most significant digit that is not 0 in absolute value. However, if the addition result is all 1s from the most significant to the middle and all the remaining are 0s, the carry is transmitted when 1 is added after reversing 0, so that the first digit higher than the first 0 is seen from the most significant. The most significant digit that is not zero. Based on this, the process is as follows.

第1、第2ステップは正負のチェック、第3ステップは最上位桁の検索、第4ステップはキャリーの有無による最上位桁の補正、第5ステップは負数の正数化時のキャリーの有無による最上位桁の補正を行っている。
まず、第1ステップで、乗算アレイ4の2つの項の出力であるキャリー部と和部の対応する桁、先ず最上位桁のビット対、即ち入力2ビットの値をチェックする。“00”または“11”の場合は第2ステップを飛ばして第3ステップを行う。“01”または“10”の場合は第2ステップを行う。
第2ステップでは、次の桁から下位に向かって入力2ビットの値が“00”または“11”の桁を探す。発見できなかった場合は図5の(11)に該当し加算結果はオール1すなわち−1なので、0でない最上位桁は最下位桁である。
第3ステップは第1、第2ステップの結果によって2通りに分かれる。
一方は第1ステップで最上位桁の入力2ビットの値が“11”の場合または第2ステップで“00”を発見した場合である。この場合の加算結果は負であるので、第3−ステップを行う。他方は第1ステップで最上位桁の入力2ビットの値が“00”の場合および第2ステップで“11”を発見した場合である。この場合の加算結果は正であるので、第3+ステップを行う。
第3−ステップでは、次の桁から下位に向かって入力2ビットの値が“11”以外の桁を探す。発見できなかった場合は図5の(6)に該当し加算結果は−2なので、0でない最上位桁は最下位桁の1桁上位である。“01”または“10”を発見した場合は、下位からのキャリーの有無によって0でない最上桁が1桁動くので、第4−ステップを行う。“00”を発見した場合は、第5−Bステップを行う。
第3+ステップでは、次の桁から下位に向かって入力2ビットの値が“00”以外の桁を探す。発見できなかった場合は図5の(10)に該当し加算結果は0なので、0でない最上位桁は存在しない。“01”または“10”を発見した場合は、下位からのキャリーの有無によって0でない最上桁が1桁動くので、第4+ステップを行う。“11”を発見した場合は図5の(9)に該当し、この桁でキャリーが発生して1桁上位が1となるので、この桁の1桁上位が0でない最上位桁である。
第4−ステップでは、次の桁から下位に向かって入力2ビットの値が“00”または“11”の桁を探す。“11”を発見した場合は第5−Aステップを行う。“00”を発見した場合または発見できなかった場合は図5の(3)に該当しキャリーが発生しないので、第3−ステップで発見した桁の1桁上位が0でない最上位桁である。
第4+ステップでは、次の桁から下位に向かって入力2ビットの値が“00”または“11”の桁を探す。“11”を発見した場合は図5の(8)に該当し、この桁から第3+ステップで発見した桁の1桁上位までキャリーが伝わって、第3+ステップで発見した桁の1桁上位が0でない最上位桁になる。“00”を発見した場合または発見できなかった場合は図5の(7)に該当しキャリーが発生しないので、第3+ステップで発見した桁が0でない最上位桁である。
第5−Aステップでは、次の桁から下位に向かって入力2ビットの値が“00”以外の桁を探す。発見した場合は図5の(1)に該当し、第4−ステップで発見した桁から第3−ステップで発見した桁の1桁上位までキャリーが伝わって、第3−ステップで発見した桁が0でない最上位桁になる。発見しなかった場合は図5の(2)に該当し、0、1反転して1を加算するとさらにキャリーが伝わるので、3−ステップで発見した桁の1桁上位が0でない最上位桁である。
第5−Bステップでは、次の桁から下位に向かって入力2ビットの値が“00”以外の桁を探す。発見した場合は図5の(4)に該当し、3−ステップで発見した桁の1桁上位が0でない最上位桁である。発見しなかった場合は図5の(5)に該当し、0、1反転して1を加算するとキャリーが伝わるので、3−ステップで発見した桁の2桁上位が0でない最上位桁である。
以上が加算器入力から加算結果の絶対値の0でない最上位桁を求める処理である。
The first and second steps are positive / negative check, the third step is the search for the most significant digit, the fourth step is the correction of the highest digit by the presence / absence of a carry, and the fifth step is the presence / absence of a carry when a negative number is converted to a positive number The most significant digit is corrected.
First, in the first step, the corresponding digits of the carry part and the sum part, which are the outputs of the two terms of the multiplication array 4, first, the bit pair of the most significant digit, that is, the value of the input 2 bits is checked. In the case of “00” or “11”, the second step is skipped and the third step is performed. If “01” or “10”, the second step is performed.
In the second step, the digit whose input 2-bit value is “00” or “11” is searched from the next digit toward the lower order. If it cannot be found, it corresponds to (11) in FIG. 5 and the addition result is all 1 or -1, so the highest digit that is not 0 is the lowest digit.
The third step is divided into two types according to the results of the first and second steps.
One is the case where the value of the input 2 bits of the most significant digit is “11” in the first step or “00” is found in the second step. Since the addition result in this case is negative, the third step is performed. The other is the case where the value of the input 2 bits of the most significant digit is “00” in the first step and “11” is found in the second step. Since the addition result in this case is positive, the third + step is performed.
In the third step, the input 2-bit value is searched for a digit other than “11” from the next digit to the lower order. If not found, it corresponds to (6) in FIG. 5 and the addition result is −2, so the highest digit that is not 0 is one digit higher than the lowest digit. If “01” or “10” is found, the fourth digit is performed because the highest digit that is not 0 moves by one depending on the presence / absence of carry from the lower order. If “00” is found, Step 5-B is performed.
In the third + step, a digit whose value of input 2 bits is other than “00” is searched from the next digit toward the lower order. If not found, it corresponds to (10) in FIG. 5 and the addition result is 0, so there is no non-zero most significant digit. If “01” or “10” is found, the 4th step is performed because the most significant digit that is not 0 moves 1 digit depending on whether there is a carry from the lower order. When “11” is found, it corresponds to (9) in FIG. 5, and a carry occurs in this digit and the upper digit of 1 is 1, so the upper digit of this digit is the highest digit other than 0.
In the fourth step, from the next digit toward the lower order, a digit whose input 2-bit value is “00” or “11” is searched. If “11” is found, Step 5-A is performed. When “00” is found or not found, it corresponds to (3) in FIG. 5 and no carry occurs, so that the first digit higher than the digit found in the third step is the highest digit other than 0.
In the 4th + step, from the next digit, the input 2-bit value is searched for a digit whose value is “00” or “11”. When “11” is found, it corresponds to (8) in FIG. 5, and the carry is transmitted from this digit to the digit one digit higher in the third + step, and the digit one digit higher in the third + step is found. The most significant digit that is not zero. If “00” is found or cannot be found, it corresponds to (7) in FIG. 5 and no carry occurs, so the digit found in the third + step is the highest digit other than 0.
In step 5-A, a digit whose input 2-bit value is other than “00” is searched from the next digit toward the lower order. If found, it corresponds to (1) in Fig. 5 and the carry is transmitted from the digit found in the 4-step to the digit one digit higher in the 3-step, and the digit found in the 3-step is The most significant digit that is not zero. If it is not found, it corresponds to (2) in FIG. 5, and if 1 is reversed and added to 1 and carry is further transmitted, the carry is transmitted. is there.
In step 5-B, the input 2-bit value is searched for a digit other than “00” from the next digit downward. When found, it corresponds to (4) in FIG. 5, and the highest digit that is one digit higher than the digit found in the 3-step is the non-zero digit. If it is not found, it corresponds to (5) in FIG. 5, and if 1 is inverted and 0 is added, carry is transmitted. Therefore, the second digit higher than the digit found in 3-step is the highest digit other than 0. .
The above is the processing for obtaining the most significant digit other than 0 as the absolute value of the addition result from the adder input.

次に、上記処理を4ビットの具体的な数値を使用して説明する。
図5のように本処理では11通りの場合があるのでそれぞれの場合について説明する。
加算器入力を1011と1110とすると、第1ステップで最上位桁は“11”であるから、次に第3−ステップを行う。上位から第2桁で“01”を発見するので、次に第4−ステップを行う。次の桁で“11”を発見するので、次に第5−Aステップを行う。次の桁で“00”以外を発見するので(1)に該当し、0でない最上位桁は第2桁である。実際に加算して符号反転すると0111となり正しい結果を得ている。
加算器入力を1101と1111とすると、第1ステップで最上位桁は“11”であるから、次に第3−ステップを行う。上位から第3桁で“01”を発見するので、次に第4−ステップを行う。次の桁で“11”を発見するので、次に第5−Aステップを行う。既に最下位に達しているので発見できない場合になって(2)に該当し、0でない最上位桁は第2桁である。実際に加算して符号反転すると0100となり正しい結果を得ている。
加算器入力を0010と1000とすると、第1ステップで最上位桁は“01”であるから、次に第2ステップを行う。次の桁で“00”を発見するので第3−ステップを行う。上位から第3桁で“10”を発見するので、次に第4−ステップを行う。次の桁で“00”を発見するので(3)に該当し、0でない最上位桁は第2桁である。実際に加算して符号反転すると0110となり正しい結果を得ている。
加算器入力を1000と0001とすると、第1ステップで最上位桁は“10”であるから、次に第2ステップを行う。次の桁で“00”を発見するので第3−ステップを行う。上位から第3桁で“00”を発見するので、次に第5−Bステップを行う。次の桁で“00”以外を発見するので(4)に該当し、0でない最上位桁は第2桁である。実際に加算して符号反転すると0111となり正しい結果を得ている。
加算器入力を1100と1100とすると、第1ステップで最上位桁は“11”であるから、第3−ステップを行う。上位から第3桁で“00”を発見するので、第5−Bステップを行う。“00”以外を発見しないので(5)に該当し、0でない最上位桁は第1桁である。実際に加算して符号反転すると1000となり正しい結果を得ている。
加算器入力を0101と1001とすると、第1ステップで最上位桁は“01”であるから、次に第2ステップを行う。次の次の桁で“00”を発見するので第3−ステップを行う。“11”以外を発見しないので、(6)に該当し、0でない最上位桁は第3桁である。実際に加算して符号反転すると0010となり正しい結果を得ている。
加算器入力を0110と1101とすると、第1ステップで最上位桁は“01”であるから、次に第2ステップを行う。次の桁で“11”を発見するので第3+ステップを行う。上位から第3桁で“10”を発見するので、次に第4+ステップを行う。“00”も“11”も発見しないので(7)に該当し、0でない最上位桁は第3桁である。実際に加算すると0011となり正しい結果を得ている。
加算器入力を0011と0101とすると、第1ステップで最上位桁は“00”であるから、次に第3+ステップを行う。上位から第2桁で“01”を発見するので、次に第4+ステップを行う。次の次の桁で“11”も発見するので(8)に該当し、0でない最上位桁は第1桁である。実際に加算すると1000となり正しい結果を得ている。
加算器入力を0011と0010とすると、第1ステップで最上位桁は“00”であるから、次に第3+ステップを行う。上位から第3桁で“11”を発見するので(9)に該当し、0でない最上位桁は第2桁である。実際に加算すると0101となり正しい結果を得ている。
加算器入力を0110と1010とすると、第1ステップで最上位桁は“01”であるから、次に第2ステップを行う。次の次の桁で“11”を発見するので第3+ステップを行う。“00”以外の桁を発見しないので(10)に該当し、値が0となって0でない最上位桁は存在しない。実際に加算すると0000となり正しい結果を得ている。
加算器入力を0110と1001とすると、第1ステップで最上位桁は“01”であるから、次に第2ステップを行う。“00”も“11”も発見しないので(11)に該当し、0でない最上位桁は最下位である。実際に加算して符号反転すると0001となり正しい結果を得ている。
以上が加算器入力から加算結果の絶対値の0でない最上位桁を誤差なしで求める処理の具体例である。
Next, the above process will be described using specific numerical values of 4 bits.
Since there are 11 cases in this processing as shown in FIG. 5, each case will be described.
If the adder inputs are 1011 and 1110, the most significant digit is "11" in the first step, so the third step is performed next. Since “01” is found in the second digit from the higher order, the fourth step is performed next. Since “11” is found in the next digit, the 5-A step is performed next. Since the next digit other than “00” is found, it corresponds to (1), and the highest digit that is not 0 is the second digit. When it is actually added and the sign is inverted, 0111 is obtained and a correct result is obtained.
If the adder inputs are 1101 and 1111, the most significant digit is “11” in the first step, so the third step is performed next. Since “01” is found in the third digit from the upper order, the fourth step is performed next. Since “11” is found in the next digit, the 5-A step is performed next. Since it has already reached the lowest order and cannot be found, it corresponds to (2), and the highest digit that is not 0 is the second digit. When it is actually added and the sign is inverted, 0100 is obtained and a correct result is obtained.
If the adder inputs are 0010 and 1000, the most significant digit is “01” in the first step, so the second step is performed next. Since “00” is found in the next digit, the third step is performed. Since “10” is found in the third digit from the upper order, the fourth step is performed next. Since “00” is found in the next digit, it corresponds to (3), and the most significant digit which is not 0 is the second digit. When it is actually added and the sign is inverted, 0110 is obtained and a correct result is obtained.
If the adder inputs are 1000 and 0001, the most significant digit is “10” in the first step, so the second step is performed next. Since “00” is found in the next digit, the third step is performed. Since “00” is found in the third digit from the higher order, the 5-B step is performed next. Since other than “00” is found in the next digit, it corresponds to (4), and the highest digit which is not 0 is the second digit. When it is actually added and the sign is inverted, 0111 is obtained and a correct result is obtained.
If the adder inputs are 1100 and 1100, the most significant digit is “11” in the first step, so the third step is performed. Since “00” is found in the third digit from the upper order, Step 5-B is performed. Since nothing other than “00” is found, this corresponds to (5), and the most significant digit that is not 0 is the first digit. When it is actually added and the sign is inverted, it becomes 1000 and a correct result is obtained.
If the adder inputs are 0101 and 1001, the most significant digit is “01” in the first step, so the second step is performed next. Since “00” is found in the next digit, the third step is performed. Since a value other than “11” is not found, it corresponds to (6) and the most significant digit that is not 0 is the third digit. When it is actually added and the sign is inverted, 0010 is obtained and a correct result is obtained.
If the adder inputs are 0110 and 1101, the most significant digit is “01” in the first step, so the second step is performed next. Since “11” is found in the next digit, the third + step is performed. Since “10” is found in the third digit from the upper order, the 4th + step is performed next. Since neither “00” nor “11” is found, this corresponds to (7), and the most significant digit that is not 0 is the third digit. When actually added, 0011 is obtained and a correct result is obtained.
If the adder inputs are 0011 and 0101, the most significant digit is “00” in the first step, so the third + step is performed next. Since “01” is found in the second digit from the upper order, the 4th + step is performed next. Since “11” is also found in the next next digit, it corresponds to (8), and the most significant digit which is not 0 is the first digit. When it actually adds, it becomes 1000 and has obtained a correct result.
If the adder inputs are 0011 and 0010, the most significant digit is “00” in the first step, so the third + step is performed next. Since “11” is found in the third digit from the top, this corresponds to (9), and the highest digit that is not 0 is the second digit. When actually added, it becomes 0101, and a correct result is obtained.
If the adder inputs are 0110 and 1010, the most significant digit is “01” in the first step, so the second step is performed next. Since “11” is found at the next next digit, the third + step is performed. Since no digit other than “00” is found, this corresponds to (10), the value is 0, and there is no non-zero most significant digit. When actually added, the result is 0000, and the correct result is obtained.
If the adder inputs are 0110 and 1001, the most significant digit is “01” in the first step, so the second step is performed next. Since neither “00” nor “11” is found, this corresponds to (11), and the most significant digit that is not 0 is the least significant digit. When it is actually added and the sign is inverted, 0001 is obtained and a correct result is obtained.
The above is a specific example of the process for obtaining the most significant non-zero absolute value of the addition result from the adder input without error.

上記図5の処理は比較的複雑でハードウェア量および検出時間の増大を招く恐れがある。これに対して、0でない最上位桁を求める際に1桁の誤差を認めれば、上記処理は大幅に簡素化される。
図6は加算器入力から加算結果の絶対値の0でない最上位桁を1桁の誤差で求める処理である。
第1、第2ステップは図5の処理と同一である。第3−ステップおよび第3+ステップでは、次の桁から下位に向かって入力2ビットの値がそれぞれ“11”以外および“00”以外の桁を探し、発見した桁を0でない最上位桁とする。発見できなかった場合は最下位桁を0でない最上位桁とする。
こうすると図5の(1)〜(11)のうち、(5)以外は1桁の誤差に収る。(5)の場合は発見した桁の2桁上位が0でない最上位桁であり1桁の誤差に収まらない。
しかし、この場合は正数化丸め部11において以下のように処理すればよい。上記の場合、正数化丸め部11において符号反転した時点では、まだ発見した桁の1桁上位が0でない最上位桁であり1桁の誤差に収まっていて、値はオール1である。そして、1を加算するとキャリーが最上位まで伝わって100.0となる。この結果を2桁右シフトすると正しい仮数部が得られるので、指数補正部12に2を送り、指数を補正する。一方、仮数部は最上位以外は全て0でありシフトしなくても値は正しく、2桁右シフト回路は不要である。最上位のみ2桁右シフトを行う。
The processing of FIG. 5 is relatively complicated and may increase the amount of hardware and detection time. On the other hand, if an error of one digit is recognized when obtaining the most significant digit other than 0, the above processing is greatly simplified.
FIG. 6 shows a process for obtaining the highest non-zero digit of the addition result from the input of the adder with a one-digit error.
The first and second steps are the same as the processing in FIG. In the third step and the third + step, from the next digit, the input 2-bit values are searched for digits other than “11” and “00”, respectively, and the found digit is set to the highest non-zero digit. . If not found, the least significant digit is set to the most significant digit other than 0.
In this way, among (1) to (11) of FIG. In the case of (5), the second digit higher than the found digit is the highest digit other than 0, and does not fall within the error of one digit.
However, in this case, the positive rounding unit 11 may process as follows. In the above case, at the time when the sign is inverted in the positive number rounding unit 11, the one digit higher than the found digit is the most significant digit that is not 0 and is within one digit error, and the value is all 1. When 1 is added, the carry is transmitted to the top and becomes 100.0. If the result is shifted to the right by two digits, the correct mantissa is obtained, so 2 is sent to the exponent correction unit 12 to correct the exponent. On the other hand, the mantissa part is all zero except for the most significant part, and the value is correct even if it is not shifted, and a two-digit right shift circuit is not required. Only the most significant digit is shifted 2 digits to the right.

上記図6の処理を最上位桁検出部5に適用するには以下のようにする。
桁合せシフト数が−1以上の場合は加数上位は0桁であるが、桁合せシフト数が−2の場合は加数上位は1桁である。したがって、該最上位桁検出はキャリー伝搬加算器6の入力である乗算アレイ4の出力にこの加数上位1桁を加えた値に対して行う(図7の第1ステップ)。
乗算アレイ4の出力はそれぞれの入力がn桁とすると、2n+1桁と2n桁の2値になる。例えば、乗算アレイ4がキャリー保存加算器であれば、キャリー部分が2n+1桁、和の部分が2n桁となる。加数上位1桁は2n桁側に加える。こうすると、どちらも2n+1桁なる。図6の処理をそのまま適用するにはさらにキャリー部分、和の部分の最上位に符号ビットを加える必要がある。積と加数が同符号なら双方(キャリー部分、和の部分の最上位に)0、異符号なら一方の最上位に0、他方の最上位に1を加える。しかし、同符号なら第3+ステップから、異符号なら第2ステップから始めれば、符号ビットを付加しないで済む。結局、図6の処理の第1ステップを図7の第1ステップのように修正すればよい。
The process of FIG. 6 is applied to the most significant digit detection unit 5 as follows.
When the digit shift number is -1 or more, the upper part of the addend is 0 digits, but when the shift number is 2, the upper part of the addend is one digit. Therefore, the most significant digit detection is performed on the value obtained by adding the upper one digit of the addend to the output of the multiplication array 4 which is the input of the carry propagation adder 6 (first step in FIG. 7).
The output of the multiplication array 4 is binary with 2n + 1 digits and 2n digits, assuming that each input has n digits. For example, if the multiplication array 4 is a carry save adder, the carry part has 2n + 1 digits and the sum part has 2n digits. The upper 1 digit of the addend is added to the 2n digit side. In this way, both are 2n + 1 digits. In order to apply the processing of FIG. 6 as it is, it is necessary to add a sign bit to the most significant part of the carry part and the sum part. If the product and the addend have the same sign, 0 is added to both (the highest part of the carry part and the sum part). However, if the same sign is used from the 3+ step and if the different code is used from the second step, it is not necessary to add a sign bit. Eventually, the first step of the process of FIG. 6 may be modified as the first step of FIG.

図8は図7の処理を実現する図1の最上位桁検出部5の構成例を示すブロック図である。
最上位桁検出部5は桁シフト数判定部82と、符号判定部84と、最上位桁判定部86と、検索回路80と、エンコーダ88とを含む。ここではスティッキービット生成用のマスクの生成部の構成は省略する。
桁シフト数判定部82は入力された桁シフト数S1の値が−2以上か、−3以下かを判定する。桁シフト数が−3以下と判定された場合は、最上位桁判定部86において、ゲートEOR1の出力に基づき図4のステップ402−404の処理を行うと共に、検索回路80に後述する検索完了モード(01)を出力して検索回路80での検索処理を行わない。
桁シフト数が−2以上と判定された場合は、符号判定部84において図7の第1ステップを行う。即ち、ゲートEOR1からの出力に基づき積と加数とが異符号か同符号かを判定し、その判定結果に基づいたモード(mode[K−1])を出力して検索回路80に与える。
検索回路80は図7の第2ステップ、第3+ステップ、第3−ステップを行うものである。
乗算アレイ4からの2項のビット幅が例えば4n桁(nは1又は2以上の整数)であるとすると、検索回路80はn−1個の4桁検索回路802〜80nと1つの最下位4桁検索回路801とから構成される。
図8において、各4桁検索回路への各入力input[]は、乗算アレイ4からの2項の対応する桁の1ビットずつ(即ち、キャリー部の1ビットと和部の1ビットからなるビット対)の計2ビットの組(桁の組)である。
各4桁検索回路は、各2ビットの組が図7の対応するステップに該当する数字の組であるかどうか判定し、判定結果をfound[]として出力すると共に、該回路への全ての入力の判定結果に従い検索モード信号mode[]を出力し、次段の検索回路に与える。
出力信号found[]は入力に対応する桁の数字が図7に対応するステップに該当する数字の組であれば“1”、そうでなければ“0”となる。
検索回路80の全ての出力found[4n−1]〜found[4k−4]はエンコーダ88でエンコードされ指数正規化値D7、正規化シフト数D9として出力される。
このように、本例では、検索回路80を4桁ごとに分割して複数の4桁検索回路を構成し、各4桁検索回路では乗算アレイ4からの2項の入力(input[])と前段の回路(または上位の4桁検索回路)からの検索モード(mode[])に基づき検索を行い、検索結果(found[])を出力すると共に、下位の4桁検索回路に検索結果に基づく検索モードを与える。
本例では、検索モードは図9のように4種類ある。即ち、図7の第2ステップに対応する正負判定モード、第3+ステップに対応する正数検索モード、第3−ステップに対応する負数検索モード、および検索終了モードであり、これら4種類のモードにはモードの種別を示す2ビットコード“00”“10”“11”“01”を割り当てている。
FIG. 8 is a block diagram illustrating a configuration example of the most significant digit detection unit 5 of FIG. 1 that implements the processing of FIG.
The most significant digit detection unit 5 includes a digit shift number determination unit 82, a sign determination unit 84, a most significant digit determination unit 86, a search circuit 80, and an encoder 88. Here, the configuration of the mask generation unit for generating sticky bits is omitted.
The digit shift number determination unit 82 determines whether the value of the input digit shift number S1 is −2 or more or −3 or less. If it is determined that the number of digit shifts is −3 or less, the most significant digit determination unit 86 performs the processing of steps 402 to 404 in FIG. 4 based on the output of the gate EOR1, and the search completion mode described later in the search circuit 80. (01) is output and the search processing in the search circuit 80 is not performed.
If it is determined that the digit shift number is −2 or more, the code determination unit 84 performs the first step of FIG. That is, based on the output from the gate EOR1, it is determined whether the product and the addend have different signs or the same sign, and a mode (mode [K-1]) based on the determination result is output and supplied to the search circuit 80.
The search circuit 80 performs the second step, the third + step, and the third step in FIG.
If the bit width of two terms from the multiplication array 4 is, for example, 4n digits (n is an integer of 1 or 2 or more), the search circuit 80 includes n-1 four-digit search circuits 802 to 80n and one least significant bit. A 4-digit search circuit 801.
In FIG. 8, each input input [] to each 4-digit search circuit is one bit of the corresponding digit in two terms from the multiplication array 4 (that is, a bit consisting of one bit of the carry portion and one bit of the sum portion). It is a set of 2 bits (a set of digits).
Each 4-digit search circuit determines whether each 2-bit set is a set of numbers corresponding to the corresponding step in FIG. 7, outputs the determination result as found [], and all inputs to the circuit. The search mode signal mode [] is output in accordance with the determination result of (1) and provided to the search circuit at the next stage.
The output signal found [] is “1” if the digit corresponding to the input is a set of numbers corresponding to the step corresponding to FIG. 7, and “0” otherwise.
All outputs found [4n-1] to found [4k-4] of the search circuit 80 are encoded by the encoder 88 and output as an exponent normalized value D7 and a normalized shift number D9.
As described above, in this example, the search circuit 80 is divided into four digits to constitute a plurality of four-digit search circuits, and each four-digit search circuit is configured to input two terms (input []) from the multiplication array 4. A search is performed based on the search mode (mode []) from the preceding circuit (or upper 4-digit search circuit), and the search result (found []) is output, and the lower 4-digit search circuit is based on the search result. Give search mode.
In this example, there are four search modes as shown in FIG. That is, a positive / negative determination mode corresponding to the second step in FIG. 7, a positive number search mode corresponding to the third + step, a negative number search mode corresponding to the third step, and a search end mode. Are assigned 2-bit codes “00”, “10”, “11”, and “01” indicating the type of mode.

図10、図11はそれぞれ図8の4桁検索回路、最下位4桁検索回路における論理の例を示す表である。図10、図11において、¬(00)、¬(11)(¬は否定を表わす)はそれぞれ00以外、11以外の2ビットの組み合わせを示す。
図8の検索回路80の動作を図7のフローチャート及び図10、図11に示す論理を用いて説明する。
符号判定部84は図7の第1ステップを実行するものであり、ゲートEOR1の出力が“1”であれば異符号であるのでモード信号mode[k−1]として正負判定モード[00]を出力し、ゲートEOR1の出力が“0”であれば同符号であるのでモード信号mode[k−1]として整数検索モード[10]を出力する。
各4桁検索回路802〜80nの動作を以下に説明する。
各4桁検索回路802〜80nにおいては、入力されるモード信号mode[k−1]のモードが正負判定モード[00]であれば(図10の(1)〜(22)該当する)、第2ステップを実行すべく、次の桁から下位に向かって2ビットの組が“00”または“11”の桁を探す。
該4桁検索回路の4組の入力input[4k−4]〜input[4k−1]に“00”の桁があれば(図10の(1)〜(10)該当)加算結果は負であるので、第3−ステップを実行し、該“00”が発見された桁から下位の桁に向かって“11”以外の桁を探す。“11”以外の桁が発見されれば、該発見された“11”以外の桁が求める最上位桁である。従って、この場合は次段以降の4桁検索回路での検索が不要であるのでモード信号mode[k]として検索完了モード[01]を出力する(図10の(1)〜(3)、(5)、(6)、(8))。“11”以外の桁が発見されなければ、モード信号mode[k]として負数検索モード[11]を出力し、次段の4桁検索回路において第3−ステップを実行する(図10の(4)、(7)、(9)、(10))。
10 and 11 are tables showing examples of logic in the 4-digit search circuit and the least significant 4-digit search circuit of FIG. 8, respectively. 10 and 11, ¬ (00) and ¬ (11) (where ¬ represents negation) indicate combinations other than 00 and 2 bits other than 11, respectively.
The operation of the search circuit 80 of FIG. 8 will be described using the flowchart of FIG. 7 and the logic shown in FIGS.
The sign determination unit 84 executes the first step of FIG. 7. If the output of the gate EOR1 is “1”, the sign determination unit 84 has a different sign, so the positive / negative determination mode [00] is set as the mode signal mode [k−1]. If the output of the gate EOR1 is “0”, the sign is the same, so that the integer search mode [10] is output as the mode signal mode [k−1].
The operation of each 4-digit search circuit 802-80n will be described below.
In each of the 4-digit search circuits 802 to 80n, if the mode of the input mode signal mode [k-1] is the positive / negative determination mode [00] (corresponding to (1) to (22) in FIG. 10), In order to execute the two steps, the digit of the set of 2 bits “00” or “11” is searched from the next digit downward.
If there is a digit of “00” in the four sets of input inputs [4k−4] to input [4k−1] of the 4-digit search circuit (corresponding to (1) to (10) in FIG. 10), the addition result is negative. Therefore, the third step is executed to search for a digit other than “11” from the digit where “00” is found toward the lower digit. If a digit other than “11” is found, the found digit other than “11” is the most significant digit to be obtained. Therefore, in this case, since the search in the 4-digit search circuit after the next stage is unnecessary, the search completion mode [01] is output as the mode signal mode [k] ((1) to (3) in FIG. 5), (6), (8)). If no digit other than “11” is found, the negative number search mode [11] is output as the mode signal mode [k], and the third step is executed in the next-stage 4-digit search circuit ((4 in FIG. 10). ), (7), (9), (10)).

一方、第2ステップにおいて、“11”の桁が発見されれば(図10の(13)〜(22)に該当)加算結果は正であるので、第3+ステップを実行し、該“11”が発見された桁から下位の桁に向かって“00”以外の桁を探す。
“00”以外の桁が発見されれば、該発見された“00”以外の桁が求める最上位桁である。従って、この場合は次段以降の4桁検索回路での検索が不要であるのでモード信号mode[k]として検索完了モード[01]を出力する((15)、(17)、(18)、(20)〜(22))。
“00”以外の桁が発見されなければ、モード信号mode[k]として正数検索モード[10]を出力し、次段の4桁検索回路において第3+ステップを実行する(図10の(13)、(14)、(16)、(19))。
また、第2ステップにおいて、“00”、“11”いずれの桁も発見されなければ、モード信号mode[k]として正負判定モード[00]を出力し、次段の4桁検索回路において第2ステップを実行する(図10の(11)、(12))。
On the other hand, if the digit “11” is found in the second step (corresponding to (13) to (22) in FIG. 10), the addition result is positive. A digit other than “00” is searched from the digit where is found to the lower digit.
If a digit other than “00” is found, the found digit other than “00” is the most significant digit to be obtained. Therefore, in this case, since the search in the 4-digit search circuit after the next stage is unnecessary, the search completion mode [01] is output as the mode signal mode [k] ((15), (17), (18), (20) to (22)).
If no digit other than “00” is found, the positive number search mode [10] is output as the mode signal mode [k], and the 3+ step is executed in the next four-digit search circuit ((13 in FIG. 10). ), (14), (16), (19)).
In addition, if neither “00” nor “11” digit is found in the second step, the positive / negative judgment mode [00] is output as the mode signal mode [k], and the second digit search circuit in the next stage outputs the second digit. Steps are executed ((11) and (12) in FIG. 10).

一方、各4桁検索回路802〜80nにおいては、入力されるモード信号mode[k−1]のモードが正数検索モード[10]であれば(図10の(24)〜(28))、第3+ステップを上記と同様に実行する。
また、各4桁検索回路802〜80nにおいては、入力されるモード信号mode[k−1]のモードが負数検索モード[11]であれば(図10の(29)〜(33))、第3−ステップを上記と同様に実行する。
また、各4桁検索回路802〜80nにおいては、入力されるモード信号mode[k−1]のモードが検索完了モード[01]であれば(図10の(23))、そのまま検索を行わずに検索完了モード[01]を出力する。
最下位4桁検索回路801の論理は、4桁検索回路802〜80nとほぼ同じであるが、第2ステップ又は第3+ステップ又は第3−ステップを実行した際に、該当する桁が発見されなかった場合は、最下位桁が求める最上位桁と判定する。また、最下位4桁検索回路801においてはモード信号は出力しない。
On the other hand, in each of the four-digit search circuits 802 to 80n, if the mode of the input mode signal mode [k-1] is the positive number search mode [10] ((24) to (28) in FIG. 10), Perform the 3+ step as above.
In each of the 4-digit search circuits 802 to 80n, if the mode of the input mode signal mode [k-1] is the negative search mode [11] ((29) to (33) in FIG. 10), 3-Step is performed as above.
In each 4-digit search circuit 802 to 80n, if the mode of the input mode signal mode [k-1] is the search completion mode [01] ((23) in FIG. 10), the search is not performed as it is. Output the search completion mode [01].
The logic of the least significant four-digit search circuit 801 is almost the same as that of the four-digit search circuits 802 to 80n. However, when the second step, the third + step, or the third step is executed, the corresponding digit is not found. If it is, the lowest digit is determined as the highest digit. The least significant 4 digit search circuit 801 does not output a mode signal.

次に、図8の検索回路80の動作を図2の例を用いて説明する。
図2の例では検索回路80は1つの4桁検索回路802と最下位4桁検索回路801で構成されるが、ここでは例えば最下位4桁検索回路801の入力を5桁とする。ゲートEOR1の出力が“0”であり積と加数が同符号であるのでモード信号mode[k−1]として4桁検索回路802に正数検索モード[10]が与えられ、4桁検索回路802は第3+ステップを実行する。
すなわち、下位に向かって“00”以外の桁を探すと“10”がinput
[4k−3]にあるため出力found[4k−4]、found[4k−3]、found[4k−2]、found[4k−1]として“0100”を出力し、、さらに、モード信号mode[k]として検索完了モード[01]を出力する。したがって、最下位桁検索回路80では出力found[4n−4]、found[4n−3]、found[4n−2]、found[4n−1]として“0000”を出力する。
こうして、入力input[4k−3]に求める最上位桁があると判定される。
Next, the operation of the search circuit 80 of FIG. 8 will be described using the example of FIG.
In the example of FIG. 2, the search circuit 80 is composed of one 4-digit search circuit 802 and the lowest-order 4-digit search circuit 801. Here, for example, the input to the lowest-order 4-digit search circuit 801 is 5 digits. Since the output of the gate EOR1 is “0” and the product and the addend have the same sign, the positive search mode [10] is given to the 4-digit search circuit 802 as the mode signal mode [k−1], and the 4-digit search circuit 802 executes the third + step.
That is, when searching for digits other than “00” in the lower order, “10” is input.
Since it is in [4k-3], "0100" is output as output found [4k-4], found [4k-3], found [4k-2], found [4k-1], and the mode signal mode The search completion mode [01] is output as [k]. Therefore, the least significant digit search circuit 80 outputs “0000” as the output found [4n-4], found [4n-3], found [4n-2], and found [4n−1].
In this way, it is determined that there is the most significant digit to be found in the input input [4k-3].

図8の回路は乗算アレイ4の出力のビット幅が小さい場合は単純で良い回路であるが、ビット幅が大きくなると検索時間が増大する。また、ビット幅が大きい場合に正規化シフタ10による正規化を1段階のシフトで行うとシフタの負荷が重くなって遅くなる。
図12の検索回路はビット幅が大きい場合に対応して図8の検索回路80を改良した回路である。
ビット幅はこの例では64桁である。ここでは、検索回路110は、7個のモード先見および第1段シフト制御回路30〜36、最下位モード先見および第1段シフト制御回路37、15個の4桁検索回路38〜52、最下位4桁検索回路53、8個の8ビット論理和54〜61(図13)から成る。
検索を高速化するために検索モード信号を高速に下位に伝えるモード先見回路を付加し、正規化シフタ10による正規化を2段階にした場合に対応する第1段シフト制御信号shift_1st[1〜8]および第2段シフト制御信号shift_2nd[1〜8]を出力している。
The circuit of FIG. 8 is a simple circuit when the output bit width of the multiplication array 4 is small, but the search time increases as the bit width increases. Also, if the normalization by the normalization shifter 10 is performed with a one-stage shift when the bit width is large, the shifter load becomes heavy and slows down.
The search circuit of FIG. 12 is a circuit obtained by improving the search circuit 80 of FIG. 8 in response to a case where the bit width is large.
The bit width is 64 digits in this example. Here, the search circuit 110 includes seven mode look-ahead and first stage shift control circuits 30 to 36, the least significant mode look ahead and first stage shift control circuit 37, 15 four-digit search circuits 38 to 52, and the least significant. It consists of a 4-digit search circuit 53 and eight 8-bit logical sums 54 to 61 (FIG. 13).
In order to speed up the search, a mode look-ahead circuit for transmitting the search mode signal to the lower order at high speed is added, and the first-stage shift control signal shift — 1st [1-8 corresponding to the case where the normalization by the normalization shifter 10 is performed in two stages. ] And the second stage shift control signal shift_2nd [1-8].

ここでは、各モード先見及び第1段シフト制御回路30〜36、及び最下位第1段シフト制御回路37への入力は8桁とする。これら8桁の入力のうち上位4桁と下位4桁とはそれぞれさらに2つの4桁検索回路(図8の4桁検索回路と同様の構成)に入力される。
各第1段シフト制御回路30〜37の出力である第1段シフト制御信号
shift_1st[1]〜[8]はエンコーダ90に与えられる。各第1段シフト制御回路30〜37に関連する2つの4桁検索回路の8つの出力(found[8k−8]〜found[8k−1]、本例ではk=1〜8)の対応する1つの対応するオアゲート54〜61の1つに入力されている。即ち、8つの出力found[8k−8]、found[8(k+1)−8]…found[56]はオアゲート54に入力され、8つの出力found[8k−7]、found[8(k+1)−7]…found[57]はオアゲート(第2段シフト制御回路)55に入力される。これらおあげーと54〜61の出力である第2段シフト制御信号shift_2nd[i]は同様にエンコーダ90に与えられる。
各モード先見及び第1段シフト制御回路30〜36は前段からのモード信号mode[]に従ったモードで検索を行い、8桁の入力内に求める最上位桁があるかどうか判定し、あれば第1段シフト制御信号shift_1st[k]を“1”、なければ“0”としてエンコーダに与える。さらに、該判定結果に従ったモード信号を次段に与える。
Here, the input to each mode look-ahead and first stage shift control circuits 30 to 36 and the lowest first stage shift control circuit 37 is 8 digits. Of these 8-digit inputs, the upper 4 digits and the lower 4 digits are respectively input to two 4-digit search circuits (same configuration as the 4-digit search circuit in FIG. 8).
First stage shift control signals shift — 1st [1] to [8], which are outputs of the first stage shift control circuits 30 to 37, are applied to the encoder 90. Eight outputs (found [8k-8] to found [8k-1], k = 1 to 8 in this example) of the two 4-digit search circuits related to the first stage shift control circuits 30 to 37 correspond to each other. It is input to one of the corresponding OR gates 54 to 61. That is, eight outputs found [8k-8], found [8 (k + 1) -8]... Found [56] are input to the OR gate 54, and eight outputs found [8k-7], found [8 (k + 1) − 7] ... found [57] is input to an OR gate (second stage shift control circuit) 55. The second stage shift control signal shift_2nd [i], which is the output of these signals and 54 to 61, is similarly applied to the encoder 90.
Each mode look-ahead and first stage shift control circuits 30 to 36 perform a search in a mode according to the mode signal mode [] from the previous stage, and determine whether or not there is the most significant digit to be found in the 8-digit input. The first stage shift control signal shift — 1st [k] is given to the encoder as “1”, otherwise “0”. Further, a mode signal according to the determination result is given to the next stage.

図14、15はそれぞれ図12のモード先見及び第1段シフト制御回路、最下位第1段シフト制御回路の動作論理の例を示す表である。
次に、モード先見及び第1段シフト制御回路30〜36の動作論理を説明する。図14において、“−”はdon’t careを示す。
14 and 15 are tables showing examples of operation logic of the mode look-ahead, the first stage shift control circuit, and the lowest first stage shift control circuit of FIG.
Next, the operation logic of the mode look-ahead and the first stage shift control circuits 30 to 36 will be described. In FIG. 14, “-” indicates don't care.

図において、例(1)〜(18)は入力モードが[00]、即ち正負判定モードであり、該回路において第2ステップを実行する事を示す。そのうち例(1)〜(8)は、該回路で8桁の入力について第2ステップを実行した結果“11”が発見されたため出力モード信号として負数検索モード[11]を出力する場合を示す。従って、次段では第3−ステップを実行する。
同様に、例(11)〜(18)は、該回路で8桁の入力について第2ステップを実行した結果“00”が発見されたため出力モード信号として正数検索モード[10]を出力する場合を示す。従って、次段では第3+ステップを実行する。
また、例(9)、(10)は、該回路で8桁の入力について第2ステップを実行した結果“00”、“11”いずれも発見されないため出力モード信号として正負判定モード[00]を出力する場合を示す。従って、次段では第2ステップを依然として実行する。
例(19)は、前段において、求める最上位桁が発見されたため入力モードが[01]、即ち、検索完了モードであり、従って同様に出力モード信号として検索完了モード[01]を出力する。
In the figure, examples (1) to (18) indicate that the input mode is [00], that is, the positive / negative determination mode, and the second step is executed in the circuit. Among them, examples (1) to (8) show a case in which the negative number search mode [11] is output as an output mode signal because “11” is found as a result of executing the second step for 8-digit input in the circuit. Therefore, the third step is executed in the next stage.
Similarly, in the examples (11) to (18), since “00” is found as a result of executing the second step for 8-digit input in the circuit, the positive number search mode [10] is output as the output mode signal. Indicates. Therefore, in the next stage, the third + step is executed.
In the examples (9) and (10), the result of executing the second step for the 8-digit input in the circuit is that neither “00” nor “11” is found, so the positive / negative judgment mode [00] is selected as the output mode signal. Indicates the case of output. Therefore, the second step is still executed in the next stage.
In the example (19), since the most significant digit to be obtained is found in the previous stage, the input mode is [01], that is, the search completion mode. Therefore, the search completion mode [01] is similarly output as an output mode signal.

例(20)は、入力モードが[10]、即ち、正数検索モードであり、該回路において第3+ステップを実行した結果、“00”以外の桁が発見されず、出力モード信号として正数検索モード[10]を出力する場合を示す。従って、次段では第3+ステップを依然として実行する。
例(21)は、入力モードが[11]、即ち、負数検索モードであり、該回路において第3−ステップを実行した結果、“11”以外の桁が発見されず、出力モード信号として負数検索モード[11]を出力する場合を示す。従って、次段では第3−ステップを依然として実行する。
上記いずれの場合も第1段シフト制御信号shift_1st[k]は“0”である。
一方、例(22)は、上記以外の場合であり、モード先見及び第1段シフト制御回路において求める最上位桁が発見され、出力モード信号として検索完了モード[01]を出力すると共に第1段シフト制御信号shift_1st[k]として“1”を出力する。
In the example (20), the input mode is [10], that is, the positive number search mode. As a result of executing the third + step in the circuit, no digits other than “00” are found, and the output mode signal is a positive number. The case where search mode [10] is output is shown. Therefore, in the next stage, the third + step is still executed.
In the example (21), the input mode is [11], that is, the negative number search mode. As a result of executing the third step in the circuit, no digits other than “11” are found, and the negative number search is performed as the output mode signal. The case where mode [11] is output is shown. Therefore, the third step is still executed in the next stage.
In any of the above cases, the first stage shift control signal shift — 1st [k] is “0”.
On the other hand, the example (22) is a case other than the above, and the most significant digit required in the mode look-ahead and the first stage shift control circuit is found, and the search completion mode [01] is output as the output mode signal and the first stage “1” is output as the shift control signal shift — 1st [k].

最下位第1段シフト制御回路37の動作論理は図15に示す通りである。
即ち、前段以前の段において、求める最上位桁が発見されたため入力モードが[01]、即ち、検索完了モードであり、従って第1段シフト制御信号shift_1st[8]として“0”を出力する。
また、入力モードが[01]以外の場合、即ち、[00][10][11]のいずれの場合も、前段以前の段において求める最上位桁が発見されなかったため、この最下位8桁で発見されるか、またはこの最下位8桁で発見されない場合は最下位桁で発見されたとみなす。従って、いずれにしてもこの最下位8桁で発見されるため第1段シフト制御信号shift_1st[8]として“1”を出力する。
The operation logic of the lowest first stage shift control circuit 37 is as shown in FIG.
That is, since the most significant digit to be obtained is found in the previous stage, the input mode is [01], that is, the search completion mode. Accordingly, “0” is output as the first stage shift control signal shift — 1st [8].
In addition, when the input mode is other than [01], that is, in any case of [00] [10] [11], the most significant digit required in the previous stage is not found, and therefore, the least significant 8 digits are used. If it is found or not found in this least significant 8 digits, it is considered as found in the least significant digit. Therefore, in any case, since it is found in the least significant 8 digits, “1” is output as the first stage shift control signal shift — 1st [8].

従って、各モード先見及び第1段シフト制御回路からの第1段シフト制御信号shift_1st[k]により8桁単位で求める最上位桁位置(シフト量)が分かり、さらにオアゲート54〜61からの第2段シフト制御信号shift_2nd[i]により1桁単位で最上位桁位置(シフト量)が分かる。従って、これら第1段、第2段シフト制御信号から最上位桁位置が分かり、これをエンコードすれば指数正規化値、正規化シフト数が求まる。   Therefore, the most significant digit position (shift amount) to be obtained in units of 8 digits can be found from each mode look-ahead and the first-stage shift control signal shift_1st [k] from the first-stage shift control circuit. The most significant digit position (shift amount) can be determined in units of one digit by the stage shift control signal shift_2nd [i]. Therefore, the most significant digit position is known from these first-stage and second-stage shift control signals, and when this is encoded, the exponent normalized value and the normalized shift number can be obtained.

このように、各モード先見及び第1段シフト制御回路において図7の対応するステップを実行した結果、目的の桁が発見されなかった場合は次段のモード先見及び第1段シフト制御回路において同様のステップを実行する必要がある(図14の例(10)、(19)〜(21))。
従ってそのような場合に、図8の構成では4桁検索回路での検索動作を介してモードが伝送されるが、図12の構成ではモード先見及び第1段シフト制御回路のみの処理で速やかに次段に実行すべきモードを指示できるので、図8の構成に比べ出力モードを高速に下位に伝送でき、その結果、速やかに求める最上位桁を検出できる。
As described above, when the target digit is not found as a result of executing the corresponding steps in FIG. 7 in each mode look-ahead and first-stage shift control circuit, the same is applied to the next-stage mode look-ahead and first-stage shift control circuit. These steps need to be executed (examples (10) and (19) to (21) in FIG. 14).
Therefore, in such a case, in the configuration of FIG. 8, the mode is transmitted through the search operation in the 4-digit search circuit, but in the configuration of FIG. 12, the mode look-ahead and the processing of only the first stage shift control circuit can quickly Since the mode to be executed at the next stage can be instructed, the output mode can be transmitted to the lower order at a higher speed than in the configuration of FIG.

モード先見論理は一見複雑で高速なモード信号の伝達ができないかのように見える。しかし、検索モードの切り替わりは、正負判定モードから正数検索モードまたは負数検索モードへの切り替わりと、その検索モードから検索完了モードへの切り替わりの2回である。すなわち、8桁ずつ8個あるモード先見回路のうち、少なくとも6個では検索モードが切り替わらない。
したがって、検索モードが切り替わらない場合を高速化すれば高速なモード信号の伝達が可能となる。検索モードが切り替わらない場合は、入力が全て0(図14の例(20))、全て1(例21)、入力の排他的論理和が全て1()例(9)、(10)の3通りであり、回路のこの部分の高速化は容易である。
また、第1段シフト制御論理は8桁のどこかに最上位桁があるかないかを判定しているので、検索結果であるfound[0〜63]に比べて生成論理が単純で高速に生成できる。
第2段シフト制御論理はfound[0〜63]から8入力論理和回路を通して生成するので遅くなるが、第1段シフトの完了時に間に合えばよいので問題ない。
例えば倍精度浮動小数の積和演算を行った場合、入力の仮数部は53桁あり、キャリー伝搬加算器6の出力は106桁+上位へのキャリーとなる。そして、桁落ちが発生すると106桁のどこにでも絶対値の0でない最上位桁が来る可能性がある。しかし、該最上位桁が下位53桁に来る可能性は極めて低い。しかも、このような大幅な桁落ちが発生すると有効数字は0桁になる。更に、該最上位桁が下位53桁にあれば丸めが不要となり正規化しなくとも正確な値を出力できる。したがって、このような場合は実行サイクル数が伸びても一旦正規化していない値を結果として出力し、その後実行サイクル数を伸して正規化を行えば十分である。
以上から最上位桁検出部5と正規化シフタ10を、キャリー伝搬加算器6の出力の下位から52桁以上に該最上位桁がある場合に正しく正規化を行い、そうでない場合には下位53桁を正規化しないまま出力するようにしても性能に影響はない。そして、こうすることにより最上位桁検出部5と正規化シフタ10を簡素化することができる。
The mode look-ahead logic appears to be complex and seemingly unable to transmit high-speed mode signals. However, the search mode is switched twice from the positive / negative determination mode to the positive number search mode or the negative number search mode and from the search mode to the search completion mode. That is, the search mode is not switched by at least six of the eight mode look-ahead circuits of eight digits.
Therefore, if the speed of the case where the search mode is not switched is increased, high-speed mode signals can be transmitted. When the search mode is not switched, all the inputs are 0 (example (20) in FIG. 14), all 1 (example 21), and the exclusive OR of the inputs is all 1 () examples (9) and (10). The speed of this part of the circuit is easy.
In addition, since the first stage shift control logic determines whether or not the most significant digit is somewhere in the 8 digits, the generation logic is simpler and faster than the search result found [0 to 63]. it can.
Since the second stage shift control logic is generated from the found [0 to 63] through the 8-input OR circuit, the second stage shift control logic is slow. However, there is no problem because it is sufficient if the first stage shift is completed.
For example, when a double-precision floating-point multiply-accumulate operation is performed, the input mantissa part has 53 digits, and the output of the carry propagation adder 6 is 106 digits + carry to the higher order. When a digit loss occurs, there is a possibility that the highest digit which is not 0 in absolute value will come anywhere in 106 digits. However, the possibility that the most significant digit comes in the lower 53 digits is extremely low. In addition, when such a significant digit loss occurs, the significant figure becomes 0 digits. Furthermore, if the most significant digit is in the lower 53 digits, rounding is unnecessary and an accurate value can be output without normalization. Therefore, in such a case, it is sufficient to output a value that has not been normalized once as a result even if the number of execution cycles increases, and then normalize by increasing the number of execution cycles.
From the above, the most significant digit detection unit 5 and the normalization shifter 10 perform normalization correctly when the most significant digit is present in the 52 or more digits from the lower order of the output of the carry propagation adder 6, and otherwise the lower order 53. Even if the digit is output without normalization, the performance is not affected. In this way, the most significant digit detector 5 and the normalization shifter 10 can be simplified.

このような構成の積和演算器の動作を図16を参照して説明する。   The operation of the product-sum calculator having such a configuration will be described with reference to FIG.

ここでは、仮数部が4桁の場合で具体的な数値を用いて説明する。
(1.001×21)×(1.001×22)+(−1.010×23)を計算すると以下のようになる。
まず、桁合せシフト数指数生成部1で、桁合せシフト数として1+2−3=0を生成し、桁合せシフト数が−2以上なので指数として1+2=3を生成する。
次に、加数桁合せ符号合せ部2で、加数仮数部1.010を0桁右シフトし、異符号なので加数中位と加数上位の0、1反転をして、加数中位10.101111、加数上位1.000、仮数下位0000、および加数上位最下位1.000を生成する。次に、加数下位スティッキービット生成部3で、加数下位0000が0なのでスティッキービットとして0を生成する。
これらの操作によって、上式は
(1.000×25)+((1.001×1.001+10.101111)×23)
となる。25は加数上位の1が加数中位の最上位の1桁上位であることを示している。
次に、乗算アレイ4で、
1.001×1.001+10.101111
を前述のように乗算部分を加算に直して3項ずつ加算すると、
000.000010
+ 11.111110
となる。この2項が乗算アレイ4出力である。
Here, the case where the mantissa part is 4 digits will be described using specific numerical values.
When (1.001 × 21) × (1.001 × 22) + (− 1.010 × 23) is calculated, the result is as follows.
First, the digit shift number exponent generation unit 1 generates 1 + 2-3 = 0 as the digit shift number, and generates 1 + 2 = 3 as the exponent because the digit shift number is −2 or more.
Next, in the addend digit alignment code matching unit 2, the addend mantissa part 1.010 is shifted to the right by 0 digits, and since it is a different sign, 0 is added to the middle of the addend and the upper part of the addend, and the addend is changed. Generates the order 10.101111, the addend high 1.000, the mantissa low 0000, and the addend high lowest 1.000. Next, the addend lower sticky bit generation unit 3 generates 0 as the sticky bit because the addend lower 0000 is 0.
By these operations, the above equation becomes (1.000 × 25) + ((1.001 × 1.001 + 10.101111) × 23)
It becomes. 25 indicates that the upper one of the addend is the highest one digit of the middle of the addend.
Next, in the multiplication array 4,
1.001 × 1.001 + 10.101111
As described above, the multiplication part is converted to addition and 3 terms are added.
000.000010
+ 11.111111
It becomes. These two terms are the output of the multiplication array 4.

最上位桁検出部5では、乗算アレイ4出力および桁合せシフト数0とから、0でない最上位桁は最下位桁であるので、下位から4桁目で検索を打切って、指数正規化部8へ指数正規化値−3を、スティッキービット生成部9へマスク00000000を、正規化シフタ10へ正規化シフト数−3を出力する。
キャリー伝搬加算器6では、乗算アレイ4出力を加算し、さらに積と加数が異符号かつ加数下位スティッキービットが0なので最下位に1を加算して00.000001を生成し、スティッキービット生成部9および正規化シフタ10へ出力する。また、最上位からのキャリー1を加数上位インクリメンタ7へ出力する。
加数上位インクリメンタ7では、桁合せシフト数0が−2以上で正規化シフト数−3が1、2以外なので00.000を生成する。
この時、最初の式は
(00.000×23)+(00.000001×23)
となっている。
指数正規化部8では、桁合せシフト数指数生成部1からの指数3と最上位桁検出部5からの−3を加算して0を出力する。
スティッキービット生成部9では、キャリー伝搬加算器6出力00.000001を最上位桁検出部5出力00000000でマスクして論理和をとり、さらに加数下位スティッキービット生成部からの0と論理和をとった値0を出力する。
正規化シフタ10では、正規化シフト数が−3であるからキャリー伝搬加算器6出力00.000001を3桁左シフトして上位6ビットの00.0010を抽出し、加数上位インクリメンタ7出力00.000と論理和をとって、00.0010として出力する。
この時、最初の式は
00.0010×20
となっている。正数化丸め部11では、正規化シフタ10出力が00.0010でスティッキービットが0であるから、正数化丸め部11出力は0.001である。指数補正部12では、正数化丸め部11で最上位桁位置の補正が不要だったので、指数正規化部8出力0をそのまま出力する。
この結果、最終的な演算結果は0.001×20となる。そして、この値を改めて正規化すると、1.000×2~3となる。
In the most significant digit detection unit 5, since the most significant digit that is not 0 is the least significant digit from the output of the multiplication array 4 and the digit shift number 0, the search is terminated at the fourth digit from the least significant, and the exponent normalization unit The exponent normalized value -3 is output to 8, the mask 00000000 is output to the sticky bit generation unit 9, and the normalized shift number -3 is output to the normalization shifter 10.
The carry propagation adder 6 adds the outputs of the multiplication array 4 and, since the product and addend have different signs and the addend lower sticky bit is 0, adds 1 to the least significant to generate 00.000001 to generate a sticky bit. Output to the unit 9 and the normalized shifter 10. Also, carry 1 from the top is output to the addend higher incrementer 7.
The addend higher incrementer 7 generates 00.000 because the digit shift number 0 is -2 or more and the normalized shift number -3 is other than 1.
At this time, the first equation is (00.000 × 23) + (00.000001 × 23)
It has become.
The exponent normalization unit 8 adds the exponent 3 from the digit shift number exponent generation unit 1 and -3 from the most significant digit detection unit 5 to output 0.
The sticky bit generation unit 9 masks the carry propagation adder 6 output 00.000001 with the most significant digit detection unit 5 output 00000000 to perform a logical sum, and further performs a logical sum with 0 from the addend lower sticky bit generation unit. The value 0 is output.
In the normalization shifter 10, since the normalized shift number is -3, the carry propagation adder 6 output 00.000001 is shifted to the left by 3 digits to extract the upper 6 bits of 00.0010, and the addend upper incrementer 7 output The logical sum of 00.000 is taken and output as 0.010.
At this time, the first equation is 00.0010 × 20
It has become. In the positive rounding unit 11, the output of the normalization shifter 10 is 00.0010 and the sticky bit is 0, so the output of the positive rounding unit 11 is 0.001. The exponent correction unit 12 outputs the exponent normalization unit 8 output 0 as it is because the positive digit rounding unit 11 did not need to correct the most significant digit position.
As a result, the final calculation result is 0.001 × 20. When this value is normalized again, it becomes 1.000 × 2-3.

図17は本発明の更に別の実施例による積和演算器の構成図である。
本積和演算器は浮動小数積和演算で一般的に行われている符号合わせ、正数化、及び様々な丸めモードによる丸めを行わない。したがって、本実施例は、被乗数、乗数、及び加数が全て同符号で丸めは切捨てのみを行う浮動小数積和演算器である。本分野を専門とする技術者であれば、本実施例に該符号合わせ、正数化、及び丸め処理を付け加えて一般的な浮動小数積和演算器を構成することが可能である。
FIG. 17 is a block diagram of a product-sum calculator according to still another embodiment of the present invention.
This product-sum calculator does not perform sign matching, normalization, and rounding in various rounding modes, which are generally performed in floating-point product-sum operations. Therefore, the present embodiment is a floating-point product-sum operation unit in which the multiplicand, multiplier, and addend all have the same sign and rounding is performed only by truncation. An engineer specializing in this field can construct a general floating-point product-sum calculator by adding the sign matching, positive number conversion, and rounding processing to this embodiment.

本実施例は、桁合せシフト数指数生成部1、加数桁合せ部2、積和演算アレイ4、再上位桁検出部5、キャリー伝搬加算器6、指数正規化部8、及び正規化シフタ10から成る。
桁合せシフト数指数生成部1は、加数、被乗数、及び乗数の指数部を入力とし、桁合せシフト数および正規化前の指数を生成して、それぞれ加数桁合せ符号合せ部2および指数正規化部8へ出力する。正規化前の指数としては被乗数と乗数の指数部の和すなわち積の指数部を出力する。桁合せシフト数は、該積の指数部から加数指数部を引いて生成する。
尚、桁合せシフト数が(−仮数部の桁数−1)以下の場合を統一的に処理しようとすると仮数部を処理する加数桁合せ部2、積和演算アレイ4、再上位桁検出部5、キャリー伝搬加算器6、及び正規化シフタ10のビット幅が膨大となり現実的でない。この場合は、丸めが切捨てであれば積の部分が切捨てられて結果は加数そのものとなるので、本実施例とは別にこの場合を検出して結果として加数を出力する回路を付け加えることにより、仮数部を処理する部分の桁数を(仮数部の桁数×3)にすることができる。
This embodiment includes a digit shift number exponent generation unit 1, an addend digit adjustment unit 2, a product-sum operation array 4, a re-higher digit detection unit 5, a carry propagation adder 6, an exponent normalization unit 8, and a normalization shifter It consists of ten.
A digit shift number exponent generation unit 1 receives an addend, a multiplicand, and an exponent part of a multiplier, generates a digit shift number and an exponent before normalization, and an addend digit adjustment code match unit 2 and an exponent, respectively. Output to the normalization unit 8. As the exponent before normalization, the sum of the exponent part of the multiplicand and the multiplier, that is, the exponent part of the product is output. The digit shift number is generated by subtracting the addend exponent from the exponent of the product.
If the number of digit shifts is equal to or less than (-the number of digits in the mantissa part-1), the addend digit aligning unit 2 for processing the mantissa part, the product-sum operation array 4, and the re-higher digit detection The bit widths of the unit 5, carry propagation adder 6, and normalization shifter 10 become enormous and are not realistic. In this case, if the rounding is rounded down, the product part is rounded down and the result becomes the addend itself. Therefore, by adding a circuit that detects this case and outputs the addend as a result separately from this embodiment. The number of digits for processing the mantissa part can be (number of digits of the mantissa part × 3).

加数桁合せ部2は、加数仮数部および桁合せシフト数を入力とし、加数仮数部の桁合せを行い桁合せ後の加数仮数部として積和演算アレイ4に出力する。通常は桁合せシフト数に応じたシフトを行う。しかし、前節で説明したように桁合せシフト数が(−仮数部の桁数−1)以下の場合は本実施例の回路の処理結果は使用しないため出力値は任意である。一方、桁合せシフト数が(仮数部の桁数×2−1)以上の場合は加数が切り捨てられて結果は被乗数と乗数の積となる。この場合は、桁合せ後の加数仮数部として0を出力する。   The addend digit aligning unit 2 receives the addend mantissa part and the digit shift number, performs digit alignment of the addend mantissa part, and outputs the result to the product-sum operation array 4 as an addend mantissa part after digit alignment. Normally, the shift is performed according to the number of digit shifts. However, as described in the previous section, when the digit shift number is (−digit number of mantissa part−1) or less, the processing result of the circuit of this embodiment is not used, and the output value is arbitrary. On the other hand, when the number of digit shifts is equal to or greater than (the number of mantissa digits × 2-1), the addend is discarded and the result is the product of the multiplicand and the multiplier. In this case, 0 is output as the addend mantissa part after digit alignment.

積和演算アレイ4は被乗数仮数部、乗数仮数部、および桁合せ後の加数仮数部を入力とし、被乗数仮数部と乗数仮数部の積と桁合せ後の加数仮数部の和を、キャリー保存加算器、冗長2進加算器等のアレイを用いて計算し、結果を最上位桁検出部5およびキャリー伝搬加算器6に出力する。積和演算アレイ4の出力は、キャリー伝搬加算器6で加算すると積和演算結果となる2つの値である。   The product-sum operation array 4 receives the multiplicand mantissa part, the multiplier mantissa part, and the addend mantissa part after digit alignment, and carries the sum of the product of the multiplicand mantissa part and the multiplier mantissa part and the addend mantissa part after digit alignment as a carry. The calculation is performed using an array such as a storage adder or a redundant binary adder, and the result is output to the most significant digit detector 5 and the carry propagation adder 6. The outputs of the product-sum operation array 4 are two values that, when added by the carry propagation adder 6, result in a product-sum operation.

最上位桁検出部5は、積和演算アレイ4出力から、積和演算結果の絶対値の0でない最上位桁を検出し、検出結果に基づいて、指数正規化部8へは指数正規化値、正規化シフタ10へは正規化シフト数を出力する。
本実施例では該指数正規化値及び正規化シフト数は常に同一である。該最上位桁検出は図5の処理に基づいて行う。但し、本実施例では該積和演算アレイ4出力は2の補数ではなく絶対値である。図5の処理を適用するには入力の2つの値のそれぞれの最上位桁の上位に0を加えて2の補数とすればよい。指数正規化値および正規化シフト数は、求めた最上位桁と正規化前の小数点の左の桁との桁位置の差である。
The most significant digit detection unit 5 detects the highest non-zero absolute value of the product-sum operation result from the output of the product-sum operation array 4, and the exponent normalization unit 8 supplies the exponent normalization value based on the detection result. The normalized shift number is output to the normalized shifter 10.
In this embodiment, the exponent normalization value and the normalized shift number are always the same. The most significant digit detection is performed based on the processing of FIG. However, in this embodiment, the output of the product-sum operation array 4 is not a two's complement but an absolute value. In order to apply the processing of FIG. 5, it is only necessary to add 0 to the higher order of the most significant digit of each of the two input values to make a two's complement. The exponent normalization value and the normalized shift number are the difference in the digit position between the calculated most significant digit and the digit to the left of the decimal point before normalization.

キャリー伝搬加算器6は積和演算アレイ4出力の2つの値を加算して正規化前の積和演算結果仮数部を生成し、正規化シフタ10へ出力する。
指数正規化部8は正規化前の指数に最上位桁検出部5からの指数正規化値を加算して正規化し、加算結果を最終的な積和演算結果指数部として出力する。
正規化シフタ10は、キャリー伝搬加算器6からの正規化前の積和演算結果仮数部を最上位桁検出部5からの正規化シフト数を用いて正規化し、最終的な積和演算結果仮数部として出力する。
Carry propagation adder 6 adds the two values of product-sum operation array 4 output to generate a product-sum operation result mantissa part before normalization, and outputs the result to normalization shifter 10.
The exponent normalization unit 8 normalizes the exponent before normalization by adding the exponent normalization value from the most significant digit detection unit 5 and outputs the addition result as a final product-sum operation result exponent part.
The normalization shifter 10 normalizes the product-sum operation result mantissa part before normalization from the carry propagation adder 6 by using the normalization shift number from the most significant digit detection unit 5 and final product-sum operation result mantissa Output as part.

図18は本実施例の仮数部が4ビットの具体的な数値による動作例である。
(1.110×22)×(1.101×23)+(1.011×27)を計算すると以下のようになる。
まず、桁合せシフト数指数生成部1で、桁合せシフト数として2+3−7=−2を生成し、正規化前の指数として2+3=5を生成する。次に、加数桁合せ符号合せ部2で、加数仮数部1.011を2桁左シフトして、桁合せ後の加数仮数部000101.100000を生成する。これらの操作によって、上式は
((1.110×1.101+000101.100000)×25)
となる。次に、積和演算アレイ4で、
1.110×1.101+000101.100000
の乗算部分を加算に直して、
0.001110
+ 0.00000
+ 0.1110
+ 1.110
+000101.100000
とし、以下のように計算する。
FIG. 18 shows an operation example in which the mantissa part of this embodiment is a specific numerical value of 4 bits.
When (1.110 × 22) × (1.101 × 23) + (1.011 × 27) is calculated, the result is as follows.
First, the digit shift number exponent generation unit 1 generates 2 + 3-7 = −2 as the digit shift number and 2 + 3 = 5 as the exponent before normalization. Next, the addend mantissa sign matching unit 2 shifts the addend mantissa part 1.011 two places to the left to generate an addend mantissa part 000011.100000 after digit alignment. By these operations, the above formula becomes ((1.110 × 1.101 + 000101.10000000) × 25)
It becomes. Next, in the product-sum operation array 4,
1.110 × 1.101 + 000101.100,000
The multiplication part of
0.001110
+ 0.00000
+ 0.1110
+ 1.110
+000101.100,000
And calculate as follows.

積和演算アレイ4はキャリー保存加算器とする。キャリー保存加算器は3つの数を加算してキャリー部分と和の部分の2つの数を出力する。キャリー部分は各桁に2つ以上1がある場合に次の桁に1を立てることによって生成する。和の部分は各桁に1つまたは3つ1がある場合にその桁に1を立てることによって生成する。まず、最初の3項を加算すると、この部分がキャリー部分と和の部分の2項となって、
0.010000
+ 0.110110
+ 1.110
+000101.100000
となる。
さらにこの結果の最初の3項を加算すると、この部分が2項となって、
01.100000
1.010110
+000101.100000
となる。
さらにこの3項を加算すると、
000011.000000
+000101.010110
となる。
この2項が積和演算アレイ4の出力である。
The product-sum operation array 4 is a carry save adder. The carry save adder adds three numbers and outputs two numbers, a carry part and a sum part. The carry part is generated by setting 1 to the next digit when there are two or more 1s in each digit. The sum part is generated by setting 1 in each digit when there is one or three in each digit. First, when the first three terms are added, this part becomes the two terms of the carry part and the sum part,
0.010000
+ 0.110110
+ 1.110
+000101.100,000
It becomes.
Furthermore, when the first three terms of this result are added, this part becomes two terms,
0.11.00000
1.010110
+000101.100,000
It becomes.
When these three terms are added,
000011.000000
+000101.010110
It becomes.
These two terms are the output of the product-sum operation array 4.

次に、最上位桁検出部5で、該積和演算アレイ4出力の2項の最上位桁の上位に0を加えて2の補数とし図5の処理に基づいて最上位桁検出を行う。
まず、第1ステップで、最上位桁が00であるから次に第3+ステップを行う。
第3+ステップでは、正規化前の小数点の左の桁を基準桁として2桁左で01を発見するので、次に第4+ステップを行う。
第4+ステップでは11を発見するので、図5の(8)の場合に該当し絶対値の0でない最上位桁として第3+ステップで発見した桁の1桁上位すなわち基準桁の3桁左が求める最上位桁である。
したがって、指数正規化部8及びへ正規化シフタ10へ指数正規化値及び正規化シフト数として3を出力する。
キャリー伝搬加算器6では、積和演算アレイ4出力を加算して0001000.010110を生成し、正規化シフタ10へ出力する。この時、最初の式は
(0001000.010110×25)
となっている。
次に、指数正規化部8で、正規化前の指数5と最上位桁検出部5からの指数正規化値3を加算して8を出力する。正規化シフタ10では、正規化シフト数が3であるからキャリー伝搬加算器6出力0001000.010110を3桁右シフトして小数点の左の桁から4ビットの1.000を出力する。この結果、演算結果は1.000×28となる。
Next, the most significant digit detection unit 5 performs the most significant digit detection based on the processing of FIG. 5 by adding 0 to the uppermost part of the two most significant digits of the output of the sum-of-products operation array 4 to make a 2's complement.
First, in the first step, since the most significant digit is 00, the third + step is performed next.
In the 3+ step, since the left digit of the decimal point before normalization is found as the reference digit and 01 is found 2 digits to the left, the 4+ step is performed next.
Since 11 is found in the 4th + step, it corresponds to the case of (8) in FIG. 5, and the highest digit which is not 0 of the absolute value is obtained as one digit higher than the digit found in the 3 + step, that is, 3 digits to the left of the reference digit. The most significant digit.
Therefore, 3 is output to the exponent normalization unit 8 and the normalization shifter 10 as the exponent normalization value and the normalized shift number.
Carry propagation adder 6 adds outputs from product-sum operation array 4 to generate 0001000.010110, and outputs the result to normalized shifter 10. At this time, the first equation is (0001000.0101110 × 25)
It has become.
Next, the exponent normalization unit 8 adds the exponent 5 before normalization and the exponent normalization value 3 from the most significant digit detection unit 5 to output 8. Since the normalized shift number is 3, the normalization shifter 10 shifts the carry propagation adder 6 output 0001000.0110110 rightward by 3 digits and outputs 1.000 of 4 bits from the left digit of the decimal point. As a result, the calculation result is 1.000 × 28.

なお、上記実施例においては、乗算アレイとしてキャリー保存加算器のアレイを用い、最上位桁検出部は該乗算アレイの2項の演算出力であるキャリー部分と和の部分を入力として絶対値の0でない最上位桁を検出しているが、乗算アレイとして冗長2進加算器等のアレイを用い、該アレイの2項の演算出力を入力として絶対値の0でない最上位桁を検出する最上位桁検出部を実施例の場合と同様に構成することができることは云うまでもない。   In the above embodiment, an array of carry save adders is used as the multiplication array, and the most significant digit detection unit receives the carry part and the sum part, which are the operation outputs of the two terms of the multiplication array, as an absolute value of 0. The most significant digit is detected by using an array such as a redundant binary adder as a multiplication array and detecting the most significant digit that is not zero in absolute value using the operation output of the two terms of the array as an input. It goes without saying that the detection unit can be configured in the same manner as in the embodiment.

尚、図3の例のように、積より加数の方が大きい場合に、積より上位にはみ出した加数上位部分を最上位桁を動かさずに処理し、該はみ出した部分以外の加数と積との積和演算結果を正規化したものと最終的に加算を行って最終的な正規化した積和演算結果を得ている実施例においては、最上位検出部への入力を乗算アレイからの2つの項の代わりにキャリー伝搬加算部6からの正規化前の積和演算結果の仮数部を用いてもよい。   As in the example of FIG. 3, when the addend is larger than the product, the upper part of the addend that protrudes higher than the product is processed without moving the most significant digit, and the addend other than the excess part is processed. In the embodiment in which the product sum operation result of the product and the product is normalized and finally added to obtain the final normalized product sum operation result, the input to the highest detection unit is multiplied by the array Instead of the two terms from, the mantissa part of the product-sum operation result before normalization from the carry propagation adder 6 may be used.

次に、上記の本発明による積和演算器を用いたデータ処理装置の一例を図19を参照して説明する。
該データ処理装置は命令フェッチデコード部100、演算部200、メモリアクセス部300、メモリ400から成る。本発明に基づく積和演算器210は演算部200内にある。
Next, an example of a data processing apparatus using the product-sum calculator according to the present invention will be described with reference to FIG.
The data processing apparatus includes an instruction fetch decoding unit 100, a calculation unit 200, a memory access unit 300, and a memory 400. The product-sum calculator 210 according to the present invention is in the calculation unit 200.

次に、図19の各部の構成及び動作を説明する。
命令フェッチデコード部100は、メモリアクセス部300に命令アドレス110を出力して命令フェッチ要求を行ってメモリ400から命令を読み出して該メモリアクセス部300を介して命令120を受取り、該命令をデコードして演算部200に制御情報130を出力する。通常は連続する命令アドレスに対して該命令フェッチ及びデコード処理を行い、演算部200が分岐アドレス140を出力して分岐要求を行った場合は、該処理を分岐アドレス140に対して行う。
演算部200は命令フェッチデコード部100からの制御情報130に基づいて演算、データフェッチ及びストア等を行う。特に、演算が浮動少数積和演算の場合は本発明に基づく積和演算器210を用いて処理する。
また、データフェッチ又はストアを行う場合は、メモリアクセス部300にアドレス220を出力し、更にストア時にはデータ230も出力して、フェッチ又はストア要求を行い、フェッチ時には該メモリアクセス部300からデータ230を受取る。
メモリアクセス部300は、命令フェッチデコード部100からの命令フェッチ要求及び演算部200からのデータフェッチ又はストア要求に基づいて、メモリ400にアドレス310を出力し、更にストア時にはデータ320も出力してアクセスを行い、要求がフェッチの場合はメモリ400からフェッチしたデータ320を要求元に出力する。
メモリ400はメモリアクセス部300からアドレス310を受取り、更にストア時にはデータ320も受取って、フェッチ又はストア動作を行い、要求がフェッチの場合はデータ320をメモリアクセス部300に出力する。
Next, the configuration and operation of each unit in FIG. 19 will be described.
The instruction fetch decoding unit 100 outputs an instruction address 110 to the memory access unit 300, makes an instruction fetch request, reads the instruction from the memory 400, receives the instruction 120 via the memory access unit 300, and decodes the instruction The control information 130 is output to the arithmetic unit 200. Normally, the instruction fetch and decode processing is performed on consecutive instruction addresses, and when the arithmetic unit 200 outputs a branch address 140 and issues a branch request, the processing is performed on the branch address 140.
The arithmetic unit 200 performs arithmetic operations, data fetches, stores, and the like based on the control information 130 from the instruction fetch decoding unit 100. In particular, when the operation is a floating-point product-sum operation, the product-sum operation unit 210 according to the present invention is used for processing.
In addition, when performing data fetch or store, the address 220 is output to the memory access unit 300, and further, the data 230 is also output at the time of store, a fetch or store request is performed, and the data 230 is received from the memory access unit 300 at the time of fetch. Receive.
Based on the instruction fetch request from the instruction fetch decoding unit 100 and the data fetch or store request from the arithmetic unit 200, the memory access unit 300 outputs the address 310 to the memory 400, and further outputs the data 320 at the time of storing. If the request is a fetch, the data 320 fetched from the memory 400 is output to the request source.
The memory 400 receives the address 310 from the memory access unit 300 and also receives the data 320 at the time of storing, performs a fetch or store operation, and outputs the data 320 to the memory access unit 300 when the request is a fetch.

次に、積和演算器210による演算動作を説明する。
先ず、命令フェッチデコード部100は、上記のようにメモリアクセス部300に命令アドレス110を出力してメモリアクセス部300より命令120を受け取り、該命令をデコードして制御情報130を得る。制御情報130としてはオペランド、加算、乗算、浮動小数点演算等の演算に関する情報がある。積和演算器210は該制御情報に基づき、メモリ400から読み出したデータ(加数、乗数、被乗数)、または演算部200内のレジスタ212から読み出したデータの積和演算を上記各実施例のように行う。演算結果はレジスタ212またはメモリアクセス部300を介してメモリ400にストアされる。
Next, the calculation operation by the product-sum calculator 210 will be described.
First, the instruction fetch decoding unit 100 outputs the instruction address 110 to the memory access unit 300 as described above, receives the instruction 120 from the memory access unit 300, and decodes the instruction to obtain the control information 130. The control information 130 includes information related to operations such as operands, addition, multiplication, and floating point operations. Based on the control information, the product-sum operation unit 210 performs a product-sum operation on the data (addend, multiplier, multiplicand) read from the memory 400 or the data read from the register 212 in the operation unit 200 as in the above embodiments. To do. The calculation result is stored in the memory 400 via the register 212 or the memory access unit 300.

本実施例は、具体的にはメモリ400以外の部分を1つのチップに納めればいわゆるマイクロプロセッサであり、複数チップに納めてボードに実装すればプロセッサボードとなる。
本実施例は本発明に基づく積和演算器を用いたデータ処理装置の一例であるが、一般に、浮動小数積和演算器を使用するデータ処理装置であれば、本発明による積和演算器を適用することができる。
More specifically, the present embodiment is a so-called microprocessor if a portion other than the memory 400 is placed on one chip, and a processor board if it is placed on a plurality of chips and mounted on a board.
The present embodiment is an example of a data processing device using a product-sum operation unit based on the present invention. However, in general, if the data processing device uses a floating-point product-sum operation unit, the product-sum operation unit according to the present invention is used. Can be applied.

本発明の実施例による積和演算器の構成を示すブロック図である。It is a block diagram which shows the structure of the sum-of-products calculator by the Example of this invention. 図1の積和演算器によりある式の積和演算を行う場合の図1の各構成要素での処理の流れを示す動作説明のための図である。FIG. 2 is a diagram for explaining an operation showing a flow of processing in each component of FIG. 1 when a product-sum operation of a certain expression is performed by the product-sum operation unit of FIG. 1. 図1の積和演算器により別の式の積和演算を行う場合の図1の各構成要素での処理の流れを示す動作説明のための図である。FIG. 8 is a diagram for explaining an operation showing a flow of processing in each component of FIG. 1 when performing a product-sum operation of another expression by the product-sum operation unit of FIG. 1. 図1の最上位桁検出部において、乗算アレイの出力である2項から、正規化前の積和演算結果の仮数部の絶対値のうち0でない最上位桁を求める処理の一例を示すフローチャートである。3 is a flowchart illustrating an example of processing for obtaining a non-zero most significant digit from the absolute value of the mantissa part of the product-sum operation result before normalization from the two terms output from the multiplication array in the most significant digit detection unit of FIG. is there. 桁合わせシフト数が−2以上の場合の、最上位桁検出部において、乗算アレイの出力である2項から、正規化前の積和演算結果の仮数部の絶対値のうち0でない最上位桁を誤差なしで求める処理を示すフローチャートである。In the most significant digit detection unit when the digit shift number is -2 or more, from the two terms output from the multiplication array, the most significant digit that is not 0 among the absolute values of the mantissa part of the product-sum operation result before normalization It is a flowchart which shows the process which calculates | requires without an error. 正規化前の積和演算結果の仮数部の絶対値のうち0でない最上位桁を1桁の誤差で求めるように図5の処理修正した処理を示すフローチャートである。FIG. 6 is a flowchart showing the processing modified in FIG. 5 so that the most significant digit that is not 0 among the absolute values of the mantissa part of the product-sum operation result before normalization is obtained with an error of one digit. 図6の処理を図1の積和演算結果の最上位桁検出部に適用可能に修正した処理を示すフローチャートである。7 is a flowchart illustrating a process in which the process of FIG. 6 is modified to be applicable to the most significant digit detection unit of the product-sum operation result of FIG. 図7の処理を実現する図1の最上位桁検出部の構成例を示すブロック図である。FIG. 8 is a block diagram illustrating a configuration example of a most significant digit detection unit in FIG. 1 that implements the processing in FIG. 7. 図8の検索回路におけるモードの例を示す図である。It is a figure which shows the example of the mode in the search circuit of FIG. 図8の検索回路における動作論理の例を示す図である。It is a figure which shows the example of the operation | movement logic in the search circuit of FIG. 図8の検索回路における動作論理の例を示す図である。It is a figure which shows the example of the operation | movement logic in the search circuit of FIG. 図8の最上位桁検出部の検索回路の別の構成例を示すブロック図である。It is a block diagram which shows another structural example of the search circuit of the most significant digit detection part of FIG. 図12の検索回路の第2段シフト制御回路の構成を示す図である。It is a figure which shows the structure of the 2nd stage shift control circuit of the search circuit of FIG. 図12のモード先見及び第1段シフト制御回路の動作論理の例を示す図である。It is a figure which shows the example of the operation logic of the mode look ahead of FIG. 12, and a 1st stage shift control circuit. 図12の最下位第1段シフト制御回路の動作論理の例を示す図である。It is a figure which shows the example of the operation | movement logic of the lowest 1st stage shift control circuit of FIG. 本発明の別実施例による積和演算器により積和演算を行う場合の各構成要素での処理の流れを示す動作説明のための図である。It is a figure for operation | movement explanation which shows the flow of a process in each component in the case of performing a product-sum operation by the product-sum operation unit by another Example of this invention. 本発明のさらに別の実施例による積和演算器の構成を示すブロック図である。It is a block diagram which shows the structure of the product-sum calculator by another Example of this invention. 図17の積和演算器によりある式の積和演算を行う場合の図17の各構成要素での処理の流れを示す動作説明のための図である。FIG. 18 is a diagram for explaining an operation showing a flow of processing in each component of FIG. 17 when a product-sum operation of a certain expression is performed by the product-sum operation unit of FIG. 17; 本発明による積和演算器を用いたデータ処理装置の一例を示すブロック図である。It is a block diagram which shows an example of the data processor using the product-sum calculator by this invention.

符号の説明Explanation of symbols

1 桁合せシフト数指数生成部
2 加数桁合せ符号合せ部
3 加数下位スティッキービット生成部
4 乗算アレイ
5 最上位桁検出部
6 キャリー伝搬加算器
7 加数上位インクリメンタ
8 指数正規化部
9 スティッキービット生成部
10 正規化シフタ
11 正規化丸め部
12 指数補正部
1 Digit shift number exponent generation unit 2 Addend digit alignment code matching unit 3 Addend lower sticky bit generation unit 4 Multiplying array 5 Most significant digit detection unit 6 Carry propagation adder 7 Addend higher incrementer 8 Exponential normalization unit 9 Sticky bit generation unit 10 Normalization shifter 11 Normalization rounding unit 12 Exponential correction unit

Claims (1)

データ処理装置において、
演算に必要な情報をストアするメモリと、
前記メモリ内の前記情報を読み出してデコードして前記演算部に与える命令フェッチ部と、
前記デコードされた情報に基づき前記乗数、被乗数、加数との積和演算を行う積和演算器を有する演算部とを備え、
前記積和演算器は、
前記乗数の指数部と前記被乗数の指数部と前記加数の指数部とに基づき、桁合わせシフト数及び正規化前の積和演算結果の指数を得る桁合わせシフト数生成部と、
該桁合わせシフト数に基づき前記加数の仮数部のなかで積に対応する桁より上位にはみ出した部分からなる前記加数の第1の仮数部からなる前記加数の第1の仮数部を出力すると共に、前記加数の仮数部のうちで前記第1の仮数部を除いた部分からなる前記加数の第2の仮数部を前記桁合わせシフト数に基づいてシフトして出力する加数桁合わせ部と、
前記乗数の仮数部と前記被乗数の仮数部と前記加数桁合わせ部からの前記加数の第2の仮数部とを入力してこれらの積和演算を行い2つの項を出力する積和演算アレイと、
前記積和演算アレイからの前記2つの項を入力して、前記2つの項に基づきキャリー伝搬加算を行い正規化前の積和演算結果の下位側の仮数部を出力するキャリー伝搬加算部と、
前記積和演算アレイからの前記2つの項、積と加数部が異符号であることを示す乗数と被乗数と加数の符号部の排他的論理和との一方、及び前記桁合わせシフト数を入力して、これらに基づき前記正規化前の積和演算結果の仮数部の絶対値の0でない最上位桁を検出する最上位桁検出部であり、前記2つの項の和または前記下位側の仮数部と桁合わせシフト数の和が正か負かを決定する決定部と、前記和が正のとき、前記2つの項または前記下位側の仮数部と桁合わせシフト数に基づき前記正規化前の積和演算結果の仮数部の絶対値のうち0でない最上位桁を検出する第1の検出部と、前記和が負のとき、前記2つの項または前記下位側の仮数部と桁合わせシフト数に基づき前記正規化前の積和演算結果の仮数部の絶対値のうち0でない最上位桁を検出する第2の検出部と、上位から下位へ、前記和の符号を判定する正負判定モード、前記和が正のときの正数検索モード、前記和が負のときの負数検索モード、及び前記最上位桁を検出した後の検索終了モードのいずれのモードであるかを伝える信号を備え、0でない最上位桁は、該最上位桁の検出が前記第1の検出部と第2の検出部のいずれで行われても、最初の検出により最終的に決定する最上位桁検出部と、
前記最上位桁検出部で検出された前記最上位桁に基づき、前記キャリー伝搬加算部からの前記正規化前の積和演算結果の下位側の仮数部の正規化を行い、正規化された積和演算結果の下位側の仮数部を得る正規化部と、
前記加数桁合わせ部からの前記加数の第1の仮数部を前記キャリー伝搬加算部からのキャリーに基づいて選択的にインクリメントする加数上位インクリメント部と、
前記正規化部から前記正規化された積和演算結果の下位側の仮数部と、前記加数上位インクリメント部からの前記インクリメントされた前記加数の第1の仮数部との論理和をとり正規化された積和演算結果の仮数部を得る手段と、
前記最上位桁検出部で検出された前記最上位桁に基づき、前記桁合わせシフト数生成部からの前記正規化前の積和演算結果の指数の正規化を行い、正規化された積和演算結果の指数を得る指数正規化部とを備える、
ことを特徴とするデータ処理装置。
In a data processing device,
A memory for storing information necessary for calculation, and
An instruction fetch unit that reads and decodes the information in the memory and gives the information to the arithmetic unit;
An arithmetic unit having a product-sum operation unit that performs a product-sum operation with the multiplier, multiplicand, and addend based on the decoded information;
The product-sum calculator is
Based on the exponent part of the multiplier, the exponent part of the multiplicand, and the exponent part of the addend, a digit shift number generator that obtains the digit shift number and the exponent of the product-sum operation result before normalization,
The first mantissa part of the addend consisting of the first mantissa part of the addend consisting of the part of the mantissa part of the addend that protrudes above the digit corresponding to the product based on the digit shift number An addend that outputs and shifts the second mantissa part of the addend consisting of a portion excluding the first mantissa part of the mantissa part of the addend based on the digit shift number The digit alignment part;
Multiply-add operation in which the mantissa part of the multiplier, the mantissa part of the multiplicand, and the second mantissa part of the addend from the addend digit aligning section are input, and the product-sum operation is performed to output two terms. An array,
A carry propagation addition unit that inputs the two terms from the product-sum operation array, performs carry propagation addition based on the two terms, and outputs a lower-order mantissa part of the product-sum operation result before normalization;
The two terms from the product-sum operation array, one of a multiplier indicating that the product and the addend are different signs, an exclusive OR of the multiplicand and the sign of the addend, and the digit shift number An uppermost digit detection unit that detects the highest digit that is not 0 of the absolute value of the mantissa part of the product-sum operation result before normalization based on these, and is the sum of the two terms or the lower-order side A determination unit that determines whether a sum of a mantissa part and a digit shift number is positive or negative; and, when the sum is positive, based on the two terms or the lower-order mantissa part and a digit shift number before the normalization A first detection unit that detects the most significant digit that is not 0 among the absolute values of the mantissa part of the product-sum operation result, and when the sum is negative, the two terms or the lower-order mantissa part and a digit shift The highest non-zero of the absolute value of the mantissa part of the product-sum operation result before normalization based on the number A second detection unit for detecting a digit; a positive / negative determination mode for determining the sign of the sum from higher to lower; a positive number search mode when the sum is positive; a negative number search mode when the sum is negative; And a signal that indicates which mode is the search end mode after detecting the most significant digit, and the most significant digit that is not 0 is detected by the first detection unit and the second detection unit. Whichever detection unit is used, the most significant digit detection unit finally determined by the first detection;
Based on the most significant digit detected by the most significant digit detection unit, normalization of the lower mantissa part of the product-sum operation result before normalization from the carry propagation addition unit is performed, and the normalized product A normalization part for obtaining the lower-order mantissa part of the sum operation result;
An addend upper increment section that selectively increments the first mantissa part of the addend from the addend digit aligning section based on the carry from the carry propagation addition section;
A normal sum is obtained by ORing the lower mantissa part of the normalized product-sum operation result from the normalization part and the first mantissa part of the incremented addend from the addend upper increment part. Means for obtaining the mantissa part of the result of the sum of products
Based on the most significant digit detected by the most significant digit detection unit, normalization of the exponent of the product-sum operation result before normalization from the digit shift number generation unit is performed, and normalized product-sum operation An exponent normalization unit for obtaining an exponent of the result,
A data processing apparatus.
JP2006275032A 1994-11-17 2006-10-06 Data processing apparatus Withdrawn JP2007073061A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006275032A JP2007073061A (en) 1994-11-17 2006-10-06 Data processing apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP30820094 1994-11-17
JP2006275032A JP2007073061A (en) 1994-11-17 2006-10-06 Data processing apparatus

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP32391095A Division JP3950920B2 (en) 1994-11-17 1995-11-17 Multiply-accumulator and data processing device

Publications (1)

Publication Number Publication Date
JP2007073061A true JP2007073061A (en) 2007-03-22

Family

ID=37934400

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006275032A Withdrawn JP2007073061A (en) 1994-11-17 2006-10-06 Data processing apparatus

Country Status (1)

Country Link
JP (1) JP2007073061A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5450781B1 (en) * 2012-12-26 2014-03-26 株式会社東芝 Arithmetic circuit and method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5450781B1 (en) * 2012-12-26 2014-03-26 株式会社東芝 Arithmetic circuit and method

Similar Documents

Publication Publication Date Title
KR0185254B1 (en) Multiplier-add unit and data processing apparatus using it
CN107077417B (en) Validity registration
US8046399B1 (en) Fused multiply-add rounding and unfused multiply-add rounding in a single multiply-add module
US5404324A (en) Methods and apparatus for performing division and square root computations in a computer
US5995991A (en) Floating point architecture with tagged operands
JPH09269891A (en) Method and device for adding partial product, method and device for multiplying floating point, and method and device for floating point product-sum operation
US20180052660A1 (en) Apparatus and method for fixed point to floating point conversion and negative power of two detector
EP0472139A2 (en) A floating-point processor
JP3418460B2 (en) Double precision division circuit and method
JPH0542011B2 (en)
US7668892B2 (en) Data processing apparatus and method for normalizing a data value
CN111936965A (en) Random rounding logic
JPH09212337A (en) Floating-point arithmetic processor
US5247471A (en) Radix aligner for floating point addition and subtraction
JPH0250492B2 (en)
GB2549153B (en) Apparatus and method for supporting a conversion instruction
US6598065B1 (en) Method for achieving correctly rounded quotients in algorithms based on fused multiply-accumulate without requiring the intermediate calculation of a correctly rounded reciprocal
JP3950920B2 (en) Multiply-accumulator and data processing device
US20060136536A1 (en) Data processing apparatus and method for converting a fixed point number to a floating point number
JP2007073061A (en) Data processing apparatus
JP2018097864A (en) Leading zero anticipation
JP3257278B2 (en) Normalizer using redundant shift number prediction and shift error correction
JPH01282633A (en) Non-normalized number processing system
JP3233432B2 (en) Multiplier
JP3522387B2 (en) Pipeline arithmetic unit

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A132

Effective date: 20070424

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20070504