JPH0448327A - Arithmetic unit - Google Patents

Arithmetic unit

Info

Publication number
JPH0448327A
JPH0448327A JP15934690A JP15934690A JPH0448327A JP H0448327 A JPH0448327 A JP H0448327A JP 15934690 A JP15934690 A JP 15934690A JP 15934690 A JP15934690 A JP 15934690A JP H0448327 A JPH0448327 A JP H0448327A
Authority
JP
Japan
Prior art keywords
digit
decimal
arithmetic unit
bit
bit arithmetic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP15934690A
Other languages
Japanese (ja)
Inventor
Makoto Ito
信 伊藤
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co 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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP15934690A priority Critical patent/JPH0448327A/en
Publication of JPH0448327A publication Critical patent/JPH0448327A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To attain an arithmetic operation at a high speed by controlling the decimal carry with only a carry signal received from a 4-bit arithmetic and logic unit and corresponding to a hexadecimal number when the decimal data expressed in a form of a complement of 10 into the decimal data expressed in the absolute value. CONSTITUTION:A 4-bit arithmetic and logic unit ALU 1 is provided together with an inverter INV, and a +10 adder circuit ADD. In such a constitution, the decimal carry can be controlled with only a carry signal received from the ALU 1 and corresponding to a hexadecimal number when the ALU 1 carries out the addition processing in order to convert the decimal data expressed in a form of a complement of 10 into the decimal data expressed in the absolute value. Thus the computing speed is extremely increased.

Description

【発明の詳細な説明】 [産業上の利用分野コ この発明は、10進数の各桁に対応して設けられた複数
の4ビット演算器により10進数演算を行う演算装置に
関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] This invention relates to an arithmetic device that performs decimal arithmetic using a plurality of 4-bit arithmetic units provided corresponding to each digit of a decimal number.

[発明の概要] この発明は、10の補数形式で表現されたlO進数デー
タを絶対値表現による10進数テータに変換するための
加算処理を4ビット−演算器により行うに際して、加算
対象データを補正して入力することにより、本来の加算
対象データ同士の加算結果か10以−トとなる場合に必
ず4ビット演算器から16進数対応のキャリー信号が得
られるようにすることによって、このキャリー信号だけ
で10進桁上げを制御できる環境にして、高速演算を実
現したものである。
[Summary of the Invention] This invention corrects the data to be added when performing an addition process using a 4-bit arithmetic unit to convert lO base number data expressed in 10's complement format to decimal number data expressed in absolute value. By inputting a hexadecimal number, a carry signal corresponding to a hexadecimal number is always obtained from a 4-bit arithmetic unit when the addition result of the original addition target data is 10 or more. This is an environment in which decimal carry can be controlled with , and high-speed calculations have been achieved.

[従来の技術] 2進化10進数で表現された複数桁のlO進数データに
ついて演算を行う場合、各桁に対応する複数の4ビット
演算器を利用しているが、この4ビット演算器では負の
減算結果は10の補数の形で出力される。
[Prior art] When performing calculations on multiple digits of lO-base data expressed in binary coded decimal numbers, multiple 4-bit calculation units corresponding to each digit are used. The subtraction result is output in the form of 10's complement.

例えば、” 30−60”なる減算を行った場合は、1
0の補数の形で表現された“70”という演算結果が得
られる。しかし、補数表現はユーザにとって理解が困難
であるなめ、上記演算結果を正規の形に変換して、すな
わち′30”とパ60°。
For example, when subtracting "30-60", 1
An operation result of "70" expressed in zero's complement form is obtained. However, since the complement representation is difficult for the user to understand, the above calculation result is converted to the normal form, that is, '30'' and 60°.

との差(絶対値)である’ 30 ”に負の符号を付加
して、出力する場合がある。
A negative sign may be added to '30'' which is the difference (absolute value) between the two and output.

ところで、上記絶対値への変換は、上記10の補数の形
で表現された演算結果の9の補数に“1″を加算するこ
とで実現される。すなわち、上記例では、70”の9の
補数である“29”に対して“1”を加算して30°°
という絶対値が得られる。
By the way, the conversion to the absolute value is realized by adding "1" to the 9's complement of the arithmetic result expressed in the form of the 10's complement. In other words, in the above example, adding "1" to "29", which is the nine's complement of "70", gives 30°
The absolute value is obtained.

