Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0435777B2 - - Google Patents
[go: Go Back, main page]

JPH0435777B2 - - Google Patents

Info

Publication number
JPH0435777B2
JPH0435777B2 JP57138535A JP13853582A JPH0435777B2 JP H0435777 B2 JPH0435777 B2 JP H0435777B2 JP 57138535 A JP57138535 A JP 57138535A JP 13853582 A JP13853582 A JP 13853582A JP H0435777 B2 JPH0435777 B2 JP H0435777B2
Authority
JP
Japan
Prior art keywords
line
absolute value
operand
circuit
operands
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 - Lifetime
Application number
JP57138535A
Other languages
Japanese (ja)
Other versions
JPS5930143A (en
Inventor
Akira Yamaoka
Koji Nakamura
Masahiro Hashimoto
Kenichi Wada
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 JP57138535A priority Critical patent/JPS5930143A/en
Publication of JPS5930143A publication Critical patent/JPS5930143A/en
Publication of JPH0435777B2 publication Critical patent/JPH0435777B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/491Computations with decimal numbers radix 12 or 20.
    • G06F7/492Computations with decimal numbers radix 12 or 20. using a binary weighted representation within each denomination
    • G06F7/493Computations with decimal numbers radix 12 or 20. using a binary weighted representation within each denomination the representation being the natural binary coded representation, i.e. 8421-code
    • G06F7/494Adding; Subtracting

Landscapes

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

Description

【発明の詳細な説明】 本発明は演算処理方式に係り、特に10進数加減
算処理方式に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to an arithmetic processing method, and particularly to a decimal addition/subtraction processing method.

10進データは、通常絶対値表示、すなわち、絶
対値と符号の組合せで表わされ絶対値は2進化10
進数、符号は4ビツトコードよりなるとする。
Decimal data is usually expressed as an absolute value, that is, a combination of an absolute value and a sign, and the absolute value is expressed as a binary code 10
It is assumed that the base number and code are made up of 4-bit codes.

また、2つのオペランドデータが同符号の加算
または異符号の減算のときを実質加算、2つのオ
ペランドデータが同符号の減算または異符号の加
算のときを実質減算と呼んでいる。
Further, when two operand data are added with the same sign or subtracted with different signs, it is called real addition, and when two operand data are subtracted with the same sign or added with different signs, it is called real subtraction.

従来の10進加減算処理は以下のステツプよりな
る。第1ステツプで両オペランドの符号と加算・
減算の別により実質加算か実質減算かを識別す
る。第2ステツプでは、被加(減)数である第1
オペランドの絶対値(以下Xと略記する)と加
(減)数である第2オペランドの絶対値(以下Y
と略記する)の間で、実質加算のときX+Yを実
質減算のときX−Yの演算を実行する。第3ステ
ツプでは、第1ステツプで調べた両オペランドの
符号及び加算・減算の別と、第2ステツプで得た
演算結果から結果の符号を決定し、符号コードを
生成する。さらに、実質減算でかつX<Yのとき
は、第2ステツプの演算X−Yの結果(Zとす
る)が負になるため、正にするための補正0−Z
を行う(この処理を再補正処理と呼ぶ)必要があ
り、この処理を行うステツプが余分にかかつてい
た。
Conventional decimal addition/subtraction processing consists of the following steps. In the first step, add and add the signs of both operands.
Depending on the type of subtraction, it is determined whether it is a real addition or a real subtraction. In the second step, the first
The absolute value of the operand (hereinafter abbreviated as X) and the absolute value of the second operand which is the addition (subtraction) number (hereinafter referred to as Y)
(abbreviated as ), the operation of X+Y is executed for substantial addition, and the operation of X-Y is executed for substantial subtraction. In the third step, the sign of the result is determined from the signs of both operands and addition/subtraction examined in the first step, and the operation result obtained in the second step, and a sign code is generated. Furthermore, when it is a real subtraction and X<Y, the result of the second step operation
(This processing is called re-correction processing), and the steps for performing this processing are extra long.

このように、従来10進加減算処理は、第1ステ
ツプから第3ステツプ、又は、再補正が必要な場
合には第4ステツプまでの処理を逐次的に行つて
いるための高速化が難しかつた。
In this way, conventional decimal addition/subtraction processing has been difficult to speed up because the processing is performed sequentially from the first step to the third step, or if re-correction is required, to the fourth step. .

本発明の目的は、前記従来の方式で第1ステツ
プから第3ステツプまで3ステツプ要していた処
理を短縮し、かつ、再補正処理を不要にして10進
加減算命令の高速処理を行うことが可能なかつ、
構造の簡単な演算処理方式を提供することにあ
る。
An object of the present invention is to shorten the processing that required three steps from the first step to the third step in the conventional method, and to perform high-speed processing of decimal addition/subtraction instructions without the need for re-correction processing. possible and
The purpose of this invention is to provide an arithmetic processing method with a simple structure.

上記目的を達成するために本発明の演算処理方
式は、10進加減算処理において第1ステツプで両
オペランドの符号と加算・減算の区別により実質
加算か実質減算かを識別すると同時に、絶対値の
大きさを比較するためのX−Yの演算を実行し、
さらに、同じ第1ステツプでX−Yの結果がオー
ルゼロか否か、およびX又はYの一方がオールゼ
ロか否かを調べることにより結果の符号コードを
決定し、第2ステツプでは、第1ステツプで調べ
た結果により、実質加算のときX+Yを、実質減
算かつX≧YのときX−Yを、実質減算かつX<
Yのとき−X+Yを実行し、さらに、第1ステツ
プで決定した符号コードを発生して、結果の絶対
値に付加することを特徴としている。
In order to achieve the above object, the arithmetic processing method of the present invention distinguishes between real addition and subtraction based on the signs of both operands and the distinction between addition and subtraction in the first step in decimal addition and subtraction processing, and at the same time identifies the magnitude of the absolute value. Execute the X-Y operation to compare the
Furthermore, in the same first step, the sign code of the result is determined by checking whether the result of X-Y is all zeros and whether one of X or Y is all zeros, and in the second step, According to the results of the investigation, when there is real addition, X+Y, when there is real subtraction and X≧Y, there is X-Y, and when there is real subtraction and X≧Y, there is X-Y.
When Y, -X+Y is executed, and the sign code determined in the first step is further generated and added to the absolute value of the result.

以下、本発明の実施例を図面を用いて説明す
る。
Embodiments of the present invention will be described below with reference to the drawings.

本発明の演算処理装置は、第1図に示すように
2つのオペランドデータを納めるX−レジスタ1
とY−レジスタ2、2進加算を行う加算器3、結
果を納めるZ−レジスタ4、および2進加算器を
用いて10進演算を行うための付属回路11,1
2,13,14,15,16、および、10進加算
制御を行うための付加回路5,6,7,8,9,
10,17,18から成る。
As shown in FIG. 1, the arithmetic processing device of the present invention comprises an
and a Y-register 2, an adder 3 for performing binary addition, a Z-register 4 for storing the result, and ancillary circuits 11 and 1 for performing decimal operations using the binary adder.
2, 13, 14, 15, 16, and additional circuits 5, 6, 7, 8, 9, for performing decimal addition control.
It consists of 10, 17, and 18.

10進演算を行う加減算器は、回路11,12,
13,14,15,16と3で構成される。以
下、10進加減算動作について説明する。被加数又
は被減数Xは、線101を介してX−レジスタ1
に、加数又は減数Yは線102を介してY−レジ
スタ2に、符号コードが右端にくるようにそれぞ
れセツトされる。また、線100は、加算のとき
“0”減算のとき“1”にセツトされる。
The adder/subtractor that performs decimal operations includes circuits 11, 12,
It consists of 13, 14, 15, 16 and 3. The decimal addition and subtraction operations will be explained below. The summand or subtractive X is transferred to the X-register 1 via line 101.
Then, the addend or subtrahend Y is set via line 102 into the Y-register 2, respectively, with the sign code at the right end. Also, line 100 is set to "0" for addition and "1" for subtraction.

10進加減算は、第1ステツプで、結果の符号と
絶対値に行うべき演算の分類、即ち、X+YかX
−Yか−X+Yかの切り分けを行い、第2ステツ
プで、その演算を実行して、符号コードを発生す
る。以下、この動作を具体的に説明する。
In decimal addition and subtraction, the first step is to determine the type of operation to be performed on the sign and absolute value of the result, i.e., X+Y or
-Y or -X+Y is determined, and in the second step, the calculation is executed to generate a sign code. This operation will be specifically explained below.

第1ステツプでは、以下の処理を行う。被加
(減)数と加(減)数の4ビツト符号コードは、
線1Bと線2Bを介してそれぞれデコーダ7と8
に送られる。デコーダ7,8ではそれぞれ線7
A,8Aを、符号コードが正のとき“0”に負の
とき“1”にする。回路18では、線100と7
Aと8Aの排他的論理和をとつて線18Aに出力
する。したがつて、同符号の二つのオペランドの
和又は異符号の二つのオペランドの差が必要のと
き(実質加算のとき)に線18Aは0となり、同
符号の二つのオペランドの差又は異符号の二つの
オペランドの和が必要のとき(実質減算のとき)
に線18Aは1となる。このように、回路18は
実質加算と実質減算のいずれを必要とするかを検
出する。被加(減)数と加(減)数の絶対値はそ
れぞれ線1Aと2Aを介して回路5,11,14
と回路12,13,15に送られる。絶対値は2
進化10進数、即ち、4ビツトで10進1桁(以下単
に桁と呼ぶ)を表わしている。ゼロ検出回路5で
は、線5Aを、線1Aが全て“0”即ちX=0な
ら“0”にし、そうでないなら“1”にする。補
数回路11と12は、それぞれ線1Aと2Aの
NOT(反転)をとつて、つまりそれぞれの1の補
数を線11Aと12Aに出力する。加算回路13
は、2進加算器3を用いて10進加算を行えるよう
に、加(減)数Yの絶対値の各桁に6を加えて、
線13Aに出力する。なお、2進化10進数である
ので、6を加えても上の桁への桁上げは生じな
い。14は、線1A,11Aのどちらかを選んで
線14Aに出力するセレクタで、線9Bで制御さ
れる。線9Bが“0”のとき線1Aを“1”のと
き線11Aをセレクトする。15は、線2A,1
2A,13Aからひとつを選んで、線15Aに出
力するセレクタで、線9Aと9Bで制御される。
線9Aが“0”のときは線9Bの値にかかわらず
線13Aを、線9Aが“1”で線9Bが“0”の
ときは線12Aを、線9Aが“1”で線9Bが
“1”のときは線2Aをセレクトする。第1ステ
ツプでは、線9A,9Bは強制的にそれぞれ
“1”、“0”にされており、線14A,15Aに
は、それぞれ線1A,12Aが出力される。即
ち、線14AにはXが線15AにはYの1の補数
(と書く)が入力され、これらは、加算器3で、
2進加算されて線3Bに出力される。このとき、
加算器3の最下位に入力される初期キヤリーとし
て、線9Aの値がそのまま使われ、最上位から得
られる最終キヤリーは、線3Aに出力される。即
ち、線3Aは、加算器3で行つたX−Yの最終キ
ヤリーであり“0”のときX<Yを“1”のとき
X≧Yであることを示している。今線9Aは
“1”であるためこれと線15A上のが加算器
3で加算されると、Yの2の補数がえられ、結局
加算器3ではX−Yの演算が実行されることにな
る。ただし、2進加算器3を用いて10進加算を行
うため補正が必要で、補正回路16では、線3B
の各桁に対して、加算器3での加算で、上の桁へ
の桁上げが生じた桁に対してはそのまま、桁上げ
が生じなかつた桁に対しては6を減算して、線1
6Aに出力する。なお、この補正方法については
公知の技術であるので、これ以上の説明は省略す
る。線16AにはX−Yの結果が出てこれがゼロ
検出回路6に送られる。ゼロ検出回路6は線6A
を、もし線16Aが全て“0”なら“0”に、そ
うでない場合は“1”にする。演算制御回路9に
は、線3Aと18Aが、符号決定回路10には線
3Aと18Aと7Aと5Aと6Aが入力され、そ
れぞれの回路のフリツプフロツプ(第2図、第3
図)にラツチされる。以上が第1ステツプの処理
である。
In the first step, the following processing is performed. The 4-bit code for the summand (subtraction) and addition (subtraction) is as follows:
Decoders 7 and 8 via lines 1B and 2B respectively
sent to. Decoders 7 and 8 each have line 7
A and 8A are set to "0" when the sign code is positive and "1" when it is negative. In circuit 18, lines 100 and 7
The exclusive OR of A and 8A is taken and outputted to line 18A. Therefore, when the sum of two operands with the same sign or the difference between two operands with opposite signs is required (in real addition), line 18A becomes 0, and the difference between two operands with the same sign or the difference between two operands with opposite signs is required. When you need the sum of two operands (actual subtraction)
The line 18A becomes 1. In this manner, circuit 18 detects whether a substantial addition or subtraction is required. The absolute values of the addend (subtraction) and addition (subtraction) are transmitted to circuits 5, 11, and 14 via lines 1A and 2A, respectively.
and is sent to circuits 12, 13, and 15. The absolute value is 2
It is an evolved decimal number, that is, 4 bits represent one decimal digit (hereinafter simply referred to as a digit). In the zero detection circuit 5, the line 5A is set to "0" if all the lines 1A are "0", that is, X=0, and is set to "1" otherwise. Complement circuits 11 and 12 are connected to lines 1A and 2A, respectively.
NOT (inversion) is performed, that is, the respective 1's complement numbers are output on lines 11A and 12A. Addition circuit 13
adds 6 to each digit of the absolute value of addition (subtraction) number Y so that decimal addition can be performed using binary adder 3,
Output to line 13A. Note that since it is a binary coded decimal number, adding 6 will not cause a carry to the upper digit. 14 is a selector that selects either line 1A or 11A and outputs it to line 14A, and is controlled by line 9B. When the line 9B is "0", the line 1A is selected, and when the line 9B is "1", the line 11A is selected. 15 is line 2A,1
A selector selects one from 2A and 13A and outputs it to line 15A, and is controlled by lines 9A and 9B.
When line 9A is “0”, line 13A is applied regardless of the value of line 9B, when line 9A is “1” and line 9B is “0”, line 12A is applied, and when line 9A is “1” and line 9B is When it is "1", line 2A is selected. In the first step, lines 9A and 9B are forced to "1" and "0", respectively, and lines 1A and 12A are output to lines 14A and 15A, respectively. That is, X is input to the line 14A, and the one's complement of Y (written as) is input to the line 15A.
The result is binary addition and output on line 3B. At this time,
The value on line 9A is used as is as the initial carry input to the bottom of adder 3, and the final carry obtained from the top is output on line 3A. That is, the line 3A is the final carry of X-Y performed by the adder 3, and indicates that when "0", X<Y, and when "1", X≧Y. Now, since line 9A is "1", when this and the value on line 15A are added in adder 3, the two's complement of Y is obtained, and in the end, adder 3 executes the operation of X-Y. become. However, since decimal addition is performed using the binary adder 3, correction is necessary, and the correction circuit 16 uses the line 3B
For each digit in the adder 3, digits for which a carry has occurred to the upper digit are left unchanged, and 6 is subtracted for digits for which no carry has occurred, and a line is drawn. 1
Output to 6A. Note that since this correction method is a known technique, further explanation will be omitted. The X-Y result appears on the line 16A and is sent to the zero detection circuit 6. Zero detection circuit 6 is line 6A
is set to "0" if all lines 16A are "0", and set to "1" otherwise. The lines 3A and 18A are input to the arithmetic control circuit 9, and the lines 3A, 18A, 7A, 5A, and 6A are input to the sign determination circuit 10.
(Fig.) is latched. The above is the first step processing.

第2ステツプの処理を以下に示す。演算制御回
路9の詳細は第2図に示され、ラツチされた線1
8Aの内容をそのまま線9Aとして、ラツチされ
た線3Aの内容の反転と線18の内容のアンドを
とつて線9Bとして出力する。即ち線9Aが
“1”のとき絶対値の差を求める実質減算である
ことを示し、線9Bが“1”のときは実質減算で
かつX<Yの場合であること、したがつて、−X
+Yの演算が必要であることを示している。ま
た、符号決定回路10では第1ステツプで調べた
結果、即ち、Xの符号を示す線7A、XとYの大
小を示す線3A、絶対値の和か差を示す線18
A、X=0かどうかを示す線5A、X−Y=0か
どうかを示す線6Aから、結果として付加する符
号を決定し、この符号が正又は負であるかに応じ
て線10Aに“0”又は“1”を出力する。符号
決定の基本は、絶対値の和又はX>Yで絶対値の
差のときはXの符号と同じに、X<Yで絶対値の
差のときはXの符号と逆にし、結果の絶対値がゼ
ロのときは符号を正にすることである。結果の絶
対値がゼロか否かは、絶対値の差を求めるとき
(線18Aが1のとき)には、線6Aが0か否か
により判断し、絶対値の和を求めるとき(線18
Aが0のとき)には線6Aが0でかつ線5Aが0
か否かにより判断する。このためには符号決定回
路10は第3図のように構成される。
The processing of the second step is shown below. Details of the arithmetic control circuit 9 are shown in FIG.
The contents of line 8A are output as line 9A, and the latched contents of line 3A are inverted and the contents of line 18 are ANDed and output as line 9B. That is, when the line 9A is "1", it indicates that it is a real subtraction to find the difference in absolute values, and when the line 9B is "1", it is a real subtraction and X<Y. Therefore, - X
This indicates that +Y operation is required. The sign determination circuit 10 also uses the results of the investigation in the first step, that is, a line 7A indicating the sign of X, a line 3A indicating the magnitude of X and Y, and a line 18 indicating the sum or difference of absolute values.
Determine the sign to be added as a result from the line 5A indicating whether or not A, Outputs “0” or “1”. The basics of determining the sign are that when the sum of absolute values or X>Y and the difference in absolute values, the sign of X is the same, and when X<Y and the difference in absolute values, the sign of When the value is zero, the sign should be positive. Whether or not the absolute value of the result is zero is determined by whether or not line 6A is 0 when calculating the difference in absolute values (when line 18A is 1), and by whether line 6A is 0 when calculating the sum of absolute values (when line 18A is 1).
When A is 0), line 6A is 0 and line 5A is 0.
Judgment will be made based on whether or not. For this purpose, the sign determining circuit 10 is constructed as shown in FIG.

