JPS6224816B2 - - Google Patents

Info

Publication number
JPS6224816B2
JPS6224816B2 JP56189311A JP18931181A JPS6224816B2 JP S6224816 B2 JPS6224816 B2 JP S6224816B2 JP 56189311 A JP56189311 A JP 56189311A JP 18931181 A JP18931181 A JP 18931181A JP S6224816 B2 JPS6224816 B2 JP S6224816B2
Authority
JP
Japan
Prior art keywords
register
digit
digits
multiplicand
signal line
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
Application number
JP56189311A
Other languages
Japanese (ja)
Other versions
JPS5892037A (en
Inventor
Takafumi Yamada
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 JP18931181A priority Critical patent/JPS5892037A/en
Publication of JPS5892037A publication Critical patent/JPS5892037A/en
Publication of JPS6224816B2 publication Critical patent/JPS6224816B2/ja
Granted 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)

Description

【発明の詳細な説明】 本発明は演算処理装置に関し、詳しくは、2進
化10進数の乗算を行う装置の改良に関するもので
ある。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to an arithmetic processing device, and more particularly to an improvement in a device that performs multiplication of binary coded decimal numbers.

2進化10進数の乗算は、加算あるいは減算の繰
り返しにより行う方法が一般によく知られてい
る。この従来より一般に用いられている2進化10
進数の乗算を行う装置の構成例を第1図に示す。
第1図において、中間結果を格納するレジスタ1
と乗数を格納するレジスタ2は、信号線31,3
2により演算器5の入力に接続されている。演算
器5の出力は、信号線30により再びレジスタ1
に接続される。レジスタ1は信号線29によりシ
フタ4の入力にも接続され、シフタ4の出力は信
号線28により再びレジスタ1に接続される。被
乗数格納レジスタ3は、桁位置指示カウンタ8に
より任意の1桁が選択され、信号線23を介して
演算器6の一方の入力に接続される。レジスタ1
の最下位桁も、信号線33を介して演算器6の同
じ入力に接続される。演算器6のもう一方の入力
には、定数生成回路7により生成された定数が信
号線24を介して接続される。演算器6の出力は
信号線25を介し、レジスタ3内の、桁位置指示
カウンタ8により示される任意の桁に格納され
る。さらに演算器6の出力は、信号線26により
0検出回路12に接続され、0検出の結果は、信
号線27を介して制御装置13に与えられる。メ
モリ9は、乗数、被乗数が読み出され、積が書き
込まれるメモリであり、アドレス生成器10によ
り生成されたアドレスにより読み書きが可能であ
る。すなわち、レジスタ3の内容は、信号線36
を介してメモリ9に書き込むことができ、メモリ
9から読み出された内容は、信号線21を介して
レジスタ2に書き込まれたり、また、信号線22
を介してレジスタ3に書き込まれたりする。制御
回路13は、信号線群34を介しアドレス生成器
10、メモリ9の読み書き、レジスタ1、レジス
タ2、レジスタ3の入力、シフタ4、演算器5、
演算器6、定数生成回路7、および桁位置指示カ
ウンタ8を制御する。
It is generally well known that binary coded decimal numbers are multiplied by repeated addition or subtraction. This conventionally commonly used binary system 10
FIG. 1 shows an example of the configuration of a device that performs base number multiplication.
In Figure 1, register 1 stores intermediate results.
The register 2 that stores the multiplier and the signal line 31, 3
2 is connected to the input of the arithmetic unit 5. The output of the arithmetic unit 5 is sent to the register 1 again via the signal line 30.
connected to. Register 1 is also connected to the input of shifter 4 by signal line 29, and the output of shifter 4 is connected to register 1 again by signal line 28. An arbitrary digit of the multiplicand storage register 3 is selected by the digit position indicating counter 8 and is connected to one input of the arithmetic unit 6 via the signal line 23 . register 1
The least significant digit of is also connected to the same input of the arithmetic unit 6 via the signal line 33. A constant generated by a constant generation circuit 7 is connected to the other input of the arithmetic unit 6 via a signal line 24. The output of the arithmetic unit 6 is stored in an arbitrary digit indicated by the digit position indicating counter 8 in the register 3 via the signal line 25. Further, the output of the arithmetic unit 6 is connected to the 0 detection circuit 12 via a signal line 26, and the result of 0 detection is given to the control device 13 via a signal line 27. The memory 9 is a memory into which multipliers and multiplicands are read and products are written, and can be read and written using addresses generated by the address generator 10. That is, the contents of register 3 are transmitted to signal line 36.
The contents read from the memory 9 can be written to the register 2 via the signal line 21, and the contents read from the memory 9 can be written to the register 2 via the signal line 21.
It is written to register 3 via. The control circuit 13 controls the address generator 10, reading and writing of the memory 9, inputs to the register 1, register 2, and register 3, the shifter 4, the arithmetic unit 5,
It controls the arithmetic unit 6, constant generation circuit 7, and digit position instruction counter 8.

本演算処理装置の動作は、次に示す6つの実行
サイクルにより実行される。
The operation of this arithmetic processing device is executed by the following six execution cycles.

第1実行サイクルはメモリ9からの被乗数の読
み出しである。アドレス生成器10により生成さ
れたアドレスにより示される内容をメモリ9から
読み出し、信号線22を介して、レジスタ3に格
納する。
The first execution cycle is the reading of the multiplicand from memory 9. The contents indicated by the address generated by the address generator 10 are read from the memory 9 and stored in the register 3 via the signal line 22.

