JPS6234235A - Multiplying device - Google Patents

Multiplying device

Info

Publication number
JPS6234235A
JPS6234235A JP60174488A JP17448885A JPS6234235A JP S6234235 A JPS6234235 A JP S6234235A JP 60174488 A JP60174488 A JP 60174488A JP 17448885 A JP17448885 A JP 17448885A JP S6234235 A JPS6234235 A JP S6234235A
Authority
JP
Japan
Prior art keywords
multiplication
positive number
complement
data
multiplier
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
Application number
JP60174488A
Other languages
Japanese (ja)
Inventor
Kazuhiro Chiba
千葉 和弘
Noriko Kojima
小島 典子
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP60174488A priority Critical patent/JPS6234235A/en
Publication of JPS6234235A publication Critical patent/JPS6234235A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To attain the multiplication of a display style of the complement of 2 by converting the data of the display style of the complement of 2 into positive numbers, performing the multiplication of positive numbers and applying correction to the multiplication of positive numbers. CONSTITUTION:Data X and Y of a display style of the complement of 2 are supplied to a positive number producing means 1 for conversion of these data into positive numbers X1 and Y1. These positive numbers are multiplied and supplied to an addition means 4. While data X and Y are supplied to a multiplication correcting means 3 for correction of multiplication involved with conversion into positive numbers. These corrected data are supplied to the means 4. The means 4 adds the output of a positive number multiplying means 2 with the output of the means 3 to obtain a product P. Thus the multiplication of the display style of the complement of 2 is made possible with use of the software and a ROM in a computer or at least the software.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、乗算装置に関し、中でもコンピュータ上で
、データが2の補数表示形式の場合の乗算を実現する乗
算装置に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a multiplication device, and more particularly to a multiplication device that realizes multiplication when data is in two's complement representation format on a computer.

〔従来の技術〕[Conventional technology]

−mに、コンピュータの基本構成要素は、CPUとRA
MとROMのハードウェアと、これらを有機的に結合し
て目的を実現するプログラムからなるソフトウェアとで
成り立つ。コンピュータ上で乗算機能を実現する場合、
従来はソフトウェアで対処していた。
-m, the basic components of a computer are CPU and RA
It consists of M and ROM hardware, and software consisting of a program that organically combines these to achieve a purpose. When realizing the multiplication function on a computer,
Previously, this was handled using software.

以下の式(11(21(3)はこのプログラムの基本と
なる乗算アルゴリズムである。
The following equation (11(21(3)) is the multiplication algorithm that is the basis of this program.

X−27・X、+2’  −X、+2’  l Xs+
24 ・x 4+ 22  ・X。
X-27・X, +2' -X, +2' l Xs+
24 ・x 4+ 22 ・X.

+22 ・x2+2・x、+X0 ・・・(1) Y−27・yt+2’  ・yb+2’  ・y。+22・x2+2・x, +X0 ...(1) Y-27・yt+2′・yb+2′・y.

+24 ・ya +2n  ・y。+24・ya +2n・y.

+22 ・y2+2・’/+ +)’。+22・y2+2・’/++)’.

・・・(2) P−X −Y −X (2’ ・y、+2h−yb+2S−y。...(2) P-X -Y -X (2' y, +2h-yb+2S-y.

+24 ・y4+23 ・ys +22 ・yt +2・yt  +)’o)=X  (
2(2’  ・Yt  +2’  −yb  +2’ 
 ・y5+23 ・ y 4+ 21  ・y3+2・
Yt  +Y+  )+)’o )−2(2(2(2(
2(2(2(yt  I X)  +y、  l X)
+ys  ・X)+y4 ・X)+)’!  ・X)+
y! ・X)+y+  ・X)+’lo  ・X・・・
(3) これらの式中、被乗数Xと乗数Y(以下ではX。
+24 ・y4+23 ・ys +22 ・yt +2・yt +)'o)=X (
2(2' ・Yt +2' -yb +2'
・y5+23 ・y4+ 21 ・y3+2・
Yt +Y+ )+)'o )-2(2(2(2(
2(2(2(yt I X) +y, l X)
+ys ・X)+y4 ・X)+)'!・X)+
Y!・X)+y+ ・X)+'lo ・X...
(3) In these formulas, the multiplicand X and the multiplier Y (hereinafter referred to as X).

