JPH07152537A - Decimal adder and adder/subtractor - Google Patents

Decimal adder and adder/subtractor

Info

Publication number
JPH07152537A
JPH07152537A JP30071193A JP30071193A JPH07152537A JP H07152537 A JPH07152537 A JP H07152537A JP 30071193 A JP30071193 A JP 30071193A JP 30071193 A JP30071193 A JP 30071193A JP H07152537 A JPH07152537 A JP H07152537A
Authority
JP
Japan
Prior art keywords
circuit
digit
adder
component
carry
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.)
Withdrawn
Application number
JP30071193A
Other languages
Japanese (ja)
Inventor
Toshimitsu Nagata
敏光 永田
Hirokore Watanabe
広是 渡辺
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP30071193A priority Critical patent/JPH07152537A/en
Publication of JPH07152537A publication Critical patent/JPH07152537A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To provide a compact decimal adder which serves as the core of a decimal computing unit in an addition table system for each decimal digit. CONSTITUTION:A decimal adder consists of an even number adding circuit 1 which divides each digit of input into an even number component shown in higher 3 bits and an odd number component shown in a single lower bit, adds together even number components as an input, and outputs the lower 3 digit bits of the sum as the even number components and a single carry bit added to a higher order digit as a carry odd component respectively, a 3-input binary addition circuit 2 which outputs higher order bit of the sum as an even number component and a lower order bit of the sum as an odd number component respectively, and an even number-plus-2 addition circuit 3 which adds the even number component received from the circuit 1 or another circuit 3 to the higher order bit of the sum of the circuit 2 and outputs lower 3 digit bits of the sum as the even number components and a single carry bit added to a higher order digit as a carry odd number component respectively. In such a constitution, the circuits 1 are combined in a tournament form for each digit and both circuits 2 and 3 are cascaded together.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は10進加算器(および加
減算器)に関する。
FIELD OF THE INVENTION The present invention relates to a decimal adder (and an adder / subtractor).

【0002】[0002]

【従来の技術】従来、10進加算器は、2進加算器に補
正回路を付加した構成で実現することが普通であった。
他に、10進の各桁毎に加算表を具体化した加算テーブ
ル(図4(A))を索引して(それに相当する結果を得
る論理回路によって)桁毎の和と桁上げとを得、桁上げ
は上位桁へ伝達加算する構成が考えられる。
2. Description of the Related Art Conventionally, a decimal adder is usually realized by a structure in which a correction circuit is added to a binary adder.
In addition, an addition table (FIG. 4A) that embodies an addition table for each decimal digit is indexed (by a logic circuit that obtains a corresponding result) to obtain the sum and carry for each digit. As for the carry, it is conceivable that the carry is transmitted to the upper digit.

【0003】前者は2進数の演算器を利用する点で、2
進演算の他に少しの10進演算を行なう場合に簡便に構
成するには便利であるが、10進数の4則演算等を行な
う10進演算器を構成するには適当でない面がある。後
者は加算テーブルのエントリに対応する論理回路数が多
く必要である。
The former is 2 in that it uses a binary arithmetic unit.
Although it is convenient to construct a simple decimal arithmetic operation in addition to a decimal arithmetic operation, it is not suitable to configure a decimal arithmetic unit for performing four arithmetic operations of decimal numbers. The latter requires a large number of logic circuits corresponding to the entries in the addition table.

【0004】[0004]

【発明が解決しようとする課題】本発明は、10進の各
桁毎に加算テーブルを索引する方式で10進演算器の中
核となる10進加算器をコンパクトに構成することを目
的としている。
SUMMARY OF THE INVENTION It is an object of the present invention to compactly configure a decimal adder, which is the core of a decimal arithmetic unit, by a method of indexing an addition table for each decimal digit.

【0005】[0005]

【課題を解決するための手段】図1および図2は本発明
の原理を示す要部ブロック図である。図1は2入力10
進加算器の構成例であり、各オペランドの下位から2桁
目を中心に表現したものである。10進の各桁ごとに、
偶数加算回路1と、3入力2進加算回路2と、偶数+2
加算回路3と、さらに2段目の3入力2進加算回路2
と、偶数+2加算回路3とで構成する。
1 and 2 are block diagrams showing the principle of the present invention. Figure 1 shows 2 inputs 10
It is an example of the configuration of a binary adder, and is expressed mainly by the second digit from the lower order of each operand. For each decimal digit,
Even number adder circuit 1, 3-input binary adder circuit 2, and even number +2
Adder circuit 3 and further 3-input binary adder circuit 2 in the second stage
And an even number + 2 adder circuit 3.