第2実行サイクルはメモリ9からの乗数の読み
出しである。アドレス生成器10により生成され
たアドレスにより示される内容をメモリ9から読
み出し、信号線21を介してレジスタ2に格納す
る。
The second execution cycle is the reading of the multiplier from memory 9. The contents indicated by the address generated by the address generator 10 are read from the memory 9 and stored in the register 2 via the signal line 21.

第3実行サイクルでは、桁位置指示カウンタ8
で示されるレジスタ3の1桁を演算器6の入力に
乗せる。定数生成回路7は、0を生成し、演算器
6のもう一方の入力に乗せる。演算器6は、加算
動作を行い、その結果を信号線26に出力する。
すなわち、信号線26には、レジスタ3の桁位置
指示カウンタ8で示される桁の内容がそのまま出
力される。
In the third execution cycle, the digit position instruction counter 8
1 digit of the register 3 shown by is placed on the input of the arithmetic unit 6. The constant generation circuit 7 generates 0 and puts it on the other input of the arithmetic unit 6. Arithmetic unit 6 performs an addition operation and outputs the result to signal line 26.
That is, the contents of the digit indicated by the digit position instruction counter 8 of the register 3 are output to the signal line 26 as they are.

第4実行サイクルは演算サイクルである。レジ
スタ1およびレジスタ2の内容は、それぞれ信号
線31,32を介して演算器5に入力され、加算
が行われる。結果は、信号線30を介してレジス
タ1に書き込まれる。同時に桁位置指示カウンタ
8により示されたレジスタ3の中の1桁が、演算
器6に入力される。演算器6および定数生成回路
7により、この値から1が減じられ、その結果は
信号線25を介して、ふたたびレジスタ3の中の
桁位置指示カウンタ8で示される桁に挿入され
る。
The fourth execution cycle is an arithmetic cycle. The contents of register 1 and register 2 are input to arithmetic unit 5 via signal lines 31 and 32, respectively, and addition is performed. The result is written to register 1 via signal line 30. At the same time, one digit in the register 3 indicated by the digit position indication counter 8 is input to the arithmetic unit 6. Arithmetic unit 6 and constant generation circuit 7 subtract 1 from this value, and the result is again inserted into the digit indicated by digit position indication counter 8 in register 3 via signal line 25.

第5実行サイクルは、求まつた積の1桁をレジ
スタ3に格納するサイクルである。レジスタ1内
の下位の1桁は、信号線33を介して演算器6に
入力され、定数生成回路7により生成された0と
加算が行われ、その結果は、信号線25を介して
レジスタ3の中の桁位置指示カウンタ8で示され
る桁に挿入される。その後、桁位置指示カウンタ
は1減じられ、次に処理すべき桁を指示する。
The fifth execution cycle is a cycle in which one digit of the determined product is stored in the register 3. The lower one digit in the register 1 is input to the arithmetic unit 6 via the signal line 33, where it is added to 0 generated by the constant generation circuit 7, and the result is sent to the register 3 via the signal line 25. It is inserted into the digit indicated by the digit position indication counter 8 in . Thereafter, the digit position indication counter is decremented by 1 to indicate the next digit to be processed.

第6実行サイクルは、求まつた積をメモリ9に
書き込むサイクルである。レジスタ3の内容は信
号線36を介し、メモリ9内のアドレス生成器1
0により生成されたアドレスで示される位置に書
き込まれる。
The sixth execution cycle is a cycle in which the determined product is written into the memory 9. The contents of register 3 are transmitted to address generator 1 in memory 9 via signal line 36.
It is written to the location indicated by the address generated by 0.

次に具体例により動作を詳細に説明する。第2
図は第1図の演算処理装置で(1002)×(0004)を
実行する時の、前述の実行サイクルの流れと、レ
ジスタ1,2,3の内容を示したものである。
Next, the operation will be explained in detail using a specific example. Second
The figure shows the flow of the aforementioned execution cycle and the contents of registers 1, 2, and 3 when (1002)×(0004) is executed by the arithmetic processing device of FIG.

演算に先立ち、中間結果格納レジスタ1は、全
桁が0に設定されていなければならない。これ
は、シフタ4あるいは演算器5の入力を強制的に
0とし、その値をレジスタ1に書き込むことによ
り容易に得られる。
Prior to the operation, all digits of intermediate result storage register 1 must be set to 0. This can be easily obtained by forcibly setting the input of the shifter 4 or the arithmetic unit 5 to 0 and writing that value to the register 1.