Yと略す)は各8ビツトと仮定しており、これらの一般
式は Xx2’ x、+2bx、+2’ XS +2’ x4
+’13x、+’l” Xt +2x、+x(。
Y) are assumed to be 8 bits each, and their general formula is Xx2' x, +2bx, +2' XS +2' x4
+'13x, +'l'' Xt +2x, +x(.

Y=2’ Y−I+2’ Yb +2’ 3’s +2
’ )’4+2’ ys +2n Yz +21+ +
 y。
Y=2'Y-I+2' Yb +2'3's +2
)'4+2' ys +2n Yz +21+ +
y.

と表現できる。XとYの積をPとすると、このPは式(
3)のように展開でき、最終的に−X−Y =2(2(2(2(2(2(2(yq・X)+y6.X
)+Ys・X)+y4・X)+ys・X)+7z・x)
+y+−x)+)’o・Xとなる。
It can be expressed as If the product of X and Y is P, this P is expressed by the formula (
3), and finally -X-Y = 2(2(2(2(2(2(2(yq・X)+y6.X
)+Ys・X)+y4・X)+ys・X)+7z・x)
+y+-x)+)'o・X.

この積Pを求める手順は、最初にyt ・Xを求めてこ
れを2倍し、次にこの値にy、・Xを加算して2(y、
・X)+ya  ・Xを求める。以下この値を2倍して
y、・Xを加算するごとく順次に値を求めて最終的に2
式を得る。これが、ソフトウェアで乗算を実行する乗算
アルゴリズムの1例である。
The procedure for finding this product P is to first find yt ・X, double it, then add y, ・X to this value and add 2(y,
・X)+ya ・Find X. Below, we calculate the values sequentially by doubling this value and adding y, ・X, and finally 2
Get the formula. This is an example of a multiplication algorithm that performs multiplication in software.