しかし、この加算処理(10進数の加算処理)を上記4
ビット演算器で行う場合、各桁の加算結果が10以上に
なった場合に桁上げを行う必要があるにも拘らず、上記
4ビット演算器は、その加算結果が16以上の場合にの
みキャリー信号を発生する。従って、4ビット演算器に
よる加算結果が10以上であるか否かを判別し、10以
上である場合には改めてキャリー信号を発生させねばな
らず、必要なキャリー信号の発生に時間がかかり、2進
データの加算の場合に比べ演算スピードが低下すると共
に、回路が複雑化していた。
However, this addition process (addition process of decimal numbers) is
When using a bit arithmetic unit, it is necessary to perform a carry when the addition result of each digit is 10 or more, but the above 4-bit arithmetic unit carries only when the addition result is 16 or more. Generate a signal. Therefore, it is necessary to determine whether the addition result by the 4-bit arithmetic unit is 10 or more, and if it is 10 or more, to generate a carry signal again, and it takes time to generate the necessary carry signal. Compared to the case of adding base data, the calculation speed is lower and the circuit is more complicated.

[発明が解決しようとする課題] これは、上記のように、4ビット演算器からの16進数
対応のキャリー信号だけでは対処できず、10進数対応
の別のキャリー信号を発生させねばならないことに起因
する。
[Problem to be Solved by the Invention] As mentioned above, this problem cannot be solved with only the carry signal corresponding to hexadecimal numbers from the 4-bit arithmetic unit, and it is necessary to generate another carry signal corresponding to decimal numbers. to cause.

そこで、種々検討した結果、9の補数に予め″6”を加
算した後に“1”を加えれば、本来の加算対象データで
ある9の補数と°“1”との加算結果が10以上となる
場合は、必ずキャリー信号が出力されることとなり、4
ビット演算器からの16進数対応のキャリー信号だけ対
処できるであろうとの着想を得な、また、9の補数に6
”を加算することは、各ビットを反転するだけで得られ
る1の補数を求めることに等しいため、上記“6”を加
算する回路も簡単な回路で済むであろうとの見通しを得
た。
As a result of various studies, we found that if we add "6" to the 9's complement in advance and then add "1", the result of adding the 9's complement, which is the original data to be added, and the "1" becomes 10 or more. In this case, a carry signal will always be output, and 4
I got the idea that it would be possible to deal with only the carry signal corresponding to hexadecimal numbers from the bit arithmetic unit, and
Since adding "6" is equivalent to finding a 1's complement number obtained by simply inverting each bit, it was predicted that the circuit for adding "6" would be simple.

この発明の課題は、10の補数形式で表現された10進
数データを、絶対値表現による10進数データに変換す
るための加算処理を4ビット演算器により行うに際して
、4ビット演算器からの16進数対応のキャリー信号だ
けで10進桁上げを制御できるようにすることである。
The problem of this invention is to convert the hexadecimal number from the 4-bit arithmetic unit into a 4-bit arithmetic unit when performing an addition process to convert decimal data expressed in 10's complement format into decimal data expressed in absolute value. The purpose is to enable decimal carry to be controlled using only the corresponding carry signal.

[課題を解決するための手段] この発明の手段は次の通りである。[Means to solve the problem] The means of this invention are as follows.

この演算装置は、10進数の各桁に対応して設けられた
複数の4ビット演算器を有し、各4ビット演算器にて発
生したキャリー信号を上位桁対応の4ビット演算器に伝
搬しながら10進数演算を行ものであり、次のような回
路を備えている。
This arithmetic unit has a plurality of 4-bit arithmetic units provided corresponding to each digit of a decimal number, and propagates the carry signal generated by each 4-bit arithmetic unit to the 4-bit arithmetic unit corresponding to the upper digit. It also performs decimal arithmetic, and is equipped with the following circuit.

(1)補正回路: 10の補数形式で表現された10進数データを、絶対値
表現による10進数データに変換するに当たり、上記1
0の補数形式で表現された10進数データの各桁に対応
する4ビットのデータ成分を夫々反転して補正する。
(1) Correction circuit: When converting decimal data expressed in 10's complement format to decimal data expressed in absolute value, the above 1.
The 4-bit data components corresponding to each digit of decimal data expressed in 0's complement format are inverted and corrected.