最初に、制御回路13はメモリ9およびアドレ
ス生成器10を制御し、前記第1実行サイクルを
実行し、これにより、レジスタ3には被乗数
(1002)が格納される。次に、第2実行サイクル
が起動され、乗数(0004)がレジスタ2に格納さ
れる。つづいて、第3実行サイクルが起動され、
レジスタ3内の最下位桁が演算器6を通して信号
線26に乗せられる。制御回路13は、この信号
線26の値が0かどうかで、次に第4実行サイク
ルを行うかどうかを決定する。第2図の例では、
信号線26の値が“2”であるので第4実行サイ
クルが起動される。第4実行サイクルは、信号線
26が0となるまで、制御回路13により、連続
して実行される。信号線26が0となると、第5
実行サイクルが実行され、レジスタ1の最下位に
求まつた積の1桁をレジスタ3に転送し、レジス
タ1を1桁分右にシフトする。その後、再び第3
実行サイクルが実行される。第2図の例では、レ
ジスタ3の2桁目が0であるので、信号線26は
0となり、今度は第5実行サイクルが起動され
る。以後、レジスタ3内の各々の桁について同様
の動作が繰り返される。レジスタ3のすべての桁
についての演算が終了すると、積がレジスタ3に
求まつているので、第6実行サイクルが起動さ
れ、メモリ10に積が書き込まれる。もし、被乗
数がレジスタ3に収まらない長さを持つているな
らば、被乗数の残りをメモリ9から読み出すべ
く、第1実行サイクルが起動され、以後、新しく
レジスタ3に取り込まれた被乗数についても、同
様の動作が繰り返される。
Initially, the control circuit 13 controls the memory 9 and the address generator 10 to execute the first execution cycle, whereby the multiplicand (1002) is stored in the register 3. Next, a second execution cycle is started and the multiplier (0004) is stored in register 2. Subsequently, a third execution cycle is started,
The least significant digit in the register 3 is passed through the arithmetic unit 6 and placed on the signal line 26. The control circuit 13 determines whether to perform the fourth execution cycle next depending on whether the value of the signal line 26 is 0 or not. In the example in Figure 2,
Since the value of the signal line 26 is "2", the fourth execution cycle is activated. The fourth execution cycle is continuously executed by the control circuit 13 until the signal line 26 becomes 0. When the signal line 26 becomes 0, the fifth
An execution cycle is executed, and one digit of the product found in the lowest register of register 1 is transferred to register 3, and register 1 is shifted to the right by one digit. Then again the third
A run cycle is executed. In the example of FIG. 2, the second digit of register 3 is 0, so the signal line 26 becomes 0, and the fifth execution cycle is started this time. Thereafter, similar operations are repeated for each digit in register 3. When the calculations for all digits of register 3 are completed, the product has been found in register 3, so a sixth execution cycle is started and the product is written into memory 10. If the multiplicand has a length that does not fit in register 3, the first execution cycle is started to read the remainder of the multiplicand from memory 9, and the same goes for the new multiplicand that has been taken into register 3. The operation is repeated.

以上、従来のやり方は、被乗数の桁の値が0で
あつても、0を検出するサイクルと求まつた積を
1桁転送するサイクルが必要である。演算におい
て、被乗数中に0が現われることに多々あり、上
記従来のやり方は性能向上の点で問題がある。
As described above, in the conventional method, even if the value of the digit of the multiplicand is 0, a cycle for detecting 0 and a cycle for transferring the calculated product by one digit are required. In calculations, 0 often appears in the multiplicand, and the conventional method described above has a problem in improving performance.

本発明の目的とするところは、上記の如き従来
の問題点を除去するものであり、2進化10進数の
乗算を行う時、被乗数の0の桁およびその桁数を
検出することにより、0の桁の演算をより高速に
行うという効果を有する演算処理装置を提供する
ことにある。
An object of the present invention is to eliminate the above-mentioned conventional problems, and to detect the 0 digit and the number of digits in the multiplicand when performing multiplication of binary coded decimal numbers. An object of the present invention is to provide an arithmetic processing device that has the effect of performing digit arithmetic at a higher speed.

しかして、本発明の特徴とするところは、演算
の途中で、被乗数の任意の位置から0の桁および
その桁数を検出し、その桁数により中間結果をシ
フトすることによつて、被乗数中の0の桁に伴う
積をより高速に求めるものである。
Therefore, the feature of the present invention is that the zero digit and its number of digits are detected from any position of the multiplicand during the calculation, and the intermediate result is shifted according to the number of digits. The product associated with the 0 digit can be found more quickly.

次に本発明の一実施例につき図面を用いて詳細
に説明する。
Next, one embodiment of the present invention will be described in detail using the drawings.

第3図は本発明の一実施例の構成図である。第
3図において、レジスタ3の出力は、信号線38
を介して0桁検出回路11に接続されている。さ
らに、桁位置指示カウンタ8は、信号線39を通
して0桁検出回路11に接続されている。0桁検
出回路11は、桁位置指示カウンタ8により示さ
れたレジスタ3の桁に0があるかどうかを示す信
号を、信号線40により制御回路13に送る。同
時に、0桁検出回路11は、連続した0の桁の桁
数を信号線41により制御回路13に送る。これ
ら以外の構成は第1図と同じである。
FIG. 3 is a block diagram of an embodiment of the present invention. In FIG. 3, the output of register 3 is connected to signal line 38.
It is connected to the 0 digit detection circuit 11 via. Further, the digit position indication counter 8 is connected to the 0 digit detection circuit 11 through a signal line 39. The zero digit detection circuit 11 sends a signal indicating whether or not there is a 0 in the digit of the register 3 indicated by the digit position indication counter 8 to the control circuit 13 via the signal line 40. At the same time, the zero digit detection circuit 11 sends the number of consecutive zero digits to the control circuit 13 via the signal line 41. The configuration other than these is the same as in FIG. 1.