第6図はそのプログラムの一例を示したものである。ス
テップMでX(!:YをレジスタR+、Rtに代入し、
ステップNでレジスタPに初期値としてOを、Yの何ビ
ット目を計算しているかを示すレジスタiに7を設定し
、7ビツト目から計算をはじめる。ステップOでyt 
・Xを計算し、レジスタPに加算する0次にステップQ
でそれを1桁の桁上げをする。これで、2(y、・X)
まで計算が終了した。ステップRでレジスタiから1を
減算して6とし、次は6ビツト目を計算する。ステップ
Oまで戻り、y6 ・Xを計算して、それをレジスタP
に加算して、ステップQで桁上げする。
FIG. 6 shows an example of the program. In step M, assign X(!:Y to registers R+, Rt,
In step N, register P is set to O as an initial value, register i indicating which bit of Y is being calculated is set to 7, and calculation is started from the 7th bit. yt at step O
・0th order step Q that calculates X and adds it to register P
and increment it by one digit. Now, 2(y,・X)
The calculation has been completed. In step R, 1 is subtracted from register i to make it 6, and then the 6th bit is calculated. Return to step O, calculate y6 ・X, and store it in register P
and carry it up in step Q.

これで、2 (2(yt  ・X)+y6)まで計算が
終了した。同様に、5,4.3,2.1.0ビツトも計
算し、ステップPの分岐によって、ステップNによりレ
ジスタPの内容が出力される。
This completes the calculation up to 2 (2(yt·X)+y6). Similarly, bits 5, 4.3, and 2.1.0 are calculated, and by branching from step P, the contents of register P are output at step N.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

従来のコンピュータ内乗算装置は以上のように構成され
ているので、データが、2の補数表示形式の場合、乗算
が不可能であった。
Since the conventional multiplication device in a computer is configured as described above, multiplication is not possible when the data is in two's complement representation format.

この発明は、上記のような問題点を解消するためになさ
れたもので、コンピュータ内のROMとソフトウェアま
たはソフトウェアの少なくとも一方を用いて、2の補数
表示形式の乗算を可能とする乗算装置を得ることを目的
とする。
The present invention has been made to solve the above-mentioned problems, and provides a multiplication device capable of performing multiplication in two's complement representation format using at least one of a ROM and software in a computer. The purpose is to

〔問題点を解決するための手段〕[Means for solving problems]

この発明に係る乗算装置は、2の補数表示形式のデータ
を正数化する正数化手段と、正数を乗算する正数乗算手
段と、該正数乗算手段の乗算補正を行なう乗算補正手段
と、正数乗算手段の出力と乗算補正手段の出力とを加算
する加算手段とを備え、 X及びYを a= X 、 −’l 1%−1 =Y+  2n−’ ただし、 x、とy、は極性符号、xlと7iは数値符号と変形し
て、積P(−X−Y)を次式 %式% ただし、 X、!*X、 のtのm数、Y 、IJ: Y I(D
 10)mWlに従って計算するようにしたものである
A multiplication device according to the present invention includes a positive number converting means for converting data in a two's complement display format into a positive number, a positive number multiplying means for multiplying by a positive number, and a multiplication correction means for performing multiplication correction of the positive number multiplying means. and addition means for adding the output of the positive number multiplication means and the output of the multiplication correction means, and , is a polarity sign, xl and 7i are transformed into numerical signs, and the product P(-X-Y) is expressed as the following formula % Formula % However, X, ! *X, m number of t of , Y , IJ: Y I(D
10) It is calculated according to mWl.

〔作用〕[Effect]

この発明においては、2の補数表示形式のデータを正数
化して正数の乗算を行ない、乗算補正手段により正数の
乗算に対する乗算の補正を行うことにより、2の補数表
現形式の乗算を行なうことができる。
In this invention, data in a two's complement representation format is converted to a positive number, multiplication is performed by a positive number, and the multiplication correction means corrects the multiplication for the positive number, thereby performing multiplication in a two's complement representation format. be able to.

〔実施例〕〔Example〕

以下、この発明の一実施例を図について説明する。 An embodiment of the present invention will be described below with reference to the drawings.

まず以下に本発明の基礎となる乗算アルゴリズムを示す
First, the multiplication algorithm that forms the basis of the present invention will be described below.

(C)  X−XI −2’−’   Y−Yl −2
n−’(D)   P鯰x−y = (XI  −2’−’ )(Yt  −2’−’ 
)=XI   −Yl  −(XI  +’y’、  
)  2n  +2n烏−f=X+  −’y’、  
+  (XI  +1 +Y1  +1)  2’−’
  +2n−”−XI  −Yl  + CXI  +
v、’)−2n−’  +2n−”+2’(E)  P
−X、  ・Yl  + (x+  +Y+ )  ・
2R−1+  (2n−”  +1)  ・2n(A)
はnビットの被乗数Xとnビットの乗数Yを2の補数表
示したときの一触式を示しており、X、とy3は極性符
号である。一般に、X≧0でX、−“0”、xく0でX
、寓″1”であり、y。
(C) X-XI -2'-' Y-Yl -2
n-' (D) P catfish x-y = (XI -2'-') (Yt -2'-'
)=XI −Yl −(XI +'y',
) 2n + 2n - f = X + -'y',
+ (XI +1 +Y1 +1) 2'-'
+2n-"-XI -Yl + CXI +
v,')-2n-'+2n-"+2'(E) P
-X, ・Yl + (x+ +Y+) ・
2R-1+ (2n-” +1) ・2n(A)
shows a one-touch equation when an n-bit multiplicand X and an n-bit multiplier Y are expressed as two's complement numbers, where X and y3 are polarity codes. Generally, if X≧0 then X, -“0”,
, fable "1", and y.

も同様である。このままでは、XとYの式中にマイナス
符号が存在するため乗算出来ないので、それぞれに(2
n−2’%−1)を加算して書き直した式を(B)に示
す。これを簡略化した式を(C)に示す。(C)のXl
とY、は、 1−X、 −0or1 1  )’5−Oorl となるため、正数とみなすことができる。(D)は積P
−X−Yの導出過程を示している。このとき、 −X+ −yl  +l、   −y、−Y、+1の恒
等式を用いている。(E)には、2の補数表示データの
積Pを得る式を示す。
The same is true. As it is, the product cannot be calculated because there is a minus sign in the formulas for X and Y, so each (2
The equation rewritten by adding n-2'%-1) is shown in (B). A simplified formula for this is shown in (C). (C) Xl
and Y are 1-X, -0or1 1 )'5-Oorl, and therefore can be regarded as positive numbers. (D) is the product P
-XY derivation process is shown. At this time, the identities of -X+ -yl +l, -y, -Y, and +1 are used. (E) shows a formula for obtaining the product P of two's complement representation data.

