JPH01193932A - Multiplication circuit - Google Patents

Multiplication circuit

Info

Publication number
JPH01193932A
JPH01193932A JP63018042A JP1804288A JPH01193932A JP H01193932 A JPH01193932 A JP H01193932A JP 63018042 A JP63018042 A JP 63018042A JP 1804288 A JP1804288 A JP 1804288A JP H01193932 A JPH01193932 A JP H01193932A
Authority
JP
Japan
Prior art keywords
register
multiplicand
bits
circuit
arithmetic
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.)
Granted
Application number
JP63018042A
Other languages
Japanese (ja)
Other versions
JP2568608B2 (en
Inventor
Masato Suzuki
正人 鈴木
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

Abstract

PURPOSE:To realize an arithmetic processing in an arithmetic circuit having the same bit length as a multiplicand by providing a shift means which shifts the output of an operation means, generates the accumulation value of a partial product used for a subsequent operation and controls the number of shifts. CONSTITUTION:The value of a multiplicand register 1 and that of a high-order product register 3a are inputted to the arithmetic circuit 5a, and the operation decided in an arithmetic control circuit 10a is executed, whereby the operated result and the content of a low-order register 4 are shifted to right in a high- order accumulation partial product shifter 8a and a low-order accumulation partial product shifter 9a by the number of bits decided in a shift number control circuit 11. Shift results are respectively stored in the high-order product register 3a and the low-order product register 4. The number of shifts in the high-order accumulation partial product shifter 8 and the low-order accumulation partial product shifter 9a are set to be variable to one bit and five bits, and the number of shifts is controlled by low-order six bits in a multiplication register 2 and a carry flag 7. Thus, the multiple value of the multiplicand is eliminated in the input of the arithmetic circuit, and the arithmetic processing is realized in the arithmetic circuit having the same bit length as the multiplicand.

Description

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

従来の技術 従来の乗算回路としては、例えば、 「インブルーブト
 アプローチ トウ ジ ユーズ オブブルース マル
チブリケーション アルゴリズム」アイ・ビー・エム 
テクニカル ディスクロージャ ブレティン(”Imp
roved approach to the use
 of Booth’s   multiplicat
ion algorithm−IBM Technic
al Disclosure Bulletin ) 
 Vol、27No、111985  に示されている
Conventional technology Conventional multiplication circuits include, for example, "In Blue But Approach to Use of Blue Multiplication Algorithm" published by IBM.
Technical Disclosure Bulletin (“Imp
roved approach to the use
of Booth's multiple
ion algorithm-IBM Technic
al Disclosure Bulletin)
Vol. 27 No. 111985.

第7図はこの従来の乗算回路のブロック図を示すもので
あり、1は被乗数を入力し保持する被乗数レジスタ、2
は乗算の開始時に乗数を入力して演算処理中は最下位ビ
ット方向(以後、右と称す)に3ビツトずつシフトされ
た乗数が保持される乗数レジスタ、3bは演算処理中に
は累算された部分積の上位が保持され演算終了時には演
算結果である積の上位が格納される上位積レジスタ、4
は演算処理中には累算された部分積の下位が保持され演
算終了時には積の下位が格納される下位積レジスタ、5
bはAとBの2つの入力の間で演算を行なう演算回路、
6は乗数レジスタ2に保持されている数値を右に3ビツ
トシフトして結果を再び乗数レジスタ2に格納する乗数
シフタ、7は乗数シフタ6の桁あふれを保持するキャリ
フラグ、8bは累算部分積の上位である演算回路5bの
出力を右に3ビツト算術シフト(最上位ビットからは符
号ビットがコピーされる)して上位積レジスタ3bに格
納する上位累算部分積シフタ、9bは上位累算部分積シ
フタ8bの桁あぶれを上位からシフト入力しつつ下位積
レジスタ4に保持されている累算部分積の下位を右に3
ビツトシフトして結果を再び下位積レジスタ4に格納す
る下位累算部分積シフタ、lObは乗数レジスタ2の下
位3ビツトおよびキャリフラグ7により演算回路5bで
実行する演算を制御する演算制御回路、12は被乗数の
2倍値を入力し保持する2倍被乗数レジスタ、13は被
乗数の3倍値を入力し保持する3倍被乗数レジスタ、1
4は被乗数の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 multiplier circuit, in which 1 is a multiplicand register that inputs and holds the multiplicand, 2
3b is a multiplier register that inputs a multiplier at the start of multiplication and holds the multiplier shifted by 3 bits in the direction of the least significant bit (hereinafter referred to as right) during arithmetic processing. an upper product register, 4, in which the upper part of the partial product is held and the upper part of the product, which is the calculation result, is stored when the calculation is completed;
is a lower product register, 5, which holds the lower part of the accumulated partial product during the calculation process and stores the lower part of the product when the calculation ends.
b is an arithmetic circuit that performs an operation between two inputs A and B;
6 is a multiplier shifter that shifts the numerical value held in multiplier register 2 to the right by 3 bits and stores the result in multiplier register 2 again, 7 is a carry flag that maintains overflow of multiplier shifter 6, and 8b is an accumulated partial product. 9b is an upper accumulation partial product shifter which arithmetic shifts the output of the arithmetic circuit 5b, which is the higher order of the bit, to the right by 3 bits (the sign bit is copied from the most significant bit) and stores it in the upper product register 3b. While shifting the digits of the partial product shifter 8b from the upper part, the lower part of the cumulative partial product held in the lower product register 4 is shifted to the right by 3.
12 is a lower cumulative partial product shifter that bit-shifts and stores the result again in the lower product register 4; A double multiplicand register 13 inputs and holds a double value of the multiplicand; 13 a triple multiplicand register inputs and holds a triple value of the multiplicand;
4 is a quadruple multiplicand register that inputs and holds the quadrupled value of the multiplicand, and 15 is a multiplicand stored in multiplicand register 1 or a double value of the multiplicand stored in double multiplicand register 12 or stored in triple multiplicand register 13. A selection circuit 16 selects either the triple value of the multiplicand stored in the multiplicand register 14 or the quadruple value of the multiplicand stored in the quadruple multiplicand register 14 and applies it to the B input of the arithmetic circuit 5b. This is a selection control circuit that controls the selection in the selection circuit 15 using the flag 7.

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

乗算の方法としてブース(Booth)のアルゴリズム
がある。この従来の乗算回路は4ビツトのブースのアル
ゴリズムを用いたもので、乗数の最下位ビット側から4
ビツト(その内1ビットはオーバーラツプする)ずつを
切り出して部分積を選択し、部分積を累算することによ
って積を求める。
Booth's algorithm is a multiplication method. This conventional multiplier circuit uses the 4-bit Booth algorithm, and uses 4 bits from the least significant bit of the multiplier.
The product is obtained by cutting out bits (of which one bit overlaps), selecting partial products, and accumulating the partial products.

第8図はこのアルゴリズムに基づいた演算制御回路10
bと選択制御回路16の制御間係図で、M2、Ml、M
Oで示す乗数レジスタ2の下位3ビツトとCで示すキャ
リフラグ7の合計4ビツトをデコードして演算回路5b
の演算と演算回路5bのB入力となる選択回路15の選
択とを決定するものである。
FIG. 8 shows an arithmetic control circuit 10 based on this algorithm.
b and the control relationship diagram of the selection control circuit 16, M2, Ml, M
The lower 3 bits of the multiplier register 2 indicated by O and the carry flag 7 indicated by C, a total of 4 bits, are decoded and sent to the arithmetic circuit 5b.
and the selection of the selection circuit 15 which becomes the B input of the calculation circuit 5b.

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

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

演算回路5bの演算および8人力は乗数レジスタ2の下
位3ビツトとキャリフラグ7とから決定され、演算回路
5bの出力は第8図において演算の欄が“A ”ならば
八人力そのまま、 “A+B”ならば八人力とB入力の
加算結果、“A −B ”ならば八人力とB入力の減算
結果となる。またB入力は第8図において8人力の欄が
“X ′9ならば被乗数レジスタ1に格納された被乗数
が、“’2X”ならば2倍被乗数レジスタ12に格納さ
れた被乗数の2倍値が、“3X”ならば3倍被乗数レジ
スタ13に格納された被乗数の3倍値が、“4X”なら
ば4倍被乗数レジスタ14に格納された被乗数の4倍値
が選択回路15において選択される。
The calculation of the arithmetic circuit 5b and the 8-man power are determined from the lower 3 bits of the multiplier register 2 and the carry flag 7, and if the operation column in FIG. ”, the result is the addition of the eight-person force and the B input, and “A − B” is the result of the subtraction, the eight-person force and the B input. In addition, the B input in FIG. , if "3X", 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 in the selection circuit 15.

演算の後、乗数シフタ6、上位累算部分積シフタ8bお
よび下位累算部分積シフタ9bはいずれも右に3ビツト
シフトし、それぞれ所定のレジスタにシフト結果を格納
する。
After the calculation, the multiplier shifter 6, the upper accumulated partial product shifter 8b, and the lower accumulated partial product shifter 9b all shift three bits to the right, and store the shift results in respective predetermined registers.

以上の演算およびシフトは、 〔乗数のビット長÷3〕
回(割り切れない場合は小数部切り上げ)繰り返される
The above operations and shifts are as follows: [Bit length of multiplier ÷ 3]
Repeated times (if not divisible, round up the decimal part).

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

以上は、4ビツトのブースのアルゴリズムを用いた従来
の乗算回路について説明したものであるが、4ビツトを
越えるブースのアルゴリズムを用いたものも同様である
。即ち、Nビットのブースのアルゴリズムを用いた従来
の乗算回路においては、演算回路5bの演算および8人
力は乗数レジスタ2の下位(N−1)ビットとキャリフ
ラグ7とから決定され、B入力は、選択回路15におい
て2の(N−2)東側のレジスタの中から、被乗数の2
の(N−2)乗倍値までの値が選択される。
The above description is about a conventional multiplication circuit using a 4-bit Booth algorithm, but the same applies to a multiplication circuit using a Booth algorithm of more than 4 bits. That is, in the conventional multiplication circuit using the N-bit Booth's algorithm, the calculation and the input power of the calculation circuit 5b 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 2 of the multiplicand from 2 (N-2) east side registers.
Values up to the (N-2) power are selected.

乗数シフタ6、上位累算部分積シフタ8bおよび下位累
算部分積シフタ9bはいずれも右に(N−1)ビットシ
フト動作をし、演算およびシフトは、乗数のビット長÷
(N−1)回(割り切れない場合は小数部切り上げ)繰
り返される。
The multiplier shifter 6, the upper cumulative partial product shifter 8b, and the lower cumulative partial product shifter 9b all perform a (N-1) bit shift operation to the right, and the calculation and shift is calculated by dividing the bit length of the multiplier by dividing the bit length of the multiplier.
It is repeated (N-1) times (if it is not divisible, the decimal part is rounded up).

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

以上は、4ビツトのブースのアルゴリズムを用いた従来
の乗算回路の問題点であるが、4ビツトを越えるブース
のアルゴリズムを用いたものも同様である。即ち、Nビ
ットのブースのアルゴリズムにおいては、演算回路の入
力に被乗数の2の(N−2)乗倍値までの値が必要であ
るため、これらの値を生成し保持する手段が不可欠で、
また被乗数の2の(N−2)乗倍値までの値を生成する
ための時間を消費しなければならないという問題点と、
被乗数の2の(N−2)乗倍値を符号付き2進数で表現
するには被乗数のビット長+(N−2)のビット長が必
要となるため、演算回路をはじめ、上位積レジスタ、上
位累算部分積シフタ、選択回路およびこれらを接続する
バスを含むすべてが被乗数のビット長+(N−2)のビ
ット長を必要とするという問題点を有していた。
The above are the problems of the conventional multiplication circuit using the 4-bit Booth algorithm, but the problems are also the same for those using the Booth algorithm of more than 4 bits. That is, in the N-bit Booth algorithm, values up to the multiplicand multiplied by 2 (N-2) are required as inputs to the arithmetic circuit, so a means to generate and hold these values is essential.
There is also the problem that time must be consumed to generate a value up to the multiplicand multiplied by 2 (N-2).
To express the (N-2) multiplication value of 2 of the multiplicand in a signed binary number, the bit length of the multiplicand + (N-2) is required. The problem is that everything including the upper cumulative partial product shifter, the selection circuit, and the bus connecting these requires a bit length of the multiplicand plus (N-2).

本発明はかかる点に鑑み、演算回路の入力に被乗数の倍
数値が一切不要で、被乗数と等しいビット長の演算回路
で演算処理が可能であり、かつ、ブースのアルゴリズム
を用いない乗算回路より高速な乗算回路を提供すること
を目的とする。
In view of these points, the present invention eliminates the need for multiples of the multiplicand in the input of the arithmetic circuit, allows arithmetic processing to be performed using an arithmetic circuit with a bit length equal to the multiplicand, and is faster than a multiplication circuit that does not use Booth's algorithm. The purpose of this invention is to provide a multiplication circuit that is easy to use.

課題Xを解決するための手段 本発明は、部分積の累算値と被乗数との間で演算を行な
う演算手段と、前記演算手段の出力をシフトし次の演算
に用いる部分積の累算値を生成する、シフト数が制御で
きるシフト手段と、前記演算手段における演算と、前記
シフト手段におけるシフト数とを乗数の一部のビット列
をデコードして決定する制御手段とを備えた乗算回路で
ある。
Means for Solving Problem and a control means for determining the calculation in the calculation means and the shift number in the shift means by decoding a bit string of a part of the multiplier. .

作用 本発明は前記した構成により、被乗数の倍数値の加減算
を、被乗数の加減算とその演算の前後に行なうシフト処
理のシフト数を制御すること、またはその繰り返しに置
き換えることができ、被乗数の倍数値およびそのための
演算回路のビット長の拡大が不要になる。
Effect of the Invention With the above-described configuration, the present invention can replace the addition and subtraction of multiples of the multiplicand by controlling the number of shifts in the shift processing performed before and after the addition and subtraction of the multiplicands, or by repeating the same. Also, there is no need to increase the bit length of the arithmetic circuit for this purpose.

実施例 第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と等しいビット長の下位累算部分積シック、10
aは乗数レジスタ2の下位3ビツトおよびキャリフラグ
7により演算回路5aで実行する演算を制御する演算制
御回路、11は乗数レジスタ2の下位6ビツトおよびキ
ャリフラグ7により上位累算部分積シフタ8aおよび下
位累算部分積シフタ9aでシフトするシフト数を制御す
るシフト数制御回路である。
Embodiment FIG. 1 shows a block diagram of a multiplication circuit in an embodiment of the present invention. 1 is a multiplicand register for inputting and holding a multiplicand, and 2 is a register for inputting a multiplier at the start of multiplication and a register on the right during arithmetic processing. 3a is a multiplicand register 1 that holds the multiplier shifted by 3 bits into the multiplier register 3a, which holds the high-order part of the accumulated partial product during calculation processing, and stores the high-order value of the product that is the calculation result when the calculation is completed. 4 is a lower product register with a bit length equal to that of multiplier register 2; 4 is a lower product register with a bit length equal to multiplier register 2; 4 is a lower product register that holds the lower part of the accumulated partial product during calculation processing and stores the lower part of the product when the calculation is completed; is an arithmetic circuit that performs an operation on the value of the multiplicand register 1 and the value of the upper product register 3a, and performs an operation with the same bit length as the multiplicand register 1. 6 is a multiplier shifter that shifts the value held in multiplier register 2 by 3 bits to the right and stores the result in multiplier register 2 again; 7 is a carry flag that maintains the overflow of multiplier shifter 6; 8a is an accumulated partial product An upper cumulative partial product shifter with a bit length equal to the multiplicand register 1, which arithmetic shifts the output of the arithmetic circuit 5a, which is the upper one, to the right and stores it in the upper product register 3a.9a is an overflow of the upper cumulative partial product shifter 8a. Shift the lower part of the accumulated partial product held in the lower product register 4 to the right while manually shifting from the upper part, and store the result in the lower product register 4 again.Lower accumulated part with bit length equal to multiplier register 2 product chic, 10
11 is an arithmetic control circuit that controls the arithmetic operation executed in the arithmetic circuit 5a using the lower 3 bits of the multiplier register 2 and the carry flag 7; and 11, the upper cumulative partial product shifter 8a and This is a shift number control circuit that controls the number of shifts shifted by the lower cumulative partial product shifter 9a.

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

この実施例の乗算回路は4ビツトのブースのアルゴリズ
ムに基づいたものである。同アルゴリズムにおいては、
部分積の累算値の3ビツト右シフトと、ゼロ、被乗数の
±1倍値、被乗数の±2倍値、被乗数の±3倍値、被乗
数の±4倍1mのいずれかの部分積の累算の繰り返しに
より積を求める。
The multiplication circuit of this embodiment is based on a 4-bit Booth algorithm. In the same algorithm,
Shift the accumulated value of partial products to the right by 3 bits and accumulate any of the partial products of zero, ±1 times the multiplicand, ±2 times the multiplicand, ±3 times the multiplicand, or ±4 times the multiplicand 1m. Find the product by repeating the calculation.

ここで、第3図(a)、 (b)に示すように、1つ前
の演算結果の3ビツト右シフト、被乗数の2倍値の加減
算、演算結果の3ビツト右シフトの一連の処理は、被乗
数の2倍値の最下位ビットがOであることから、1つ前
の演算結果の4ビツト右シフト、被乗数の加減算、演算
結果の2ビツト右シフトからなる一連の処理に置き換え
られる。また、被乗数の3倍値の加減算は、被乗数の加
減算と被乗数の2倍値の加減算とを連続して行なうこと
と等しく、被乗数の2倍値の最下位ビットが0であるこ
とから、第4図(a)、 (b)に示すように、1つ前
の演算結果の3ビツト右シフト、被乗数の3倍値の加減
算、演算結果の3ビツト右シフトの一連の処理は、1つ
前の演算結果の3ビツト右シフト、被乗数の加減算、演
算結果の1ビツト右シフト、被乗数の加減算、演算結果
の2ビツト右シフトからなる一連の処理に置き換えられ
る。
Here, as shown in FIGS. 3(a) and 3(b), the series of processes of shifting the previous operation result by 3 bits to the right, adding or subtracting the double value of the multiplicand, and shifting the operation result to the right by 3 bits is , since the least significant bit of the double value of the multiplicand is O, it is replaced by a series of processing consisting of a 4-bit right shift of the previous operation result, addition/subtraction of the multiplicand, and 2-bit right shift of the operation result. Furthermore, adding and subtracting the triple value of the multiplicand is equivalent to adding and subtracting the multiplicand and adding and subtracting the double value of the multiplicand, and since the least significant bit of the double value of the multiplicand is 0, the fourth As shown in Figures (a) and (b), the series of processes of shifting the previous operation result by 3 bits to the right, adding or subtracting the triple value of the multiplicand, and shifting the operation result by 3 bits to the right This is replaced by a series of processing consisting of a 3-bit right shift of the operation result, addition and subtraction of the multiplicand, 1-bit right shift of the operation result, addition and subtraction of the multiplicand, and 2-bit right shift of the operation result.

同様に、被乗数の4倍値の下位2ビツトがともに0であ
ることから、第5図(a)、 (b)に示すように、1
つ前の演算結果の3ビツト右シフト、被乗数の4倍値の
加減算、演算結果の3ビツト右シフトの一連の処理は、
1つ前の演算結果の5ビツト右シフト、被乗数の加減算
、演算結果の1ビツト右シフトからなる一連の処理に置
き換えられる。これらのことよりこの実施例の乗算回路
は、被乗数の加減算とその結果の1ビツトないし5ビツ
トの右シフトを繰り返して積を求めるものである。
Similarly, since the lower two bits of the quadrupled value of the multiplicand are both 0, 1
The series of processes of shifting the previous operation result by 3 bits to the right, adding or subtracting the quadrupled value of the multiplicand, and shifting the operation result to the right by 3 bits is as follows:
This is replaced by a series of processing consisting of a 5-bit right shift of the previous operation result, addition/subtraction of the multiplicand, and a 1-bit right shift of the operation result. For these reasons, the multiplication circuit of this embodiment repeatedly adds and subtracts the multiplicands and shifts the result by 1 to 5 bits to the right to obtain a product.

第2図は前記した考え方に基づいた演算制御回路10a
とシフト数制御回路11の制御関係図で、M2.Ml、
MOで示す乗数レジスタ2の下位3ビツトとCで示すキ
ャリフラグ7の合計4ビツトをデコードして演算回路5
aの演算と、M5.M4.M3゜M2.Ml、MOで示
す乗数レジスタ2の下位6ビツト(同図(a)中のK 
l 、 K 2は同図(b)に示す通り乗数レジスタ2
の下位から4〜6ビツトにより決まる)とCで示すキャ
リフラグ7の合計7ビツトをデコードして上位累算部分
積シフタ8aおよび下位累算部分積シフタ9aのシフト
数とを決定するものである。第2図において、演算“3
A″は八人力そのまま、“A + B ”は八人力とB
入力の加算、“A−B”はA入力とB入力の減算を表す
FIG. 2 shows an arithmetic control circuit 10a based on the above-mentioned concept.
and the control relationship diagram of the shift number control circuit 11, M2. Ml,
The lower 3 bits of the multiplier register 2 indicated by MO and the carry flag 7 indicated by C, a total of 4 bits, are decoded and sent to the arithmetic circuit 5.
a calculation, and M5. M4. M3゜M2. The lower 6 bits of multiplier register 2 indicated by Ml and MO (K in FIG.
l, K2 are multiplier registers 2 as shown in the same figure (b).
(determined by 4 to 6 bits from the lowest order) and a carry flag 7 indicated by C, a total of 7 bits are decoded to determine the shift number of the upper cumulative partial product shifter 8a and the lower cumulative partial product shifter 9a. . In Figure 2, the operation “3
A'' is eight-person power as is, “A + B” is eight-person force and B
Addition of inputs, "A-B" represents subtraction of A and B inputs.

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

始めに、被乗数ならびに乗数をそれぞれ被乗数レジスタ
1と乗数レジスタ2に入力すると共に、上位積レジスタ
3aと下位積レジスタ4およびキャリフラグ7を零にク
リアする。
First, a multiplicand and a multiplier are input into multiplicand register 1 and multiplier register 2, respectively, and upper product register 3a, lower product register 4, and 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に格納
する。
After inputting the value of the multiplicand register 1 and the value of the upper product register 3a to the arithmetic circuit 5a and performing the arithmetic operation determined by the arithmetic control circuit 10a, the result of the operation and the contents of the lower product register 4 are used as the upper cumulative partial product. The shifter 8a and the lower cumulative partial product shifter 9a shift to the 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, the second
If the number of calculations and shifts is written in the second column in Figure (a), the above calculations and shifts are performed twice according to the contents. In addition, the above shift (Fig. 2 (a)
), in parallel with the second shift), the multiplier shifter 6 shifts the value of the multiplier register 2 to the right by 3 bits, and the result is transferred to the multiplier register 2. Then, the overflow is stored in the carry flag 7.

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

乗算結果は上位積レジスタ3aと下位積レジスタ4に上
位と下位に別れて保持される。
The multiplication results are held in the upper product register 3a and the lower product register 4 separately into upper and lower parts.

以上のように、この実施例によれば、演算回路5aに後
置される上位累算部分積シフタ8aおよび下位累算部分
積シフタ9aにおけるシフト数を1ビツトないし5ビツ
トと可変にし、そのシフト数を乗数レジスタ2の下位6
ビツトとキャリフラグ7で制御することにより、演算回
路の人力に被乗数の倍数値が不要となり、また被乗数と
等しいビット長の演算回路で演算処理が可能となる。ま
たその処理時間は、ブースのアルゴリズムを用いない乗
算回路に比べ、平均で2.4分の1に短縮される。これ
は、1回のデコードに対応する演算は平均 lX12/
16+2X4/16=1.25回となるから、3ビツト
シフトする本アルゴリズムでの処理時間は(3÷1.2
5)分の1になるという計算に基づいている。
As described above, according to this embodiment, the number of shifts in the upper cumulative partial product shifter 8a and the lower cumulative partial product shifter 9a provided after the arithmetic circuit 5a is made variable from 1 bit to 5 bits, and the shift Lower 6 of multiplier register 2
Control using bits and the carry flag 7 eliminates the need for multiples of the multiplicand in the human power of the arithmetic circuit, and allows arithmetic processing to be performed using an arithmetic circuit having the same bit length as the multiplicand. Furthermore, the processing time is reduced to 1/2.4 on average compared to a multiplication circuit that does not use Booth's algorithm. This means that the calculation corresponding to one decoding is on average lX12/
16+2X4/16=1.25 times, so the processing time for this algorithm that shifts 3 bits is (3÷1.2
5) It is based on the calculation that it becomes 1/1.

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

Nビットのブースのアルゴリズムに基づいた本発明の実
施例における乗算回路の演算制御回路10aは、乗数レ
ジスタ2の下位(N−1)ビットとキャリフラグ7をデ
コードして演算回路5aを制御し、シフト数制御回路1
1は、乗数レジスタ2の下位2(N−1)ビットとキャ
リフラグ7をデコードして上位累算部分積シフタ8aお
よび下位累算部分積シフタ9aを制御する。また、上位
累算部分積シフタ8aおよび下位累算部分積シフタ9a
のシフト数は1ビツトから(2N−3)ビットの範囲で
可変であり、乗数シフタ6は右に(N−1)ビットシフ
トする。平均処理時閘は、Nの増加に伴ない短縮される
。第6図は5ビツトのブースのアルゴリズムに基づいた
本発明の他の実施例における乗算回路の演算制御回路1
0aとシフト数制御回路11の制御間係図で、M3.M
2.Ml、MOで示す乗数レジスタ2の下位4ビツトと
Cで示すキャリフラグ7の合計5ビツトをデコードして
演算回路5aの演算と、M?、M6.M5.M4.M=
16= 3、M2.Ml、MOで示す乗数レジスタ2の下位8ビ
ツトとCで示すキャリフラグ7の合計9ビツトをデコー
ドして上位累算部分積シフタ8aおよび下位累算部分積
シフタ9aのシフト数とを決定するものである。
The arithmetic control circuit 10a of the multiplication circuit in the embodiment of the present invention based on the N-bit Booth algorithm decodes the lower (N-1) bits of the multiplier register 2 and the carry flag 7 to control the arithmetic circuit 5a, Shift number control circuit 1
1 decodes the lower 2 (N-1) bits of the multiplier register 2 and the carry flag 7 to control the upper accumulated partial product shifter 8a and the lower accumulated partial product shifter 9a. Additionally, an upper cumulative partial product shifter 8a and a lower cumulative partial product shifter 9a
The number of shifts is variable in the range of 1 bit to (2N-3) bits, and the multiplier shifter 6 shifts (N-1) bits to the right. The average processing time is shortened as N increases. FIG. 6 shows an arithmetic control circuit 1 of a multiplication circuit in another embodiment of the present invention based on the 5-bit Booth algorithm.
0a and the control relationship between the shift number control circuit 11 and M3. M
2. A total of 5 bits of the lower 4 bits of the multiplier register 2 indicated by Ml and MO and the carry flag 7 indicated by C are decoded to perform the operation of the arithmetic circuit 5a and M? , M6. M5. M4. M=
16=3, M2. A device that decodes a total of 9 bits of the lower 8 bits of the multiplier register 2 indicated by Ml and MO and the carry flag 7 indicated by C to determine the shift number of the upper accumulated partial product shifter 8a and the lower accumulated partial product shifter 9a. It is.

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

【図面の簡単な説明】[Brief explanation of the drawing]

第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 relationship diagram of the arithmetic control circuit and shift number control circuit in the same embodiment, and Fig. 3 is a multiplicand twice the number in the same embodiment. Explanatory diagram showing the substitution principle of addition and subtraction of values, Part 4
The figure is an explanatory diagram showing the replacement principle for adding and subtracting a value 3 times the multiplicand in the same embodiment. Figure 5 is an explanatory diagram showing the replacement principle for adding and subtracting a value 4 times the multiplicand in the same embodiment. Figure 6 is an explanatory diagram showing the replacement principle for adding and subtracting a value 4 times the multiplicand in the same embodiment. FIG. 7 is a block diagram of a conventional multiplier circuit, and FIG. 8 is a control diagram of an arithmetic control circuit and a selection control circuit in the conventional example. FIG. 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... Upper cumulative partial product shifter, 9a, 9b... Lower cumulative partial product shifter, 10a
, 10b... Arithmetic control circuit, 11... Shift number control circuit, 12... 2x multiplicand register, 13... 3x multiplicand register, 14... 4x multiplicand register, 15
...Selection circuit, 16...Selection control circuit.

Claims (1)

【特許請求の範囲】[Claims]  部分積の累算値と被乗数との間で演算を行なう演算手
段と、前記演算手段の出力をシフトし次の演算に用いる
部分積の累算値を生成する、シフト数が制御できるシフ
ト手段と、前記演算手段における演算と、前記シフト手
段におけるシフト数とを乗数の一部のビット列をデコー
ドして決定する制御手段とを備えた乗算回路。
A calculation means for performing an operation between an accumulated value of partial products and a multiplicand, and a shifting means for shifting the output of the operation means to generate an accumulated value of partial products to be used for the next operation, the number of shifts being controllable. . A multiplication circuit comprising: a control means for determining an operation in the arithmetic means and a shift number in the shift means by decoding a part of a 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 true JPH01193932A (en) 1989-08-03
JP2568608B2 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)