【0006】偶数加算回路1は図4(B)および図5に
示すような論理を実現した回路であり、BCDコードの
上位3ビットで表される偶数を2つ加算し、やはり3ビ
ットで表した偶数と、上位桁に相当する桁上げ1ビット
とを出力する。10進の1桁同士の加算を行なうとすれ
ば図4(A)に示す論理を実現する必要があり、それに
比べて論理回路は少なくて済む。
The even-number adder circuit 1 is a circuit that realizes the logic as shown in FIGS. 4B and 5, and adds two even-numbers represented by the upper 3 bits of the BCD code and is also represented by 3 bits. The even number and the carry 1 bit corresponding to the upper digit are output. If one decimal digit is added, it is necessary to realize the logic shown in FIG. 4A, and the number of logic circuits can be reduced as compared with that.

【0007】3入力2進加算回路2は図6(A)に示す
ような論理を実現した回路であり、通常の2進加算で用
いられるCSA(Carry Save Adder) でよい。これは、
1または0の値をとる3つの数の合計を計算する回路と
考えることもできる。
The 3-input binary adder circuit 2 is a circuit that realizes the logic as shown in FIG. 6A, and may be a CSA (Carry Save Adder) used in normal binary addition. this is,
It can also be considered as a circuit that calculates the sum of three numbers that take the values of 1 or 0.

【0008】偶数+2加算回路3は図6(B)に示すよ
うな論理を実現した回路であり、偶数加算回路1の簡易
なものともいえる。偶数加算回路1は、加算すべき2数
の各桁ごとに、上位3ビットで表される偶数同士を加算
し、和出力として下位の3ビット(偶数)と上位桁への
桁上げ出力1ビット C0u〜とを出力する。
The even +2 adder circuit 3 is a circuit that realizes the logic as shown in FIG. 6B and can be said to be a simple one of the even adder circuit 1. The even number adder circuit 1 adds even numbers represented by the upper 3 bits for each digit of 2 to be added, and outputs the lower 3 bits (even number) as a sum output and the carry output 1 bit to the upper digit. C0u ~ and are output.

【0009】3入力2進加算回路2は、加算すべき2数
の各桁ごとに、下位1ビット同士と、下位桁の偶数加算
回路の桁上げ出力 C0l〜とを加算し、各1ビットの和出
力と桁上げ出力とを出力する。
The 3-input binary adder circuit 2 adds the lower 1 bit and the carry output C0l of the even-numbered adder circuit of the lower digit for each digit of the two numbers to be added, and the 1-bit of each 1 bit is added. The sum output and the carry output are output.

【0010】偶数+2加算回路3は、各桁の偶数加算回
路1の和出力下位と3入力2進加算回路2の桁上げ出力
とを加算し、和出力として偶数を表す3ビットと上位桁
への桁上げ出力1ビット C1u〜とを出力する。
The even +2 adder circuit 3 adds the lower sum output of the even adder circuit 1 of each digit and the carry output of the 3-input binary adder circuit 2 to the 3 bits representing the even number and the upper digit as a sum output. Carry output 1 bit of C1u to and is output.

【0011】さらに、2段目の3入力2進加算回路20に
よって前段の3入力2進加算回路2の和出力と、下位桁
からの2つの桁上げC1l,C2l とを加算し、各1ビットの
和出力と桁上げ出力とを出力する。
Further, the sum output of the preceding three-input binary adder circuit 2 and the two carry C1l and C2l from the lower digit are added by the second-stage three-input binary adder circuit 20 to obtain 1 bit each. The sum output and the carry output of are output.

【0012】2段目(最終段)の偶数+2加算回路30に
よって、前段の偶数+2加算回路3の和出力と2段目の
3入力2進加算回路20の桁上げ出力とを加算し、和出力
として偶数を表す3ビットと上位桁への桁上げ出力1ビ
ット C2u〜とを出力する。
The second-stage (final-stage) even +2 adder circuit 30 adds the sum output of the preceding even-number +2 adder circuit 3 and the carry output of the second-stage three-input binary adder circuit 20 to obtain the sum. It outputs 3 bits that represent an even number and 1 bit carry output C2u ~ to the upper digit.