次に本発明の一実施例による乗算装置の機能ブロック図
を第1図に示し、説明する。
Next, a functional block diagram of a multiplication device according to an embodiment of the present invention is shown in FIG. 1 and will be described.

第1図において、1は2の補数表示形式のデータである
X、Yを正数化、即ちX”XI   2n−冨。
In FIG. 1, 1 converts X and Y, which are data in a two's complement representation format, to positive numbers, that is, X''XI 2n-Ten.

Y=’l*   2’−”とする正数化手段、2は得ら
れた正数XI、 Ylを乗算する正数乗算手段、3は上
記X、Yを入力とし、上記正数化に伴う乗算補正を行な
う、即ち(Ml 、 Yl >  ・2n−1+(2n
−富+1) ・2nを求める乗算補正手段、4は上記正
数乗算手段2の出力と乗算補正手段3の出力とを加算し
積Pを求める加算手段である。
2 is a positive number multiplier that multiplies the obtained positive number Perform multiplicative correction, i.e. (Ml, Yl > ・2n-1+(2n
-Wealth+1) - Multiplication correction means for calculating 2n; and 4 is an addition means for adding the output of the positive number multiplication means 2 and the output of the multiplication correction means 3 to obtain the product P.

また上記実施例の乗算装置のハード構成図を第2図に示
す。図中、11はCPUI 1 aと、RAM1lbと
、プログラム格納用ROMI  (11c)からなるコ
ンピュータ、12はXl 、Ylの部分積の乗算結果を
収納したROM2.13はROMはCPU11aにより
構成されている。また正数乗算手段2による乗算は従来
と同様コンピュータのみにより行なってもよいが、これ
はXI、Ylを2つ以上の数値の和に分解し、その分解
値の部分積をROM変換テーブルROM2 (12)を
用いて行なってもよく、その方法を以下に説明する。
Further, a hardware configuration diagram of the multiplication device of the above embodiment is shown in FIG. In the figure, 11 is a computer consisting of a CPU 1a, a RAM 1lb, and a ROMI for storing programs (11c), 12 is a ROM 2 that stores the multiplication results of partial products of Xl and Yl, and 13 is a ROM that is configured by the CPU 11a. . Further, the multiplication by the positive number multiplication means 2 may be performed only by a computer as in the past, but in this case, XI and Yl are decomposed into the sum of two or more numerical values, and the partial products of the decomposed values are stored in the ROM conversion table ROM2 ( 12), and the method will be explained below.

即ち、まずXl とY、を各8ビツトと仮定し、Xl 
=Xt・2’+Xb・2b+Xs・25+x4・2’+
)C+・23+xz・22+X、・2+x0 Yl−yy・2’+yh・2’+)’s・25+Ya・
2’+ys・2’+)’z・22+y1・2+)’。
That is, first assume that Xl and Y are 8 bits each, and
=Xt・2'+Xb・2b+Xs・25+x4・2'+
)C+・23+xz・22+X,・2+x0 Yl−yy・2'+yh・2'+)'s・25+Ya・
2'+ys・2'+)'z・22+y1・2+)'.

と表現する。これらX、、Y、を次のように2項分解す
る。
Expressed as. These X,, Y, are decomposed into two terms as follows.

Xl = (X7・2’+X6・2n+X5’ 2 +
X4)2’+ (x3−23+x、・2n +xI・2
+xo)−XU・2’+XL Yl = (y−+・2 ’ + y 6・22+ys
・2+y4)2’+(y、・2’+)’z・22+yI
・2+)’o)”YLl・2 ’ + Y L 従って、積Pは、 P−X、  ・Yl ”Xu’ Yu・2n+(Xu−Yt + Xt、−YU)2’+XL−YL となる。2式でXu  −Yu 、  Xu  −Yt
 、  XL  ’YU、XL−YLは部分積を表して
おり、21′と24は桁上げ量を示している。ところで
、Xu。
Xl = (X7・2'+X6・2n+X5' 2 +
X4) 2'+ (x3-23+x, ・2n +xI・2
+xo)-XU・2'+XL Yl = (y-+・2' + y 6・22+ys
・2+y4)2'+(y,・2'+)'z・22+yI
・2+)'o)"YLl・2' + Y L Therefore, the product P is P-X, ・Yl "Xu' Yu・2n+(Xu-Yt + Xt, -YU)2'+XL-YL. In the two equations, Xu -Yu, Xu -Yt
, XL'YU, XL-YL represent partial products, and 21' and 24 represent carry amounts. By the way, Xu.

