JPS62108330A - Subtracting circuit - Google Patents

Subtracting circuit

Info

Publication number
JPS62108330A
JPS62108330A JP60249481A JP24948185A JPS62108330A JP S62108330 A JPS62108330 A JP S62108330A JP 60249481 A JP60249481 A JP 60249481A JP 24948185 A JP24948185 A JP 24948185A JP S62108330 A JPS62108330 A JP S62108330A
Authority
JP
Japan
Prior art keywords
circuit
terminals
output
carry
difference
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
JP60249481A
Other languages
Japanese (ja)
Inventor
Shinobu Yonemitsu
米満 忍
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP60249481A priority Critical patent/JPS62108330A/en
Publication of JPS62108330A publication Critical patent/JPS62108330A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To obtain the absolute value of a difference between a minuend and a subtrahend without requiring any timing control by providing the first and the second adding circuits and a selecting circuit for selecting their outputs. CONSTITUTION:A binary value which has been applied to minuend input terminals 1-4 is inputted to A3-A0 terminals of an adding circuit 18, and also to A3-A0 terminals of an adding circuit 19 after having been converted to a complement on one by inverter circuits 13-16, respectively. In the same way, a binary value which has been applied to subtrahend input terminals 5-8 is inputted to B3-B0 terminals of the circuit 19, and also to B3-B0 terminals of the circuit 18 through inverter circuits 9-12, respectively. A carry-in input terminal 17 is fixed to '0'. In this case, when a minuend is smaller than a subtrahend, a complement of the absolute value of a difference is obtained in an output of S3-S0 terminals of the circuit 18, and a carry-out signal 61 is not outputted. ON the other hand, when the former is larger, a one's complement of the absolute value of a difference is obtained in S3-S1 terminals of the circuit 19, a carry-out signal 62 is not outputted, and also, when both are equal, both the circuits provide an output in the same way. A selecting circuit selects a circuit in accordance with each output, and outputs the absolute value of a difference.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は減算回路に関する。[Detailed description of the invention] [Industrial application field] The present invention relates to a subtraction circuit.

〔従来の技術〕[Conventional technology]

第2図は従来の減算回路の一例を示す回路図である。同
図において、参照符号36はタイミング信号印加端子、
37.38,39.40は被減数入力端子、41.42
.43.44は減数入力端子、45.46.47.48
はインバーター回路49はD形フリ・ツブフロ・ツブ回
路、50は4ビ・・lI・加算回路、51.52.53
.54はエクスクル−シブノア回路、55,56.57
.58は差の絶対値の出力端子、59はキャリーアウト
信号60はキャリーイン信号を示す。
FIG. 2 is a circuit diagram showing an example of a conventional subtraction circuit. In the figure, reference numeral 36 is a timing signal application terminal;
37.38, 39.40 are minuend input terminals, 41.42
.. 43.44 is the subtraction input terminal, 45.46.47.48
The inverter circuit 49 is a D-type free-tub-flow-tub circuit, 50 is a 4-bi...lI-adder circuit, and 51.52.53
.. 54 is exclusive Noah circuit, 55, 56.57
.. Reference numeral 58 indicates an output terminal for the absolute value of the difference, 59 indicates a carry-out signal, and 60 indicates a carry-in signal.

続いて本例の動作について説明する。Next, the operation of this example will be explained.

被減数入力端子37.38,39.40に印加された2
進値は4ビツト加算回路50に入力される。減数入力端
子41.42.43.44に印加された2進値はインバ
ーター回路45.46.47.48によりそれぞれ1の
補数に変換され、4ピッl−加算回路50に入力される
。4ビ・ソト加算回路50からキャリ−7′ウド信号5
9が出力されれば、これは4ビ・ソト加算回路にキャリ
ーイン信号を印加すれば4ビツト加算回路50の出力端
子には差の絶対値が得られることを示しているので、発
振防止のなめにタイミング信号印加端子36に印加され
るタイミング信号によりD形フリ・ソプフロツ1回路4
9に取り込み、キャリーイン信号60を発生する。4ビ
ツト加算回路50からのキャリーアラ1−信号59が出
力されなければ、4ピッ1〜加算回路50の出力端子に
は差の絶対値の1の補数が得られていることを示してい
るので、エクスクル−シブノア回路51.52,53.
54により更に1の補数に変換して差の絶対値を得る。
2 applied to minuend input terminals 37.38, 39.40
The base value is input to a 4-bit adder circuit 50. The binary values applied to the subtraction input terminals 41 , 42 , 43 , 44 are respectively converted into one's complement numbers by inverter circuits 45 , 46 , 47 , 48 and input to the 4-pill adder circuit 50 . Carry-7' output signal 5 from 4-bit soto adder circuit 50
If 9 is output, this means that if the carry-in signal is applied to the 4-bit adder circuit 50, the absolute value of the difference will be obtained at the output terminal of the 4-bit adder circuit 50, so oscillation prevention can be done. The timing signal applied to the timing signal application terminal 36 causes the D-type free sopflotz 1 circuit 4
9 and generates a carry-in signal 60. If the carry-a-ra 1 signal 59 from the 4-bit adder circuit 50 is not output, this indicates that the 1's complement of the absolute value of the difference is obtained at the output terminals of the 4-bit adder circuit 50. , exclusive Noah circuits 51, 52, 53.
54, it is further converted into one's complement to obtain the absolute value of the difference.