(2)出力回R: 上記4ビット演算器の夫々に、“0°°、及び上記補正
回路にて補正された対応する桁の4ビットの補正データ
が入力され、さらに1桁目に対応する4ビット演算器に
対してはキャリー信号が入力されて加算指示が行われた
とき、この加算指示に基づく加算処理によりキャリー信
号が発生した桁については、その加算結果の値を出力し
、キャリ一信号が発生しなかった桁については、加算結
果から“6”を減算した値を出力する。
(2) Output time R: The 4-bit correction data of “0°°” and the corresponding digit corrected by the correction circuit are input to each of the 4-bit arithmetic units, and then the 4-bit correction data corresponding to the 1st digit is input. When a carry signal is input to a 4-bit arithmetic unit and an addition instruction is issued, for the digit for which a carry signal is generated by addition processing based on this addition instruction, the value of the addition result is output, and the carry signal is For digits where no signal is generated, a value obtained by subtracting "6" from the addition result is output.

[作 用] この発明の手段の作用は次の通りである。[Work] The operation of the means of this invention is as follows.

例えば、10の補数の形で表現された“70”という演
算結果を絶対値表現に変換するものとする。
For example, assume that the calculation result "70" expressed in 10's complement form is converted into absolute value expression.

この場合、補正回路は、“70”の1桁目の“0”、2
桁目の“7”、すなわち、“0000”“0111”を
夫々反転して“1]11”“1000”のように補正す
る。
In this case, the correction circuit outputs "0" in the first digit of "70",
The digit "7", that is, "0000" and "0111" are respectively inverted and corrected as "1]11" and "1000".

このように補正された1桁目の補正データ“1111”
、2桁目の補正データ“1000”は、夫々、対応する
桁の4ビット演算器に入力される。
The first digit correction data “1111” corrected in this way
, the second digit correction data "1000" are respectively input to the 4-bit arithmetic unit of the corresponding digit.

また、1桁目、及び2桁目対応の各4ビット演算器には
、他方の加算対象データとして、共に“0000”が入
力される。そして、1桁目対応の4ビット演算器に更に
キャリー信号が入力されて、加算処理が指示される。
Furthermore, "0000" is input to each of the 4-bit arithmetic units corresponding to the first and second digits as the other data to be added. Then, a carry signal is further input to the 4-bit arithmetic unit corresponding to the first digit to instruct addition processing.

出力回路4」゛、この指示に基づいて加算処理が実行さ
れたとき、キャリー信号が発生した桁については、その
加算結果の値を出力し、キャリー信号が発生しなかった
桁については、加算結果から”6′′を減算した値を出
力する。
Output circuit 4'' When the addition process is executed based on this instruction, the value of the addition result is output for the digit where a carry signal was generated, and the value of the addition result is output for the digit where a carry signal was not generated. Outputs the value obtained by subtracting "6'' from

例えば、上記例において、1桁目の4ビット演算器では
、加算対象デ・−タ(1]、 1 ]、 )、(000
0)の他に、キャリー信号が入力されたので、(<11
11)+(0000)+ ”]” )なる加算処理が行
われる。この場合、論理的には加算結果は(10000
)、となるが、4ビット演算器では4ビットまでの演算
結果しか得られないので、5ビット目の“1”に基づい
てキャリー信号が発生され、<0000)のビット内容
となる。
For example, in the above example, in the 1st digit 4-bit arithmetic unit, the data to be added are (1], 1 ], ), (000
In addition to 0), a carry signal was input, so (<11
11)+(0000)+"]") addition processing is performed. In this case, logically the addition result is (10000
), but since a 4-bit arithmetic unit can only obtain arithmetic results up to 4 bits, a carry signal is generated based on the 5th bit "1", resulting in a bit content of <0000).

このように、キャリー信号が発生された場合、10の補
数の形で表現された“70゛を絶対値表現に変換した場
合の変換結果である゛30パの1桁目と一致する。従っ
て、1桁目に対応する4ビット演算器の演算結果<00
00)は、そのまま出力する。
In this way, when a carry signal is generated, it matches the first digit of ``30'', which is the conversion result when ``70'' expressed in 10's complement form is converted to absolute value expression. Therefore, Operation result of 4-bit arithmetic unit corresponding to 1st digit <00
00) is output as is.

上記例において、2桁目の4ビット演算器では、加算対
象データ(1000)、(0000)の他に、上記1桁
目の4ビット演算器にて発生されたキャリー信号が入力
されるので、 + <1000>+ (0000)+“′1”)なる加
算処理が行われる。この場合、加算結果はく1001)
であり、4ビットで表現可能な16未満の9”なのでキ
ャリー信号は出力されない。
In the above example, in addition to the addition target data (1000) and (0000), the carry signal generated by the 4-bit arithmetic unit in the first digit is input to the 4-bit arithmetic unit in the second digit. + <1000>+ (0000) + "'1") is performed. In this case, the addition result is 1001)
Since it is 9" which is less than 16 which can be expressed with 4 bits, no carry signal is output.