【0013】この2段目の偶数+2加算回路30の和出力
の偶数を表す3ビットと2段目の3入力2進加算回路20
の和出力1ビットとを連結して、この桁の和出力Zとす
る。前述の構成要素の数を増やせば、加算する10進数
の数を多くすることができる。図2は、3つの10進数
を加算する3入力10進加算器として構成した例であ
る。偶数加算回路1はオペランドの数に対応して2つず
つトーナメント形式接続し、3入力2進加算回路2およ
び偶数+2加算回路3とはカスケード接続とする。
3 bits representing the even number of the sum output of the even-numbered + 2 addition circuit 30 in the second stage and the 3-input binary addition circuit 20 in the second stage
The 1-bit sum output is concatenated to form the sum output Z of this digit. The number of decimal numbers to be added can be increased by increasing the number of the aforementioned components. FIG. 2 is an example configured as a 3-input decimal adder that adds three decimal numbers. The even-numbered adder circuits 1 are connected in a two-tournament form according to the number of operands, and are connected in cascade with the 3-input binary adder circuit 2 and the even-numbered +2 adder circuit 3.

【0014】最終段の偶数+2加算回路(30)と最終段
の3入力2進加算回路(20)とは図3に示すように一体
として桁上げ先見加算回路4として構成してもよい。図
3では2入力の例であるが、3入力以上の場合も同様に
構成できる。
The even-numbered +2 adder circuit (30) at the final stage and the 3-input binary adder circuit (20) at the final stage may be integrally configured as a carry look-ahead adder circuit 4 as shown in FIG. Although FIG. 3 shows an example of two inputs, the same configuration can be applied to the case of three or more inputs.

【0015】符号付オペランドを扱う場合または減算に
関しては以下のようにする。前述の10進加算器に加え
て、その各入力に、負のオペランドの加数と正のオペラ
ンドの減数とは補数に変換し、正のオペランドの加数と
負のオペランドの減数は正の数に変換する前処理回路
を、出力には結果を補数に変換する後処理回路とを設
け、また、前処理回路の出力における補数表現のオペラ
ンドの数と前述の10進加算器の最上位桁のすべての桁
上げ出力の和との差をとる判定回路を設ける。
When handling signed operands or subtraction, the following is performed. In addition to the decimal adder described above, the addend of the negative operand and the subtraction of the positive operand are converted into the complements at each input, and the addend of the positive operand and the subtraction of the negative operand are positive numbers. And a post-processing circuit for converting the result to a complement at the output, and the number of operands in the complement expression at the output of the pre-processing circuit and the most significant digit of the decimal adder described above. A decision circuit is provided that takes the difference from the sum of all carry outputs.

【0016】前処理回路による変換後の数を前述の10
進加算器により加算する。最終結果の符号は、前記判定
回路の出力が負であれば、加算結果を後処理回路を通し
て符号を負とし、正であれば後処理回路を通さず符号を
正とするように構成すればよい。
The number after conversion by the preprocessing circuit is set to 10 as described above.
Add with a decimal adder. The sign of the final result may be configured such that if the output of the determination circuit is negative, the addition result is passed through the post-processing circuit to make the sign negative, and if the sign is positive, the sign is passed without passing through the post-processing circuit. .

【0017】[0017]

【作用】10進数1桁の値は、偶数+1または偶数+0
で置き換えることができる。BCDコードであれば、4
ビットの上位3ビットは偶数をあらわし、下位1ビット
が1または0を表す。これをそれぞれ偶数成分、奇数成
分とよぶことにする。
Operation: The value of one decimal digit is even + 1 or even + 0
Can be replaced with 4 for BCD code
The upper 3 bits of the bit represent an even number, and the lower 1 bit represents 1 or 0. This is called an even component and an odd component, respectively.

【0018】10進1桁の2数、XとYを偶数成分X’
Y’と奇数成分x,y(値は1または0)とで表すと、 X=X’+x, Y=Y’+y である。その和は、 X +Y =(X’+Y’)+(x+y) X’+Y’= C0u×10+Z0 x+y = z0 である。
Decimal 1 digit 2 number, X and Y are even components X '
Expressing Y ′ and odd-numbered components x and y (values are 1 or 0), X = X ′ + x, Y = Y ′ + y. The sum is X + Y = (X '+ Y') + (x + y) X '+ Y' = C0u × 10 + Z 0 x + y = z 0.