本演算処理装置の特徴は、0桁検出回路11に
より、0の桁が連続している場合に従来の第3実
行サイクルが不要となつたことで、動作は、この
従来の第3実行サイクルを除いた次の5つの実行
サイクルにより行われる。即ち、第1実行サイク
ルはメモリ9からの被乗数の読み出しである。第
2実行サイクルはメモリ9からの乗数の読み出し
である。次に、ただちに第4実行サイクルの演算
サイクルに移り、演算器5によるレジスタ1およ
びレジスタ2の加算、および演算器6によるレジ
スタ3内の1桁の減算が行われる。第5実行サイ
クルは、求まつた積の1桁をレジスタ1の下位か
らレジスタ3に転送するサイクルである。第6実
行サイクルは、レジスタ3の中の求まつた積をメ
モリ10に書き込むサイクルである。
The feature of this arithmetic processing device is that the 0 digit detection circuit 11 eliminates the need for the conventional third execution cycle when there are consecutive 0 digits; This is performed by the next five execution cycles. That is, the first execution cycle is the reading of the multiplicand from the memory 9. The second execution cycle is the reading of the multiplier from memory 9. Next, the process immediately shifts to the fourth execution cycle, in which the arithmetic unit 5 adds registers 1 and 2, and the arithmetic unit 6 subtracts one digit in register 3. The fifth execution cycle is a cycle in which one digit of the determined product is transferred from the lower register of register 1 to register 3. The sixth execution cycle is a cycle in which the calculated product in the register 3 is written to the memory 10.

次に具体例により、本演算処理装置の動作を説
明する。第4図は(1002)×(0004)を実行する時
の、上記実行サイクルの流れと、レジスタ1,
2,3の内容を示したものである。
Next, the operation of the present arithmetic processing device will be explained using a specific example. Figure 4 shows the flow of the above execution cycle when executing (1002) x (0004), and the register 1,
This shows the contents of 2 and 3.

演算に先立ち、中間結果格納レジスタ1は、全
桁が0に設定されている。最初に、制御回路13
はメモリ9およびアドレス生成器10を制御し
て、前記第1実行サイクルを実行する。これによ
り、レジスタ3には、被乗数が格納される。次に
第2実行サイクルが起動され、乗数がレジスタ2
に格納される。
Prior to the operation, all digits of the intermediate result storage register 1 are set to 0. First, the control circuit 13
controls the memory 9 and address generator 10 to execute the first execution cycle. As a result, the multiplicand is stored in register 3. A second execution cycle is then started and the multiplier is set in register 2.
is stored in

次に、0桁検出回路11により、桁位置指示カ
ウンタ8により示された桁が0かどうかを検出
し、もし、0である桁が存在すれば、第5実行サ
イクルが行われ、0である桁が存在しなければ、
第4実行サイクルが行われる。第4図の例では、
最初、桁位置指示カウンタ8はレジスタ3の最右
端の桁を示しており、この場合、値が“2”であ
るので、第4実行サイクルが起動される。第4実
行サイクルは、信号線26が0となるまで、制御
回路13により連続して実行される。
Next, the 0 digit detection circuit 11 detects whether the digit indicated by the digit position indication counter 8 is 0 or not. If there is a digit that is 0, a fifth execution cycle is performed and the digit is 0. If the digit does not exist,
A fourth execution cycle is performed. In the example in Figure 4,
Initially, the digit position indication counter 8 indicates the rightmost digit of the register 3, and in this case, the value is "2", so the fourth execution cycle is started. The fourth execution cycle is continuously executed by the control circuit 13 until the signal line 26 becomes 0.

信号線26が0となると、第5実行サイクルが
実行され、レジスタ1の最下位に求まつた積の1
桁をレジスタ3に転送し、レジスタ1を1桁分右
にシフトする。
When the signal line 26 becomes 0, the fifth execution cycle is executed and 1 of the product found in the lowest register 1 is stored.
Transfer the digit to register 3 and shift register 1 to the right by one digit.

その後、再び0桁検出回路11により、次に第
4実行サイクルを実行するか第5実行サイクルを
実行するかが決定される。第4図の例では、桁位
置指示カウンタ8は、レジスタ3の右から2番目
の桁を示しており、この桁および次の桁が0であ
る。この結果は、信号線40によつて0桁が存在
することが、又、信号線41によつてその0桁数
が制御回路13に送出される。制御回路は、信号
線40によつて第5サイクルを実行し、又、信号
線41により、第5サイクルを連続して何サイク
ル実行するかを決める。第4図の例では、信号線
41により0桁の数“2”が送出されるので、第
5サイクルが2サイクル連続して実行される。
Thereafter, the 0 digit detection circuit 11 again determines whether to execute the fourth execution cycle or the fifth execution cycle. In the example of FIG. 4, the digit position indication counter 8 indicates the second digit from the right of the register 3, and this digit and the next digit are 0. As a result, the signal line 40 indicates that there is a 0 digit, and the signal line 41 sends the number of 0 digits to the control circuit 13. The control circuit executes the fifth cycle through a signal line 40, and determines how many consecutive cycles of the fifth cycle are to be executed through a signal line 41. In the example shown in FIG. 4, since the zero-digit number "2" is sent out through the signal line 41, the fifth cycle is executed two times in a row.

以後、レジスタ3内の各桁について、同様の動
作が繰り返される。
Thereafter, similar operations are repeated for each digit in register 3.

レジスタ3内の、すべての桁についての演算が
終了すると、積がレジスタ3に求まつているの
で、第6実行サイクルが起動され、メモリ10に
積が書き込まれる。その後、もし被乗数がレジス
タ3に収まらない長さを持つているならば、被乗
数の残りをメモリ10から読み出すべく、第1実
行サイクルが起動され、以後新しくレジスタ3に
取り込まれた被乗数についても、同様の動作が、
繰り返される。
When the operations for all digits in register 3 are completed, the product has been found in register 3, so a sixth execution cycle is started and the product is written into memory 10. Thereafter, if the multiplicand has a length that does not fit in register 3, a first execution cycle is started to read the remainder of the multiplicand from memory 10, and the same goes for any new multiplicands that are subsequently taken into register 3. The operation of
Repeated.