このとき、4ビット演算器での演算結果である°“9′
は、“70”を絶対値表現に変換した場合の変換結果で
ある30”の2桁目の“3′°より°″6”たけ大きく
なっている。そこで、出力回路は、2桁目に対応する4
ビット演算器の演算結果である°′9”から“6”を減
算して、論理的に正しい°’3”、すなわち、(001
1)を2桁目の変換結果として出力する。
At this time, the calculation result of the 4-bit arithmetic unit is °“9′
is larger by 6 degrees than the second digit 3' degrees of 30, which is the conversion result when converting 70 to absolute value representation. Therefore, the output circuit is
By subtracting "6" from °'9", which is the operation result of the bit arithmetic unit, we obtain the logically correct °'3", that is, (001
1) is output as the second digit conversion result.

従って、10の補数形式で表現された10進数データを
、絶対値表現による10進数データに変換するための加
算処理を4ビット演算器により行うに際して、4ビット
演算器からの16進数対応のキャリー信号だけで10進
桁上げを制御できる。
Therefore, when a 4-bit arithmetic unit performs addition processing to convert decimal data expressed in 10's complement format to decimal data expressed in absolute value, a carry signal corresponding to a hexadecimal number from the 4-bit arithmetic unit is required. You can control decimal carry with just

[実施例] 以下、実施例を第1図ないし第5図を参叩しながら説明
する。
[Example] Hereinafter, an example will be described with reference to FIGS. 1 to 5.

第1図は、第1実施例による演算装置のブロック構成図
である。
FIG. 1 is a block configuration diagram of an arithmetic device according to a first embodiment.

この演算装置は、4つの4ビット演算器ALU1を有し
ており、各4ビット演算器ALUIには、夫々、反転回
路INV、+10加算回BADDが接続されている。
This arithmetic device has four 4-bit arithmetic units ALU1, and each 4-bit arithmetic unit ALUI is connected to an inversion circuit INV and a +10 addition circuit BADD, respectively.