XL、¥CI、YLは各ビットの2進データであり、0
≦X、、XL、Y、、YL≦15である。従って、0≦
Xu  −Yu 、Xu  ・YL、Xl、  −Yu
 。
XL, ¥CI, YL are binary data of each bit, 0
≦X, XL, Y, YL≦15. Therefore, 0≦
Xu -Yu, Xu ・YL, Xl, -Yu
.

XL−YL≦225であり、8ビツトで表現できる。そ
こで、4ビツト×4ビツトの乗算後の8ビツトの値を、
ROMの被乗数と乗数の合成アドレス番地に収納してお
けば、それを読出すだけでXu・Yu 、 Xu −Y
L、 XL −Yu 、 Xt −Ytの値が得られる
。このROM2  (12)は第2図のようにコンピュ
ータ11の外につけてもよいし、また第5図のようにコ
ンピュータ11の中のROフロー図を第3図に示し、説
明する。まず、XIとYlをコンピュータのRAM上の
レジスタR。
XL-YL≦225 and can be expressed in 8 bits. Therefore, the 8-bit value after multiplication of 4 bits x 4 bits is
If you store it in the composite address of the multiplicand and multiplier in the ROM, just read it and you will get Xu・Yu, Xu -Y
The values of L, XL-Yu, and Xt-Yt are obtained. This ROM2 (12) may be installed outside the computer 11 as shown in FIG. 2, or the RO flow diagram inside the computer 11 as shown in FIG. 5 is shown and explained in FIG. First, store XI and Yl in register R on the computer's RAM.

とR1に取り込み(ステップH)、次にかけ算を4回行
なうために、ループ制御用のレジスタiに3を収納する
(ステップI)。次にXL+とYt+の合成アドレスを
出力してROMより乗算結果Xt+Yυを得て、レジス
タB3に収納する。以下、XuYt 、XL YLl 
、Xt YLについても同様に行ない、レジスタBt 
、B+ 、Beに乗算結果を収納する(ステップJ)。
is taken into R1 (step H), and then 3 is stored in the loop control register i in order to perform multiplication four times (step I). Next, the combined address of XL+ and Yt+ is output to obtain the multiplication result Xt+Yυ from the ROM and stored in register B3. Below, XuYt, XL YLl
, Xt YL, register Bt
, B+, and Be store the multiplication results (step J).

次に。next.

P−B0+B、・z’−+−Bz・2’+B、・2aの
加算をCPUで実行し、積Pの乗算結果を得る(ステッ
プK)。最後に、積Pをコンピュータの所定のボートか
ら出力して乗算が終了する(ステップL)。このように
、ROMとプログラムを結合することにより正数の乗算
が実行できる。
The CPU executes the addition of P-B0+B, .z'-+-Bz.2'+B, and 2a to obtain the multiplication result of the product P (step K). Finally, the product P is output from a predetermined port of the computer to complete the multiplication (step L). In this way, multiplication of positive numbers can be executed by combining the ROM and the program.

第4図に上記(E)のアルゴリズムを用いた、本実施例
の乗算装置による、2の補数表現形式のXとYの乗算の
プログラムフロー図を示す。ただしnwa 3とする。
FIG. 4 shows a program flow diagram for multiplication of X and Y in two's complement representation format by the multiplication device of this embodiment using the algorithm (E) above. However, it is set to nwa 3.

まず、被乗数Xと乗数YをレジスタR+、Rtに収納す
る(ステップA)。次に、x3を反転させてXIを、y
、を反転させてY。
First, the multiplicand X and the multiplier Y are stored in registers R+ and Rt (step A). Next, invert x3 to obtain XI, y
, reverse it and press Y.

を作成し、レジスタRs、R4に収納する(ステップB
)。次にXl、Y、を反転させてXl、Ylとし、レジ
スタR5とR6に収納する(ステップC)。X、とY、
を加算して、レジスタR1に収納する(ステップD)。
is created and stored in registers Rs and R4 (Step B
). Next, Xl and Y are inverted to become Xl and Yl, and stored in registers R5 and R6 (step C). X, and Y,
are added and stored in register R1 (step D).