第2図と第4図を比較することにより明らかな
ように、第3図の如く0桁検出回路11を持つこ
とにより、0を検出するサイクル(前記、第3実
行サイクル)をそれぞれの桁ごとに実行する必要
がなくなり、被乗数に0を含む時の乗算を高速に
行うことができる。
As is clear from comparing FIG. 2 and FIG. 4, by having the 0 digit detection circuit 11 as shown in FIG. This eliminates the need to perform multiplication at high speed when the multiplicand includes 0.

第5図は、第3図中の0桁検出回路11の具体
的構成例を行したものである。レジスタ3および
桁位置指示カウンタ8は、第3図で説明したもの
と同じである。第5図では、レジスタ3は4桁分
の幅を持つているとしたが、一般には4桁より多
くても少くてもよい。桁位置指示カウンタ8は、
レジスタ3の4桁分の桁位置を指定できるように
2ビツトの幅を持つている。この桁位置指示カウ
ンタ8の幅も、レジスタ3の幅と同様に任意であ
る。
FIG. 5 shows a specific example of the configuration of the zero digit detection circuit 11 shown in FIG. The register 3 and digit position counter 8 are the same as those described in FIG. In FIG. 5, it is assumed that the register 3 has a width of four digits, but in general, the width may be more or less than four digits. The digit position instruction counter 8 is
It has a width of 2 bits so that the 4 digit positions of register 3 can be specified. The width of this digit position instruction counter 8 is also arbitrary like the width of the register 3.

第6図は、第5図の例での桁位置カウンタ8の
内容とレジスタ3の桁位置との対応を示したもの
である。第6図ではレジスタ3の左の桁から順に
(00)(01)(10)(11)として表わしている。この表現方
法は、レジスタ3の桁位置を明確に決めることの
できるコードであれば、どのようなコードでもよ
い。
FIG. 6 shows the correspondence between the contents of the digit position counter 8 and the digit positions of the register 3 in the example of FIG. In FIG. 6, the digits of register 3 are represented in order from the left as (00), (01), (10), and (11). This expression may be any code as long as it can clearly determine the digit position of register 3.

第5図に戻り、レジスタ3は信号線38を介
し、0検出回路50〜53に接続される。0検出
回路50〜53は各桁ごとに0を検出し、もし、
その桁が全て0であれば“1”を、そうでなけれ
ば“0”を、信号線72〜75に出力する。
NOTゲート55,56は、それぞれ、信号線7
2,73の否定をとり、信号線80,81に出力
する。
Returning to FIG. 5, the register 3 is connected to the 0 detection circuits 50 to 53 via the signal line 38. The 0 detection circuits 50 to 53 detect 0 for each digit, and if
If all the digits are 0, "1" is output, otherwise "0" is output to signal lines 72-75.
The NOT gates 55 and 56 are connected to the signal line 7, respectively.
2, 73 is negated and output to signal lines 80, 81.

一方、桁位置指示カウンタ8は、信号線39を
介してデコーダ54に接続されている。デコーダ
54は、デコード結果を信号線76〜49に出力
する。第6図には、デコーダ54の動作も示され
ている。即ち、第6図では、デコーダの入力を
b0,b1とし、出力をy0,y1,y2,y3としている。
y0〜y3は、それぞれ第5図中の信号線76〜79
に対応している。第6図に示すように、デコーダ
54は、入力(00)であればy0に1を、(01)で
あればy1に1を、(10)であればy2に(11)であればy3
に、それぞれ1を出力する。
On the other hand, the digit position instruction counter 8 is connected to the decoder 54 via a signal line 39. Decoder 54 outputs decoding results to signal lines 76-49. FIG. 6 also shows the operation of the decoder 54. That is, in Fig. 6, the input of the decoder is
b 0 and b 1 , and the outputs are y 0 , y 1 , y 2 , and y 3 .
y 0 to y 3 are signal lines 76 to 79 in FIG. 5, respectively.
It corresponds to As shown in FIG. 6, the decoder 54 sets 1 to y 0 if the input is (00), 1 to y 1 if the input is (01), and 1 to y 2 if the input is (10). If yes 3
Outputs 1 for each.

第5図の信号線72〜81は、ANDゲート5
7〜67およびORゲート68〜71で構成され
るゲート群に入力される。これらのゲート群は、
信号線40および信号線41を出力する。信号線
40および41は第3図で説明したものと同じで
ある。このうち、信号線41は、0である桁の数
を示すため、2本の信号線42および43で構成
されている。第5図の例では、レジスタ3の幅を
4桁としているので、連続した0の桁の数を表現
するには2ビツトあれば十分であるが、もしレジ
スタ3の幅が4桁より大きい時には、信号線41
は3本、あるいは、それより多くの信号線により
構成される。
The signal lines 72 to 81 in FIG.
7 to 67 and a gate group consisting of OR gates 68 to 71. These gate groups are
A signal line 40 and a signal line 41 are output. Signal lines 40 and 41 are the same as described in FIG. Among these, the signal line 41 is composed of two signal lines 42 and 43 in order to indicate the number of digits that are 0. In the example in Figure 5, the width of register 3 is 4 digits, so 2 bits are sufficient to represent the number of consecutive 0 digits, but if the width of register 3 is larger than 4 digits, then , signal line 41
consists of three or more signal lines.