Citations (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

Patent Citations (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
JP2568608B2 (en) 1997-01-08

Similar Documents

Publication Publication Date Title
JPS6347874A (en) Arithmetic unit
JP2000259394A (en) Floating point multiplier
JPH0831025B2 (en) Multiplication circuit
JPH0234054B2 (en)
JPH0317132B2 (en)
JPH06119148A (en) Arithmetic circuit
US4118786A (en) Integrated binary-BCD look-ahead adder
JPH01193932A (en) Multiplication circuit
JPH05158659A (en) Multiplier
JPH076024A (en) Decimal number multiplier
JP3019796B2 (en) Multiplier
JP2734438B2 (en) Multiplier
JP3612950B2 (en) Arithmetic apparatus and method
JP2777265B2 (en) High radix square root arithmetic unit
JPH0784762A (en) Multiplication circuit
JP2996024B2 (en) Multiplication circuit
JPS63182738A (en) Multiplying circuit
JPH02115929A (en) Multiplier
JP3197186B2 (en) Multiplication device using semiconductor memory
JPS62214435A (en) Digital dividing circuit
JP2675087B2 (en) Microcomputer
JP3433487B2 (en) Binary to decimal converter
JPS62298835A (en) Multiplying circuit
JPH01314020A (en) Decimal/binary conversion system
JPS62147526A (en) Multiplier

Legal Events

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