【0019】X’+Y’を偶数加算回路1で演算し、和
の下位の値Z0 と上位桁への桁上げC0uとを得る。偶数
と偶数の和は16以下の偶数であるので、和の下位の値
0はそのまま偶数成分であり、桁上げ C0uは1ビット
であって、上位桁における奇数成分である。
X '+ Y' is calculated by the even adder circuit 1 to obtain the lower value Z 0 of the sum and the carry C 0u to the upper digit. Since the sum of the even number and the even number is 16 or less, the lower value Z 0 of the sum is the even component as it is, and the carry C0u is 1 bit and is the odd component in the upper digit.

【0020】x+yと下位の桁からの桁上げ C0l(これ
は下位の桁では上位桁への桁上げ C0uである)とを3入
力2進加算回路2で加算して2ビットの値z0 を得る。
これはそのまま10進1桁の下位2ビットに相当する。
従って、これを1ビットずつ偶数成分と奇数成分とに分
離することができる。すなわち上位の1ビットは10進
の2または0を表す偶数成分であり、下位の1ビットは
10進の1または0を表す奇数成分である。
X + y and the carry C0l from the lower digit (this is the carry C0u to the upper digit in the lower digit) are added by the 3-input binary adder circuit 2 to obtain the 2-bit value z 0 . obtain.
This directly corresponds to the lower 2 bits of the decimal 1 digit.
Therefore, this can be separated bit by bit into an even component and an odd component. That is, the upper 1 bit is an even component representing a decimal 2 or 0, and the lower 1 bit is an odd component representing a decimal 1 or 0.

【0021】偶数加算回路1の偶数成分出力と3入力2
進加算回路2の偶数成分出力とを偶+2加算回路3で加
算すると同様に偶数成分である和と上位桁への奇数成分
桁上げとを得る。
Even component output of even adder circuit 1 and 3 inputs 2
When the output of the even-numbered component of the binary adder circuit 2 is added by the even +2 adder circuit 3, the sum of the even-numbered components and the carry of the odd-numbered component to the upper digit are similarly obtained.

【0022】構成要素とした偶数加算回路1、3入力2
進加算回路2、偶数+2加算回路3はいずれも簡単な論
理回路として実現できる。最終段においては桁上げがリ
ップル伝播する可能性があるため、最終段の偶数+2加
算回路30と最終段の3入力2進加算回路20とを一体とし
て桁上げ先見加算回路4として構成すれば高速化でき
る。
Even adder circuit 1 and 3 inputs 2 as constituent elements
Both the decimal addition circuit 2 and the even +2 addition circuit 3 can be realized as a simple logic circuit. Since the carry may ripple propagate in the final stage, if the even-numbered +2 adder circuit 30 in the final stage and the 3-input binary adder circuit 20 in the final stage are integrally configured as the carry look-ahead adder circuit 4, high speed is achieved. Can be converted.

【0023】符号付オペランドを扱う場合、または減算
器として構成する場合は、負のオペランドまたは減数を
補数に変換して加算器に入力することで処理することが
できるのは自明である。
It is obvious that when a signed operand is handled, or when it is configured as a subtracter, it can be processed by converting a negative operand or a subtraction into a complement and inputting it to an adder.

【0024】ここで、結果の符号を考えると多入力の場
合少し複雑である。以下に3入力の場合について説明す
る。A,B,Cを入力の3つの数とする。説明の都合
上、これらは1桁の数とする。あるいは最上位桁で代表
させたものと考えればよい。 1)3数の内、1つ(C)が負の場合。
Considering the sign of the result, it is a little complicated in the case of multiple inputs. The case of three inputs will be described below. Let A, B, and C be the three numbers of inputs. For convenience of explanation, these are single digit numbers. Alternatively, it may be considered that the representative is represented by the highest digit. 1) One of the three numbers (C) is negative.

【0025】最上位からの桁上げが1以上の場合。 A+B+(10−C)≧10 A+B≧C 従って、結果は
正である。
When the carry from the highest rank is 1 or more. A + B + (10−C) ≧ 10 A + B ≧ C Therefore, the result is positive.