し発明が解決しようとする問題点〕 上述した従来の減算回路は、演算の結果に応じてキャリ
ーアウト信号をキャリーイン信号にフィードパ・ツクさ
せるために発振防止の79117071回路が必要とな
っているので、被減数または減数の変化に応じてタイミ
ング信号を発生させフリップフロ・ツブ回路の保持する
内容を更新しなければならない欠点がある。
[Problems to be Solved by the Invention] The conventional subtraction circuit described above requires a 79117071 circuit to prevent oscillation in order to feed-patch the carry-out signal to the carry-in signal according to the result of the operation. However, there is a drawback that a timing signal must be generated in response to a change in the minuend or the subtrahend to update the contents held in the flip-flop circuit.

〔問題点を解決するための手段〕[Means for solving problems]

本発明の減算回路は、被減数の真数と減数の1の補数を
入力とする第1の加算回路と、被減数の1の補数と減数
の真数を入力とする第2の加算回路と、前記第1.第2
の加算回路の出力を選択する選択回路とを備えている。
The subtraction circuit of the present invention comprises: a first addition circuit that receives as input the true number of the minuend and the one's complement of the subtrahend; a second addition circuit that receives the one's complement of the minuend and the true number of the subtrahend; 1st. Second
and a selection circuit for selecting the output of the adder circuit.

〔実施例、1 次に、本発明について第1図を参照して説明する。[Example, 1 Next, the present invention will be explained with reference to FIG.

第1図は本発明の減算回路の一実施例を示す回路図であ
る。
FIG. 1 is a circuit diagram showing an embodiment of the subtraction circuit of the present invention.

第1図において、参照符号1.2,3.4は被減数入力
端子、5.6.7.8は減数入力端子、9.10.11
.12.1.3.14.15.16はインバーター回路
、17はキャリーイン入力端子、18.19は4ビ・・
))・加算回路、20.21゜22.2B、24,25
.26.27はアンド回路、28,29,30.31は
オア回路、32゜33.34.35は差の絶対値の出力
端子、61゜62はキャリーアウト信号を示し、アンド
回路20、〜23.’24.〜27及びオア回路28.
〜31で選択回路を形成している。
In FIG. 1, reference numbers 1.2 and 3.4 are minuend input terminals, 5.6.7.8 is a subtrahend input terminal, and 9.10.11
.. 12.1.3.14.15.16 is an inverter circuit, 17 is a carry-in input terminal, 18.19 is a 4-bit...
))・Addition circuit, 20.21°22.2B, 24,25
.. 26.27 is an AND circuit, 28, 29, 30.31 is an OR circuit, 32° 33, 34, 35 is an output terminal for the absolute value of the difference, 61° 62 is a carry-out signal, AND circuits 20, 23 .. '24. ~27 and OR circuit 28.
.about.31 form a selection circuit.

続いて本実施例の動作について説明する。Next, the operation of this embodiment will be explained.

被減数入力端子1.2.3.4に印加された2進値は、
4ビ・ソ■〜加算回路18のA3.A2゜At、AO端
子には直接入力され、4ビツト加算回路19のA3.A
2.A1.AO端子にはインバーター回路13.14.
15.16により1の補数に変換されて入力される。同
様に減数入力端子5.6.7.8に印加された2進値は
、4ビツト加算回路19のB3.B2.B1.BO端子
には直接入力され、4ビ・ソト加算回路18のB3゜B
2.B1.BO端子にはインバーター回路9゜to、1
1.12により1の補数に変換されて入力される キャ
リーイン入力端子17は論理°゛0”に固定される。
The binary value applied to minuend input terminal 1.2.3.4 is
4B/S■~A3 of the adder circuit 18. A2°At is directly input to the AO terminal, and A3. A
2. A1. The AO terminal has an inverter circuit 13.14.
15.16, it is converted into a one's complement number and input. Similarly, the binary value applied to the subtraction input terminal 5.6.7.8 is applied to the B3. B2. B1. It is directly input to the BO terminal, and B3°B of the 4-bit soto adder circuit 18
2. B1. The inverter circuit 9°to, 1 is connected to the BO terminal.
The carry-in input terminal 17, which is converted into a one's complement number by 1.12 and inputted, is fixed at logic 0.

