JP2568608B2 - Multiplication circuit - Google Patents

Multiplication circuit

Info

Publication number
JP2568608B2
JP2568608B2 JP63018042A JP1804288A JP2568608B2 JP 2568608 B2 JP2568608 B2 JP 2568608B2 JP 63018042 A JP63018042 A JP 63018042A JP 1804288 A JP1804288 A JP 1804288A JP 2568608 B2 JP2568608 B2 JP 2568608B2
Authority
JP
Japan
Prior art keywords
multiplicand
register
circuit
multiplier
bits
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 - Fee Related
Application number
JP63018042A
Other languages
Japanese (ja)
Other versions
JPH01193932A (en
Inventor
正人 鈴木
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP63018042A priority Critical patent/JP2568608B2/en
Publication of JPH01193932A publication Critical patent/JPH01193932A/en
Application granted granted Critical
Publication of JP2568608B2 publication Critical patent/JP2568608B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 産業上の利用分野 本発明はディジタル計算機の中央処理装置等に用いら
れ、符号付きの乗算を行なう乗算回路に関するものであ
る。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a multiplication circuit used for a central processing unit of a digital computer and performing signed multiplication.

従来の技術 従来の乗算回路としては、例えば、「インプルーブド
アプローチ トゥ ジ ユーズ オブ ブルース マ
ルチプリケーション アルゴリズム」アイ・ビー・エム
テクニカル ディスクロージャ ブレティン("Impro
ved approach to the use of Booth's multiplication
algorithm",IBM Technical Disclosure Bulletin) Vo
l.27 No.11 1985に示されている。
2. Description of the Related Art Conventional multiplication circuits include, for example, "Improved approach to the use of blues multiplication algorithm" IBM Technical Disclosure Bulletin ("Impro
ved approach to the use of Booth's multiplication
algorithm ", IBM Technical Disclosure Bulletin) Vo
l.27 No.11 1985.

第7図はこの従来の乗算回路のブロック図を示すもの
であり、1は被乗数を入力し保持する被乗数レジスタ、
2は乗算の開始時に乗数を入力して演算処理中は最下位
ビット方向(以後、右と称す)に3ビットずつシフトさ
れた乗数が保持される乗数レジスタ、3bは演算処理中に
は累算された部分積の上位が保持され演算終了時には演
算結果である積の上位が格納される上位積レジスタ、4
は演算処理中には累算された部分積の下位が保持され演
算終了時には積の下位が格納される下位積レジスタ、5b
はAとBの2つの入力の間で演算を行なう演算回路、6
は乗数レジスタ2に保持されている数値を右に3ビット
シフトして結果を再び乗数レジスタ2に格納する乗数シ
フタ、7は乗数シフタ6の桁あふれを保持するキャリフ
ラグ、8bは累算部分積の上位である演算回路5bの出力を
右に3ビット算術シフト(最上位ビットからは符号ビッ
トがコピーされる)して上位積レジスタ3bに格納する上
位累算部分積シフタ、9bは上位累算部分積シフタ8bの桁
あふれを上位からシフト入力しつつ下位積レジスタ4に
保持されている累算部分積の下位を右に3ビットシフト
して結果を再び下位積レジスタ4に格納する下位累算部
分積シフタ、10bは乗数レジスタ2の下位3ビットおよ
びキャリフラグ7により演算回路5bで実行する演算を制
御する演算制御回路、12は被乗数の2倍値を入力し保持
する2倍被乗数レジスタ、13は被乗数の3倍値を入力し
保持する3倍被乗数レジスタ、14は被乗数の4倍値を入
力し保持する4倍被乗数レジスタ、15は被乗数レジスタ
1に格納された被乗数または2倍被乗数レジスタ12に格
納された被乗数の2倍値または3倍被乗数レジスタ13に
格納された被乗数の3倍値または4倍値被乗数レジスタ
14に格納された被乗数の4倍値のいずれかを選択し演算
回路5bのB入力に加える選択回路、16は乗数レジスタ2
の下位3ビットおよびキャリフラグ7により選択回路15
での選択を制御する選択制御回路である。
FIG. 7 shows a block diagram of this conventional multiplication circuit, where 1 is a multiplicand register for inputting and holding a multiplicand,
2 is a multiplier register that inputs a multiplier at the start of multiplication and holds a multiplier shifted by 3 bits in the least significant bit direction (hereinafter referred to as right) during arithmetic processing. 3b is an accumulator during arithmetic processing. The upper product register, in which the higher order of the partial product is held and the higher order of the product as the operation result is stored when the operation is completed,
Is a lower product register that holds the lower order of the accumulated partial product during operation processing and stores the lower order of the product when the operation is completed.
Is an arithmetic circuit for performing an operation between two inputs of A and B, 6
Is a multiplier shifter that shifts the value held in the multiplier register 2 to the right by 3 bits and stores the result in the multiplier register 2 again, 7 is a carry flag that holds the overflow of the multiplier shifter 6, and 8b is an accumulated partial product 3b arithmetically shifts the output of the arithmetic circuit 5b, which is the upper bit, to the right (the sign bit is copied from the most significant bit) and stores it in the upper product register 3b. 9b is the upper bit. Lower-order accumulation in which the overflow of the partial product shifter 8b is shifted in from the upper bit and the lower bit of the accumulated partial product held in the lower-order product register 4 is shifted to the right by 3 bits, and the result is again stored in the lower-order product register 4. A partial product shifter, 10b is an arithmetic control circuit for controlling the arithmetic executed by the arithmetic circuit 5b by the lower 3 bits of the multiplier register 2 and the carry flag 7, and 12 is a double multiplicand register for inputting and holding a double value of the multiplicand 13 is a triple multiplicand register for inputting and holding a triple value of the multiplicand, 14 is a quadruple multiplicand register for inputting and holding a quadruple value of the multiplicand, and 15 is a multiplicand or double multiplicand register 12 stored in the multiplicand register 1. The double or triple multiplicand stored in the register The triple or quadruple multiplicand of the multiplicand stored in the register 13
A selection circuit for selecting one of the quadruple values of the multiplicand stored in 14 and adding it to the B input of the arithmetic circuit 5b, and 16 is a multiplier register 2
Selection circuit 15 by lower 3 bits of
Is a selection control circuit for controlling the selection in the step (a).

以上のように構成された従来の乗算回路について、以
下にその原理を説明する。
The principle of the conventional multiplication circuit configured as described above will be described below.

乗算の方法としてブース(Booth)のアルゴリズムが
ある。この従来の乗算回路は4ビットのブースのアルゴ
リズムを用いたもので、乗数の最下位ビット側から4ビ
ット(その内1ビットはオーバーラップする)ずつを切
り出して部分積を選択し、部分積を累算することによっ
て積を求める。第8図はこのアルゴリズムに基づいた演
算制御回路10bと選択制御回路16の制御関係図で、M2,M
1,M0で示す乗数レジスタ2の下位3ビットとCで示すキ
ャリフラグ7の合計4ビットをデコードして演算回路5b
の演算と演算回路5bのB入力となる選択回路15の選択と
を決定するものである。
As a method of multiplication, there is a Booth algorithm. This conventional multiplication circuit uses a 4-bit Booth's algorithm, and selects a partial product by cutting out 4 bits (one bit of which overlaps) from the least significant bit side of the multiplier and selecting the partial product. Find the product by accumulating. FIG. 8 is a control relation diagram of the arithmetic control circuit 10b and the selection control circuit 16 based on this algorithm.
The arithmetic circuit 5b decodes a total of 4 bits including the lower 3 bits of the multiplier register 2 indicated by 1, M0 and the carry flag 7 indicated by C.
And the selection of the selection circuit 15 to be the B input of the arithmetic circuit 5b.

以下に回路の動作を説明する。 The operation of the circuit will be described below.

始めに、被乗数ならびに乗数をそれぞれ被乗数レジス
タ1と乗数レジスタ2に入力すると共に、上位積レジス
タ3bと下位積レジスタ4およびキャリフラグ7を零にク
リアする。
First, the multiplicand and the multiplier are input to the multiplicand register 1 and the multiplier register 2, respectively, and the upper product register 3b, the lower product register 4, and the carry flag 7 are cleared to zero.

演算回路5bの演算およびB入力は乗数レジスタ2の下
位3ビットとキャリフラグ7とから決定され、演算回路
5bの出力は第8図において演算の欄が“A"ならばA入力
そのまま、“A+B"ならばA入力とB入力の加算結果、
“A−B"ならばA入力とB入力の減算結果となる。また
B入力は第8図においてB入力の欄が“X"ならば被乗数
レジスタ1に格納された被乗数が、“2X"ならば2倍被
乗数レジスタ12に格納された被乗数の2倍値が、“3X"
ならば3倍被乗数レジスタ13に格納された被乗数の3倍
値が、“4X"ならば4倍被乗数レジスタ14に格納された
被乗数の4倍値が選択回路15において選択される。演算
の後、乗数シフタ6、上位累算部分積シフタ8bおよび下
位累算部分積シフタ9bはいずれも右に3ビットシフト
し、それぞれ所定のレジスタにシフト結果を格納する。
The operation of the arithmetic circuit 5b and the B input are determined from the lower 3 bits of the multiplier register 2 and the carry flag 7, and the arithmetic circuit
In FIG. 8, the output of 5b is the A input as it is if the operation column is "A", the addition result of the A input and B input if "A + B",
If "AB", the result is the subtraction of the A and B inputs. In FIG. 8, if the B input field is "X" in FIG. 8, the multiplicand stored in the multiplicand register 1 is "2X", and the double value of the multiplicand stored in the double multiplicand register 12 is "2X". 3X "
If this is the case, the triple value of the multiplicand stored in the triple multiplicand register 13 is selected, and if "4X", the quadruple value of the multiplicand stored in the quadruple multiplicand register 14 is selected by the selection circuit 15. After the operation, the multiplier shifter 6, the upper accumulation partial product shifter 8b, and the lower accumulation partial product shifter 9b all shift right by 3 bits, and store the shift results in predetermined registers.

以上の演算およびシフトは、〔乗数のビット長÷3〕
回(割り切れない場合は小数部切り上げ)繰り返され
る。
The above operation and shift are performed as follows: [bit length of multiplier 乗 3]
(Or rounded up if not divisible).

乗算結果は上位積レジスタ3bと下位積レジスタ4に上
位と下位に別れて保持される。
The multiplication result is stored in the upper product register 3b and the lower product register 4 separately for the upper product and the lower product register.

以上は、4ビットのブースのアルゴリズムを用いた従
来の乗算回路について説明したものであるが、4ビット
を越えるブースのアルゴリズムを用いたものも同様であ
る。即ち、Nビットのブースのアルゴリズムを用いた従
来の乗算回路においては、演算回路5bの演算およびB入
力は乗数レジスタ2の下位(N−1)ビットとキャリフ
ラグ7とから決定され、B入力は、選択回路15において
2の(N−2)乗個のレジスタの中から、被乗数の2の
(N−2)乗倍値までの値が選択される。乗数シフタ
6、上位累算部分積シフタ8bおよび下位累算部分積シフ
タ9bはいずれも右に(N−1)ビットシフト動作をし、
演算およびシフトは、乗数のビット長÷(N−1)回
(割り切れない場合は小数部切り上げ)繰り返される。
The above is a description of a conventional multiplying circuit using a 4-bit Booth algorithm, but the same applies to a circuit using a Booth algorithm exceeding 4 bits. That is, in the conventional multiplication circuit using the N-bit Booth algorithm, the operation of the operation circuit 5b and the B input are determined from the lower (N-1) bits of the multiplier register 2 and the carry flag 7, and the B input is , The selection circuit 15 selects a value up to the (N-2) th power of the multiplicand from the 2 (N-2) th power registers. Each of the multiplier shifter 6, the upper accumulation partial product shifter 8b and the lower accumulation partial product shifter 9b performs an (N-1) bit shift operation to the right.
The calculation and the shift are repeated for the bit length of the multiplier divided by (N-1) times (when it is not divisible, the fractional part is rounded up).

発明が解決しようとする課題 しかしながら上記のような構成では、演算回路5bの入
力に被乗数の4倍値までの値が必要であるため、これら
の値を生成し保持する手段が不可欠で、また被乗数の4
倍値までの値を生成するための時間を消費しなければな
らない。かつ、被乗数の4倍値を符号付き2進数で表現
するには被乗数のビット長+2のビット長が必要となる
ため、演算回路5bをはじめ、上位積レジスタ3b、上位累
算部分積シフタ8b、選択回路15およびこれらを接続する
バスを含むすべてが被乗数のビット長+2のビット長を
必要とする。
However, in the above configuration, since the input of the arithmetic circuit 5b requires a value up to four times the multiplicand, a means for generating and holding these values is indispensable. Of 4
Time must be expended to generate values up to double. In addition, to express a quadruple value of the multiplicand as a signed binary number, the bit length of the multiplicand + 2 bit length is required. Therefore, the arithmetic circuit 5b, the high-order product register 3b, the high-order accumulation partial product shifter 8b, Everything including the selection circuit 15 and the bus connecting them requires a bit length of the multiplicand bit length + 2.

以上は、4ビットのブースのアルゴリズムを用いた従
来の乗算回路の問題点であるが、4ビットを越えるブー
スのアルゴリズムを用いたものも同様である。即ち、N
ビットのブースのアルゴリズムにおいては、演算回路の
入力に被乗数の2の(N−2)乗倍値までの値が必要で
あるため、これらの値を生成し保持する手段が不可欠
で、また被乗数の2の(N−2)乗倍値までの値を生成
するための時間を消費しなければならないという問題点
と、被乗数の2の(N−2)乗倍値を符号付き2進数で
表現するには被乗数のビット長+(N−2)のビット長
が必要となるため、演算回路をはじめ、上位積レジス
タ、上位累算部分積シフタ、選択回路およびこれらを接
続するバスを含むすべてが被乗数のビット長+(N−
2)のビット長を必要とするという問題点を有してい
た。
The above is a problem of the conventional multiplication circuit using the 4-bit Booth's algorithm, but the same applies to the case using the Booth's algorithm exceeding 4 bits. That is, N
In the Booth's algorithm of bits, since the input of the arithmetic circuit requires values up to the multiplied value of 2 (N−2) times, means for generating and holding these values is indispensable. The problem of consuming time to generate a value up to the 2 (N-2) th power and the 2 (N-2) th power of the multiplicand are represented by a signed binary number. Requires the bit length of the multiplicand + (N−2). Therefore, the arithmetic circuit, the high-order product register, the high-order accumulation partial product shifter, the selection circuit, and the bus connecting these components are all multiplicands. Bit length + (N−
There is a problem that the bit length of 2) is required.

本発明はかかる点に鑑み、演算回路の入力に被乗数の
倍数値が一切不要で、被乗数と等しいビット長の演算回
路で演算処理が可能であり、かつ、ブースのアルゴリズ
ムを用いない乗算回路より高速な乗算回路を提供するこ
とを目的とする。
In view of the foregoing, the present invention does not require any multiplicative value of the multiplicand at the input of the arithmetic circuit, enables arithmetic processing with an arithmetic circuit having a bit length equal to the multiplicand, and has a higher speed than a multiplier circuit that does not use the Booth algorithm. It is an object to provide a simple multiplication circuit.

課題を解決するための手段 本発明は、部分積の累算値と被乗数との間で演算を行
なう演算手段と、前記演算手段の出力をシフトし次の演
算に用いる部分積の累算値を生成する、シフト数が制御
できるシフト手段と、前記演算手段における演算と、前
記シフト手段におけるシフト数とを乗数の一部のビット
列をデコードして決定する制御手段とを備えた乗算回路
である。
Means for Solving the Problems The present invention provides an arithmetic means for performing an operation between an accumulated value of a partial product and a multiplicand, and an accumulated value of a partial product used for a next operation by shifting an output of the arithmetic means. The multiplication circuit includes a shift unit to be generated and capable of controlling the number of shifts, and a control unit that determines the operation of the arithmetic unit and the shift number of the shift unit by decoding a bit string of a multiplier.

作用 本発明は前記した構成により、被乗数の倍数値の加減
算を、被乗数の加減算とその演算の前後に行なうシフト
処理のシフト数を制御すること、またはその繰り返しに
置き換えることができ、被乗数の倍数値およびそのため
の演算回路のビット長の拡大が不要になる。
According to the present invention, the addition and subtraction of the multiplicand of the multiplicand can be controlled by the addition and subtraction of the multiplicand and the shift number of the shift process performed before and after the operation, or can be replaced with the repetition of the multiplication of the multiplicand. In addition, it is not necessary to increase the bit length of the arithmetic circuit.

実施例 第1図は本発明の実施例における乗算回路のブロック
図を示すものであり、1は被乗数を入力し保持する被乗
数レジスタ、2は乗算の開始時に乗数を入力して演算処
理中は右に3ビットずつシフトされた乗数が保持される
乗数レジスタ、3aは演算処理中には累算された部分積の
上位が保持され演算終了時には演算結果である積の上位
が格納される被乗数レジスタ1と等しいビット長の上位
積レジスタ、4は演算処理中には累算された部分積の下
位が保持され演算終了時には積の下位が格納される乗数
レジスタ2と等しいビット長の下位積レジスタ、5aは被
乗数レジスタ1の値と上位積レジスタ3aの値の演算を行
なう演算回路で、被乗数レジスタ1と等しいビット長の
演算を行なう。6は乗数レジスタ2に保持されている数
値を右に3ビットシフトして結果を再び乗数レジスタ2
に格納する乗数シフタ、7は乗数シフタ6の桁あふれを
保持するキャリフラグ、8aは累算部分積の上位である演
算回路5aの出力を右に算術シフトして上位積レジスタ3a
に格納する被乗数レジスタ1と等しいビット長の上位累
算部分積シフタ、9aは上位累算部分積シフタ8aの桁あふ
れを上位からシフト入力しつつ下位積レジスタ4に保持
されている累算部分積の下位を右にシフトして結果を再
び下位積レジスタ4に格納する乗数レジスタ2と等しい
ビット長の下位累算部分積シフタ、10aは乗数レジスタ
2の下位3ビットおよびキャリフラグ7により演算回路
5aで実行する演算を制御する演算制御回路、11は乗数レ
ジスタ2の下位6ビットおよびキャリフラグ7により上
位累算部分積シフタ8aおよび下位累算部分積シフタ9aで
シフトするシフト数を制御するシフト数制御回路であ
る。
Embodiment FIG. 1 is a block diagram of a multiplication circuit according to an embodiment of the present invention. 1 is a multiplicand register for inputting and holding a multiplicand. 2 is a multiplier input at the start of multiplication. A multiplier register 3a holds a multiplier shifted by 3 bits each, and a multiplicand register 3a stores therein the higher order of the accumulated partial product during the operation processing and stores the higher order of the product as the operation result when the operation is completed. A lower product register having a bit length equal to the multiplier register 2 for storing the lower order of the accumulated partial product during operation processing and storing the lower order of the product at the end of the operation; Is an arithmetic circuit for calculating the value of the multiplicand register 1 and the value of the high-order product register 3a, and performs a calculation having the same bit length as that of the multiplicand register 1. 6 shifts the numerical value held in the multiplier register 2 to the right by 3 bits and shifts the result again to the multiplier register 2
, 7 is a carry flag for holding the overflow of the multiplier shifter 6, and 8a is an arithmetically right-shifted output of the arithmetic circuit 5a, which is the upper part of the accumulated partial product, and is a higher-order product register 3a.
The upper accumulative partial product shifter 9a has the same bit length as the multiplicand register 1 stored in the lower accumulator partial shifter 9a. Is shifted to the right and the result is again stored in the lower product register 4. A lower accumulating partial product shifter having the same bit length as the multiplier register 2; 10a is an arithmetic circuit based on the lower 3 bits of the multiplier register 2 and the carry flag 7;
An operation control circuit for controlling the operation executed by 5a. A shift 11 for controlling the number of shifts by the upper accumulation partial product shifter 8a and the lower accumulation partial product shifter 9a by the lower 6 bits of the multiplier register 2 and the carry flag 7. It is a number control circuit.

以上のように構成されたこの実施例の乗算回路につい
て、以下にその原理を説明する。
The principle of the multiplying circuit of this embodiment configured as described above will be described below.

この実施例の乗算回路は4ビットのブースのアルゴリ
ズムに基づいたものである。同アルゴリズムにおいて
は、部分積の累算値の3ビット右シフトと、ゼロ、被乗
数の±1倍値、被乗数の±2倍値、被乗数の±3倍値、
被乗数の±4倍値のいずれかの部分積の累算の繰り返し
により積を求める。ここで、第3図(a)、(b)に示
すように、1つ前の演算結果の3ビット右シフト、被乗
数の2倍値の加減算、演算結果の3ビット右シフトの一
連の処理は、被乗数の2倍値の最下位ビットが0である
ことから、1つ前の演算結果の4ビット右シフト、被乗
数の加減算、演算結果の2ビット右シフトからなる一連
の処理に置き換えられる。また、被乗数の3倍値の加減
算は、被乗数の加減算と被乗数の2倍値の加減算とを連
続して行なうことと等しく、被乗数の2倍値の最下位ビ
ットが0であることから、第4図(a)、(b)に示す
ように、1つ前の演算結果の3ビット右シフト、被乗数
の3倍値の加減算、演算結果の3ビット右シフトの一連
の処理は、1つ前の演算結果の3ビット右シフト、被乗
数の加減算、演算結果の1ビット右シフト、被乗数の加
減算、演算結果の2ビット右シフトからなる一連の処理
に置き換えられる。同様に、被乗数の4倍値の下位2ビ
ットがともに0であることから、第5図(a)、(b)
に示すように、1つ前の演算結果の3ビット右シフト、
被乗数の4倍値の加減算、演算結果の3ビット右シフト
の一連の処理は、1つ前の演算結果の5ビット右シフ
ト、被乗数の加減算、演算結果の1ビット右シフトから
なる一連の処理に置き換えられる。これらのことよりこ
の実施例の乗算回路は、被乗数の加減算とその結果の1
ビットないし5ビットの右シフトを繰り返して積を求め
るものである。
The multiplication circuit of this embodiment is based on the 4-bit Booth algorithm. In this algorithm, the accumulated value of the partial product is shifted right by 3 bits, and zero, ± 1 times the multiplicand, ± 2 times the multiplicand, ± 3 times the multiplicand,
A product is obtained by repeating accumulation of any partial product of ± 4 times the multiplicand. Here, as shown in FIGS. 3 (a) and 3 (b), a series of processes of shifting the immediately preceding operation result to the right by 3 bits, adding / subtracting the double value of the multiplicand, and shifting the operation result to the right by 3 bits are performed as follows. Since the least significant bit of the doubled value of the multiplicand is 0, it is replaced by a series of processes including a 4-bit right shift of the immediately preceding operation result, an addition / subtraction of the multiplicand, and a 2-bit right shift of the operation result. Further, addition and subtraction of a triple value of a multiplicand is equivalent to consecutively performing addition and subtraction of a multiplicand and addition and subtraction of a double value of a multiplicand. Since the least significant bit of the double value of the multiplicand is 0, the fourth As shown in FIGS. 7A and 7B, a series of processes of shifting the immediately preceding operation result to the right by 3 bits, adding and subtracting a triple value of the multiplicand, and shifting the operation result to the right by 3 bits are performed in series. It is replaced by a series of processing including a 3-bit right shift of the operation result, addition / subtraction of the multiplicand, a 1-bit right shift of the operation result, an addition / subtraction of the multiplicand, and a 2-bit right shift of the operation result. Similarly, since the lower two bits of the quadruple value of the multiplicand are both 0, FIGS. 5 (a) and 5 (b)
As shown in the figure, the previous operation result is shifted right by 3 bits,
A series of processing of addition / subtraction of a quadruple value of a multiplicand and a 3-bit right shift of an operation result is a series of processing including a 5-bit right shift of a previous operation result, an addition / subtraction of a multiplicand, and a 1-bit right shift of an operation result. Be replaced. From these facts, the multiplying circuit of this embodiment is capable of adding / subtracting the multiplicand and adding 1
The product is obtained by repeating a right shift of bits to 5 bits.

第2図は前記した考え方に基づいた演算制御回路10a
とシフト数制御回路11の制御関係図で、M2,M1,M0で示す
乗数レジスタ2の下位3ビットとCで示すキャリフラグ
7の合計4ビットをデコードして演算回路5aの演算と、
M5,M4,M3,M2,M1,M0で示す乗数レジスタ2の下位6ビッ
ト(同図(a)中のK1,K2は同図(b)に示す通り乗数
レジスタ2の下位から4〜6ビットにより決まる)とC
で示すキャリフラグ7の合計7ビットをデコードして上
位累算部分積シフタ8aおよび下位累算部分積シフタ9aの
シフト数とを決定するものである。第2図において、演
算“A"はA入力そのまま、“A+B"はA入力とB入力の
加算、“A−B"はA入力とB入力の減算を表す。
FIG. 2 shows an arithmetic control circuit 10a based on the above concept.
In the control relationship diagram of the shift number control circuit 11, the lower 3 bits of the multiplier register 2 indicated by M2, M1, and M0 and the carry flag 7 indicated by C are decoded to a total of 4 bits, and the operation of the operation circuit 5a is performed.
Lower 5 bits of multiplier register 2 indicated by M5, M4, M3, M2, M1, M0 (K1 and K2 in FIG. 2A are 4 to 6 bits from lower order of multiplier register 2 as shown in FIG. 2B) And C)
The 7 bits of the carry flag 7 indicated by the symbol (7) are decoded to determine the shift numbers of the upper accumulation partial product shifter 8a and the lower accumulation partial product shifter 9a. In FIG. 2, the operation "A" represents the A input as it is, "A + B" represents the addition of the A input and the B input, and "AB" represents the subtraction of the A input and the B input.

以下にその動作を説明する。 The operation will be described below.

始めに、被乗数ならびに乗数をそれぞれ被乗数レジス
タ1と乗数レジスタ2に入力すると共に、上位積レジス
タ3aと下位積レジスタ4およびキャリフラグ7を零にク
リアする。
First, the multiplicand and the multiplier are input to the multiplicand register 1 and the multiplier register 2, respectively, and the upper product register 3a, the lower product register 4, and the carry flag 7 are cleared to zero.

被乗数レジスタ1の値と上位積レジスタ3aの値を演算
回路5aに入力し、演算制御回路10aで決定される演算を
行なった後、その演算結果と下位積レジスタ4の内容を
上位累算部分積シフタ8aと下位累算部分積シフタ9aにお
いてシフト数制御回路11で決定されるビット数だけ右に
シフトし、それぞれ上位積レジスタ3a、下位積レジスタ
4にシフト結果を格納する。ここで、第2図(a)にお
いて2回目の欄に演算およびシフト数が記されている場
合は、その内容に従い、上記の演算およびシフトを2回
行なう。また、上記のシフト(第2図(a)において2
回目の欄に演算およびシフト数が記されている場合は、
2回目のシフト)に並行して、乗数シフタ6で乗数レジ
スタ2の値を右に3ビットシフトし、結果を乗数レジス
タ2に、桁あふれをキャリフラグ7に格納する。
The value of the multiplicand register 1 and the value of the high-order product register 3a are input to the arithmetic circuit 5a, and the operation determined by the arithmetic control circuit 10a is performed. The shifter 8a and the lower accumulation partial product shifter 9a shift right by the number of bits determined by the shift number control circuit 11, and store the shift results in the upper product register 3a and the lower product register 4, respectively. Here, in the case where the number of calculations and shifts are described in the second column in FIG. 2A, the above calculation and shift are performed twice according to the contents. Further, the shift (2 in FIG. 2A)
If the number of operations and the number of shifts are listed in the second column,
In parallel with the second shift), the value of the multiplier register 2 is shifted to the right by 3 bits by the multiplier shifter 6, and the result is stored in the multiplier register 2 and overflow is stored in the carry flag 7.