第7図は、第5図で示した0桁検出回路の動作
を詳しく説明した図である。第7図では、桁位置
指示カウンタ8をb0,b1、第5図の信号線72〜
75をx0,x1,x2,x3、信号線41をc0,c1、信
号線40をdとして表現している。b0,b1
(00)のとき(y0=1)、x0が0であれば、乗数と
中間結果の加算サイクルが必要であるので、dは
0が出力される。x0が1であれば、0の桁が1桁
存在するわけであるから、c0,c1には(00)、d
には1が出力される。b0,b1が(01)のとき(y1
=1)、x1が0であれば、乗数と中間結果の加算
サイクルが必要であるので、dには0が出力され
る。x1が1でx0が0のときには、0の桁が1桁存
在するので、c0,c1には(00)、dには1が出力
される。x1が1でx0も1であれば、0の桁が2桁
存在するので、c0,c1には(01)が、dには1が
出力される。b0,b1が(10)(y2=1)(11)(y3=1)
の場合にも、同様に、0の桁が存在する時には、
dには1、存在しない時には、dには0が出力さ
れ、0の桁が存在する時、c0,c1には、1桁が0
のときは(00)、連続した2桁が0のときは
(01)、連続した3桁が0のときは(10)、連続した4
桁が0のときには(11)が出力される。これらの条件
はANDゲート57〜67、ORゲート68〜71
でとられる。
FIG. 7 is a diagram illustrating in detail the operation of the 0-digit detection circuit shown in FIG. 5. In FIG. 7, the digit position instruction counter 8 is connected to b 0 , b 1 , and the signal lines 72 to 72 in FIG.
75 is expressed as x 0 , x 1 , x 2 , x 3 , the signal line 41 is expressed as c 0 , c 1 , and the signal line 40 is expressed as d. When b 0 and b 1 are (00) (y 0 =1), if x 0 is 0, d is output as 0 because an addition cycle of the multiplier and the intermediate result is required. If x 0 is 1, there is one 0 digit, so c 0 and c 1 have (00), d
1 is output. When b 0 and b 1 are (01) (y 1
= 1), if x 1 is 0, a 0 is output to d because an addition cycle of the multiplier and the intermediate result is required. When x 1 is 1 and x 0 is 0, there is one 0 digit, so (00) is output to c 0 and c 1 and 1 is output to d. If x 1 is 1 and x 0 is also 1, there are two 0 digits, so (01) is output to c 0 and c 1 and 1 is output to d. b 0 and b 1 are (10) (y 2 = 1) (11) (y 3 = 1)
Similarly, when there is a 0 digit,
1 is output to d, when it does not exist, 0 is output to d, and when 0 digit exists, 1 digit is 0 in c 0 and c 1 .
(00) if two consecutive digits are 0, (01) if two consecutive digits are 0, (10) if three consecutive digits are 0, consecutive 4
When the digit is 0, (11) is output. These conditions are AND gates 57-67 and OR gates 68-71.
It is taken by

このようにして、出力された信号線40および
41の状態を用い、被乗数の0桁の回数だけ、前
記第5実行サイクルを実行することにより、被乗
数に0の桁を含む場合の2進化10進数の乗算を高
速に実行することのできる演算処理装置を実現で
きる。
In this way, by using the states of the output signal lines 40 and 41 and executing the fifth execution cycle as many times as there are 0 digits in the multiplicand, a binary coded decimal number when the multiplicand includes a 0 digit is obtained. It is possible to realize an arithmetic processing device that can perform multiplication at high speed.

第8図は0桁検出回路の他の具体的構成例であ
る。第8図も第5図と同様に、レジスタ3が4
桁、桁位置検出回路8が2ビツトの場合について
示してある。第8図中、レジスタ3、桁位置指示
カウンタ8、信号線38〜39、0検出回路50
〜53、デコーダ54、信号線72〜75および
信号線76〜79は、第5図で説明したものと同
じである。ANDゲート82〜88およびORゲー
ト89は、信号線72〜75および信号線76〜
79を入力として、レジスタ3の中に0桁が存在
したかどうかを示す信号を信号線40に出力す
る。0の桁の数を示す信号線41は、直接、桁位
置指示カウンタの出力に接続された信号線90〜
91により構成される。
FIG. 8 shows another specific example of the configuration of the 0-digit detection circuit. In FIG. 8, as in FIG. 5, register 3 is 4.
The case where the digit and digit position detection circuit 8 is 2 bits is shown. In FIG. 8, register 3, digit position instruction counter 8, signal lines 38 to 39, 0 detection circuit 50
53, decoder 54, signal lines 72-75, and signal lines 76-79 are the same as those described in FIG. AND gates 82 to 88 and OR gate 89 connect signal lines 72 to 75 and signal lines 76 to
79 as an input, and outputs a signal indicating whether or not there is a 0 digit in the register 3 to the signal line 40. The signal line 41 indicating the number of 0 digits is directly connected to the signal lines 90 to 90 connected to the output of the digit position indicating counter.
91.