ここで、被減数入力端子1.2,3.4に印加される2
進値が減数入力端子5,6,7.8に印加される2進値
より小であるときは、4ピッI〜加算回路18のS3.
S2.St、SO端子の出力には差の絶対値の1の補数
が得られ、キャリーアウト信号61はそのC0UT端子
から出力されない。また、被減数入力端子1.2,3.
4に印加される2進値と減数入力端子5,6,7.8に
印加される2進値より大であるときは、4ビツト加算回
路1つの83.S2.SL、So端子の出力には差の絶
対値の1の補数が得られ、そのC0UT端子からキャリ
ーアウト信号62は出力されない。更に被減数入力端子
1,2,3.4に印加される2進値と′J!i数入力端
子5.+5.7.8に印加される2進値が等しいときは
、4ビツト加算回路18.19の出力にはいずれも差の
絶対値の1の補数が出力され、キャリーアウト信号61
.62はいずれも出力されない。
Here, 2 applied to minuend input terminals 1.2, 3.4
When the decimal value is smaller than the binary value applied to the subtraction input terminals 5, 6, 7.8, 4 pips I to S3.
S2. The one's complement of the absolute value of the difference is obtained at the output of the St, SO terminals, and the carry-out signal 61 is not output from the C0UT terminal. Further, minuend input terminals 1, 2, 3.
When the binary value applied to 83.4 of one 4-bit adder circuit is greater than the binary value applied to subtraction input terminals 5, 6, 7.8. S2. The one's complement of the absolute value of the difference is obtained at the outputs of the SL and So terminals, and the carry-out signal 62 is not output from the C0UT terminal. Furthermore, the binary values applied to the minuend input terminals 1, 2, 3.4 and 'J! i number input terminal5. When the binary values applied to +5.
.. 62 are not output.

前記選択回路は、キャリーアウト信号61が無ければ4
ビツト加算回路18の出力の1の補数を選択し、またキ
ャリーアウト信号62が無ければ4ビツト加算回路19
の出力の1の補数を選択して差の絶対値の出力端子32
.33.34.35に出力する。更にキャリーアウト信
号61.62がいずれら出力されていなければ、4ビッ
ト加算回路18.19の出力の1の補数の論理和が出力
されるが、この場合においても差の絶対値が正しく出力
されている。
The selection circuit selects 4 if there is no carry-out signal 61.
The 1's complement of the output of the bit adder 18 is selected, and if there is no carry-out signal 62, the 4-bit adder 19 is selected.
Select the one's complement of the output of the output terminal 32 of the absolute value of the difference.
.. Output on 33.34.35. Furthermore, if neither of the carry-out signals 61 and 62 is output, the logical sum of the one's complement of the outputs of the 4-bit adder circuits 18 and 19 is output, but even in this case, the absolute value of the difference is correctly output. ing.

以上説明したように本実施例では、被減数入力端子1,
2.3.4に印加された2進値と減数入内端子5.6,
7.8に印加された2進値との差の絶対値が、何らのタ
イミング制御を要せずに差の絶対値の出力端子32.3
3,34.35に出力される。
As explained above, in this embodiment, the minuend input terminal 1,
The binary value applied to 2.3.4 and the subtraction input terminal 5.6,
The absolute value of the difference with the binary value applied to 7.8 is output to the output terminal 32.3 of the absolute value of the difference without any timing control.
3, output on 34.35.

なお、本実施−例は被減数、減数がともに4ビツトの場
合を示したが、ビット数が本発明を限定するものでない
ことは自明である。
Although this embodiment shows the case where both the minuend and the subtrahend are 4 bits, it is obvious that the number of bits does not limit the present invention.

