JPH0812595B2 - Multiplication circuit - Google Patents
Multiplication circuitInfo
- Publication number
- JPH0812595B2 JPH0812595B2 JP60224417A JP22441785A JPH0812595B2 JP H0812595 B2 JPH0812595 B2 JP H0812595B2 JP 60224417 A JP60224417 A JP 60224417A JP 22441785 A JP22441785 A JP 22441785A JP H0812595 B2 JPH0812595 B2 JP H0812595B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- output
- multiplier
- complement
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
- 230000000295 complement effect Effects 0.000 claims description 19
- 238000010586 diagram Methods 0.000 description 7
- 230000000694 effects Effects 0.000 description 2
- 238000000034 method Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は2の補数データの乗算を行う乗算回路に関す
る。The present invention relates to a multiplication circuit for multiplying two's complement data.
半導体製造技術の進歩に伴い、高集積度、かつ高速度
のLSIが可能となり、乗算を含む高速演算を必要とする
リアルタイム・ディジタル信号処理プロセッサが可能と
なった。With the progress of semiconductor manufacturing technology, high-integration and high-speed LSI has become possible, and real-time digital signal processor that requires high-speed operation including multiplication has become possible.
ディジタル信号処理とは、アナログ信号をディジタル
信号に変換し、フィルタ操作、直交変換等をディジタル
演算で実行する技術である。Digital signal processing is a technique of converting an analog signal into a digital signal and executing filter operation, orthogonal transformation, etc. by digital operation.
一般に、これらディジタル信号処理において行なわれ
る演算は、(1)式に示すように配列同志の積和である
ことが多い。In general, the arithmetic operation performed in these digital signal processing is often the sum of products of arrays as shown in the equation (1).
ただし、k=0,1,… i=0,1,… Nは所定の正の整数 Xk+i:入力 Yk+i:出力 これらの演算を実行するためのプロセッサのデータ形
式は、一例として第2図に示すように2の補数表示の固
定小数点形式を用いる場合が多い。第2図のように、4
ビットの2の補数表示のデータで、小数点位置がMSBとM
SBの次のビットとの間にある場合、4ビットで表示でき
る数値Aは、(2)式のように表わされる。 However, k = 0,1, ... i = 0,1, ... N is a predetermined positive integer X k + i : input Y k + i : output The data format of the processor for executing these operations is an example. As shown in FIG. 2, a fixed point format of 2's complement display is often used. As shown in FIG. 2, 4
Bit 2's complement display data, where the decimal point position is MSB and M
When it is between the SB and the next bit, the numerical value A that can be represented by 4 bits is expressed by the equation (2).
A=−a3+a2・2-1+a1・2-2+a0・2-3 ……(2) ただし、a0,a1,a2,a3は0または1すなわち −1≦A<1 ……(3) となる。A = -a 3 + a 2・ 2 -1 + a 1・ 2 -2 + a 0・ 2 -3 (2) where a 0 , a 1 , a 2 , a 3 is 0 or 1, that is, -1≤A <1 …… (3)
したがって、このような2つの2の補数A,Bの積は −1<A・B1 となる。すなわち、AとBの積は第2図で示す2の補数
表示で表示できる最大値を超えてしまう場合がある。た
だし、この最大値を超える場合はAおよびBの値が共に
−1に等しい場合である。例えば負の最小値(1.000B)
同志の積は第4図のようになる。Therefore, the product of such two 2's complements A and B is -1 <A · B1. That is, the product of A and B may exceed the maximum value that can be displayed in the 2's complement display shown in FIG. However, when the maximum value is exceeded, the values of A and B are both equal to -1. For example, the negative minimum value (1.000 B )
The product of comrades is shown in Fig. 4.
従来、2の補数表示のデータを乗算する乗算回路の入
出力のデータ形式は、第3図に示すように、入力の小数
点位置と出力の小数点位置が同一になっているもの、即
ち小数点の位置は入力も出力もMSBから数えて同じ位置
にあるものが一般的であり、前記最大値を超えるデータ
の乗算は禁止されているか、あるいは第3図および第4
図のように全く異なるデータを出力する場合が一般的で
ある。Conventionally, as shown in FIG. 3, the input / output data format of the multiplication circuit for multiplying the data of the two's complement display is such that the input decimal point position and the output decimal point position are the same, that is, the decimal point position. In general, both the input and the output are in the same position as counted from the MSB, and multiplication of data exceeding the maximum value is prohibited, or FIG. 3 and FIG.
It is common to output completely different data as shown in the figure.
第3図に示すように全く異なるデータを出力する場合
には、巡回型ディジタルフィルタに用いた場合、発振し
たり、S/D特性が劣化したりする場合がある。When outputting completely different data as shown in FIG. 3, when it is used for a recursive digital filter, it may oscillate or the S / D characteristics may deteriorate.
本発明の目的は、このような乗算結果が、表示できる
数値の最大を超えた場合でも使用可能な乗算回路を提供
することにある。An object of the present invention is to provide a multiplication circuit that can be used even when the multiplication result exceeds the maximum value that can be displayed.
本発明の乗算回路は、Nビット(Nは2以上の整数)
の2の補数表示のデータとMビット(Mは2以上の整
数)の2の補数表示のデータを乗算し、(N+M−1)
ビットの乗算結果を得る乗算器と、前記Nビットのデー
タがNビットで表わせる2の補数表示のデータの負の最
小値であり、かつ前記MビットのデータがMビットで表
わせる2の補数表示のデータの負の最小値であることを
検出する検出器と、前記(N+M−1)ビットの乗算結
果を入力とし、前記検出器が前記NビットおよびMビッ
トのデータが共に負の最小値であることを検出した場合
所定の値を出力し、共に負の最小値であることを検出し
ない場合前記乗算結果を出力する出力置換回路を有す
る。The multiplication circuit of the present invention has N bits (N is an integer of 2 or more)
2's complement display data and M bits (M is an integer greater than or equal to 2) 2's complement display data are multiplied, and (N + M-1)
A multiplier for obtaining a bit multiplication result, and the N-bit data is a negative minimum value of 2's complement data represented by N bits, and the M-bit data is 2's complement represented by M bits. A detector for detecting the negative minimum value of the displayed data and a multiplication result of the (N + M-1) bits as an input, and the detector detects the negative minimum value of both the N-bit and M-bit data. When the above is detected, a predetermined value is output, and when neither is detected as a negative minimum value, the output replacement circuit that outputs the multiplication result is included.
したがって、乗算結果が、表示できる数値の最大を超
えた場合でも使用可能となる。Therefore, even if the multiplication result exceeds the maximum value that can be displayed, it can be used.
次に、本発明の実施例について図面を参照して説明す
る。Next, embodiments of the present invention will be described with reference to the drawings.
第1図は本発明の乗算回路の一実施例のブロック図で
ある。FIG. 1 is a block diagram of an embodiment of the multiplication circuit of the present invention.
入力端子1,2からはそれぞれ乗数、被乗数が入力され
る。乗算器3は、例えば第4図に示すような4ビットの
2の補数表示のデータを乗算する。データ置換回路5
は、データ検出器4の検出結果に基づき、乗算器3の出
力もしくは第7図に示す正の最大値を出力端子6に出力
する。データ検出器4は、入力端子1および2から入力
されたデータが共に負の最小値、即ち第6図に示すデー
タであるか否かを検出し、共に前記負の最小値である場
合にはデータ置換回路5に所定の値の出力端子6に出力
するように指示し、少くとも1つが負の最小値でなけれ
ば、データ置換回路5に乗算器3の出力を出力端子6に
出力するように指示する。乗算器3は、入力端子1およ
び2を通して第5図(a)および第5図(b)に示す2
の補数表示のデータを入力し、第5図(c)に示す乗算
結果を出力端子6に出力する。入力された2つのデータ
が共に負の最小値でなければ乗算結果は第5図(c)の
フォーマットで表わせる数値であるから、正しい乗算結
果がデータ置換回路5に出力される。この場合、2つの
入力データが共に負の最小値ではないため、データ検出
器4はデータ置換回路5に乗算器3の出力を出力端子6
に出力するように指示する。したがって、出力端子6に
は通常の乗算結果が出力される。一方、入力端子1およ
び2に共に負の最小値、即ち第6図に示された値が入力
された場合には、乗算結果は、第5図(c)で表示でき
る正の最大値よりも大きい値となるため、乗算器3はデ
ータ置換回路5に正しい乗算結果を出力しない。一方、
2つの入力は共に負の最小値であるため、データ検出器
4はデータ置換回路5に正の最大値を出力端子6に出力
するように指示する。従ってこの場合、正の最大値が出
力される。即ち、乗算結果が第5図(c)で表示できる
数値の場合には正しい値が出力され、第5図(c)で表
示できる数値を超えた場合には第5図(c)で表示でき
る正の最大値が出力される。A multiplier and a multiplicand are input from the input terminals 1 and 2, respectively. The multiplier 3 multiplies, for example, 4-bit 2's complement data as shown in FIG. Data replacement circuit 5
Outputs the output of the multiplier 3 or the maximum positive value shown in FIG. 7 to the output terminal 6 based on the detection result of the data detector 4. The data detector 4 detects whether the data inputted from the input terminals 1 and 2 are both negative minimum values, that is, the data shown in FIG. 6, and when both are the negative minimum values, The data replacement circuit 5 is instructed to output to the output terminal 6 of a predetermined value, and if at least one is not the negative minimum value, the data replacement circuit 5 outputs the output of the multiplier 3 to the output terminal 6. Instruct. The multiplier 3 is input through the input terminals 1 and 2 and is shown at 2 in FIG. 5 (a) and FIG. 5 (b).
The data of the complement display of is input and the multiplication result shown in FIG. 5C is output to the output terminal 6. If the two input data are not both negative minimum values, the multiplication result is a numerical value that can be represented in the format of FIG. 5 (c), so the correct multiplication result is output to the data replacement circuit 5. In this case, since the two input data are not both negative minimum values, the data detector 4 causes the data replacement circuit 5 to output the output of the multiplier 3 to the output terminal 6.
To output to. Therefore, the normal multiplication result is output to the output terminal 6. On the other hand, when the negative minimum value, that is, the value shown in FIG. 6 is input to both the input terminals 1 and 2, the multiplication result is larger than the positive maximum value that can be displayed in FIG. 5 (c). Since it has a large value, the multiplier 3 does not output a correct multiplication result to the data replacement circuit 5. on the other hand,
Since the two inputs are both negative minimum values, the data detector 4 instructs the data replacement circuit 5 to output the positive maximum value to the output terminal 6. Therefore, in this case, the maximum positive value is output. That is, if the multiplication result is a numerical value that can be displayed in FIG. 5 (c), a correct value is output, and if it exceeds the numerical value that can be displayed in FIG. 5 (c), it can be displayed in FIG. 5 (c). The maximum positive value is output.
一般に、ディジタル信号処理は入力データを統計的に
処理する技術であるため、データ置換回路により正しい
乗算結果に比べ若干の誤差を出力する乗算器であっても
良い。In general, digital signal processing is a technique for statistically processing input data, and therefore may be a multiplier that outputs a slight error compared to a correct multiplication result by a data replacement circuit.
本実施例では4ビットの乗算器を用いた例を示した
が、4ビット以外の2の補数データの乗算器にも応用で
きることは明白である。In this embodiment, an example using a 4-bit multiplier is shown, but it is obvious that the present invention can be applied to a multiplier of 2's complement data other than 4 bits.
以上説明したように本発明は、乗算器の入力データを
検出するデータ検出器と、データ検出器の出力に従って
乗算器の出力を所定の値に置換、出力するデータ置換回
路とを有することにより、乗算結果が、表示できる数値
範囲を超えても、その誤差が最小になる乗算出力を得る
ことができるという効果がある。As described above, the present invention has the data detector that detects the input data of the multiplier and the data replacement circuit that replaces and outputs the output of the multiplier with a predetermined value according to the output of the data detector. Even if the multiplication result exceeds the displayable numerical range, there is an effect that a multiplication output that minimizes the error can be obtained.
【図面の簡単な説明】 第1図は本発明の乗算回路の一実施例を示すブロック
図、第2図は4ビットの2の補数データの一例を示す
図、第3図および第5図は4ビットの2の補数データの
乗算器の一般的な入出力データフォーマットを示す図、
第4図は第3図の乗算器の出力が正しい乗算結果を出力
しない場合の例を示す図、第6図は4ビットの2の補数
表示の負の最小値を示す図、第7図は出力端子6に出力
される正の最大値を示す図である。 1,2……入力端子、3……乗算器、 4……データ検出器、5……データ置換回路、 6……出力端子。BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing an embodiment of a multiplication circuit of the present invention, FIG. 2 is a diagram showing an example of 4-bit 2's complement data, and FIGS. 3 and 5 are A diagram showing a general input / output data format of a 4-bit 2's complement data multiplier,
FIG. 4 is a diagram showing an example in which the output of the multiplier of FIG. 3 does not output a correct multiplication result, FIG. 6 is a diagram showing a negative minimum value of a 4-bit 2's complement representation, and FIG. 6 is a diagram showing a maximum positive value output to an output terminal 6. FIG. 1,2 ... Input terminal, 3 ... Multiplier, 4 ... Data detector, 5 ... Data replacement circuit, 6 ... Output terminal.
───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭61−62937(JP,A) 特開 昭57−76635(JP,A) 特開 昭60−142735(JP,A) 特開 昭59−176919(JP,A) 特開 昭58−115544(JP,A) ─────────────────────────────────────────────────── ─── Continuation of front page (56) Reference JP 61-62937 (JP, A) JP 57-76635 (JP, A) JP 60-142735 (JP, A) JP 59- 176919 (JP, A) JP 58-115544 (JP, A)
Claims (1)
表示のデータとMビット(Mは2以上の整数)の2の補
数表示のデータを乗算し、(N+M−1)ビットの乗算
結果を得る乗算器と、前記NビットのデータがNビット
で表せる2の補数表示のデータの負の最小値であり、か
つ前記MビットのデータがMビットで表せる2の補数表
示のデータの負の最小値であることを検出する検出器
と、前記検出器が前記NビットおよびMビットのデータ
が共に負の最小値であることを検出した場合前記乗算器
の出力にかえて正の最大値を出力し、共に負の最小値で
あることを検出しない場合乗算器の乗算結果を出力する
出力置換回路とを有する乗算回路。1. N-bit (N is an integer of 2 or more) 2's complement data and M bits (M is an integer of 2 or more) 2's complement data are multiplied to obtain (N + M-1) bits. A multiplier for obtaining the multiplication result of N, and the N-bit data is a negative minimum value of the data of 2's complement representation that can be represented by N bits, and the M-bit data is the data of 2's complement representation that can be represented by M bits. Of a negative minimum value of the multiplier, and when the detector detects that the N-bit data and the M-bit data are both negative minimum values, the output of the multiplier is changed to a positive value. And a permutation circuit which outputs the multiplication result of the multiplier when both of the maximum values are not detected to be negative minimum values.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP60224417A JPH0812595B2 (en) | 1985-10-07 | 1985-10-07 | Multiplication circuit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP60224417A JPH0812595B2 (en) | 1985-10-07 | 1985-10-07 | Multiplication circuit |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS6282430A JPS6282430A (en) | 1987-04-15 |
| JPH0812595B2 true JPH0812595B2 (en) | 1996-02-07 |
Family
ID=16813447
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP60224417A Expired - Lifetime JPH0812595B2 (en) | 1985-10-07 | 1985-10-07 | Multiplication circuit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0812595B2 (en) |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS6162937A (en) * | 1984-09-04 | 1986-03-31 | Toshiba Corp | Multiplier |
-
1985
- 1985-10-07 JP JP60224417A patent/JPH0812595B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPS6282430A (en) | 1987-04-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5726924A (en) | Exponentiation circuit utilizing shift means and method of using same | |
| JP2526532B2 (en) | Digital filter for image processing | |
| JPH0812595B2 (en) | Multiplication circuit | |
| EP0472030A2 (en) | Method and apparatus for modifying two's complement multiplier to perform unsigned magnitude multiplication | |
| US5463571A (en) | Multi-nary OR logic device | |
| US7111028B2 (en) | Data conversion method, a data conversion circuit and a data conversion program | |
| JPH0519170B2 (en) | ||
| JPS6116110B2 (en) | ||
| JP2645422B2 (en) | Floating point processor | |
| JP2558739B2 (en) | Absolute value circuit | |
| JPH0883263A (en) | Digital signal processor | |
| JP3053637B2 (en) | Calculation method of digital filter | |
| JP3235125B2 (en) | Digital signal processing circuit | |
| JP3210356B2 (en) | Data zero judgment device | |
| JP2753922B2 (en) | Fixed-point division method | |
| JPH05224888A (en) | Variable point position type data multiplication circuit | |
| JP3323166B2 (en) | Interpolation device | |
| JP2550597B2 (en) | Squarer | |
| JPH0628503A (en) | Adder | |
| JP2907276B2 (en) | Arithmetic processing unit | |
| JPH04281524A (en) | Floating point arithmetic processor | |
| JP2870018B2 (en) | Product-sum operation circuit | |
| JPH05307401A (en) | Control arithmetic circuit | |
| JP3078696B2 (en) | Reciprocal arithmetic unit | |
| JP2638842B2 (en) | Decoder circuit |