XlとYlを第3図のフロー図に従って乗算し、その結
果をレジスタReに収納する(ステップE)Reと、R
1を27倍したものと、定数4100(16進)とを加
算して、積Pを求める(ステップF)。積Pを予め決め
られたコンピュータの入出力ボートに出力する(ステッ
プG)。
Multiply Xl and Yl according to the flowchart in FIG. 3, and store the result in register Re (step E) Re and R
1 multiplied by 27 and a constant 4100 (hexadecimal) are added to obtain the product P (step F). The product P is output to a predetermined computer input/output port (step G).

以上のように本発明によれば上記(A)〜(E)の乗算
アルゴリズムを用いることによって2の補数表示形式の
データの乗算が実現できる。
As described above, according to the present invention, multiplication of data in two's complement display format can be realized by using the multiplication algorithms (A) to (E) above.

なお、上記実施例ではn=8の8×8ビット乗算器を例
に説明したが、一般的なnXmビット乗算器についても
、本発明の主旨を通用して同様に実現できる。
Although the above embodiment has been described using an 8×8 bit multiplier with n=8 as an example, a general nXm bit multiplier can also be implemented in the same manner by applying the gist of the present invention.

〔発明の効果〕〔Effect of the invention〕

以上のように、この発明によれば、2の補数表示形式の
被乗数と乗数を正数化する正数化手段と、正数を乗算す
る正数乗算手段と、上記正数化に伴い乗算補正を行なう
乗算補正手段と、正数乗算手段及び乗算補正手段の出力
を加算する加算手段とを備え、上記被乗数と乗数の積を
所定の式に従って計算するようにしたので、2つの補数
表現形式の乗算をソフトウェア又はソフトウェアとRO
Mとの結合により実現できる効果がある。
As described above, according to the present invention, there is provided a positive number conversion means for converting a multiplicand and a multiplier in a two's complement representation format into positive numbers, a positive number multiplication unit for multiplying a positive number, and a multiplication correction accompanying the conversion to a positive number. and an addition means that adds the outputs of the positive number multiplication means and the multiplication correction means, and calculates the product of the multiplicand and the multiplier according to a predetermined formula. Multiplication in software or software and RO
There are effects that can be achieved by combining with M.

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

第1図は本発明の一実施例による乗算装置の機能ブロッ
ク図、第2図は上記実施例のハード構成図、第3図は上
記実施例の正数乗算手段によるROMを使用した乗算の
プログラムフロー図、第4図は上記実施例による乗算の
プログラムフロー図、第5図は本発明の他の実施例によ
る乗算装置のハード構成図、第6図は従来例のプログラ
ムフロー図である。 1・・・正数化手段、2・・・正数乗算手段、3・・・
乗算補正手段、4・・・加算手段、11・・・コンピュ
ータ、11 a−・・CPU、12・・・ROM変換テ
ーブル(ROM2)。
FIG. 1 is a functional block diagram of a multiplication device according to an embodiment of the present invention, FIG. 2 is a hardware configuration diagram of the above embodiment, and FIG. 3 is a multiplication program using ROM by the positive number multiplication means of the above embodiment. FIG. 4 is a program flow diagram of multiplication according to the above embodiment, FIG. 5 is a hardware configuration diagram of a multiplication device according to another embodiment of the present invention, and FIG. 6 is a program flow diagram of a conventional example. 1... Positive number conversion means, 2... Positive number multiplication means, 3...
Multiplication correction means, 4... Addition means, 11... Computer, 11 a-... CPU, 12... ROM conversion table (ROM2).

Claims (2)