[発明の効果〕 以上説明したように本発明は、第1.第2の加算回路と
それらの出力を選択する選択回路とを備えることにより
、何らのタイミング制御を必要とせずに被減数と減数と
の差の絶対値を得ることができる効果がある。
[Effects of the Invention] As explained above, the present invention has the following advantages. By providing the second adder circuit and a selection circuit that selects their outputs, it is possible to obtain the absolute value of the difference between the minutand and the subtrahend without requiring any timing control.

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

第1図は本発明の減算回路の一実施例を示す回路図、第
2図は従来の減算回路の一例を示す回路図である。 1.2,3.4.37.38.39.40・・・被減数
入力端子、5,6.7,8,41.42.43.44・
・・減数入力端子、9.10,11,12゜13、 1
4. 15. 16. 45.46,47. 48・・
・インバーター回路、17・・・キャリーイン入力端子
、18,19.50・・・4ビツト加算回路、59.6
1.62・・・キャリーアウト信号、20,21.22
,23.24.25,26.27・・・アンド回路、2
8,29,30.31・・・オア回路、32.33.3
4,35,55.56,57.58・・・差の絶対値の
出力端子、36・・・タイミング信号印加端子、49・
・・D形フリップフロップ回路、51.52.53.5
4・・・エクスクル−シブノア回路、60・・・キャリ
ーイン信号。 $ 1 図
FIG. 1 is a circuit diagram showing an embodiment of a subtraction circuit of the present invention, and FIG. 2 is a circuit diagram showing an example of a conventional subtraction circuit. 1.2, 3.4.37.38.39.40... minuend input terminal, 5, 6.7, 8, 41.42.43.44...
... Subtraction input terminal, 9.10,11,12゜13, 1
4. 15. 16. 45.46,47. 48...
・Inverter circuit, 17... Carry-in input terminal, 18, 19.50... 4-bit addition circuit, 59.6
1.62... Carry-out signal, 20, 21.22
, 23.24.25, 26.27...AND circuit, 2
8,29,30.31...OR circuit, 32.33.3
4, 35, 55.56, 57.58... Output terminal for absolute value of difference, 36... Timing signal application terminal, 49.
・・D type flip-flop circuit, 51.52.53.5
4... Exclusive NOR circuit, 60... Carry-in signal. $1 Figure

Claims (1)

【特許請求の範囲】[Claims] 被減数の真数と減数の1の補数を入力とする第1の加算
回路と、被減数の1の補数と減数の真数を入力とする第
2の加算回路と、前記第1、第2の加算回路の出力を選
択する選択回路とを備えることを特徴とする減算回路。
a first addition circuit that receives as input the true number of the minuend and the one's complement of the subtrahend; a second addition circuit that receives the one's complement of the minuend and the true number of the subtrahend; and the first and second addition circuits. A selection circuit for selecting an output of the circuit.
JP60249481A 1985-11-06 1985-11-06 Subtracting circuit Pending JPS62108330A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60249481A JPS62108330A (en) 1985-11-06 1985-11-06 Subtracting circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60249481A JPS62108330A (en) 1985-11-06 1985-11-06 Subtracting circuit

Publications (1)

Publication Number Publication Date
JPS62108330A true JPS62108330A (en) 1987-05-19

Family

ID=17193606

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60249481A Pending JPS62108330A (en) 1985-11-06 1985-11-06 Subtracting circuit

Country Status (1)

Country Link
JP (1) JPS62108330A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60156139A (en) * 1984-01-25 1985-08-16 Nec Corp Absolute difference calculating circuit

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60156139A (en) * 1984-01-25 1985-08-16 Nec Corp Absolute difference calculating circuit

Similar Documents

Publication Publication Date Title
US4953115A (en) Absolute value calculating circuit having a single adder
JPH0479013B2 (en)
JPS6132437Y2 (en)
US5153850A (en) Method and apparatus for modifying two's complement multiplier to perform unsigned magnitude multiplication
JPS62108330A (en) Subtracting circuit
JPH0346024A (en) Floating point computing element
US4254471A (en) Binary adder circuit
JPH07118654B2 (en) Arithmetic unit
JP2991788B2 (en) Decoder
US4707799A (en) Bit sliced decimal adding/subtracting unit for multi-digit decimal addition and subtraction
US4449197A (en) One-bit full adder circuit
JPS6152493B2 (en)
JPH0331015B2 (en)
JP2757714B2 (en) Frame pulse generation circuit
JP3528334B2 (en) Data select circuit
RU2225638C2 (en) Arithmetic operations in data processing system
JPH02238522A (en) Arithmetic circuit for absolute value
JPH02178833A (en) Adder for adding data different in bit length
JPH0467650B2 (en)
JPH0250723A (en) Partial product forming circuit
JPH0285922A (en) Arithmetic circuit
JPS60186933A (en) Binary-coded decimal multiplication system
JPH0345419B2 (en)
JPH05257643A (en) Binary complement unit
JPH03109670A (en) Accumulator