【0026】最上位からの桁上げがない場合。 A+B+(10−C)<10 A+B<C 従って、結果は
負である。 2)3数の内、2つ(B,C)が負の場合。
When there is no carry from the highest rank. A + B + (10-C) <10 A + B <C Therefore, the result is negative. 2) Of the three numbers, two (B, C) are negative.

【0027】最上位の桁上げが2以上の場合。 A+(10-B)+(10-C)≧20 A≧B+C 従って、結果は
正である。
When the highest carry is 2 or more. A + (10−B) + (10−C) ≧ 20 A ≧ B + C Therefore, the result is positive.

【0028】最上位の桁上げが1以下の場合。 A+(10-B)+(10-C)<20 A<B+C 従って、結果は
負である。 3)3数がすべて正または0の場合。結果は正であり、 A+B+C≧0 最上位からの桁上げにかか
わらない。 4)3数がすべて負の場合。結果は負であり、 A+B+C<9+9+9<30 従って、最上位からの桁上げは2以下である。
When the most significant carry is 1 or less. A + (10-B) + (10-C) <20 A <B + C Therefore, the result is negative. 3) When all three numbers are positive or zero. The result is positive, A + B + C ≧ 0, regardless of carry from the top. 4) When all 3 numbers are negative. The result is negative, A + B + C <9 + 9 + 9 <30 Therefore, the carry from the most significant digit is 2 or less.

【0029】以上を、オペランドの負の数の数が最上位
桁からの桁上げ出力の値より大であるとき、結果は負で
あるとまとめることができる。2入力の場合も同じであ
り、また、4入力以上の場合にも容易に拡張でき、同じ
ことがいえる。
The above can be summarized as the result is negative when the number of negative numbers in the operand is greater than the value of the carry output from the most significant digit. The same applies to the case of two inputs, and it can be easily expanded to the case of four or more inputs, and the same can be said.

【0030】[0030]

【実施例】以下、図面を参照して本発明の実施例を説明
する。図3は2入力10進加算器の実施例を示す。高速
化するため、最終段は桁上げ先見加算回路4にしてあ
る。その他は課題を解決するための手段の項で説明した
ものと同じである。図7はその演算例を示す説明図であ
る。以下に図3、図7を併せて参照しながら説明する。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 3 shows an embodiment of a 2-input decimal adder. In order to increase the speed, the carry look-ahead addition circuit 4 is provided at the final stage. Others are the same as those described in the section of means for solving the problem. FIG. 7 is an explanatory diagram showing an example of the calculation. Description will be given below with reference to FIGS.

【0031】被加数X=9999999と加数Y=99
88777とを加算する。 X,Yをそれぞれ上位3ビットの偶数成分と下位1ビ
ットの奇数成分に分離する。すなわち、8888888
+1111111と8888666+1100111と
なる。 偶数成分を偶数加算回路1で加算して各桁ごとに1桁
の和Z0=6666444と桁上げC0=1111111・
とを得る(・は0である)。 入力の2つの奇数成分と偶数加算回路1の出力の桁上
げC0とを3入力2進加算回路2で加算して、偶数成分0
2222222と奇数成分11100110とを得る。 偶数+2加算回路3でZ0=6666444との偶数
成分02222222とを加算して、和Z1=88886
66と桁上げC1=0000000・とを得る。 最終段加算回路(桁上げ先見加算回路)4により、
の出力の和Z1=8888666と桁上げC1=00000
00・との出力の奇数成分11100110とを加算
して最終和Z=19988776を得る。
Addend X = 9999999 and addend Y = 99
88777 is added. Each of X and Y is separated into an upper-order 3-bit even component and a lower-order 1-bit odd component. That is, 8888888
+1111111 and 8888666 + 1100111. The even-numbered component is added by the even-numbered addition circuit 1 and the sum of one digit for each digit Z0 = 66666444 and carry C0 = 1111111.
And get (· is 0). The two odd-numbered components of the input and the carry C0 of the output of the even-numbered addition circuit 1 are added by the 3-input binary addition circuit 2 to obtain the even-numbered component 0.
2222222 and the odd component 11100110 are obtained. The even number +2 addition circuit 3 adds Z0 = 66666644 and the even number component 0222222 to obtain the sum Z1 = 88886.
66 and carry C1 = 0000000. By the final stage adder circuit (carry lookahead adder circuit) 4,
Output sum Z1 = 8888666 and carry C1 = 00000
The output 00 and the odd component 11100110 of the output are added to obtain the final sum Z = 19988776.