第3図を簡単に説明する。実質減算か否かを示
す線18Aと加算器3からのキヤリー即ちXとY
の絶対値の大小を表わす線3Aの反転とのAND
である線10AAは、“1”のとき実質減算でか
つX<Yであることを示す。言いかえれば、線1
0AAが“1”のとき、−X+Yの演算が行われ
ることを意味する。さらにこれと線7Aとの
ANDである線10ACは、線10AAが“0”即
ちX±Yの演算のときXの符号を表わす線7Aの
値そのままであり、線10AAが“1”のとき線
7Aの反転となる。以上が主な符号決定の論理で
あり、残りの部分は結果がオール0のとき符号を
強制的に0にするための論理である。線10AB
が“0”のときX+YでかつX=0であることを
示し、線10ADが0のときは、結果がオール0
となることを示している。線10ACと線10
ADのANDをとることにより、線10Aは通常
線10ACが出力され、結果がオール0のとき強
制的に0となる。線9A,9Bはセレクタ14,
15に送られる。セレクタ14では線9Bが
“0”のときXに相当する線1Aを、“1”のとき
Xに相当する線11Aを出力する。セレクタ15
は線9Aが“0”のとき+Yに相当する線13A
を、線9A,9Bが、“1”・“0”のときに相
当する線12Aを、線9A,9Bが“1”・“1”
のときYに相当する線2Aを出力する。加算器3
ではセレクタ14,15の出力に対して線9Aを
初期キヤリーとして2進加算し、その出力線3B
は、補正回路16で補正されて、Zレジスタ4に
セツトされる。結局、信号9A,9Bが、0,0
のときには、X+Yが、信号9A,9Bが、1,
0のときには、X−Yが、信号9A,9Bが、
1,1のときには、Y−Xが求められる。この
際、二つの補数回路11,12を設け、セレクタ
14,15によりこれらの出力と元のオペランド
の中からこの加算器の入力を選択することにより
これらのステツプ2でのいろいろの演算及びステ
ツプ1での前述の減算を行うことが出来る。一方
結果の符号を示す線10Aはエンコーダ17に送
られる。エンコーダ17は、線10Aがもし
“0”なら正の、“1”なら負の4ビツトの符号コ
ードを発生して線17Aに出力する。線17A
は、Z−レジスタ4にセツトされる。このように
してZ−レジスタに得られた結果の絶対値と符号
は、線104を介して、メモリなどに格納され
る。以上が第2ステツプの処理である。
FIG. 3 will be briefly explained. The line 18A indicating whether or not it is a real subtraction and the carries from the adder 3, that is, X and Y
AND with the inversion of line 3A, which represents the magnitude of the absolute value of
When the line 10AA is "1", it indicates a substantial subtraction and X<Y. In other words, line 1
When 0AA is "1", it means that the operation -X+Y is performed. Furthermore, between this and line 7A
The line 10AC, which is AND, has the same value as the line 7A representing the sign of X when the line 10AA is "0", that is, the calculation of X±Y, and is the inverse of the line 7A when the line 10AA is "1". The above is the main code determination logic, and the remaining part is the logic for forcibly setting the code to 0 when the result is all 0. line 10AB
When is “0”, it indicates that X+Y and X=0, and when line 10AD is 0, the result is all 0.
It shows that. Line 10AC and line 10
By ANDing AD, the normal line 10AC is output from the line 10A, and when the result is all 0, it is forced to 0. Lines 9A and 9B are selectors 14,
Sent to 15th. The selector 14 outputs a line 1A corresponding to X when the line 9B is "0", and outputs a line 11A corresponding to X when the line 9B is "1". Selector 15
is line 13A which corresponds to +Y when line 9A is “0”
, when the lines 9A and 9B are "1" and "0", the corresponding line 12A is when the lines 9A and 9B are "1" and "1"
When , line 2A corresponding to Y is output. Adder 3
Then, binary addition is made to the outputs of selectors 14 and 15 using line 9A as an initial carry, and the output line 3B is
is corrected by the correction circuit 16 and set in the Z register 4. In the end, the signals 9A and 9B are 0, 0
When , X+Y is 1, and signals 9A and 9B are 1,
When it is 0, X-Y and signals 9A and 9B are
When it is 1,1, Y-X is obtained. At this time, two's complement circuits 11 and 12 are provided, and selectors 14 and 15 select the input of this adder from among these outputs and the original operand, thereby performing various operations in step 2 and step 1. The above-mentioned subtraction can be performed. On the other hand, a line 10A indicating the sign of the result is sent to an encoder 17. The encoder 17 generates a 4-bit sign code, which is positive if the line 10A is "0" and negative if it is "1", and outputs it to the line 17A. line 17A
is set in Z-register 4. The absolute value and sign of the result thus obtained in the Z-register are stored in a memory or the like via line 104. The above is the second step processing.