第9図は、第8図で示した0桁検出回路の動作
を詳しく説明した図である。b0,b1,x0〜x3
c0,c1,dの意味は、第7図と同じである。b0
b1が(00)のときは、x0が1であれば、c0,c1
は(00)が、dには1が出力される。x0が1でな
ければ、dには0が出力される。b0,bAが
(01)のときは、x0,x1がもとに1のとき、c0
c1には(01)が、dには1が出力される。それ以
外のときには、dには0が出力される。b0,b1
(10)のときには、x0,x1,x2がともに1のとき、
c0,c1には(10)が、dには1が出力される。それ以
外のときには、dには0が出力される。b0,b1
(11)のときは、x0,x1,x2,x3がすべて1のとき、
c0,c1には(11)が、dには1が出力される。それ以
外のときには、dには、0が出力される。
FIG. 9 is a diagram illustrating in detail the operation of the 0-digit detection circuit shown in FIG. 8. b 0 , b 1 , x 0 ~ x 3 ,
The meanings of c 0 , c 1 , and d are the same as in FIG. 7. b0 ,
When b 1 is (00), if x 0 is 1, (00) is output to c 0 and c 1 , and 1 is output to d. If x 0 is not 1, 0 is output to d. When b 0 and bA are (01), when x 0 and x 1 are originally 1, c 0 ,
(01) is output to c1 and 1 is output to d. At other times, 0 is output to d. b 0 and b 1 are
In (10), when x 0 , x 1 , and x 2 are all 1,
(10) is output to c 0 and c 1 , and 1 is output to d. At other times, 0 is output to d. b 0 and b 1 are
In (11), when x 0 , x 1 , x 2 , x 3 are all 1,
(11) is output to c 0 and c 1 , and 1 is output to d. At other times, 0 is output to d.

第8図の0桁検出回路は、第5図に示す0桁検
出回路とは異なり、桁位置指示カウンタ8の示す
桁から、左側の桁がすべて0の時だけ、信号線4
0が1となり、信号線41に、その時の0の桁の
桁数が出力される。したがつて、前記第3実行サ
イクルを実行せず、第5サイクルの連続として実
行できるのは、レジスタ3の上位の桁に0が連続
している場合である。一般には、被乗数の上位に
0桁が連続している場合が多いので、第8図の実
施例でも、十分な効果を得ることができる。
The 0 digit detection circuit shown in FIG. 8 differs from the 0 digit detection circuit shown in FIG. 5 in that the 0 digit detection circuit shown in FIG.
0 becomes 1, and the number of digits of 0 at that time is output to the signal line 41. Therefore, the fifth cycle can be executed continuously without executing the third execution cycle when the upper digits of the register 3 are consecutively 0's. Generally, there are many consecutive 0 digits at the top of the multiplicand, so the embodiment shown in FIG. 8 can also provide sufficient effects.

以上、実施例では、中間結果格納レジスタ1の
下位をレジスタ3に転送する時に用いる演算器6
の幅は、1桁として説明したが、この幅は、2桁
でもよいし、あるいは、もつと大きくてもよい。
この幅を大きくすると、レジスタ1からレジスタ
3へ積を転送するのに要するサイクルが少なくて
すみ、被乗数に0が多数連続している場合には、
より高速に演算が行える。
As described above, in the embodiment, the arithmetic unit 6 used when transferring the lower part of the intermediate result storage register 1 to the register 3
Although the width has been described as being one digit, the width may be two digits or even larger.
Increasing this width will require fewer cycles to transfer the product from register 1 to register 3, and if the multiplicand has many consecutive 0s,
Calculations can be performed faster.

また、実施例では、被乗数の格納と、求まつた
積の格納を同じレジスタ3で行つたが、別々のレ
ジスタで構成してもよい。また、演算サイクル
で、被乗数の1桁から1を減算する時に使用する
演算器と、中間結果格納レジスタ1から、求まつ
た積をレジスタ3へ転送する経路を演算器6で共
有化しているが、それぞれ別に構成してもよい。
Further, in the embodiment, the multiplicand and the calculated product are stored in the same register 3, but they may be configured in separate registers. In addition, in the calculation cycle, the calculation unit used to subtract 1 from one digit of the multiplicand and the path for transferring the calculated product from intermediate result storage register 1 to register 3 are shared by calculation unit 6. , may be configured separately.

以上に述べたように、本発明にあたつては、被
乗数の中の0の桁、および、0の桁の数を検出す
ることにより、その桁数分だけ、中間結果格納レ
ジスタから積を取り出すサイクルを連続させるこ
とができ、被乗数の中の0の桁の演算を高速に実
行することが可能となる。
As described above, in the present invention, by detecting the number of 0 digits and the number of 0 digits in the multiplicand, the product is extracted from the intermediate result storage register by the number of digits. Cycles can be made consecutive, and operations on 0 digits in the multiplicand can be performed at high speed.

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

第1図は従来の2進化10進数の乗算を行う演算
処理装置のブロツク図、第2図は第1図による動
作例を説明する図、第3図は本発明の一実施例を
示す図、第4図は第3図による動作例を説明する
図、第5図は第3図における0桁検出回路の具体
的回路図、第6図および第7図は第5図の動作を
説明するための図、第8図は第3図における0桁
検出回路の他の具体的回路図、第9図は第8図の
動作を説明するための図である。 1……中間結果レジスタ、2……乗数レジス
タ、3……被乗数レジスタ、4……シフタ、5…
…演算器、6……演算器、7……定数生成回路、
8……桁位置指示カウンタ、9……メモリ、10
……アドレス生成器、11……0桁検出回路、1
2……0検出回路、13……制御回路。
FIG. 1 is a block diagram of a conventional arithmetic processing device that performs multiplication of binary coded decimal numbers, FIG. 2 is a diagram explaining an example of the operation according to FIG. 1, and FIG. 3 is a diagram showing an embodiment of the present invention. 4 is a diagram for explaining an example of the operation according to FIG. 3, FIG. 5 is a specific circuit diagram of the 0 digit detection circuit in FIG. 3, and FIGS. 6 and 7 are for explaining the operation of FIG. 5. , FIG. 8 is another specific circuit diagram of the 0-digit detection circuit in FIG. 3, and FIG. 9 is a diagram for explaining the operation of FIG. 8. 1... Intermediate result register, 2... Multiplier register, 3... Multiplicand register, 4... Shifter, 5...
...Arithmetic unit, 6...Arithmetic unit, 7...Constant generation circuit,
8...Digit position instruction counter, 9...Memory, 10
... Address generator, 11 ... 0 digit detection circuit, 1
2...0 detection circuit, 13...control circuit.