【特許請求の範囲】[Claims] (1)コンピュータで2の補数表示形式の被乗数X(n
ビット)と乗数Y(mビット)の乗算を行なう乗算装置
において、 2の補数表示形式のデータを正数化する正数化手段と、 正数を乗算する正数乗算手段と、 該正数乗算手段の乗算補正を行なう乗算補正手段と、 上記正数乗算手段の出力と上記乗算補正手段の出力とを
加算する加算手段とを備え、 X及びYを X=(1−x_s)2^n^−^1+Σ^n^−^2_
i_=_0x_i・2^i−2^n^−^1=X_1−
2^n^−^1 Y=(1−y_s)2^n^−^1+Σ^m^−^2_
j_=_0y_j・2^j−2^m^−^1=Y_1−
2^m^−^1 ただし、 x_sとy_sは極性符号、x_iとy_iは数値符号
と変形して、積P(=X・Y)を次式 P=X_1・Y_1+@X@_1・2^m^−^1+@
Y@_1・2^n^−^1+2^m^−^1+2^n^
−^1+2^m^+^n^−^2ただし、 @X@_1はX_1の1の補数、@Y@_1はY_1の
1の補数に従って計算することを特徴とする乗算装置。
(1) The multiplicand X(n
A multiplication device that multiplies a multiplier Y (m bits) by a multiplier Y (m bits), comprising: a positive number converting means for converting data in two's complement display format into a positive number; a positive number multiplying means for multiplying by a positive number; and the positive number multiplication device. A multiplication correction means for performing multiplication correction of the means, and an addition means for adding the output of the positive number multiplication means and the output of the multiplication correction means, and -^1+Σ^n^-^2_
i_=_0x_i・2^i-2^n^-^1=X_1-
2^n^-^1 Y=(1-y_s)2^n^-^1+Σ^m^-^2_
^_=_0y_j・2^^j−2^m^−^1=Y_1−
2^m^-^1 However, x_s and y_s are polar signs, x_i and y_i are numerical signs, and the product P (=X・Y) is expressed as the following formula: P=X_1・Y_1+@X@_1・2^ m^−^1+@
Y@_1・2^n^-^1+2^m^-^1+2^n^
-^1+2^m^+^n^-^2 However, @X@_1 is calculated according to the one's complement of X_1, and @Y@_1 is calculated according to the one's complement of Y_1.
(2)上記正数乗算手段は、その被乗数と乗数を各々2
つ以上の数値の和に分解し、各分解値の部分積を加算し
て乗算を行なうもので、各分解値による部分積の計算を
ROM変換テーブルを用いて行なうものであることを特
徴とする特許請求の範囲第1項記載の乗算装置。
(2) The above positive number multiplication means each sets the multiplicand and the multiplier to 2
It is characterized in that it decomposes into the sum of two or more numerical values, adds the partial products of each decomposed value, and performs multiplication, and the calculation of the partial product by each decomposed value is performed using a ROM conversion table. A multiplication device according to claim 1.
JP60174488A 1985-08-08 1985-08-08 Multiplying device Pending JPS6234235A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60174488A JPS6234235A (en) 1985-08-08 1985-08-08 Multiplying device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60174488A JPS6234235A (en) 1985-08-08 1985-08-08 Multiplying device

Publications (1)

Publication Number Publication Date
JPS6234235A true JPS6234235A (en) 1987-02-14

Family

ID=15979357

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60174488A Pending JPS6234235A (en) 1985-08-08 1985-08-08 Multiplying device

Country Status (1)

Country Link
JP (1) JPS6234235A (en)

Similar Documents

Publication Publication Date Title
JPS60164837A (en) Divider
JPH0713741A (en) Alpha resultant conputing element
JPH0474219A (en) High speed multiplier
JPH02100717A (en) Fixed decimal point division system
JPS6234235A (en) Multiplying device
JPS6247740A (en) Multiplying device
JP3190826B2 (en) Product-sum operation unit
JPS6222178A (en) Multiplier for multiplying two complex numbers
JP2529890B2 (en) Multiplicative remainder calculator
JPS62232028A (en) Rom type multiplier
JPH0225924A (en) Floating point arithmetic processor
JPH0784762A (en) Multiplication circuit
JP3197186B2 (en) Multiplication device using semiconductor memory
JPH0778748B2 (en) Galois field arithmetic unit
SU1541599A1 (en) Matrix computing device
JPS62214435A (en) Digital dividing circuit
JPH06314979A (en) Galois field multiplier circuit
JP2568608B2 (en) Multiplication circuit
JPS63623A (en) Multiplier
JPH04177529A (en) Dividing and multiplying circuit
JPS62211773A (en) Simultaneous equations solving circuit
JPS63310023A (en) Fixed decimal point multiplier with sign
JPH0554160A (en) Function generating method and general function generator for its method
JPH0651949A (en) Multiplexer circuit
JPS60247735A (en) Decimal multiplying circuit