本実施例では、ゼロ検出回路5と6を設け、符
号決定回路10に反映させることにより、10進加
減算の結果にマイナスゼロが許されない場合で
も、2ステツプで10進加減算処理が行える効果が
ある。
In this embodiment, by providing zero detection circuits 5 and 6 and reflecting the result in the sign determination circuit 10, it is possible to perform decimal addition and subtraction processing in two steps even when minus zero is not allowed in the result of decimal addition and subtraction. .

本発明によれば、10進加減算処理において、結
果の符号と、絶対値に対して行うべき演算の切り
分けを決定するステツプと、実際の演算を行い結
果の符号コードを発生するステツプの、2ステツ
プで処理が完了できるので、従来3ステツプかか
つていた処理が短縮できると同時に、従来実質減
算で必要としていた再補正処理をなくすことがで
きるという効果がある。さらに、一つの加算器を
用いて、実現できるので回路が非常に簡単にな
る。
According to the present invention, in decimal addition/subtraction processing, there are two steps: a step of determining the sign of the result and the division of operations to be performed on the absolute value, and a step of performing the actual operation and generating the sign code of the result. Since the process can be completed in just 3 steps, the process that conventionally required three steps can be shortened, and at the same time, the re-correction process that was conventionally required in actual subtraction can be eliminated. Furthermore, since it can be realized using one adder, the circuit becomes extremely simple.

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