Claims (1)

【特許請求の範囲】[Claims] 1 被乗数を格納するレジスタと、乗数を格納す
るレジスタと、中間結果を格納するレジスタと、
前記乗数を格納するレジスタの内容と前記中間結
果を格納するレジスタの内容を演算する演算器
と、前記中間結果を格納するレジスタの内容をシ
フトするシフタと、前記被乗数を格納するレジス
タの桁を順次指示する桁位置指示カウンタと、該
カウンタにより指示された桁を選択して演算する
演算器と、該演算器の出力が所定値になるまで、
該当桁に対する前記乗数格納レジスタと中間結果
格納レジスタの内容を繰り返し演算せしめる制御
回路とを有し、2進化10進数の乗算を加算あるい
は減算を繰り返すことにより行う演算処理装置に
おいて、前記カウンタが示す前記被乗数格納レジ
スタの被乗数の桁の0および該桁に連続する0の
桁数を検出する0桁検出回路を設け、該0桁検出
回路により被乗数の0の桁とその桁数を検出し、
前記制御回路は、その桁数だけ前記中間結果格納
レジスタの内容を前記シフタによりシフトしつ
つ、中間結果から積を求める制御を行うことを特
徴とする演算処理装置。
1 A register that stores the multiplicand, a register that stores the multiplier, and a register that stores the intermediate result.
an arithmetic unit that operates on the contents of the register that stores the multiplier and the register that stores the intermediate result; a shifter that shifts the contents of the register that stores the intermediate result; and a shifter that sequentially shifts the digits of the register that stores the multiplicand. A counter for indicating the digit position to be instructed, a computing unit that selects and computes the digit indicated by the counter, and a computing unit that selects and computes the digit indicated by the counter, until the output of the computing unit reaches a predetermined value.
An arithmetic processing device comprising a control circuit for repeatedly calculating the contents of the multiplier storage register and the intermediate result storage register for a corresponding digit, and performing multiplication of binary coded decimal numbers by repeating addition or subtraction; A 0 digit detection circuit is provided to detect a 0 digit of the multiplicand of the multiplicand storage register and the number of 0 digits consecutive to the digit, and the 0 digit detection circuit detects the 0 digit of the multiplicand and the number of digits thereof,
The arithmetic processing device is characterized in that the control circuit performs control to obtain a product from the intermediate results while shifting the contents of the intermediate result storage register by the number of digits using the shifter.
JP18931181A 1981-11-27 1981-11-27 Operation processor Granted JPS5892037A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18931181A JPS5892037A (en) 1981-11-27 1981-11-27 Operation processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18931181A JPS5892037A (en) 1981-11-27 1981-11-27 Operation processor

Publications (2)

Publication Number Publication Date
JPS5892037A JPS5892037A (en) 1983-06-01
JPS6224816B2 true JPS6224816B2 (en) 1987-05-30

Family

ID=16239220

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18931181A Granted JPS5892037A (en) 1981-11-27 1981-11-27 Operation processor

Country Status (1)

Country Link
JP (1) JPS5892037A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6479567B1 (en) 2000-03-03 2002-11-12 Ashland Inc. Furan no-bake foundry binders and their use

Citations (1)

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

Patent Citations (1)

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

Also Published As

Publication number Publication date
JPS5892037A (en) 1983-06-01

Similar Documents

Publication Publication Date Title
JP3081710B2 (en) Multiplier with overflow detection function
US4823258A (en) Index limited continuous operation vector processor
US4631672A (en) Arithmetic control apparatus for a pipeline processing system
JPH0479015B2 (en)
JPH0690668B2 (en) Fuzzy computing device
JPH0326872B2 (en)
JPH07107664B2 (en) Multiplication circuit
JPS6224816B2 (en)
US3400259A (en) Multifunction adder including multistage carry chain register with conditioning means
JP2793357B2 (en) Parallel processing unit
JP2591250B2 (en) Data processing device
JP2675087B2 (en) Microcomputer
US4141077A (en) Method for dividing two numbers and device for effecting same
JPH0797312B2 (en) Arithmetic unit
US3624375A (en) Binary coded decimal to binary conversion apparatus
JPH0260020B2 (en)
JP2741869B2 (en) Inverse coordinate transformation processor
JP2654062B2 (en) Information processing device
JPS59103148A (en) Multiplying circuit
JPS63279321A (en) Microprogram controller
SU661549A1 (en) Arithmetic device
SU680477A1 (en) Arithmetic unit
JPS5851352A (en) Data processor
JPH01166214A (en) Information processor
JPS61188624A (en) Fixed point arithmetic unit