JPH03188523A - multiplication circuit - Google Patents
multiplication circuitInfo
- Publication number
- JPH03188523A JPH03188523A JP1327892A JP32789289A JPH03188523A JP H03188523 A JPH03188523 A JP H03188523A JP 1327892 A JP1327892 A JP 1327892A JP 32789289 A JP32789289 A JP 32789289A JP H03188523 A JPH03188523 A JP H03188523A
- Authority
- JP
- Japan
- Prior art keywords
- data
- multiplication
- circuit
- serial
- output
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Abstract
(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.
Description
【発明の詳細な説明】
産業上の利用分野
本発明は、2の補数のデジタル・データと絶対値表現の
デジタル・データとの乗算回路に関するものである。DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a multiplication circuit for two's complement digital data and absolute value representation digital data.
従来の技術
近年、デジタル処理はさまざまな分野で使用されており
、特に汎用デジタル・シグナル・プロセッサー(DSP
)や、デジタル・フィルターの技術においては、乗算機
能が多用されるようになってきた。BACKGROUND OF THE INVENTION In recent years, digital processing has been used in various fields, especially general-purpose digital signal processors (DSPs).
) and in digital filter technology, multiplication functions have come to be used frequently.
従来、これらの乗算機能はパラレル乗算回路として実現
されることが多い。Conventionally, these multiplication functions are often implemented as parallel multiplication circuits.
以下に、従来の乗算回路について説明する。A conventional multiplication circuit will be described below.
第5図は、従来の乗算回路の回路図であり、51〜59
は入力データ(XO” X2・・・・・・2の補数表現
)と係数データ(yo”y2・・・・・・絶対値表現)
との積をつくるための論理積(AND)ゲート、60〜
62は、係数データを反転させるためのインバータ、6
3〜74は各種を加算するためのフルアダーである。FIG. 5 is a circuit diagram of a conventional multiplication circuit, 51 to 59
are the input data (XO"X2...2's complement representation) and the coefficient data (yo"y2...absolute value representation)
Logical product (AND) gate for creating a product with, 60~
62 is an inverter for inverting coefficient data;
3 to 74 are full adders for adding various types.
この乗算回路は、デジタル・フィルタ等によく用いられ
る2の補数データと絶対値表現の係数データとの乗算を
行なうものであり、図の上側の端子より入力される2の
補数データ、
X=−2n−1・xn−■+Σ2I−xiと、図の左側
10
の端子より入力される絶対値表現の係数データ、して
Z=−20−1・xn−ヒΣ2”yk+Σ2”xH・Σ
2”Ykかに−0、緯Ok+0
得られる。This multiplier circuit multiplies 2's complement data, which is often used in digital filters, etc., with coefficient data expressed as an absolute value. 2n-1.
2”Yk crab-0, latitude Ok+0 are obtained.
また、係数を1以下すなわち小数として取り扱る。Further, the coefficients are treated as 1 or less, that is, as decimal numbers.
発明が解決しようとする課題
しかしながら上記の従来の構成では、(nxm)個のA
NDゲートとフルアダーや、m個のインバータ、更にm
個のフルアダーが必要であり、回路規模が非常に大きく
、コスト・アップになるという問題点を有していた。Problem to be Solved by the Invention However, in the above conventional configuration, (nxm) A
ND gate, full adder, m inverters, and m
This has the problem of requiring multiple full adders, resulting in a very large circuit scale and increased costs.
本発明は上記従来の問題点を解決するもので、2の補数
と絶対値表現のデータとの乗算を実現でき、回路規模を
小さ(抑えた乗算回路を提供することを目的とする。The present invention solves the above-mentioned conventional problems, and aims to provide a multiplication circuit that can realize multiplication between two's complement and absolute value representation data and has a small circuit scale.
課題を解決するための手段
この目的を達成するために、本発明の乗算回路は、2の
補数データのMSBによりデータを反転させるEORと
、その出力と絶対値表現のデータとのシリアル乗算を行
なう乗算器と、この乗算結果のゼロを検出する回路とか
ら構成されている。Means for Solving the Problems To achieve this object, the multiplication circuit of the present invention performs EOR inversion of data by the MSB of two's complement data, and serial multiplication of its output with data in absolute value representation. It consists of a multiplier and a circuit that detects zero in the multiplication result.
作用
この構成によって、正と負の各値を持つ2の補数表現の
データはEORによりすべて正の値に変換され、シリア
ル乗算が実現できるため、ANDゲートとフルアダーと
で構成される積和回路の数は、絶対値表現の乗算係数デ
ータのビット数m個だけでよく、回路規模の削減をはか
ることができる。Effect With this configuration, data in two's complement representation with positive and negative values are all converted to positive values by EOR, and serial multiplication can be realized. The number of bits required is only m, which is the number of bits of multiplication coefficient data expressed in absolute value, and the circuit scale can be reduced.
実施例
以下本発明の一実施例について、図面を参照しながら説
明する。EXAMPLE Hereinafter, an example of the present invention will be described with reference to the drawings.
第1図は本発明の一実施例における乗算回路のブロック
図、第2図は第1図のシリアル乗算器の回路図、第3図
は第1図のゼロ検出回路の回路図、第4図はシリアル乗
算器の動作説明図である。FIG. 1 is a block diagram of a multiplication circuit according to an embodiment of the present invention, FIG. 2 is a circuit diagram of the serial multiplier of FIG. 1, FIG. 3 is a circuit diagram of the zero detection circuit of FIG. 1, and FIG. is an explanatory diagram of the operation of a serial multiplier.
第1図において、11は2の補数表現のデータを反転さ
せるためのEOR112はEORIIの出力と絶対値表
現の係数との乗算を行なうシリアル乗算器、13はシリ
アル乗算器12の出力を保持するためのシフト・レジス
タ、15はシフト・レジスタ13の値がゼロであること
を検出するゼロ検出回路、14はシフト・レジスタ13
の出力を反転させるEOR181は2の補数表現のデー
タのシリアル入力端子、82は2の補数表現のデータの
MSBを入力するMSB入力端子、83はシリアル乗算
器とゼロ検出回路を制御する切換信号、84は係数を入
力する端子、85はジルアリ出力端子、86はシリアル
乗算器とシフトレジスタのシフト・クロック入力端子で
ある。In FIG. 1, 11 is a serial multiplier for inverting data in two's complement representation, EOR 112 is a serial multiplier for multiplying the output of EORII by a coefficient in absolute value representation, and 13 is for holding the output of serial multiplier 12. 15 is a zero detection circuit that detects that the value of shift register 13 is zero; 14 is shift register 13;
EOR 181 is a serial input terminal for data in two's complement representation, 82 is an MSB input terminal for inputting the MSB of data in two's complement representation, and 83 is a switching signal for controlling the serial multiplier and zero detection circuit. 84 is a terminal for inputting coefficients, 85 is a signal output terminal, and 86 is a shift clock input terminal for a serial multiplier and a shift register.
第2図において、21〜25は入力データをシフトする
ためのD・フリップ・フロップ、26〜29はD・フリ
ップ・フロップの出力と係数を入力とするANDゲート
、30〜32はANDゲートの出力を加算するフルアダ
ー、33〜35はフルアダーのキャリー出力を保持する
ためのD・フリップ・フロップ、36はセレタク、83
は切換信号入力端子、84は係数入力する端子、86は
そのシフト・クロック端子、87はシリアル入力端子で
ある。In FIG. 2, 21 to 25 are D flip-flops for shifting input data, 26 to 29 are AND gates that receive the outputs and coefficients of the D flip flops, and 30 to 32 are outputs of the AND gates. 33 to 35 are D flip-flops to hold the carry output of the full adder, 36 is a selector, 83
84 is a switching signal input terminal, 84 is a coefficient input terminal, 86 is a shift clock terminal thereof, and 87 is a serial input terminal.
第3図において、41は入力されるデータのオール・ゼ
ロを検出するための多大力NORゲート、42はNOR
ゲート41を制御するためのインバータ、43はNOR
ゲート41の出力とMSBデータとを入力とするAND
ゲート、44はANDゲート43の出力を保持するため
のD・フリップ・フロップ、89はデータ入力端子、9
0はゼロ検出信号端子である。In FIG. 3, 41 is a large power NOR gate for detecting all zeros of input data, and 42 is a NOR gate.
Inverter for controlling gate 41, 43 is NOR
AND with the output of gate 41 and MSB data as input
gate, 44 is a D flip-flop for holding the output of AND gate 43, 89 is a data input terminal, 9
0 is a zero detection signal terminal.
本実施例の乗算回路について具体的数値例と共にその動
作を説明する。The operation of the multiplication circuit of this embodiment will be explained with specific numerical examples.
まず、n=5.m=4として、入力される2の補数表現
のデジタル・データを
“10010(B)−14”、絶対値表現の係数データ
を“1010<s>”とする。ここで、係数はすべて1
以下であり、“1010(B)”は“0.1010<s
>=10/ 16”を示すものである。入力される2の
補数のデジタル・データのうち、MSBを除<(n−1
)ビットがシリアル入力端子81から最下位ビット(L
SB)側を先頭に入力され、MSBデータはMSB入力
端子82から入力されるものとする。First, n=5. Assume that m=4, input digital data in two's complement representation is "10010(B)-14", and coefficient data in absolute value representation is "1010<s>". Here, all coefficients are 1
and “1010(B)” is “0.1010<s
>=10/16". Of the input two's complement digital data, excluding the MSB <(n-1
) bit is input from the serial input terminal 81 to the least significant bit (L
SB) side is input first, and the MSB data is input from the MSB input terminal 82.
シリアル入力端子81から入力されたデータは第1図の
EORllでMSBに従って反転され、すべて正の値に
変換される。すなわち、入力データ“0010(B)=
14”は、
“1101(B)=13”に変換される。Data input from the serial input terminal 81 is inverted according to the MSB at EORll in FIG. 1, and all data is converted into positive values. That is, input data “0010(B)=
14” is converted to “1101(B)=13”.
次にシリアル乗算器12により
“1101(B)= 13”と、
“0.1010(B)= 10/ 16”が乗算される
。Next, the serial multiplier 12 multiplies "1101(B)=13" and "0.1010(B)=10/16".
この動作を第4図を示しながら説明する。第4図はシフ
トレジスタを構成するDフリップフロップ21〜25の
5ビツトと、キャリ・セーブ用レジスタ33〜3503
ビツトと、セレクタ36の入力端子A、Bの状態を示し
た真理値図である。初期状態ではすべてクリアされてい
るものとする。This operation will be explained with reference to FIG. Figure 4 shows 5 bits of D flip-flops 21 to 25 that constitute a shift register and carry/save registers 33 to 3503.
3 is a truth diagram showing the states of bits and input terminals A and B of the selector 36. FIG. It is assumed that all are cleared in the initial state.
まず、最初にデータ“1101”のLSBがシフト・レ
ジスタを構成するDフリップフロップ21に入ると第4
図の(A)の状態となるが、セレクタ36の入力端子A
、Bは共にOのままである。First, when the LSB of data "1101" enters the D flip-flop 21 constituting the shift register, the fourth
The state shown in (A) in the figure is reached, but the input terminal A of the selector 36
, B both remain O.
次にデータの2ビツト目がシフトレジスタを構成するD
フリップフロップ21に入ると(B)の状態となり、係
数の2ビツト目とデータの1ビツト目との積により、セ
レクタ36の入力端子Bは1となる。以降同様にして、
データがシフト・レジスタに入力され、このデータと係
数データとの積を生成し、その積を加算し乗算を実現し
ている。Next, the second bit of data is D, which constitutes the shift register.
When it enters the flip-flop 21, it becomes the state (B), and the input terminal B of the selector 36 becomes 1 due to the product of the second bit of the coefficient and the first bit of the data. Similarly,
Data is input to a shift register, a product of this data and coefficient data is generated, and the products are added to realize multiplication.
その結果、セレクタ36の入力端子A、Bに出力される
値は、
A=1101.0000
B=1000.0010
となり、その整数部分である上位4ビツトはA=110
1(B)=13
B= 1000<a>=8
を示し、Aは入力された元のデータ、Bは係数との乗算
結果であり、セレクタ36が切換信号により入力端子B
を選択しておれば、第1図のシフト−L/ジ、113に
は、”1000(a)=8” が保持される。As a result, the values output to the input terminals A and B of the selector 36 are A=1101.0000 B=1000.0010, and the upper 4 bits of the integer part are A=110.
1(B)=13 B=1000<a>=8 where A is the original input data, B is the multiplication result with the coefficient, and the selector 36 selects the input terminal B by the switching signal.
is selected, "1000(a)=8" is held in shift-L/di, 113 in FIG.
次に、こうして得られた乗算結果を入力端子82より入
力されるMSBに従って再度EORを用いて反転させる
ことで、本来負の値であったデータは乗算結果も負のデ
ータに戻す必要がある。ただし、もともと、負の値であ
ったデータが乗算過程において1より小さくなった場合
、すなわちB=OOO0,1111以下になった場合は
、シフト・レジスタ13の値はオール・ゼロであり、こ
のままMSBに従って反転すると、
“1111(B)= 1”となってしまう。そのため
、ゼロ検出回路15を設け、第3図に示す多入力NOR
ゲート41でシフト・レジスタ13の値がオール・ゼロ
であることを検出し、オール・ゼロの場合ゼロ検出回路
15のゼロ検出信号90をMSBの値によらず“L″レ
ベルすることで14のEORでの反転を行なわず、同シ
フトレジスタ13の値をそのまま出力している。Next, by inverting the multiplication result thus obtained using EOR again according to the MSB input from the input terminal 82, it is necessary to return the data that was originally a negative value to the multiplication result as negative data. However, if the data that was originally a negative value becomes smaller than 1 during the multiplication process, that is, if it becomes less than or equal to B=OOO0,1111, the value in the shift register 13 will be all zeros, and the MSB will remain as is. If it is inverted according to the following, "1111(B)=1" will be obtained. Therefore, a zero detection circuit 15 is provided, and a multi-input NOR shown in FIG.
The gate 41 detects that the values in the shift register 13 are all zeros, and in the case of all zeros, the zero detection signal 90 of the zero detection circuit 15 is set to "L" level regardless of the MSB value. The value of the shift register 13 is output as is without inversion at EOR.
先はどの数値例の場合1乗算数結果
″1000(a)= 8″より第3図のNORゲート4
1の出力は“H”となり、MSBによりANDゲート4
3の出力が“H″′になり、フリップフロップ44によ
りその“H”が一定期間保持されて、第1図のEOR1
4により、シフトレジスタ13の値“1000(B)=
8”が反転され、“0111”が出力される。これはM
SBを含めて表わすと“10111(B)= 9”を
示している。For which numerical example, from the multiplication number result "1000(a) = 8", NOR gate 4 in Figure 3
The output of 1 becomes “H”, and the AND gate 4
The output of EOR1 in FIG.
4, the value of the shift register 13 is “1000(B)=
8” is inverted and “0111” is output. This is M
When expressed including SB, it shows "10111(B)=9".
このようにして
14x 10/16=−8,75<−9(切り捨て処理
)を得ることができる。In this way, 14x 10/16=-8, 75<-9 (round down) can be obtained.
以上のように本実施例によれば、乗算回路をシリアル乗
算器にすると共に乗算をすべて正の数で行なうことによ
り、回路規模を太き(することなく、2の補数表現と絶
対値表現のデータの乗算を実現することができる。As described above, according to this embodiment, by making the multiplication circuit a serial multiplier and performing all multiplications using positive numbers, the circuit size can be increased (without increasing the size of the circuit), and two's complement representation and absolute value representation can be performed. Data multiplication can be realized.
発明の効果
本発明によれば、乗算回路にシリアル乗算器を用いると
共に、乗算データをすべて正の値に変換するためのEO
Rを設けたことにより、回路規模を増大させることなく
、2の補数表現のデータと絶対値表現の係数データとの
乗算を実現することができ、また、ゼロ検出回路を設け
たことにより、乗算過程で1より小さくなった負のデー
タを再度反転させることな(0を出力することができ、
さらに、シリアル乗算回路にセレクタを設けたことで乗
算結果あるいは、もとのデータのどちらかを選択するこ
とができるという効果を得ることのできる優れた乗算回
路を実現できる。Effects of the Invention According to the present invention, a serial multiplier is used in the multiplication circuit, and an EO for converting all multiplication data into positive values is used.
By providing R, it is possible to realize multiplication of data in two's complement representation and coefficient data in absolute value representation without increasing the circuit scale.In addition, by providing a zero detection circuit, multiplication can be realized without increasing the circuit scale. Negative data that becomes smaller than 1 in the process is not inverted again (0 can be output,
Furthermore, by providing a selector in the serial multiplication circuit, it is possible to realize an excellent multiplication circuit that can select either the multiplication result or the original data.
第1図は本発明の一実施例における乗算回路のブロック
図、第2図は第1図中のシリアル乗算器の回路図、第3
図は第1図中のゼロ検出回路の回路図、第4図はシリア
ル乗算器の動作を説明するための真理値図、第5図は従
来の乗算回路の回路図である。
11.14・・・・・・EOR,12・・・・・・シリ
アル乗算器、13・・・・・・シフト・レジスタ、15
・・・・・・ゼロ検出回路、21〜25.33〜35・
・・・・・D・フリップ・フロップ、26〜29・・・
・・・AND、30〜32・・・・・・フルアダー、3
6・・・・・・セレクタ、41・・・・・・多入力N0
R142・・・・・・インバータ、43・・・・・・A
ND、44・・・・・・D・フリッ゛ブフロツブ、51
〜59・・・・・・AND、60〜62・・・・・・イ
ンバータ、63〜74・・・・・・フルアダー、81・
・・・・・シリアル入力端子、82・・・・・・MSB
入力端子、83・・・・・・切換信号、84・・・・・
・係数、85・・・・・・シリアル出力、86・・・・
・・シフト・クロック、87・・・・・・乗算器のシリ
アル入力、88・・・・・・乗算器のシリアル出力、8
9・・・・・・データ入力端子、90・・・・・・ゼロ
検出信号。FIG. 1 is a block diagram of a multiplier circuit in one embodiment of the present invention, FIG. 2 is a circuit diagram of a serial multiplier in FIG. 1, and FIG.
4 is a truth diagram for explaining the operation of a serial multiplier, and FIG. 5 is a circuit diagram of a conventional multiplier circuit. 11.14... EOR, 12... Serial multiplier, 13... Shift register, 15
...Zero detection circuit, 21-25.33-35.
...D.Flip-flop, 26-29...
...AND, 30-32...Full adder, 3
6...Selector, 41...Multi-input N0
R142...Inverter, 43...A
ND, 44...D Flip Flip Flip, 51
~59...AND, 60-62...Inverter, 63-74...Full adder, 81.
...Serial input terminal, 82 ...MSB
Input terminal, 83...Switching signal, 84...
・Coefficient, 85...Serial output, 86...
...Shift clock, 87... Serial input of multiplier, 88... Serial output of multiplier, 8
9...Data input terminal, 90...Zero detection signal.
Claims (2)
ビット(MSB)により、同MSBを除く(n−1)ビ
ットを反転させる排他的論理和(EOR)と、その出力
と係数とのシリアル乗算を行なうシリアル乗算器と、こ
のシリアル乗算器の出力を保持するシフト・レジスタと
、このシフト・レジスタの値がゼロであることを検出す
るゼロ検出回路と、このゼロ検出回路の出力により前記
シフト・レジスタの出力を反転させるEORとを備えた
ことを特徴とする乗算回路。(1) Exclusive OR (EOR) that inverts (n-1) bits excluding the MSB using the most significant bit (MSB) of an n-bit digital signal in two's complement representation, and its output and coefficient. A serial multiplier that performs serial multiplication, a shift register that holds the output of this serial multiplier, a zero detection circuit that detects that the value of this shift register is zero, and a A multiplication circuit comprising an EOR for inverting the output of a shift register.
力データとして、入力データもしくは乗算結果を選択す
る選択回路を備えたことを特徴とする請求項1記載の乗
算回路。(2) The multiplication circuit according to claim 1, wherein the serial multiplier includes a selection circuit that is controlled by a switching signal and selects input data or a multiplication result as output data.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1327892A JPH03188523A (en) | 1989-12-18 | 1989-12-18 | multiplication circuit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1327892A JPH03188523A (en) | 1989-12-18 | 1989-12-18 | multiplication circuit |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH03188523A true JPH03188523A (en) | 1991-08-16 |
Family
ID=18204151
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1327892A Pending JPH03188523A (en) | 1989-12-18 | 1989-12-18 | multiplication circuit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH03188523A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO1996010784A1 (en) * | 1994-09-30 | 1996-04-11 | Vlsi Technology, Inc. | Arithmetic logic unit with zero sum prediction |
| JP2012249225A (en) * | 2011-05-31 | 2012-12-13 | Noritz Corp | Ask modulation type digital data transmitting and receiving device and method |
-
1989
- 1989-12-18 JP JP1327892A patent/JPH03188523A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO1996010784A1 (en) * | 1994-09-30 | 1996-04-11 | Vlsi Technology, Inc. | Arithmetic logic unit with zero sum prediction |
| JP2012249225A (en) * | 2011-05-31 | 2012-12-13 | Noritz Corp | Ask modulation type digital data transmitting and receiving device and method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0328063A2 (en) | Absolute value calculating circuit having a single adder | |
| JPS59149539A (en) | Fixed-to-floating point converting device | |
| JPH0573269A (en) | Adder | |
| KR870009595A (en) | Serial-Bit 2's Complement Digital Signal Processing Unit | |
| JPH03188523A (en) | multiplication circuit | |
| JP2002111447A (en) | Digital filter | |
| CN114895868B (en) | Division operation unit and divider based on two-bit quotient calculation | |
| CN112988111B (en) | Single-bit multiplier | |
| JP3074958B2 (en) | Serial multiplier with addition function | |
| KR100196520B1 (en) | Two's complement converter for area improvement | |
| JP2513021B2 (en) | Signed digit number sign judgment circuit | |
| US5483477A (en) | Multiplying circuit and microcomputer including the same | |
| JP2504153B2 (en) | Signed digit number sign judgment circuit | |
| KR950003116Y1 (en) | Binary adder | |
| KR100198783B1 (en) | How to drive a serial processing divider | |
| SU1019441A1 (en) | Binary-decimal adder | |
| KR940007925B1 (en) | Accumulator with Code Processing | |
| JPS60537A (en) | Normalizing circuit | |
| SU1465882A1 (en) | Inverse value computing device | |
| JPS6265131A (en) | Multiplier | |
| JPH10254680A (en) | Square circuit | |
| JPH02201538A (en) | Counter | |
| JPH07120964B2 (en) | Extension circuit | |
| JPH01276227A (en) | Digital rounding circuit | |
| JPH0253819B2 (en) |