第1図は、本発明の演算処理方式を実現する回
路例、第2図は第1図の演算制御回路例、第3図
は第1図の符号決定回路例を示した図である。
FIG. 1 is a diagram showing an example of a circuit implementing the arithmetic processing method of the present invention, FIG. 2 is an example of the arithmetic control circuit of FIG. 1, and FIG. 3 is a diagram showing an example of the code determination circuit of FIG. 1.

Claims (1)

【特許請求の範囲】 1 絶対値と符号からなり、加算又は減算のいず
れかの演算が施されるべき第1、第2のオペラン
ドのそれぞれの絶対値の補数を生成する第1、第
2の補数回路と、 加算回路と、 該第1のオペランドの絶対値と該第1の補数回
路の出力の内、該加算回路へ入力すべきものを選
択する第1の選択手段と、 該第2のオペランドの絶対値と該第2の補数回
路の出力の内、該加算回路へ入力すべきものを選
択する第2の選択手段と、 該演算が該第1、第2のオペランドの絶対値に
対する加算か否かを、該第1、第2のオペランド
の符号に基づき識別する手段と、 該第1、第2の選択手段を制御する手段とを有
し、 該制御手段は、 まず、その加算回路により該第1、第2のオペ
ランドの絶対値の間の比較を、該識別手段による
識別と並行して行わせるように、該第1、第2の
オペランドの一方の絶対値とその他方の絶対値に
対して該第1、第2の補数回路のいずれかにより
生成された補数を、該第1、第2の選択手段によ
り選択させ、それにより該比較を、該識別手段に
よる識別と並行して行わせ、 次に、該加算回路により該比較を行つたときの
該加算回路のキヤリー出力と該識別手段の出力と
の組み合わせに応じて、 (イ)該第1、第2のオペランドの絶対値の加算の
ために、それぞれを選択するか、(ロ)該第1のオペ
ランドの絶対値からの該第2のオペランドの絶対
値の減算のために、該第1のオペランドの絶対値
と該第2の補数回路の出力を選択するか、あるい
は、(ハ)該第2のオペランドの絶対値からの該第1
のオペランドの絶対値の減算のために、該第1の
補数回路の出力と該第2のオペランドの絶対値を
選択するように、該第1、第2の選択手段を制御
するものであり、 該加算回路により該第1、第2のオペランドの
絶対値の上記比較を行つたときの該加算回路の上
記キヤリー出力と該識別手段の出力との組み合わ
せにより該演算の結果データの符号を決定する手
段をさらに設けた演算処理方式。
[Claims] 1. First and second operands that are composed of an absolute value and a sign and that generate the complements of the respective absolute values of the first and second operands to which addition or subtraction operations are to be performed. a complement circuit; an adder circuit; first selection means for selecting which of the absolute value of the first operand and the output of the first complement circuit should be input to the adder circuit; and the second operand. a second selection means for selecting which of the absolute value of and the output of the second complement circuit should be input to the addition circuit; and whether or not the operation is an addition to the absolute value of the first and second operands. means for identifying the first and second operands based on the signs of the first and second operands, and means for controlling the first and second selection means, the control means first selecting the The absolute value of one of the first and second operands is compared with the absolute value of the other such that the comparison between the absolute values of the first and second operands is performed in parallel with the identification by the identification means. The complement generated by either the first or second complement circuit is selected by the first or second selection means, whereby the comparison is performed in parallel with the identification by the identification means. Then, depending on the combination of the carry output of the adding circuit and the output of the discriminating means when the adding circuit performs the comparison, (a) the absolute value of the first and second operands is determined. (b) select the absolute value of the first operand and the second operand for subtraction of the absolute value of the second operand from the absolute value of the first operand; or (c) select the output of the complement circuit of the first operand from the absolute value of the second operand.
controlling the first and second selection means to select the output of the first complement circuit and the absolute value of the second operand for subtraction of the absolute value of the operand; When the adding circuit compares the absolute values of the first and second operands, the sign of the resultant data of the operation is determined by the combination of the carry output of the adding circuit and the output of the identifying means. An arithmetic processing method with additional means.
JP57138535A 1982-08-11 1982-08-11 Arithmetic processing method Granted JPS5930143A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP57138535A JPS5930143A (en) 1982-08-11 1982-08-11 Arithmetic processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP57138535A JPS5930143A (en) 1982-08-11 1982-08-11 Arithmetic processing method