この演算装置は、2進化10進数コード(BCDコード
)で表現された10進数データについて、図示省略した
C P [J等からの指示に基ついて、加算、減算、乗
算、除算等の各種演算処理を行うものであり、各4ビ・
ノド演算器A L L、+ 1は、演算対象の10進数
データの各桁と1対1に対応づけられている9すなわち
、10進数データは、各桁対応の4ビブ■−のデータ成
分に区分され、夫々、対応する4ビ・ノド演算器AL[
J]に振り分けて入力される。
This arithmetic unit performs various arithmetic operations such as addition, subtraction, multiplication, and division on decimal data expressed in binary coded decimal code (BCD code) based on instructions from C P [J, etc. (not shown) Each 4-bit
The node operator A L L, + 1 has a one-to-one correspondence with each digit of the decimal number data to be operated on.9 In other words, the decimal number data is divided into four bib ■ - data components corresponding to each digit. divided into corresponding 4-bit arithmetic units AL[
J] are distributed and input.

なお、10の補数形式で表現された10進データを絶対
値表現による10進データに変換する場合、変換対象で
ある10の補数形式で表現された10進データの各桁数
分は、対応桁の反転回路INVにて反転された後、対応
桁の4ビット演算器ALU1に入力される。この場合、
各4ビット演算器ALU1には、他方の演算対象データ
として、“°0”が共通に入力される。そして、1桁目
に対応する4ビット演算器ALU1にのみキャリー信号
が入力されて、加算指令が与えられる。
Note that when converting decimal data expressed in 10's complement format to decimal data expressed in absolute value, each digit of the decimal data expressed in 10's complement format, which is the target of conversion, is converted into a corresponding digit. After being inverted by the inverting circuit INV, the signal is input to the 4-bit arithmetic unit ALU1 of the corresponding digit. in this case,
“°0” is commonly input to each 4-bit arithmetic unit ALU1 as the other data to be calculated. Then, the carry signal is input only to the 4-bit arithmetic unit ALU1 corresponding to the first digit, and an addition command is given.

以上の反転処理は、次のような意義を持つ。The above reversal processing has the following significance.

すなわち、上記絶対値表現への変換は、変換対象データ
(10進数)に対する9の補数に“1”を加算すること
で実現されるが、この10進加算を行うに際して、加算
結果が10以上になる場合は、必ず4ビット演算器AL
U1から16進数対応のキャリー信号が発生するように
して、10進桁上げを上記16進数対応のキャリー信号
だけで行えるようにするための前処理として行われる。
In other words, the above conversion to absolute value expression is achieved by adding "1" to the 9's complement of the data to be converted (decimal number), but when performing this decimal addition, if the addition result is 10 or more, If so, be sure to use 4-bit arithmetic unit AL
This is performed as preprocessing so that a hexadecimal carry signal is generated from U1 so that decimal carry can be performed only with the hexadecimal carry signal.

すなわち、加算結果が10以上になる場合に、必ず4ビ
ット演算器ALU1から16進数対応のキャリー信号が
発生するようにするためには、16進法と10進法との
基数(ラディックス)の差である6”を加算対象データ
に予め加えておくことで実現できるが、上記9の補数に
“6”を加えることは°“1”の補数を求めることに他
ならない、そこで、この“1”の補数を求めるための反
転処理を行い、実質的に9の補数に6”加えることとし
た。
In other words, in order to ensure that a carry signal corresponding to a hexadecimal number is generated from the 4-bit arithmetic unit ALU1 when the addition result is 10 or more, the difference in the radix between the hexadecimal system and the decimal system must be This can be achieved by adding ``6'' to the data to be added in advance, but adding ``6'' to the above 9's complement is nothing but finding the complement of ``1'', so this ``1'' We decided to perform inversion processing to find the complement of , and essentially add 6'' to the complement of 9.

+10加算回路ADDは、+6された9の補数を用いて
加算処理を行った結果、キャリー信号が発生しない桁で
は、4ビット演算器ALU1による加算結果が論理演算
値よりも°°6“°だけ大きくなるため、キャリー信号
が発生しない場合に、4ビット演算器ALU1での加算
結果に°10“°を加算して(16進数では′°6”を
減算することに等しい)、正しく修正する回路である。
As a result of the +10 addition circuit ADD performing addition processing using the 9's complement number increased by +6, in the digit where no carry signal is generated, the addition result by the 4-bit arithmetic unit ALU1 is only °°6"° higher than the logical operation value. Therefore, if a carry signal is not generated, a circuit that adds °10" ° (equivalent to subtracting '°6" in hexadecimal) to the addition result in 4-bit arithmetic unit ALU1 and corrects it correctly. It is.

この+10加算回路ADDは、キャリー信号が発生した
場合は、4ビット演算器ALU1での加算結果をそのま
ま出力する。
This +10 addition circuit ADD outputs the addition result of the 4-bit arithmetic unit ALU1 as is when a carry signal is generated.

なお54桁以上の10進データを演算する場合は、4つ
の4ビット演算器ALU1等をサイクリックに活用する
9例えば、8桁の10進データを演算する場合は、1桁
目から4桁目までの演算を、夫々対応する桁の4ビット
演算器ALUIにて行い、その後、5桁目、6桁目、7
桁目、8桁目の演算は、夫々、1桁目、2桁目、3桁目
、4桁目の4ビット演算器ALUIにて行われる。この
場合、1桁目から4桁目までの演算を行った際に4桁目
の4ビット演算器ALU1にて発生したキャリー信号は
、2順目の演算を行うに先立って、5桁目の演算を行う
1桁目に対応する4ビット演算器ALU1に入力される
Note that when calculating decimal data of 54 digits or more, four 4-bit calculating units ALU1 etc. are used cyclically.9For example, when calculating 8-digit decimal data, the first to fourth digits are The calculations up to the 4-bit calculation unit ALUI for the corresponding digit are performed, and then the calculations for the 5th, 6th, and 7th digits are performed.
The operations on the digits and the 8th digit are performed by the 4-bit arithmetic units ALUI on the 1st, 2nd, 3rd, and 4th digits, respectively. In this case, the carry signal generated in the 4-bit arithmetic unit ALU1 of the 4th digit when performing the calculation from the 1st to the 4th digit is The data is input to the 4-bit arithmetic unit ALU1 corresponding to the first digit to be calculated.

次に、絶対値表現への変換動作を具体例で説明する。Next, the conversion operation to absolute value representation will be explained using a specific example.

例えば、10の補数形式で表現された10進デーダ“9
778 ”を、絶対値表現による10進データ“’02
22“に変換する場合、変換対象である’9778“の
各桁数分“9′°  “′7”“7”“8“は、夫々対
応する桁の反転口1INVに入力されて反転され、その
反転結果である′6′。
For example, the decimal data "9" expressed in 10's complement format is
778” as decimal data “’02” in absolute value representation.
When converting to 22", each number of digits "9'° "'7""7" and "8" of '9778' to be converted is input to the inversion port 1INV of the corresponding digit and inverted, '6' is the inversion result.

“8゛°、8”  °′7°°が夫々対応桁の4ビット
演算器ALUIに入力される(第2図■参照)。
"8°, 8"°'7° are respectively input to the 4-bit arithmetic unit ALUI of the corresponding digit (see FIG. 2).

この場合、各4ビット演算器ALLJ1には、もう一方
の演算データとして°’oooo”が共通入力され、1
桁目の4ビット演算器ALU1には、更にキャリー信号
も入力される。そして、加算指令が与えられると、1桁
目の4ビット演算器ALU1では、入力されたキャリー
信号に基づいて、上記入力データの他に1′′をも加算
対象データとして取り扱う(第2図■参照)、この結果
、各4ビット演算器ALU1での加算結果は、夫々、”
 6 ”、′8゛、“8゛、“′8“となる(第2図■
参照)。
In this case, °'ooo'' is commonly input to each 4-bit arithmetic unit ALLJ1 as the other calculation data, and 1
A carry signal is also input to the 4-bit arithmetic unit ALU1 of the digit. When an addition command is given, the 4-bit arithmetic unit ALU1 in the first digit handles 1'' in addition to the above input data as addition target data based on the input carry signal (see Figure 2). ), as a result, the addition results in each 4-bit arithmetic unit ALU1 are ``
6", '8", "8", "'8" (Fig. 2■
reference).

この場合、各加算結果は全て16以下であるので、いず
れの4ビット演算器ALUlも、キャリー信号を発生せ
ず、上記加算結果は、論理的に正しい変換結果” 02
22 ”に比べ、+6補正した分だけ大きくなっている
In this case, since each addition result is all 16 or less, none of the 4-bit arithmetic units ALU1 generates a carry signal, and the above addition result is a logically correct conversion result."02
Compared to 22'', it is larger by +6 correction.

そこで、各桁対応の」−10加算回路ADDは、上記加
算結果に対して“10”を加算することにより実質的に
−6再補正しく第2図■参照)、その再補正結果″′0
”、“2”、“、“2”を絶対値表現データとして出力
する(第2図■参照)このように、10進桁上げは4ビ
ット演算器ALUIからのキャリー信号だけに基づいて
実行されるので、従来のように、キャリー信号が発生し
ない場合でも、その都度、各4ビット演算器ALU1で
の加算結果が10以上であるか否かをチエツクし、10
以上の場合に別のキャリー信号を改めて発生させる必要
がなくなり、演算スピードをアップすることができる。
Therefore, the ``-10 addition circuit ADD corresponding to each digit adds ``10'' to the above addition result to effectively re-correct by -6 (see Figure 2 ■), and the re-correction result is ``'0.
", "2", ", "2" are output as absolute value expression data (see Figure 2 ■) In this way, decimal carry is executed based only on the carry signal from the 4-bit arithmetic unit ALUI. Therefore, as in the past, even if a carry signal is not generated, it is checked each time whether the addition result in each 4-bit arithmetic unit ALU1 is 10 or more.
In the above case, there is no need to generate another carry signal again, and the calculation speed can be increased.

また、反転入力用のインバータを付加するだけで目的を
達成でき、コスト的にもほとんど影響をうけない。
Furthermore, the purpose can be achieved simply by adding an inverter for inverting input, and there is almost no effect on cost.

次に、第2実施例を第3図ないし第5図を参照しながら
説明する。
Next, a second embodiment will be described with reference to FIGS. 3 to 5.

第3図は第2実施例による演算装置のブロック構成図で
ある。この第2実施例の構成、機能は、第1実施例と共
通する部分が多いので、相違点のみを簡単に説明する。
FIG. 3 is a block diagram of the arithmetic device according to the second embodiment. The configuration and functions of this second embodiment have many parts in common with the first embodiment, so only the differences will be briefly explained.

第1実施例と相違する点は、各4ビット演算器ALU2
が桁上げ先読み機能を有すると共に、桁上げ発生回路3
が設けられ、これらによって高速桁上げが実行される点
である。
The difference from the first embodiment is that each 4-bit arithmetic unit ALU2
has a carry lookahead function, and the carry generation circuit 3
are provided, and high-speed carry is performed by these.

すなわち、各4ビット演算器ALU2は、第4図に示し
たようなゲートアレイからなる桁上げ先読部LACを有
している。この桁上げ先読部LACは、入力された2つ
の加算対象データに基づいて、信号Gと信号Pを生成し
、桁上げ発生回路3に出力する。これら信号の出力は、
各桁とも同時に行われる。ここで、信号Gは、下位桁か
らのキャリー信号が無くても演算対象データの加算だけ
でキャリー信号が発生ずる場合の桁上げを示し、発生桁
上げと呼ばれるものである。また、信号Pは、下位桁か
らのキャリー信号が有るときにキャリー信号が発生する
場合に対応している。
That is, each 4-bit arithmetic unit ALU2 has a carry look-ahead section LAC consisting of a gate array as shown in FIG. The carry lookahead unit LAC generates a signal G and a signal P based on the two input data to be added, and outputs them to the carry generation circuit 3. The output of these signals is
Each digit is performed at the same time. Here, the signal G indicates a carry when a carry signal is generated simply by adding the data to be operated on even if there is no carry signal from the lower digit, and is called a generated carry. Further, the signal P corresponds to the case where a carry signal is generated when there is a carry signal from a lower digit.

桁上げ発生回B3は、第5図に示したようなゲートアレ
イにより構成され、各桁対応の4ビット演算器ALU2
の桁上番ヂ先読部LACからの信号G、信号P等に基づ
いて、各桁のキャリー信号C1〜C4を発生し、夫々、
対応する桁の+10加算回路ADD2に出力する。すな
わち、第5図から明らかなように、 C1=GO+PO−CO−・・・・・・・・(1)C2
=G1+Pl・C1−・・・・・・・・(2)C3=G
2+P2・C2・・・・・・・・・(3)C4=G3+
P3・C3−・・・・・・・・(4)なる論理式で求め
られる。各式中の“’PO・CO°′パP1・C]パ’
P2・C2”P3・C3“は、下位桁からのキャリー信
号が有る場合に行われる桁上げを示し、伝搬桁上けと呼
ばれるものである。
The carry generation circuit B3 is composed of a gate array as shown in FIG.
Carry signals C1 to C4 for each digit are generated based on the signal G, signal P, etc. from the look-ahead unit LAC for the upper digit number, respectively.
It is output to the +10 adder circuit ADD2 of the corresponding digit. That is, as is clear from Fig. 5, C1=GO+PO-CO- (1) C2
=G1+Pl・C1−・・・・・・・(2)C3=G
2+P2・C2・・・・・・・・・(3)C4=G3+
P3・C3-...It is determined by the logical formula (4). "'PO・CO°'PaP1・C]Pa' in each formula
P2.C2"P3.C3" indicates a carry performed when there is a carry signal from a lower digit, and is called a propagation carry.

これらキャリー信号C1〜C4も同時に発生・出力され
る。すなわち、2桁目以降のキャリー信号C2〜C4も
、1桁目のキャリー信号C1と同時に発生される。
These carry signals C1 to C4 are also generated and output at the same time. That is, the carry signals C2 to C4 for the second and subsequent digits are also generated simultaneously with the carry signal C1 for the first digit.

従って、2桁目以降の加算結果は、1桁目の加算結果が
確定するのと同時に確定され、第1実施例の場合のよう
に逐次的に確定していく必要はないので、更にスピード
アップされる。
Therefore, the addition results for the second and subsequent digits are determined at the same time as the addition results for the first digit, and there is no need to determine them sequentially as in the case of the first embodiment, further speeding up the process. be done.

この発明は、上記実施例に限定されることなく、例えば
、4つ以上の4ビット演算器を備えた演算装置に適用す
ることも可能である。
The present invention is not limited to the above-mentioned embodiments, but can also be applied to, for example, an arithmetic device equipped with four or more 4-bit arithmetic units.

「発明の効果」 この発明によれは、10の補数形式で表現された10進
数テータを、絶対値表現による10進数データに変換す
るための加算処理を4ビット演算器により行うに際して
、4ビット演算器からの16進数対応のキャリー信号な
けて10進桁上げを制御でき、演算スピードを大巾にア
ップすることが可能となる。
"Effects of the Invention" According to the present invention, when performing addition processing for converting decimal data expressed in 10's complement form into decimal data expressed in absolute value form using a 4-bit arithmetic unit, 4-bit operation is possible. Decimal carry can be controlled without a carry signal corresponding to hexadecimal numbers from the device, making it possible to greatly increase calculation speed.

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

第1図は第1の実施例のブロック構成図、第2図は加算
動作を具体的に説明するための図、第3図は第2の実施
例のプロ・ツク構成図、第・1図は第3図における桁上
げ先読み部の構成図、第5図は第3図における桁上げ発
生回路の構成図である。 ALU 1 。 ALU2・・・4ビット演算器、 NV ・・・反転回路、 ADD・・・+10加算回路。
Fig. 1 is a block diagram of the first embodiment, Fig. 2 is a diagram specifically explaining the addition operation, Fig. 3 is a block diagram of the second embodiment, and Fig. 1 is a block diagram of the first embodiment. 3 is a block diagram of the carry lookahead section in FIG. 3, and FIG. 5 is a block diagram of the carry generation circuit in FIG. 3. ALU 1. ALU2...4-bit arithmetic unit, NV...inversion circuit, ADD...+10 addition circuit.

Claims (1)

【特許請求の範囲】 10進数の各桁に対応して設けられた複数の4ビット演
算器を有し、各4ビット演算器にて発生したキャリー信
号を上位桁対応の4ビット演算器に伝搬しながら10進
数演算を行う演算装置において、 10の補数形式で表現された10進数データを、絶対値
表現による10進数データに変換するに当たり、上記1
0の補数形式で表現された10進数データの各桁に対応
する4ビットのデータ成分を夫々反転して補正する補正
回路と、 上記4ビット演算器の夫々に、“0”、及び上記補正回
路にて補正された対応する桁の4ビットの補正データが
入力され、さらに1桁目に対応する4ビット演算器に対
してはキャリー信号が入力されて加算指示が行われたと
き、この加算指示に基づく加算処理によりキャリー信号
が発生した桁については、その加算結果の値を出力し、
キャリー信号が発生しなかった桁については、加算結果
から“6”を減算した値を出力する出力回路と、を備え
たことを特徴とする演算装置。
[Scope of Claims] A plurality of 4-bit arithmetic units are provided corresponding to each digit of a decimal number, and a carry signal generated by each 4-bit arithmetic unit is propagated to a 4-bit arithmetic unit corresponding to an upper digit. When converting decimal data expressed in 10's complement format to decimal data expressed in absolute value in an arithmetic device that performs decimal arithmetic, the above 1.
a correction circuit that respectively inverts and corrects 4-bit data components corresponding to each digit of decimal data expressed in 0's complement format; and a 0 in each of the 4-bit arithmetic units, and the correction circuit. When the 4-bit corrected data of the corresponding digit corrected by For the digits for which a carry signal is generated by addition processing based on , the value of the addition result is output,
An arithmetic device comprising: an output circuit that outputs a value obtained by subtracting "6" from the addition result for digits for which no carry signal is generated.
JP15934690A 1990-06-18 1990-06-18 Arithmetic unit Pending JPH0448327A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15934690A JPH0448327A (en) 1990-06-18 1990-06-18 Arithmetic unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15934690A JPH0448327A (en) 1990-06-18 1990-06-18 Arithmetic unit

Publications (1)

Publication Number Publication Date
JPH0448327A true JPH0448327A (en) 1992-02-18

Family

ID=15691838

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15934690A Pending JPH0448327A (en) 1990-06-18 1990-06-18 Arithmetic unit

Country Status (1)

Country Link
JP (1) JPH0448327A (en)

Similar Documents

Publication Publication Date Title
US6233597B1 (en) Computing apparatus for double-precision multiplication
EP0271255A2 (en) High-speed binary and decimal arithmetic logic unit
US3711693A (en) Modular bcd and binary arithmetic and logical system
JP3345894B2 (en) Floating point multiplier
GB1390385A (en) Variable length arithmetic unit
JPS6125245A (en) Rounding process circuit
JP2970231B2 (en) Parallel multiplication circuit
US3816734A (en) Apparatus and method for 2{40 s complement subtraction
JPH03135627A (en) Fuzzy arithmetic unit
JPH0346024A (en) Floating point computing element
JPH0464091B2 (en)
JPH0448327A (en) Arithmetic unit
US3462589A (en) Parallel digital arithmetic unit utilizing a signed-digit format
JP2705162B2 (en) Arithmetic processing unit
SU1273918A1 (en) Adding-subtracting device
JPS62209621A (en) Multiplying device
JPS62288936A (en) Generating system for conditional code in decimal operation
JPS6265131A (en) Multiplier
JP2890412B2 (en) Code conversion circuit
JPH07114454A (en) Multiplication circuit and multiplication method
JPH1115641A (en) Multiplier using redundant binary adder
JPH02137022A (en) Data type converting circuit
JPS62119632A (en) Multiplier
JPH04246722A (en) Adder/subtracter
JPH02212927A (en) Binary integer multiplication processing method