JPH02210532A - Code processor for complement of two - Google Patents
Code processor for complement of twoInfo
- Publication number
- JPH02210532A JPH02210532A JP1029979A JP2997989A JPH02210532A JP H02210532 A JPH02210532 A JP H02210532A JP 1029979 A JP1029979 A JP 1029979A JP 2997989 A JP2997989 A JP 2997989A JP H02210532 A JPH02210532 A JP H02210532A
- Authority
- JP
- Japan
- Prior art keywords
- signal
- carry
- adder
- complement
- output
- 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
Links
- 230000000295 complement effect Effects 0.000 title claims abstract description 20
- 238000000034 method Methods 0.000 abstract description 4
- 239000004065 semiconductor Substances 0.000 abstract description 3
- 230000000694 effects Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000008054 signal transmission Effects 0.000 description 1
Abstract
Description
【発明の詳細な説明】 (産業上の利用分野) 本発明は、2の補数加算の符号処理装置に関する。[Detailed description of the invention] (Industrial application field) The present invention relates to a code processing device for two's complement addition.
(従来の技術)
従来、2進数のデータを扱う場合、その場に応じて、整
数、1の補数、グレイコード等様々な表記法を用いてそ
のデータを表しているが、加減算を行う場合、正の値、
負の値を意識することなく加減算が行えるメリットを生
かし、2の補数表記がよく用いられる。(Prior art) Conventionally, when handling binary data, various notations such as integer, 1's complement, Gray code, etc. are used to represent the data depending on the situation, but when performing addition and subtraction, positive value,
Two's complement notation is often used to take advantage of the advantage of being able to perform addition and subtraction without having to be aware of negative values.
第2図は従来の補数符号処理装置の1例である。FIG. 2 shows an example of a conventional complement code processing device.
第2図において、21ないし25は全加算器、Aoない
しA3およびB。ないしB3は4ビットの2進数の入力
データであって、入力データのM S B (A3およ
びB3)は符号ビットである。SoないしS4は5ビッ
トの出力信号であり、出力信号のMSB(S4)は符号
ビットである。第3図は従来の符号ビットの処理装置を
示している。第3図において、31は全加算器(1)、
32は全加算器(2)、A、およびB5は入力信号のM
SBで符号ビット、S MSB−1は加算結果のデータ
、S、は出力のMSBで符号ビット、C3は下位の加算
器からキャリー人力信号、C5は全加算器(1,)31
の出力キャリー信号であり、全加算器(2)32のキャ
リーの入力信号となる。In FIG. 2, 21 to 25 are full adders, Ao to A3 and B. to B3 are 4-bit binary input data, and M S B (A3 and B3) of the input data is a sign bit. So to S4 are 5-bit output signals, and the MSB (S4) of the output signals is a sign bit. FIG. 3 shows a conventional code bit processing device. In FIG. 3, 31 is a full adder (1);
32 is a full adder (2), A and B5 are input signal M
SB is the sign bit, S MSB-1 is the data of the addition result, S is the MSB of the output and the sign bit, C3 is the carry human signal from the lower adder, C5 is the full adder (1,) 31
This is the output carry signal of the full adder (2) 32 and becomes the carry input signal of the full adder (2) 32.
次に第3図の動作を示すと真理値表1で表わされる。表
1の真理値表からも明らかなように、S、は2の補数の
符号ビットになっていることがわかる。Next, the operation shown in FIG. 3 is expressed in truth table 1. As is clear from the truth table in Table 1, S is the sign bit of a two's complement number.
表 1
(発明が解決しようとする課題)
しかしながら、上記従来の符号ビット処理法では、全加
算器の数は第2図に示す如く出力のピッ1〜数(入力の
ビット数+1)だけ必要となり、また全加算器の出力段
数の数だけキャリー信号の伝達時間がかかる。即ち、従
来の回路方式で加算の演算速度を早めるには、各々のキ
ャリー処理速度を早めるしかなく、また、キャリーリッ
クアヘッド法等の方法では回路が複雑化し、したがって
回路面積が増加する問題があった。また、全加算器(2
)32を符号処理専用の回路で構成したとしても、A5
.B5.C,の入力に対してS、を処理するための論理
式は
5s=(A、−B5+A、・B、)C5+A、−B、・
C9となり、C−MOSの回路で実現するとすれば、少
くとも20トランジスタ程度は必要となる。Table 1 (Problems to be Solved by the Invention) However, in the conventional code bit processing method described above, the number of full adders required is equal to the number of output bits (number of input bits + 1) as shown in Figure 2. , and it takes the same number of carry signal transmission times as the number of output stages of the full adders. In other words, the only way to increase the calculation speed of addition using conventional circuit systems is to increase the speed of each carry process, and methods such as the carry rick-ahead method have the problem of complicating the circuit and increasing the circuit area. Ta. In addition, a full adder (2
) 32 with a circuit dedicated to code processing, the A5
.. B5. The logical formula for processing S, for the input of C, is 5s=(A, -B5+A, ・B,)C5+A, -B, ・
If it is C9 and is realized with a C-MOS circuit, at least about 20 transistors are required.
本発明は上記従来の問題を解決し、回路が簡単したがっ
て回路面積が少く、かつ、処理度が速い2の補数符号処
理装置を提供することを目的とするものである。SUMMARY OF THE INVENTION An object of the present invention is to solve the above-mentioned conventional problems and to provide a two's complement code processing device which has a simple circuit, therefore, a small circuit area and a high processing speed.
(課題を解決するための手段)
本発明は上記の目的を達成するために、2の補数符号処
理装置は、符号ビット処理の論理演算を見直し、すなわ
ち、
S 、=A、・B、+(A、+B、)C。(Means for Solving the Problems) In order to achieve the above object, the present invention provides a two's complement code processing device that reconsiders the logical operation of code bit processing, that is, S , =A, ·B, +( A, +B,)C.
また全加算のキャリー出力C6は、
′C,=A、・B5+(A、+B、)C:1という演算
式に着目し、全加算器と同じ回路を用い、入力データの
極性を操作することにより、入力データと同じ数の全加
算回路で、出力信号の符号ビットおよびS□R−xの加
算出力を得るようにしたものである。In addition, the carry output C6 of the full adder is calculated by focusing on the arithmetic expression 'C,=A,・B5+(A,+B,)C:1, and manipulating the polarity of the input data using the same circuit as the full adder. Accordingly, the sign bit of the output signal and the addition output of S□R-x are obtained using the same number of full adder circuits as the input data.
(作 用)
したがって、本発明によれば、2の補数符号処理装置を
半導体集積回路で実現する場合、全加算器のセルパター
ンを連結させて加算器回路を作成するが、その場合、入
力ビット数分の全加算回路数で実現することができるた
め、回路面積を小さくかつ演算処理速度を早めることが
可能になる作用を有する。(Function) Therefore, according to the present invention, when realizing a two's complement code processing device using a semiconductor integrated circuit, an adder circuit is created by connecting cell patterns of full adders. Since it can be realized with a few minutes of total adder circuits, it has the effect of reducing the circuit area and increasing the calculation processing speed.
(実施例)
第1図は、本発明の実施例における半導体集積回路の4
ビットの全加算器を示すものである。第1図において、
11ないし14は全加算器、15ないし19はインバー
タ、AoないしA3およびB。ないしB3は入力信号、
SoないしB4は加算出力信号である。(Embodiment) FIG. 1 shows four diagrams of a semiconductor integrated circuit according to an embodiment of the present invention.
This shows a bit full adder. In Figure 1,
11 to 14 are full adders, 15 to 19 are inverters, Ao to A3 and B. or B3 is the input signal,
So to B4 are addition output signals.
次に上記実施例の動作について説明する。第1図(A)
において、入力信号A。−A3およびB。〜B3は、そ
れぞれ全加算器11〜14に入力される。Next, the operation of the above embodiment will be explained. Figure 1 (A)
Input signal A. -A3 and B. -B3 are input to full adders 11-14, respectively.
それぞれの全加算器は、正極性の2つの入力信号と同じ
く正極性の桁上げ入力信号により、正極性の次段への桁
上げ信号と加算出力を得ることができる。すなわち全加
算器では、次の演算が行われている。Each full adder can obtain a positive-polarity carry signal to the next stage and an addition output in response to two positive-polarity input signals and a positive-polarity carry input signal. That is, the following operations are performed in the full adder.
Go=A−B+C1(A+B)
S、=(A−B+A−B)C,+(A−B+A−B)C
。Go=A-B+C1(A+B) S,=(A-B+A-B)C,+(A-B+A-B)C
.
但し、A、Bは入力、C,は桁上げ入力、co。However, A and B are inputs, C is a carry input, and co.
Soはそれぞれ桁上げ出力、加算出力。So is carry output and addition output, respectively.
ここで、全加算器13と14の間にインバータ15と、
全加算器14の加算出力にインバータ16を付加するこ
とにより、次の演算を行うこととなる。すなわち、
S、=A−B十C1(A−B)
となり、S、は2の補数の符号演算、およびS。はMS
B−1ビット目の加算処理結果と等しい。Here, an inverter 15 is provided between the full adders 13 and 14,
By adding the inverter 16 to the addition output of the full adder 14, the following calculation will be performed. That is, S, = A-B + C1 (A-B), where S is a two's complement sign operation, and S. is MS
It is equal to the addition processing result of the B-1st bit.
以上のように本実施例によれば、入力信号のMSBが入
力される加算器の下位からの桁上げ信号と、その加算器
の加算出力を反転するインバータをもうけることにより
、正極性の2の補数符号処理結果と加算出力を得ること
ができる。As described above, according to this embodiment, by providing an inverter that inverts the carry signal from the lower order of the adder into which the MSB of the input signal is input and the addition output of the adder, two positive polarity signals are provided. Complement code processing results and addition output can be obtained.
第1図(B)は本発明の他の実施例であり、2つの入力
信号のMSB(A3.B、)をインバータ17および1
8で極性を反転し、またその全加算器の上位への桁上げ
出力信号(S4)をインバータ19で極性反転した実施
例である。第1図(A)と(B)は同等の機能をもつ。FIG. 1(B) shows another embodiment of the present invention, in which the MSB (A3.B,) of two input signals is input to inverters 17 and 1.
In this embodiment, the polarity is inverted by the inverter 8 and the carry output signal (S4) to the higher order of the full adder is inverted by the inverter 19. Figures 1(A) and 1(B) have equivalent functions.
(発明の効果)
本発明は上記実施例より明らかなように、全加算器を減
らしたことにより、回路面積を増加させることなく、2
の補数加算の演算速度を速めることが可能であるという
効果を有する。(Effects of the Invention) As is clear from the above embodiment, the present invention reduces the number of full adders so that two
This has the effect of increasing the computation speed of complement addition of .
第1図は本発明の一実施例の2の補数符号処理装置、第
2図は従来の2の補数符号処理装置、第3図は従来の符
号ビットの処理装置である。
11ないし14.21ないし25.3]、、 32・・
・全加算器、15ないし19・・・インバータ、Aoな
いしA4. BoないしB4 ・ 入力信号、 Soな
いしS4 ・・出力信号、 cl・・・下位からのキャ
リー人力信号、C9・キャリー出力信号。
特許出願人 松下電器産業株式会社
第
図
(A)
第
図FIG. 1 shows a two's complement code processing device according to an embodiment of the present invention, FIG. 2 shows a conventional two's complement code processing device, and FIG. 3 shows a conventional code bit processing device. 11 to 14.21 to 25.3],, 32...
- Full adder, 15 to 19... Inverter, Ao to A4. Bo to B4 - input signal, So to S4 - output signal, cl - carry manual signal from lower order, C9 - carry output signal. Patent applicant Matsushita Electric Industrial Co., Ltd. Figure (A) Figure
Claims (2)
号の各1ビットの入力信号に対し、上位への桁上げ出力
信号および加算出力信号を得ることのできる信号処理回
路で、前記加数信号および被加数信号を逆極性にした信
号を前記信号処理回路の入力信号とすることにより、前
記上位への桁上げ信号を2の補数の反転符号出力信号と
し、かつ、前記加算出力信号を加数結果とすることを特
徴とする2の補数符号処理装置。(1) A signal processing circuit capable of obtaining a carry output signal and an addition output signal to the higher order for each 1-bit input signal of the addend signal, the summand signal, and the carry signal from the lower order, By using signals obtained by making the addend signal and the summand signal opposite in polarity as input signals of the signal processing circuit, the carry signal to the higher order is made into a two's complement inverted sign output signal, and the addition output A two's complement code processing device characterized in that a signal is an addend result.
号の各1ビットの入力信号に対し、上位への桁上げ出力
信号および加算出力信号を得ることのできる信号処理回
路で、前記下位からの桁上げ信号を逆極性にした信号を
桁上げの入力信号とすることにより、前記上位への桁上
げ信号を2の補数の符号出力信号とし、かつ、前記加算
出力信号を反転加数結果とすることを特徴とする2の補
数符号処理装置。(2) A signal processing circuit capable of obtaining an upper carry output signal and an addition output signal for each 1-bit input signal of an addend signal, an augend signal, and a carry signal from a lower order; By using a signal obtained by inverting the polarity of the carry signal from the lower order as a carry input signal, the carry signal to the upper order becomes a two's complement sign output signal, and the addition output signal becomes an inverted addend. A two's complement code processing device characterized in that the result is a two's complement code processing device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1029979A JPH02210532A (en) | 1989-02-10 | 1989-02-10 | Code processor for complement of two |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1029979A JPH02210532A (en) | 1989-02-10 | 1989-02-10 | Code processor for complement of two |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH02210532A true JPH02210532A (en) | 1990-08-21 |
Family
ID=12291084
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP1029979A Pending JPH02210532A (en) | 1989-02-10 | 1989-02-10 | Code processor for complement of two |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH02210532A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0534799U (en) * | 1991-10-07 | 1993-05-07 | 株式会社ケンウツド | Prolog decoder |
-
1989
- 1989-02-10 JP JP1029979A patent/JPH02210532A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0534799U (en) * | 1991-10-07 | 1993-05-07 | 株式会社ケンウツド | Prolog decoder |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH0479013B2 (en) | ||
JPH0431412B2 (en) | ||
JPH04290122A (en) | Numerical expression conversion device | |
JPS61214025A (en) | Comparator for difference absolute value | |
JPS62280930A (en) | Digital multiplier | |
US4709346A (en) | CMOS subtractor | |
JPH0331930A (en) | Method and instrument of multiplication of complement code of real time 2'c in digital signal processing system | |
EP0044450B1 (en) | Digital adder circuit | |
JPH02210532A (en) | Code processor for complement of two | |
JPH0511980A (en) | Overflow detecting method and circuit | |
JPH11126157A (en) | Method and circuit for multiplication | |
US7240085B2 (en) | Faster shift value calculation using modified carry-lookahead adder | |
JPH03177922A (en) | Wallence tree circuit | |
KR100196520B1 (en) | Apparatus for conversion of two's complement numbers | |
JP2558739B2 (en) | Absolute value circuit | |
JPS6349835A (en) | Arithmetic processor | |
JP2890412B2 (en) | Code conversion circuit | |
JP2711487B2 (en) | Fixed data addition / subtraction circuit | |
SU607216A1 (en) | Arrangement for subtracting decimal numbers | |
JP2980341B2 (en) | Floating point alignment circuit | |
JPH02238522A (en) | Arithmetic circuit for absolute value | |
JPH02297625A (en) | Carry look-ahead adder | |
JPH0610787B2 (en) | Multiplication processing device | |
JP3077880B2 (en) | Sticky bit detection circuit | |
JP2563467B2 (en) | Binary calculator |