Publications (2)

Publication Number Publication Date
JPS5930143A JPS5930143A (en) 1984-02-17
JPH0435777B2 true JPH0435777B2 (en) 1992-06-12

Family

ID=15224420

Family Applications (1)

Application Number Title Priority Date Filing Date
JP57138535A Granted JPS5930143A (en) 1982-08-11 1982-08-11 Arithmetic processing method

Country Status (1)

Country Link
JP (1) JPS5930143A (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61103243A (en) * 1984-10-25 1986-05-21 Nec Corp Subtracting device
JPS61177542A (en) * 1985-02-01 1986-08-09 Nec Corp Adding and subtracting device using both sign complementary number and sign absolute value
JPH0371329A (en) * 1989-08-11 1991-03-27 Fujitsu Ltd Arithmetic control circuit for arithmetic and logicical operation processor

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5852747A (en) * 1981-09-25 1983-03-29 Nec Corp Adding and subtracting circuit

Also Published As

Publication number Publication date
JPS5930143A (en) 1984-02-17

Similar Documents

Publication Publication Date Title
US5469377A (en) Floating point computing device for simplifying procedures accompanying addition or subtraction by detecting whether all of the bits of the digits of the mantissa are 0 or 1
US5136536A (en) Floating-point ALU with parallel paths
US4617641A (en) Operation unit for floating point data having a variable length exponent part
US4110831A (en) Method and means for tracking digit significance in arithmetic operations executed on decimal computers
US4692891A (en) Coded decimal non-restoring divider
JPH03135627A (en) Fuzzy arithmetic unit
JPH0435777B2 (en)
JPH0545980B2 (en)
US3489888A (en) Floating point look-ahead binary multiplication system utilizing two&#39;s complement notation for representing negative numbers
JPH1091395A (en) Processor
JPH07118654B2 (en) Arithmetic unit
US4810995A (en) Arithmetic and logic operating unit
EP0442220B1 (en) Decoder
JP2856792B2 (en) Floating point arithmetic unit
US5724275A (en) Fast multi-operand bit pattern detection method and circuit
JP2752698B2 (en) Floating point addition / subtraction circuit
JP3205020B2 (en) Arithmetic unit
JP2006338215A (en) Vector product-sum operation circuit
JP3522387B2 (en) Pipeline arithmetic unit
JPS62259140A (en) Address generating circuit
JP2555967B2 (en) Floating point adder / subtractor
JPS6149234A (en) Multiplier circuit for floating point
JPH04151729A (en) Floating point accumulator
JPH11232249A (en) Product-sum operation processing apparatus and product-sum operation processing method
JPH04191925A (en) Arithmetic processor