以上の演算およびシフトは、乗数シフタ6におけるシ
フト回数(演算制御回路10aおよびシフト数制御回路11
におけるデコード回数)が、乗数のビット長÷3回(割
り切れない場合は小数部切り上げ)に達するまで繰り返
される。
The above operation and shift are performed by the number of shifts in the multiplier shifter 6 (the operation control circuit 10a and the shift number control circuit 11
Is repeated until the bit length of the multiplier is divided by three times (if it is not divisible, the fractional part is rounded up).

乗算結果は上位積レジスタ3aと下位積レジスタ4に上
位と下位に別れて保持される。
The result of the multiplication is stored in the upper product register 3a and the lower product register 4 separately for upper and lower products.

以上のように、この実施例によれば、演算回路5aに後
置される上位累算部分積シフタ8aおよび下位累算部分積
シフタ9aにおけるシフト数を1ビットないし5ビットと
可変にし、そのシフト数を乗数レジスタ2の下位6ビッ
トとキャリフラグ7で制御することにより、演算回路の
入力に被乗数の倍数値が不要となり、また被乗数と等し
いビット長の演算回路で演算処理が可能となる。またそ
の処理時間は、ブースのアルゴリズムを用いない乗算回
路に比べ、平均で2.4分の1に短縮される。これは、1
回のデコードに対応する演算は平均1×12/16+2×4/1
6=1.25回となるから、3ビットシフトする本アルゴリ
ズムでの処理時間は(3÷1.25)分の1になるという計
算に基づいている。
As described above, according to this embodiment, the number of shifts in the high-order accumulation partial product shifter 8a and the low-order accumulation partial product shifter 9a that is provided after the arithmetic circuit 5a is made variable from 1 bit to 5 bits, and the shift is performed. By controlling the number with the lower 6 bits of the multiplier register 2 and the carry flag 7, a multiple value of the multiplicand is not required at the input of the arithmetic circuit, and arithmetic processing can be performed by the arithmetic circuit having a bit length equal to the multiplicand. In addition, the processing time is reduced by an average of 2.4 in comparison with a multiplier circuit that does not use the Booth algorithm. This is 1
The average operation corresponding to decoding is 1 × 12/16 + 2 × 4/1
Since 6 = 1.25 times, the processing time in the present algorithm that shifts by 3 bits is based on the calculation that it becomes 1 / (3 ÷ 1.25).

この実施例の乗算回路は4ビットのブースのアルゴリ
ズムに基づいたものであるが、本発明は基づくブースの
アルゴリズムのビット数について何ら制限するものでは
ない。
Although the multiplication circuit of this embodiment is based on the 4-bit Booth algorithm, the present invention does not limit the number of bits of the Booth algorithm based on this.

Nビットのブースのアルゴリズムに基づいた本発明の
実施例における乗算回路の演算制御回路10aは、乗数レ
ジスタ2の下位(N−1)ビットとキャリフラグ7をデ
コードして演算回路5aを制御し、シフト数制御回路11
は、乗数レジスタ2の下位2(N−1)ビットとキャリ
フラグ7をデコードして上位累算部分積シフタ8aおよび
下位累算部分積シフタ9aを制御する。また、上位累算部
分積シフタ8aおよび下位累算部分積シフタ9aのシフト数
は1ビットから(2N−3)ビットの範囲で可変であり、
乗数シフタ6は右に(N−1)ビットシフトする。平均
処理時間は、Nの増加に伴ない短縮される。第6図は5
ビットのブースのアルゴリズムに基づいた本発明の他の
実施例における乗算回路の演算制御回路10aとシフト数
制御回路11の制御関係図で、M3,M2,M1,M0で示す乗数レ
ジスタ2の下位4ビットとCで示すキャリフラグ7の合
計5ビットをデコードして演算回路5aの演算と、M7,M6,
M5,M4,M3,M2,M1,M0で示す乗数レジスタ2の下位8ビッ
トとCで示すキャリフラグ7の合計9ビットをデコード
して上位累算部分積シフタ8aおよび下位累算部分積シフ
タ9aのシフト数とを決定するものである。
The arithmetic control circuit 10a of the multiplier circuit according to the embodiment of the present invention based on the N-bit Booth algorithm controls the arithmetic circuit 5a by decoding the lower (N-1) bits of the multiplier register 2 and the carry flag 7, Shift number control circuit 11
Decodes the lower 2 (N-1) bits of the multiplier register 2 and the carry flag 7 to control the upper accumulation partial product shifter 8a and the lower accumulation partial product shifter 9a. The shift number of the upper accumulation partial product shifter 8a and the lower accumulation partial product shifter 9a is variable from 1 bit to (2N-3) bits.
The multiplier shifter 6 shifts to the right by (N-1) bits. The average processing time decreases with increasing N. Figure 6 shows 5
In the control relation diagram of the arithmetic control circuit 10a and the shift number control circuit 11 of the multiplication circuit according to another embodiment of the present invention based on the Bit Booth algorithm, the lower 4 bits of the multiplier register 2 indicated by M3, M2, M1, and M0. The arithmetic circuit 5a decodes a total of 5 bits of the carry flag 7 indicated by the bit and C, and calculates M7, M6,
The lower 8 bits of the multiplier register 2 indicated by M5, M4, M3, M2, M1 and M0 and the carry flag 7 indicated by C, that is, 9 bits in total, are decoded, and the upper accumulated partial product shifter 8a and the lower accumulated partial product shifter 9a are decoded. Is determined.

発明の効果 以上説明したように、本発明によれば、演算回路の入
力に被乗数の倍数値が不要となり、また被乗数と等しい
ビット長の演算回路で演算処理が可能で、かつ、ブース
のアルゴリズムを用いない乗算回路より高速に符号付き
乗算を行なうことができ、その実用的効果は大きい。ま
た、演算手段としての算術論理演算ユニット(ALU)や
シフト手段を備えているマイクロプロセッサ等において
は、僅かのハードウェアを付加することにより、算術論
理演算ユニットのビット長と等しいビット長の被乗数の
乗算を高速に実現できるという効果も有する。
Effect of the Invention As described above, according to the present invention, the multiplication value of the multiplicand is not required at the input of the arithmetic circuit, the arithmetic processing can be performed by the arithmetic circuit having a bit length equal to the multiplicand, and the Booth algorithm can be used. Signed multiplication can be performed faster than a multiplication circuit that does not use it, and its practical effect is large. In addition, in an arithmetic logic unit (ALU) as arithmetic means or a microprocessor having a shift means, by adding a small amount of hardware, a multiplicand having a bit length equal to the bit length of the arithmetic logic arithmetic unit can be obtained. There is also an effect that multiplication can be realized at high speed.

【図面の簡単な説明】[Brief description of the drawings]

第1図は本発明の一実施例における乗算回路のブロック
図、第2図は同実施例における演算制御回路とシフト数
制御回路の制御関係図、第3図は同実施例における被乗
数の2倍値の加減算の置き換え原理を示す説明図、第4
図は同実施例における被乗数の3倍値の加減算の置き換
え原理を示す説明図、第5図は同実施例における被乗数
の4倍値の加減算の置き換え原理を示す説明図、第6図
は本発明の他の実施例における乗算回路の演算制御回路
とシフト数制御回路の制御関係図、第7図は従来の乗算
回路のブロック図、第8図は同従来例における演算制御
回路と選択制御回路の制御関係図である。 1…被乗数レジスタ、2…乗数レジスタ、3a,3b…上位
積レジスタ、4…下位積レジスタ、5a,5b…演算回路、
6…乗数シフタ、7…キャリフラグ、8a,8b…上位累算
部分積シフタ、9a,9b…下位累算部分積シフタ、10a,10b
…演算制御回路、11…シフト数制御回路、12…2倍被乗
数レジスタ、13…3倍被乗数レジスタ、14…4倍被乗数
レジスタ、15…選択回路、16…選択制御回路。
FIG. 1 is a block diagram of a multiplication circuit in one embodiment of the present invention, FIG. 2 is a control relation diagram of an arithmetic control circuit and a shift number control circuit in the embodiment, and FIG. 3 is twice the multiplicand in the embodiment. FIG. 4 is an explanatory view showing the principle of replacement of addition and subtraction of values;
FIG. 5 is an explanatory view showing the principle of addition and subtraction of a triple value of a multiplicand in the embodiment, FIG. 5 is an explanatory view showing the principle of addition and subtraction of a quadruple value of a multiplicand in the embodiment, and FIG. FIG. 7 is a block diagram of a conventional multiplication circuit, and FIG. 8 is a block diagram of a conventional multiplication circuit, and FIG. 8 is a block diagram of a calculation control circuit and a selection control circuit in the conventional example. It is a control relation diagram. 1 multiplicand register, 2 multiplier register, 3a, 3b upper product register, 4 lower product register, 5a, 5b arithmetic circuit,
6: Multiplier shifter, 7: Carry flag, 8a, 8b: Higher accumulation partial product shifter, 9a, 9b: Lower accumulation partial product shifter, 10a, 10b
... Arithmetic control circuit, 11 shift number control circuit, 12 double multiplicand register, 13 triple multiplicand register, 14 quadruple multiplicand register, 15 selection circuit, 16 selection control circuit.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】部分積の累算値と被乗数との間で演算を行
なう演算手段と、前記演算手段の出力をシフトし次の演
算に用いる部分積の累算値を生成する、シフト数が制御
できるシフト手段と、前記演算手段における演算と、前
記シフト手段におけるシフト数とを乗数の一部のビット
列をデコードして決定する制御手段とを備えた乗算回
路。
An arithmetic means for performing an operation between an accumulated value of a partial product and a multiplicand; and a shift number for shifting an output of the arithmetic means to generate an accumulated value of a partial product used in a next operation. A multiplication circuit comprising: a shift unit that can be controlled; and a control unit that determines an operation of the arithmetic unit and a shift number of the shift unit by decoding a partial bit string of a multiplier.
JP63018042A 1988-01-28 1988-01-28 Multiplication circuit Expired - Fee Related JP2568608B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63018042A JP2568608B2 (en) 1988-01-28 1988-01-28 Multiplication circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63018042A JP2568608B2 (en) 1988-01-28 1988-01-28 Multiplication circuit

Publications (2)

Publication Number Publication Date
JPH01193932A JPH01193932A (en) 1989-08-03
JP2568608B2 true JP2568608B2 (en) 1997-01-08

Family

ID=11960627

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63018042A Expired - Fee Related JP2568608B2 (en) 1988-01-28 1988-01-28 Multiplication circuit

Country Status (1)

Country Link
JP (1) JP2568608B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63298627A (en) * 1987-05-29 1988-12-06 Nec Corp Multiplying circuit

Also Published As

Publication number Publication date
JPH01193932A (en) 1989-08-03

Similar Documents

Publication Publication Date Title
EP0158530B1 (en) Nonrestoring divider
CA2225899A1 (en) A method and apparatus for finite field multiplication
JPH0612229A (en) Multiplication and accumulation circuit
JPH0831025B2 (en) Multiplication circuit
US20010054053A1 (en) Method and apparatus for finite field multiplication
US5289399A (en) Multiplier for processing multi-valued data
US4118786A (en) Integrated binary-BCD look-ahead adder
JP2568608B2 (en) Multiplication circuit
JP3660075B2 (en) Dividing device
JPH0234054B2 (en)
US4190894A (en) High speed parallel multiplication apparatus with single-step summand reduction
JPH076024A (en) Decimal number multiplier
JP2734438B2 (en) Multiplier
JPH0869372A (en) Binary multiplier
JPH0831024B2 (en) Arithmetic processor
JP2606339B2 (en) Multiplier
JP2532505B2 (en) Multiplication circuit
JP3106767B2 (en) Multiplication method and multiplication circuit
JP3197186B2 (en) Multiplication device using semiconductor memory
JPH02115929A (en) Multiplier
JP2777265B2 (en) High radix square root arithmetic unit
JP3068640B2 (en) Computing device
JP3612950B2 (en) Arithmetic apparatus and method
JPH05241793A (en) Double-precision multiplier
JPH05216626A (en) Multiplier

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees