JPS58129654A - Multiplication system - Google Patents

Multiplication system

Info

Publication number
JPS58129654A
JPS58129654A JP1162782A JP1162782A JPS58129654A JP S58129654 A JPS58129654 A JP S58129654A JP 1162782 A JP1162782 A JP 1162782A JP 1162782 A JP1162782 A JP 1162782A JP S58129654 A JPS58129654 A JP S58129654A
Authority
JP
Japan
Prior art keywords
operand
register
length
gate
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
JP1162782A
Other languages
Japanese (ja)
Inventor
Masaharu Fukuda
福田 雅晴
Yoshio Oshima
大島 喜男
Suketaka Ishikawa
石川 佐孝
Toru Otsuki
大築 徹
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP1162782A priority Critical patent/JPS58129654A/en
Publication of JPS58129654A publication Critical patent/JPS58129654A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/52Multiplying; Dividing

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)

Abstract

PURPOSE:To execute multiplication with a multiplying time proportional to a smaller value between the 1st operand length - 2nd operand length and the 2nd operand length, by determining a multiplier and a multiplicand from the compared result between the 1st operand length - the 2nd operand length and the 2nd operand length. CONSTITUTION:It is defined that the variable length of an operand (OP) 1 specified by the 1st address is L1 and the variable length of an operand (OP) 2 specified by the 2nd address is L2. If L1-L2<L2, a comparator 5 opens AND gates 6-8 through a line 5a, so that the value of L1-L2 is set up in a control counter 15 through the AND gate 6 and an OR gate 12, the OP2 is set up in a multiplicand register 17 through the AND gate 6 and an OR gate 13 and the OP1 is set up in a multiplier register 17 through the AND gate 8 and an OR gate 14. When L1-L2>=L2, the OP1 and the OP2 are set up in the multiplicand register 16 and the multiplier register 17 respectively.

Description

【発明の詳細な説明】 本発明は、特に乗算命令の冥行時間を短縮した乗算方式
に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention particularly relates to a multiplication method that reduces the processing time of multiplication instructions.

第1アドレスで指定された可変長のオペランド(以下O
P1と略しオペランド長をLlとする)が第2アドレス
で指定された可変長のオペランド(以下UP2と略しオ
ペランド長をL2とする)の長さに等しい上位ゼロのバ
イトを持ち、該OP1がOF2によって乗算され、積が
OIMの記憶場所中、右によせて格納される乗算におい
て、従来は無条件にOPlを被乗数、UF4を乗数とし
ていた。この場合1乗算はこの乗数をビット走査し、被
乗数の倍数を選択し加算する加算サイクルを繰り返すこ
とにより実施する。
The variable length operand specified by the first address (hereinafter O
OP1 has a high-order zero byte equal to the length of the variable-length operand (hereinafter abbreviated as UP2, the operand length is L2) specified by the second address, and OP1 is OF2. In the multiplication in which the product is stored in the memory location of OIM, shifted to the right, conventionally, OPl was unconditionally used as the multiplicand and UF4 as the multiplier. In this case, multiplication by 1 is carried out by bit-scanning this multiplier, selecting a multiple of the multiplicand, and repeating an addition cycle in which they are added.

乗算時間は、この加算サイクル数と比例するたぬ、OF
2のオペランド長L2に比例する。
The multiplication time is proportional to the number of addition cycles.
It is proportional to the operand length L2 of 2.

()PlのLlの長さに等しい上位ゼロを除く有効デー
タ長は、Ll−Llであり、Ll−Ll<Llの場合、
OPlを乗数とし、OF2を被乗数として乗数のビット
走査による乗算を実施すれば1乗算時間はLl−Llに
比例する。
The effective data length of ()Pl excluding high-order zeros, which is equal to the length of Ll, is Ll-Ll, and if Ll-Ll<Ll,
If OPl is used as a multiplier and OF2 is used as a multiplicand and multiplication is performed by bit scanning of the multiplier, the time for one multiplication is proportional to Ll - Ll.

しかし従来は、無条件にOPlを被乗数、OF2を乗数
として乗数のビット走査による乗算を実施していたため
、Ll−Ll<Llの場合でも。
However, conventionally, multiplication by bit scanning of the multiplier was performed unconditionally using OPl as the multiplicand and OF2 as the multiplier, even when Ll-Ll<Ll.

乗算時間はLlに比例し、OPlを乗数とした場合の乗
算時間がLl−Llに比例するのと比べて。
The multiplication time is proportional to Ll, compared to the multiplication time when OPl is the multiplier, which is proportional to Ll - Ll.

より大きな乗算時間を要していた。It required more multiplication time.

本発明の目的は、上記の如き従来の問題点を除去するも
のであり、Ll−LlあるいはLlのうち小さい方に比
例した乗算時間で乗算を実施する乗算方式を提供するこ
とにある。
An object of the present invention is to eliminate the above-mentioned conventional problems, and to provide a multiplication method that performs multiplication in a multiplication time proportional to the smaller of Ll - Ll or Ll.

本発明は、Ll−LlとLlの比較結果により1乗数お
よび被乗数を決定する。即ちLl−Ll<Llの場合は
OPlを乗数、OF2を被乗数どし、L1L2≧L2の
場合はOPlを被乗数、OF2を乗数とする。
The present invention determines the first multiplier and the multiplicand based on the comparison result between Ll-Ll and Ll. That is, when Ll-Ll<Ll, OPl is used as a multiplier and OF2 is used as a multiplicand, and when L1L2≧L2, OPl is used as a multiplicand and OF2 is used as a multiplicand.

こうして1乗数ビット走査による乗算を実施することに
より、Ll−LlあるいはLlのうち小さい方に比例し
た乗算時間で乗算を実施することを可能とする。
By performing multiplication by scanning one multiplier bit in this manner, it is possible to perform multiplication in a multiplication time proportional to the smaller of Ll-Ll or Ll.

以下、本発明を実施例を用いて詳細(説明する。Hereinafter, the present invention will be explained in detail using examples.

図は1本発明の一実施例を示すブロック図である。図に
おいて、比較器502つの入力にはLlを保持するレジ
スタ1の出力と、Ll−Llを保持するレジスタ2の出
力が入力される、この比較器5の71,1−Ll<Ll
の場合の出力信号は線5aを介してアンドゲート6.7
.8にそれぞれ入力される。アンドグー)6.7.8の
それぞれのもう1つの入力には、それぞれLl−Llを
保持するレジスタ2の出力、OF2を保持するレジスタ
4の出力、OPlを保持するレジスタ3の出力が入力さ
れる。一方、比較器5のLl−L2≧L2の場合の出力
信号は、、115.6を介してアンドゲート9 、10
. IIKそれぞれ入力される。アンドグー)9.10
.11のそれぞれのもう1つの入力には、それぞれLl
を保持するレジスタ1の出力。
The figure is a block diagram showing an embodiment of the present invention. In the figure, the output of register 1 holding Ll and the output of register 2 holding Ll-Ll are input to two inputs of comparator 50, 71,1-Ll<Ll
The output signal for the case is connected to the AND gate 6.7 via line 5a.
.. 8 respectively. The output of register 2 that holds Ll-Ll, the output of register 4 that holds OF2, and the output of register 3 that holds OPl are input to each other input of 6.7.8. . On the other hand, when Ll-L2≧L2, the output signal of the comparator 5 is passed through the AND gates 9 and 10 through 115.6.
.. IIK are respectively input. Ando Goo) 9.10
.. Another input for each of the 11
The output of register 1 that holds .

OP Iを保持するレジスタ5の出力、OF2を保持す
るレジスタ4の出力が人力される。そしてオアゲート1
202つの入力には、アンドゲート6の出力およびアン
ドゲート9の出力が入力され、オアゲート13の2つの
入力には、アンドゲート7の出力およびアンドゲート1
0の出力が人力され、オアゲート1402つの入力には
、アンドゲート8の出力およびアンドゲート11の出力
が人力される。またオアグー)12.15.14のそれ
ぞれの出力は、それぞれ制御カウンタ15゜被乗数を保
持するレジスタ161乗数を保持するレジスタ17へ入
力される。
The output of register 5 holding OP I and the output of register 4 holding OF2 are input manually. and or gate 1
The output of AND gate 6 and the output of AND gate 9 are input to two inputs of 20, and the output of AND gate 7 and the output of AND gate 1 are input to two inputs of OR gate 13.
The output of 0 is input manually, and the output of AND gate 8 and the output of AND gate 11 are input to the two inputs of OR gate 140. The outputs of the control counters 12, 15, and 14 are input to a control counter 15, a register 161 that holds the multiplicand, and a register 17 that holds the multiplier.

被乗数の倍数選択回路19では、被乗数レジスタ16の
出力より作成された被乗数の倍数が乗数レジスタ17の
下位ビットにより選択され、該倍数選択回路19の出力
は加算器2101つの入力となる。
In the multiplicand multiple selection circuit 19, a multiple of the multiplicand created from the output of the multiplicand register 16 is selected by the lower bits of the multiplier register 17, and the output of the multiple selection circuit 19 becomes an input of one adder 210.

レジスタ18には前回の加算サイクルの加算結果を保持
するレジスタ22の上位部分が入力され。
The upper part of the register 22 that holds the addition result of the previous addition cycle is input to the register 18.

該レジスタ18の出力は前記加算器21の1つの入力と
なる。乗数レジスタ+7の内容はシフト回路20を介し
て右シフトされ、該乗数レジスタ17の上位部分には前
記加算結果を保持するレジスタ22の下位部分が入力さ
れる。
The output of the register 18 becomes one input of the adder 21. The contents of the multiplier register +7 are shifted to the right via a shift circuit 20, and the upper part of the multiplier register 17 receives the lower part of the register 22 that holds the addition result.

以上の装置は以下のように動作する。まず。The above device operates as follows. first.

Ll−Ll<Llの場合には、比較器5は線5αを介し
てアンドゲート6.7.8を開き、制御カウンタ15に
はアンドゲート6およびオアゲート+2を介してLl−
L20位がセットされ、II乗数レジスタ16にはアン
ドゲート7およびオアゲート13を介してOF2がセッ
トされ1乗数レジスタ+74Cはアンドゲート8および
オアゲート14を介してOP jがセットされる・ 最初の加算サイクルにおいて1倍数選択回路19では、
被乗数レジスタ16にセットされたOF2より作成され
たOF20倍数が乗数レジスタ17にセットされたOP
lの下位n(nは整数)ビットにより選択され、該倍数
選択回路19で選択されたOF2の倍数は加算器21へ
入力される。
If Ll-Ll<Ll, comparator 5 opens AND gate 6.7.8 via line 5α and control counter 15 receives Ll- via AND gate 6 and OR gate +2.
The L20th place is set, OF2 is set in II multiplier register 16 via AND gate 7 and OR gate 13, and OP j is set in 1 multiplier register +74C via AND gate 8 and OR gate 14. First addition cycle In the 1 multiple selection circuit 19,
OP in which the OF20 multiple created from OF2 set in the multiplicand register 16 is set in the multiplier register 17
The multiple of OF2 selected by the lower n bits (n is an integer) of l and selected by the multiple selection circuit 19 is input to the adder 21.

一方、レジスタ18の初期値はOK上セツトれており、
加算器21の他の入力に対しては10′′が入力される
。加算結果はレジスタ22にセットされ。
On the other hand, the initial value of register 18 is set to OK,
10'' is input to the other input of the adder 21. The addition result is set in register 22.

該レジスタ22の下位nビットを除く上位部分は前記レ
ジスタ18にセットされ1次の加算サイクルにおいて加
算器2101つの入力となる。前記乗数レジスタ17に
保持されたOPlはシフト回路20ヲ介してnビット右
シフトされ、該乗数レジスタ17の上位nビットに対し
ては前記加算結果を保持てるレジスタ22の下位nビッ
トがセットされる。これで最初の加算サイクルが終了す
る、 以後、同様な加算サイクルなLl−+2の長さを持つO
Plの有効データが前記乗数レジスタ17から全部右シ
フトされ失われるまで繰り返す。
The upper part of the register 22 excluding the lower n bits is set in the register 18 and becomes one input to the adder 210 in the first addition cycle. OPl held in the multiplier register 17 is shifted to the right by n bits via a shift circuit 20, and the lower n bits of the register 22 holding the addition result are set for the upper n bits of the multiplier register 17. . This completes the first addition cycle. From then on, similar addition cycles are performed using O with length Ll-+2.
Repeat until the valid data of Pl is all right-shifted and lost from the multiplier register 17.

最終結果すなわち乗算の積は前記レジスタ18及び前記
乗数レジスタ17の上位部分に得られる。
The final result, ie the product of the multiplication, is obtained in the upper part of said register 18 and said multiplier register 17.

れたOPlの下位をビット走査することにより実施し、
制御カウンタ15にセットされたOPlの有効データ長
L1−L2に比例した加算サイクルを実施後完了する。
This is carried out by scanning the lower bits of the OPl,
After performing an addition cycle proportional to the effective data length L1-L2 of OPl set in the control counter 15, the process is completed.

一方、L1−L2≧L2の場合には、比較器5は線5b
を介してアンドゲート9.IO,I+を開き、制御カウ
ンタ15にはアンドゲート9およびオアゲート12を介
して+2がセットされ、被乗数レジスタ16にはアンド
ゲート10およびオアゲート13を介してOPlがセッ
トされ1乗数レジスタ17にはアンドゲート11および
オアゲート14を介してOF2がセットされる。従って
、Ll−+2<+2の場合と同様に乗算は1乗数レジス
タ17にセットされたOF2の下位をビット走査するこ
とにより実施し、制御カウンタ15にセットされたOF
2のデータ長L2に比例した加算サイクルを実施後完了
する。
On the other hand, in the case of L1-L2≧L2, the comparator 5
via andgate9. IO, I+ are opened, +2 is set in the control counter 15 via AND gate 9 and OR gate 12, OPl is set in multiplicand register 16 via AND gate 10 and OR gate 13, and AND is set in 1 multiplier register 17. OF2 is set via gate 11 and OR gate 14. Therefore, as in the case of Ll-+2<+2, multiplication is performed by scanning the lower bits of OF2 set in the 1 multiplier register 17, and the OF2 set in the control counter 15 is
After performing an addition cycle proportional to the data length L2 of 2, the addition cycle is completed.

従って、Ll−+2〈+2の場合には、Ll−+2に比
例した加算サイクルで乗算を実施でき、Ll−+2≧L
2の場合にはL2Vc比例した加算サイクルで乗算を実
施できる。
Therefore, if Ll-+2<+2, multiplication can be performed in addition cycles proportional to Ll-+2, and Ll-+2≧L
2, the multiplication can be performed in addition cycles proportional to L2Vc.

以上の如く1本発明によれば、Ll−+2あるいは+2
のうち小さい方に比例した乗算時間で乗算を実施するこ
とができるので高速に乗算を実施することができる。
As described above, according to the present invention, Ll-+2 or +2
Since the multiplication can be performed in a multiplication time proportional to the smaller of the two, the multiplication can be performed at high speed.

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

図は1本発明の一実施例を示すブロック図である。 1・・・+2を保持するレジスタ 2・・・Ll−+2を保持するレジスタ5・・・OPl
を保持するレジスタ 4・・・OF2を保持するレジスタ 5・・・比較器 6〜11・・・アンドゲート 12へ14・・・オアゲート +5・・・制御カウンタ 16・・・被乗数を保持するレジスタ 17・・・乗数を保持するレジスタ 18 、22・・・レジスタ 19・・・倍数選択回路 20・・・シフト回路 21・・・加算器
The figure is a block diagram showing an embodiment of the present invention. 1...Register 2 for holding +2...Register 5 for holding Ll-+2...OPl
Register 4 to hold OF2...Register 5 to hold OF2...Comparators 6 to 11...To AND gate 12 14...OR gate +5...Control counter 16...Register 17 to hold multiplicand ...Registers 18 and 22 that hold multipliers...Register 19...Multiple selection circuit 20...Shift circuit 21...Adder

Claims (1)

【特許請求の範囲】 1、 乗算を指定する命令の第1アドレスで指定された
可変長のオペランド(以後第1オペランドと略す)が第
2アドレスで指定された可変長のオペランド(以後第2
オペランドと略す)の長さに等しい上位ゼロのバイトを
持ち。 前記第1オペランドと前記第2オペランドによる乗算の
積が第1オペランドの記憶場所中。 右によせて格納される乗算方式において、前記第1オペ
ランドと第2オペランドの長さの差と前記第2オペラン
ドの長さを比較する手段を具備し、当該比較手段よりの
比較結果により前記2つのオペランドのうち被乗数とな
るオペランドと乗数となるオペランドをそれぞれ決定す
るようにしたことを特徴とする乗算方式。 2、特許請求の範囲第1項記載の乗算方式において、第
2オがランドの長さと、第1オペランドと第2オペラン
ドの長さの差の比較結果において、前者の長さが大きい
場合は、第1オペランドを乗数かつ第2オペランドを被
乗数とし、後者の長さが等しいもしくは大きい場合は、
第2オペランドを乗数かつ第1オペランドを被乗数とす
ることを%徴とする乗算方式。
[Claims] 1. The variable length operand specified by the first address (hereinafter referred to as the first operand) of an instruction specifying multiplication is the variable length operand specified by the second address (hereinafter referred to as the second operand).
with a high-order zero byte equal to the length of the operand (abbreviated as operand). The product of the multiplication by the first operand and the second operand is in the memory location of the first operand. In the right-shifted multiplication method, the method includes means for comparing the difference in length between the first and second operands with the length of the second operand, and the second A multiplication method characterized in that an operand serving as a multiplicand and an operand serving as a multiplier are determined respectively among two operands. 2. In the multiplication method described in claim 1, in the comparison result of the difference between the length of the second operand and the length of the first operand and the second operand, if the length of the former is larger, If the first operand is a multiplier and the second operand is a multiplicand, and the lengths of the latter are equal or larger, then
A multiplication method in which the second operand is the multiplier and the first operand is the multiplicand.
JP1162782A 1982-01-29 1982-01-29 Multiplication system Pending JPS58129654A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1162782A JPS58129654A (en) 1982-01-29 1982-01-29 Multiplication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1162782A JPS58129654A (en) 1982-01-29 1982-01-29 Multiplication system

Publications (1)

Publication Number Publication Date
JPS58129654A true JPS58129654A (en) 1983-08-02

Family

ID=11783163

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1162782A Pending JPS58129654A (en) 1982-01-29 1982-01-29 Multiplication system

Country Status (1)

Country Link
JP (1) JPS58129654A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5569849A (en) * 1978-11-22 1980-05-26 Toshiba Corp Multiplication control system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5569849A (en) * 1978-11-22 1980-05-26 Toshiba Corp Multiplication control system

Similar Documents

Publication Publication Date Title
US8473719B2 (en) Data packet arithmetic logic devices and methods
JPH07506444A (en) small multiplier
JPH0477338B2 (en)
JP3345894B2 (en) Floating point multiplier
US4677582A (en) Operation processing apparatus
JP3271120B2 (en) Device for fast multiplication of binary numbers
JPS63198125A (en) Multiplication circuit
JPS58129654A (en) Multiplication system
US4546447A (en) Division apparatus
JP2579321B2 (en) Binary processing unit
JPS6259828B2 (en)
JP2591250B2 (en) Data processing device
JPS63111535A (en) Data processor
JPH0313624B2 (en)
JPS60167030A (en) System and circuit for shift flag generation
JPS59184944A (en) Rounding arithmetic system
JPH09101877A (en) Operation method and device for multipilcation
JP3696669B2 (en) Comparator mechanism and comparator
JPS62209621A (en) Multiplying device
SU857979A1 (en) Computing device for rotating vector
JPS61177540A (en) Control circuit for string data
JPH0317738A (en) Arithmetic processor
SU558276A1 (en) A device for simultaneously performing addition operations on a set of numbers
SU682895A1 (en) Apparatus for computing exponential functions
JPH02126322A (en) Information processor