【0032】なお、上位への各桁の桁上げは、での和
Z1の各桁が`8'(2進での`1000'B )のとき、和Z1の各桁
の最上位1ビットと、桁上げC1と奇数成分の各1ビット
により簡単に生成することができる。
The carry of each digit to the higher order is the sum of
When each digit of Z1 is '8'(`1000'B in binary), it can be easily generated by the most significant 1 bit of each digit of Z1 and carry C1 and each 1 bit of odd component. it can.

【0033】図8も同様の例を示す。図のの下位から
3桁目と6桁目において、桁上げ出力が実際に出る例で
ある。図9、図10は本発明の10進加算器を使って減算
を行なう例を示す。
FIG. 8 shows a similar example. This is an example in which carry output is actually output at the third and sixth digits from the bottom of the figure. 9 and 10 show examples of subtraction using the decimal adder of the present invention.

【0034】減数は補数回路によって9の補数にされる
(a)のと、最後に最上位桁からの桁上げ出力があれば
最下位に1を加えて補正し、無ければ9の補数に変換し
て、最終結果の「差」を得る(b)ように補数回路を追
加すればよい。
The subtraction is converted to 9's complement by the complement circuit (a). Finally, if there is a carry output from the most significant digit, 1 is added to the least significant digit to correct it. Then, a complement circuit may be added so as to obtain the “difference” of the final result (b).

【0035】本発明によれば、3入力以上の加算器を構
成することは容易であり、図2の3入力の10進加算器
の基本構成例の最終段を図3と同様に桁上げ先見回路と
すれは、実用的なものになる。同様に4入力以上に拡張
することも容易である。
According to the present invention, it is easy to construct an adder having three or more inputs, and the final stage of the basic configuration example of the three-input decimal adder shown in FIG. Circuits and lines will be practical. Similarly, it is easy to expand to more than 4 inputs.

【0036】[0036]

【発明の効果】以上説明したように、本発明によれば簡
単な機能回路の組合せで10進加算器を実現することが
でき、3入力以上の10進加算器に拡張することも容易
である。また10進減算器にする他、乗算、除算、2進
10進変換等の10進演算を行なう演算器の中核とする
ことが容易になる。
As described above, according to the present invention, a decimal adder can be realized with a simple combination of functional circuits, and it can be easily expanded to a decimal adder having three or more inputs. . In addition to the decimal subtractor, it becomes easy to use it as the core of an arithmetic unit that performs decimal operations such as multiplication, division, and binary-decimal conversion.

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

【図1】 2入力10進加算器の構成例FIG. 1 is a configuration example of a 2-input decimal adder.

【図2】 3入力10進加算器の構成例FIG. 2 is a configuration example of a 3-input decimal adder.

【図3】 最終段を桁上げ先見加算器にした実施例[FIG. 3] Example in which a carry-look-ahead adder is used at the final stage

【図4】 10進1桁+1桁の加算回路の機能FIG. 4 Function of adder circuit for 1 digit in decimal and 1 digit in decimal

【図5】 偶数加算回路の下位桁(和)出力と上位桁
(桁上げ)出力
[Figure 5] Lower digit (sum) output and upper digit (carry) output of the even number addition circuit

【図6】 3入力2進加算回路および偶数+2加算回
路の機能
FIG. 6 Functions of 3-input binary adder circuit and even +2 adder circuit

【図7】 加算例1FIG. 7 Addition example 1

【図8】 加算例2FIG. 8 Addition example 2

【図9】 減算例1FIG. 9 Subtraction example 1

【図10】 減算例2FIG. 10 Subtraction example 2

【符号の説明】[Explanation of symbols]

1 偶数加算回路 2 3入力2進加算回路 3 偶数+2加算回路 20 最終段3入力2進加算回路 30 最終段偶数+2加算回路 4 桁上げ先見加算回路 1 even number adder circuit 2 3 input binary adder circuit 3 even number +2 adder circuit 20 final stage 3 input binary adder circuit 30 final stage even number +2 adder circuit 4 carry carry lookahead adder circuit

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 BCDコード表現の10進数を加算する
加算器であって、 オペランドの各桁を上位3ビットで表される偶数成分と
下位1ビットで表される奇数成分とに分離し、 2つの偶数成分を入力として加算し、和の下位桁の3ビ
ットを偶数成分とし、上位桁への桁上げの1ビットを桁
上げ奇数成分として出力する偶数加算回路(1)と、 奇数成分または下位桁からの桁上げ奇数成分を3つずつ
入力として加算し、和の上位ビットを偶数成分の最下位
ビットとし、和の下位ビットを奇数成分として出力する
3入力2進加算回路(2)と、 偶数加算回路(1)または他の偶数+2加算回路(3)
からの偶数成分と3入力2進加算回路(2)の和の上位
ビットを偶数成分の最下位ビットとみなして加算し、和
の下位桁の3ビットを偶数成分とし、上位桁への桁上げ
の1ビットを桁上げ奇数成分として出力する偶数+2加
算回路(3)とを構成要素として、各桁毎に、 偶数加算回路(1)をトーナメント式に組み合わせて入
力の偶数成分を加算して1つの偶数成分を得て、途中で
発生する桁上げ奇数成分を上位桁へ送り、 3入力2進加算回路(2)をカスケード接続して、入力
および途中で発生する奇数成分および下位桁からの桁上
げ奇数成分を3つずつ組み合わせて加算し、 偶数+2加算回路(3)をカスケード接続して、偶数加
算回路(1)の最終段で得られる偶数成分または他の偶
数+2加算回路(3)の出力の偶数成分と、3入力2進
加算回路(2)の出力の奇数成分とを加算し、 偶数+2加算回路(3)の最終段の桁上げ奇数成分出力
を上位桁へ送り、偶数+2加算回路(3)の最終段の偶
数成分出力と、3入力2進加算回路(2)の最終段の奇
数成分出力とを連結してこの桁の和出力とするように構
成したことを特徴とする10進加算器。
1. An adder for adding a decimal number represented by a BCD code, wherein each digit of an operand is separated into an even component represented by upper 3 bits and an odd component represented by lower 1 bit, and 2. Two even-numbered components are added as input, the lower 3 bits of the sum are set as an even-numbered component, and one bit of carry to the upper-order digit is output as a carry-odd component. A three-input binary addition circuit (2) that adds three carry odd components from the digits as inputs, outputs the upper bit of the sum as the least significant bit of the even component, and outputs the lower bit of the sum as the odd component, Even adder circuit (1) or other even +2 adder circuit (3)
The even-numbered component from and the upper bit of the sum of the 3-input binary adder circuit (2) are regarded as the least significant bit of the even-numbered component and added, and the lower 3 bits of the sum are set as the even-numbered component and carry to the upper digit. For each digit, the even-numbered addition circuit (1) is combined in a tournament formula to add the even-numbered component of the input to 1 One even component is obtained and the carry odd component generated in the middle is sent to the upper digit, and the 3-input binary adder circuit (2) is connected in cascade to input and generate the odd component and the digit from the lower digit. Add up three odd-numbered components in combination and add the even-numbered +2 addition circuit (3) in a cascade connection to obtain an even-numbered component obtained at the final stage of the even-numbered addition circuit (1) or another even-numbered +2 addition circuit (3). Output even component and 3 inputs Add the odd component of the output of the binary adder circuit (2), carry the final carry of the even +2 adder circuit (3), send the output of the odd component to the upper digit, and add the final component of the even +2 adder circuit (3). A decimal adder characterized in that an even-numbered component output and an odd-numbered component output at the final stage of the 3-input binary addition circuit (2) are connected to obtain a sum output of this digit.
【請求項2】 最終段の偶数+2加算回路(3)と最終
段の3入力2進加算回路(2)の代わりに、前段の偶数
+2加算回路(3)の出力と前段の3入力2進加算回路
(2)の奇数成分と下位の桁すべてからの桁上げとを加
算してこの桁の和出力と上位桁への桁上げ出力とする桁
上げ先見加算回路を設けたことを特徴とする請求項1に
記載の10進加算器。
2. The output of the even +2 adder circuit (3) at the previous stage and the 3-input binary at the previous stage instead of the even +2 adder circuit (3) at the final stage and the 3-input binary adder circuit (2) at the final stage. A carry look-ahead addition circuit for adding the odd component of the adder circuit (2) and the carry from all the lower digits to produce a sum output of this digit and a carry output to the upper digit is provided. The decimal adder according to claim 1.
【請求項3】 符号付オペランドを扱う場合または減算
を行なう場合において、 請求項1ないし3に記載の10進加算器に加えて、その
各入力に、負のオペランドの加数と正のオペランドの減
数とは補数に変換し、正のオペランドの加数と負のオペ
ランドの減数は正の数に変換する前処理回路を、出力に
は結果を補数に変換する後処理回路を設け、前処理回路
の出力における補数表現のオペランドの数と前記の10
進加算器の最上位桁のすべての桁上げ出力の和との差を
とる判定回路を設け、 前処理回路による変換後の数を前記の10進加算器によ
り加算し、 最終結果の符号を、前記判定回路の出力が負であれば、
加算結果を後処理回路を通して符号を負とし、正であれ
ば後処理回路を通さず符号を正とするように構成したこ
とを特徴とする10進加減算器。
3. When handling signed operands or performing subtraction, in addition to the decimal adder according to any one of claims 1 to 3, the adder of the negative operand and the positive operand A pre-processing circuit is provided to convert a subtraction to a complement and to convert a positive operand addend and a negative operand subtraction to a positive number, and to provide a post-processing circuit for converting a result to a complement at the output. The number of operands in the complement representation in the output of
A decision circuit that takes the difference from the sum of all carry outputs of the most significant digit of the decimal adder is provided, the number after conversion by the preprocessing circuit is added by the decimal adder, and the sign of the final result is If the output of the determination circuit is negative,
A decimal adder / subtractor characterized in that the addition result is passed through a post-processing circuit to make the sign negative, and if the addition result is positive, the sign is made positive without passing through the post-processing circuit.
JP30071193A 1993-12-01 1993-12-01 Decimal adder and adder/subtractor Withdrawn JPH07152537A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30071193A JPH07152537A (en) 1993-12-01 1993-12-01 Decimal adder and adder/subtractor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30071193A JPH07152537A (en) 1993-12-01 1993-12-01 Decimal adder and adder/subtractor

Publications (1)

Publication Number Publication Date
JPH07152537A true JPH07152537A (en) 1995-06-16

Family

ID=17888177

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30071193A Withdrawn JPH07152537A (en) 1993-12-01 1993-12-01 Decimal adder and adder/subtractor

Country Status (1)

Country Link
JP (1) JPH07152537A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851110A (en) * 2019-11-15 2020-02-28 北京智芯微电子科技有限公司 Divider-free divide-by-three circuit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851110A (en) * 2019-11-15 2020-02-28 北京智芯微电子科技有限公司 Divider-free divide-by-three circuit
CN110851110B (en) * 2019-11-15 2022-04-01 北京智芯微电子科技有限公司 Divider-free divide-by-three circuit

Similar Documents

Publication Publication Date Title
JP2000347836A (en) High-order radix divider and method therefor
JPH0713742A (en) Multiplicaton device
US5426598A (en) Adder and multiplier circuit employing the same
JPH038018A (en) Adder / subtracter for signed absolute value
JP4273071B2 (en) Divide and square root calculator
US4677583A (en) Apparatus for decimal multiplication
JPH0619685A (en) Parallel multiplying circuit
Wang et al. A new redundant binary number to 2's-complement number converter
Gao et al. An improved BCD adder using 6-LUT FPGAs
JPH07152537A (en) Decimal adder and adder/subtractor
US7840628B2 (en) Combining circuitry
US3462589A (en) Parallel digital arithmetic unit utilizing a signed-digit format
Choo et al. A novel conversion scheme from a redundant binary number to two's complement binary number for parallel architectures
JP3558436B2 (en) Multiplier and product-sum operation unit
JP2682142B2 (en) Multiplier
JP2002014804A (en) Ternary digital circuit
JP2606326B2 (en) Multiplier
JPH11126157A (en) Method and circuit for multiplication
JP2990910B2 (en) Binary parallel squaring multiplier
JPS63311433A (en) Binary redundant sd code converting/subtracting method and its circuit
JPH0216632A (en) Fixed point number/floating point number converting circuit
sadat Hoseininasab et al. A Method for Single Radix-10 constant multiplication
JPH03163624A (en) Digital decimal number multiplier
JP3803653B2 (en) Multiplication processor
JPH05265715A (en) Adder/multiplier

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20010206