JPS6484331A - Absolute value circuit - Google Patents

Absolute value circuit

Info

Publication number
JPS6484331A
JPS6484331A JP62243131A JP24313187A JPS6484331A JP S6484331 A JPS6484331 A JP S6484331A JP 62243131 A JP62243131 A JP 62243131A JP 24313187 A JP24313187 A JP 24313187A JP S6484331 A JPS6484331 A JP S6484331A
Authority
JP
Japan
Prior art keywords
input
circuit
signal
output
absolute value
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.)
Granted
Application number
JP62243131A
Other languages
Japanese (ja)
Other versions
JP2558739B2 (en
Inventor
小山 鋼
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP62243131A priority Critical patent/JP2558739B2/en
Publication of JPS6484331A publication Critical patent/JPS6484331A/en
Application granted granted Critical
Publication of JP2558739B2 publication Critical patent/JP2558739B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Analogue/Digital Conversion (AREA)

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Abstract] Since this publication is application data from before electronic filing, the abstract data is not recorded.

Description

【発明の詳細な説明】 [発明の目的] (産業上の利用分野) この発明は、小規模な回路構成で入力信号の絶対値を求
めることができる絶対値回路に関する。
[Detailed Description of the Invention] [Purpose of the Invention] (Industrial Field of Application) This invention relates to an absolute value circuit that can determine the absolute value of an input signal with a small circuit configuration.

(従来の技術) ディジタル回路で演算を行うとぎ、2進数で表現された
数の絶対値を得たい場合がある。例えば、11−7 I
Iを4ピツトで表現すると“1001”であるが、この
絶対値、すなわち“7″を4ビットで表現すると011
1 ”となる。
(Conventional Technology) When performing calculations with digital circuits, there are times when it is necessary to obtain the absolute value of a number represented in binary. For example, 11 - 7 I
If we represent I with 4 bits, it is "1001". However, if we represent its absolute value, which is "7", with 4 bits, it is 011.
It becomes 1.

従来、このような絶対値を求める方法としては、最上位
ビット(以下MSBと略称する)信号がO″の場合には
全ビットをそのまま出力し、MS3信号が“1”の場合
には各ビットを反転して1を加えるという、2の補数が
用いられていた。
Traditionally, the method for calculating such absolute values has involved using two's complement, where if the most significant bit (hereinafter abbreviated as MSB) signal is O'', all bits are output as they are, and if the MS3 signal is "1", each bit is inverted and 1 is added.

第5図は従来の4ビット絶対値回路の構成を示す図であ
る。4ピツトで表現された入力信号は、MSB信号から
順に入力端子11.12.13および14に入力される
。入力端子11に入力されたMSB信号は排他的論理和
回路22.23および24の一方の端子に入力される。
Figure 5 shows the configuration of a conventional 4-bit absolute value circuit. The input signal, represented in 4 bits, is input to input terminals 11, 12, 13, and 14 in order, starting with the MSB signal. The MSB signal input to input terminal 11 is input to one of the terminals 22, 23, and 24 of the exclusive OR circuit.

排他的論理和回路22.23および24の他方の端子に
は、それぞれ入力端子12.13および14に入力され
た第2M5B信号、第3M5B信号および最下位ビット
(以下しSBと略称する)信号が入力される。
The other terminals of the exclusive OR circuits 22, 23 and 24 are input to the second M5B signal, the third M5B signal, and the least significant bit (hereinafter abbreviated as SB) signal, respectively, which are input to the input terminals 12, 13 and 14.

排他的論理和回路22.23および24の出力1言号は
、それぞれ全加算器32.33および34の一方の端子
Xに入力される。全加算器32.33I3よび34の他
方の端子yには、それぞれ“0゛′が入力される。
The output 1 of each of the exclusive OR circuits 22.23 and 24 is input to one terminal X of each of the full adders 32.33 and 34, respectively. The other terminal y of each of the full adders 32.33I3 and 34 is input to "0"'.

全加算器34の端子Ciには、入力端子]1に入力した
MSB信号が入力される。また、全加算器32および3
3の端子Ciには、それぞれ全加算器33および34の
端子GOからのキャリー信号が入力される。
The MSB signal input to input terminal 1 is input to terminal Ci of the full adder 34.
The carry signals from the GO terminals of the full adders 33 and 34 are input to terminal Ci of terminal 3, respectively.

全加算器32.33および34の端子Sからの出力信号
は、それぞれ出力端子42.43および44に導出され
る。また、全加算器32の端子COからのキャリー信号
は、出力端子41に導出される。このようにして出力端
子41.42.43および44には、M S B、第2
M5B、第3M5Bおよび18B信号が出力され、4ビ
ットで表現される絶対値が得られる。
The output signals from terminals S of the full adders 32, 33, and 34 are led to output terminals 42, 43, and 44, respectively. The carry signal from terminal CO of full adder 32 is led to output terminal 41. In this way, output terminals 41, 42, 43, and 44 receive the MSB and 2
The M5B, 3rd M5B, and 18B signals are output, and an absolute value represented by 4 bits is obtained.

前述した4ビットの絶対値回路では、排他的論理和回路
が3個、全加算器が3個必要となる。この絶対値回路を
C−MOSで構成する場合、排他的論理和回路は通常ト
ランジスタ10個、全加算器は通常トランジスタ32個
で構成されるので、全体のトランジスタの数は3X 1
0+3x32−126個となってしまう。このトランジ
スタの数は回路の大きさを示1目安となるが、ICを開
発する場合の製作コスト、歩どまり、チップ面積、動作
速度等を考えると、回路規模は小さい方が望ましい。
The aforementioned 4-bit absolute value circuit requires three exclusive OR gates and three full adders. When this absolute value circuit is constructed using CMOS, the exclusive OR gate typically consists of 10 transistors, and the full adder typically consists of 32 transistors, so the total number of transistors is 3 x 1.
This would result in 0 + 3 x 32 - 126 transistors. While this number of transistors can be used as a guideline for circuit size, when developing an IC, considering factors such as manufacturing costs, yield, chip area, and operating speed, a smaller circuit size is preferable.

(発明が解決しようとする問題点) 前述したように、例えば従来の4ビットの絶対値回路を
C−MOSで構成する場合、トランジスタの数は通常1
2611となる。しかし、ICを開発する場合にはさら
に小規模な回路構成が可能な絶対値回路が必要である。
(Problems the invention aims to solve) As mentioned above, for example, when constructing a conventional 4-bit absolute value circuit with C-MOS, the number of transistors is usually 1
The result is 2611. However, when developing an IC, an absolute value circuit is needed that allows for an even smaller circuit configuration.

そこで、この発明の目的は小規模の回路構成により入力
信号の絶対値を得ることができる絶対値回路を提供する
ことである。
Therefore, the objective of this invention is to provide an absolute value circuit that can obtain the absolute value of an input signal with a small-scale circuit configuration.

[発明の目的コ (問題を解決するための手段) 上記のような問題点を解決するため、この発明は入力信
号の最下位ビットの値をそのまま出力する手段と、最上
位ビットが“1”で、かつ前記最下位ビット以外の所定
のビットにおいてこのビットよりも下位のビットのうち
少なくとも1ビットが“1nの場合には、このビットの
値を極性を反転して出力する手段とを有している。
[Purpose of the Invention (Means for Solving the Problems) In order to solve the above-mentioned problems, this invention has means for outputting the value of the least significant bit of the input signal as is, and means for outputting the value of a bit with its polarity reversed if the most significant bit is "1" and at least one bit lower than this bit in a predetermined set of bits other than the least significant bit is "1n".

(作用) 上記の構成によれば、最上位ビットが“O”のときは全
ビットがそのまま出力され、最上位ビットがパ“1”の
ときはビット反転後“+1”したのと同様に機能するの
で、小規模の回路構成により入力信号の絶対値を得るこ
とができる絶対値回路を提供することができる。
(Operation) With the above configuration, when the most significant bit is "O", all bits are output as is, and when the most significant bit is "1", it functions as if the bits were inverted and then "+1", thus providing an absolute value circuit that can obtain the absolute value of the input signal with a small circuit configuration.

(実施例) 以下この発明の実施例を図面を参照して説明する。(Examples) Examples of this invention will be described below with reference to the drawings.

第1図は本発明の一実施例を示す図である。第1図にお
いて、4ビットの入力信号および出力信号は入力端子1
1.12.13および14、出力端子41.42.43
および44でそれぞれ表現される。
Figure 1 shows one embodiment of the present invention. In Figure 1, the 4-bit input signal and output signal are connected to input terminal 1.
1.12.13 and 14, Output terminals 41, 42, 43
These are represented by 44, respectively.

入力端子14に入力されたLSB信号は出力端子44に
導出される。
The LSB signal input to input terminal 14 is led to output terminal 44.

入力端子11に入力されたMSB信号と入力端子14に
入力されたLSB信号を負論理積回路121aで負論理
積演算を行い、負論理積回路121aから出力された信
号と入力端子13からの第3MS[3信丹とは排他的負
論理和回路122で排他的負論理和演算される。排他的
負論理和回路122の出力信号は出力端子43に導出さ
れる。
The MSB signal input to input terminal 11 and the LSB signal input to input terminal 14 are subjected to a negative AND operation in the negative AND circuit 121a. The signal output from the negative AND circuit 121a and the third MSB signal from input terminal 13 are then subjected to an exclusive negative OR operation in the exclusive negative OR circuit 122. The output signal of the exclusive negative OR circuit 122 is led to output terminal 43.

入力端子13に入力された第3M88信号と入力端子1
4に入力されたLSB信号とは論理和回路123aで論
理和がとられ、論理和回路123aの出力信号と入力端
子11に入力されたM S B信号とは負論理積回路1
24で負論理積をとり、負論理積回路124の出力信号
と入力端子12に入力された第2M5B信号とを排他的
負論理和回路125で排他的負論理和をとることによっ
て、排他的負論理和回路125の出力信号が出力端子4
2に導出される。
The third M88 signal input to input terminal 13 and input terminal 1
The LSB signal input to terminal 4 is logically ORed with the OR circuit 123a, and the output signal of the OR circuit 123a and the MSB signal input to input terminal 11 are combined with the negative AND circuit 1
A negative AND is taken at 24, and the output signal of the negative AND circuit 124 and the second M5B signal input to input terminal 12 are subjected to an exclusive negative OR operation in the exclusive negative OR circuit 125, so that the output signal of the exclusive negative OR circuit 125 is at output terminal 4
This leads to 2.

入力端子14に入力されたLSB信号と、入力端子13
に入力された第3M5B信号と、入力端子12に入力さ
れた第2M5B信号と、入力端子11に入力されたMS
B信号の極性をインバータ126によって反転させるこ
とによりインバータ126から出力された信号とを負論
理和回路127aで負論理和をとることによって、負論
理和回路127aから出力された信号が出力端子41に
導出される。
The LSB signal input to input terminal 14 and input terminal 13
The third M5B signal input to the input terminal, the second M5B signal input to input terminal 12, and the MS signal input to input terminal 11
By inverting the polarity of the B signal using the inverter 126, the signal output from the inverter 126 is negatively ORed with the B signal using the negative OR circuit 127a, and the signal output from the negative OR circuit 127a is led to the output terminal 41.

次にこの実施例回路の作用について説明する。Next, the operation of this embodiment circuit will be explained.

出力端子44には、入力端子14に入力された13B信
号がそのまま出力される。
The 13B signal input to the input terminal 14 is output directly to the output terminal 44.

出力端子43には、入力端子11に入力されたMSB信
号が“1”°で、かつ入力端子14に入力されたLSB
信号が““1”の場合のみ、入力端子13に入力された
第3M5B信号の極性を反転して出力され、それ以外の
場合には、入力端子13に入力された第3M5B信号が
そのまま出力される。
Output terminal 43 receives the MSB signal input to input terminal 11 at "1"° and the LSB signal input to input terminal 14.
Only when the signal is "1", the polarity of the third M5B signal input to input terminal 13 is reversed and output; otherwise, the third M5B signal input to input terminal 13 is output as is.

出力端子42には、入力端子11に入力されたMSB信
号が“1”で、かつ入力端子13および14の少なくと
も一方が“1Hである場合には、入力端子12に入力さ
れた第2M5B信号の極性を反転して出力され、それ以
外の場合には、入力端子12に入力された第2M5B信
号がそのまま出力される。
If the MSB signal input to input terminal 11 is "1" and at least one of input terminals 13 and 14 is "1H", the polarity of the second M5B signal input to input terminal 12 is reversed and output to output terminal 42. Otherwise, the second M5B signal input to input terminal 12 is output as is.

出力端子41には、入力端子11に入力されたMSB信
号が1”で、かつ入力端子12.13.14のいずれか
1つが““1”である場合には、入力端子11に入力さ
れたMSB信号の極性を反転して出力され、それ以外の
場合には、入力端子11に入力されたMSB信号がその
まま出力される。
If the MSB signal input to input terminal 11 is 1" and any one of input terminals 12, 13, or 14 is 1", the MSB signal input to input terminal 11 is output with its polarity reversed. Otherwise, the MSB signal input to input terminal 11 is output as is.

このような動作により、入力信号の絶対値が求められる
。
This process allows the absolute value of the input signal to be determined.

なお、第1図に示した4ビット絶対値回路に用いられる
トランジスタの数は40個であるため、従来の4ビット
絶対値回路に用いられるトランジスタの数の約1/3で
回路構成できることになる。
Furthermore, since the 4-bit absolute value circuit shown in Figure 1 uses 40 transistors, it can be constructed with approximately one-third the number of transistors used in conventional 4-bit absolute value circuits.

第2図は第1図の実施例の絶対値回路の動作を示す真理
値表である。第2図において、出力端子41.42.4
3および44には、入力端子11.12.13および1
4に入力された信号の絶対値が出力されている。
Figure 2 is a truth table showing the operation of the absolute value circuit in the embodiment of Figure 1. In Figure 2, output terminals 41, 42, 4
3 and 44 have input terminals 11, 12, 13 and 1
The absolute value of the signal input to 4 is output.

第3図は4ビット絶対値回路の第2の実施例を示す図で
ある。第3図は、第1図に示した回路構成のうち、論理
和回路123bおよび負論理積回路127bに入力され
る信号の取出し位置を変えたものであり、作用および回
路規模は第1の実施例の絶対値回路の場合と同様である
。
Figure 3 shows a second embodiment of the 4-bit absolute value circuit. Figure 3 shows the same circuit configuration as in Figure 1, but with the input positions of the OR circuit 123b and the negative AND circuit 127b changed. The operation and circuit size are the same as in the absolute value circuit of the first embodiment.

また、他の実施例として、例えば4ビットの入力信号を
3ビットに削減して出力する場合を考える。すなわち、
“−8″が入力された場合には“8”が出力されるはず
であるが、ビットを削減するために“7″を出力する場
合がある。なお、その他は第2図と同じである。
Another example is the case where a 4-bit input signal is reduced to 3 bits and output. That is,
If "-8" is input, "8" should be output, but in some cases, "7" may be output to reduce the number of bits. Otherwise, it is the same as in Figure 2.

第4図はこの場合における絶対値回路の第3の実施例を
示す図である。第4図は、第1図に示した絶対値回路に
おいて、論理和回路123Cに入力される信号を3人力
とし、負論理積回路121Cの一方の端子と入力端子1
4との間に論理和回路221を、入力端子14と出力端
子44との間に排他的負論理和回路120をそれぞれ新
たに挿入し、出力端子41を削除したものである。なお
、論理和回路123Cには負論理和回路127Cの出力
信号が新たに導出される。また、負論理和回路127C
の出力信号と入力端子14から出力されたLSB信号は
論理和回路221で論理和をとることによって、その出
力信号が負論理積回路121Cに入力される。ざらに、
負論理和回路127Cの出力信号と入力端子14から出
力されたLSB信号は排他的負論理和回路120で排他
的負論理和を取ることにより、出力端子44に出力され
る。
Figure 4 shows a third embodiment of the absolute value circuit in this case. In Figure 4, the absolute value circuit shown in Figure 1 has three signals input to the OR circuit 123C, and one terminal of the negative AND circuit 121C and input terminal 1
A logical OR circuit 221 is newly inserted between 4 and the input terminal 14 and the output terminal 44, and an exclusive negative OR circuit 120 is newly inserted between the input terminal 14 and the output terminal 44, while the output terminal 41 is removed. The output signal of the negative OR circuit 127C is newly derived from the logical OR circuit 123C.
The output signal and the LSB signal output from input terminal 14 are logically ORed in the OR circuit 221, and the resulting output signal is input to the negative AND circuit 121C.
The output signal of the negative OR circuit 127C and the LSB signal output from input terminal 14 are subjected to exclusive negative OR by the exclusive negative OR circuit 120, and the result is output to output terminal 44.

これによって、例えば“−8”、すなわち′“1000
″が入力された場合、その出力は117 JT、すなわ
ち“11“1”となる。
This results in, for example, "-8", that is, "1000"
If " is input, the output will be 117 JT, or "11"1".

以上本発明の実施例について説明したが、本発明は上記
実施例に限定されるものではなく種々の変形実施が可能
である。
Although embodiments of the present invention have been described above, the present invention is not limited to the above embodiments and various modifications are possible.

[発明の効果] 以上詳述したように、本発明によれば小規模の回路構成
により入力信号の絶対値を求めることができる絶対値回
路を提供することができる。
[Effects of the Invention] As described in detail above, the present invention provides an absolute value circuit that can determine the absolute value of an input signal with a small-scale circuit configuration.

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

第1図は本発明の第1の実施例の絶対値回路を示す図、
第2図は第1図の第1の実施例の絶対値回路の動作を示
す真理値表、第3図および第4図は本発明の第2および
第3の実施例の絶対値回路の構成を示す図、第5図は従
来の絶対値回路の構成例を示す図である。 121a、124.121 c・−・−負論理積回路、
120.122.125・・・・・・排他的負論理和回
路、123a、123b、123c、221−・・・・
・論理和回路、126・・・・・・インバータ、127
a。 127b、127C・・・・・・負論理和回路。 出願人代理人 弁理士 鈴江武彦
Figure 1 shows an absolute value circuit of the first embodiment of the present invention.
Figure 2 is a truth table showing the operation of the absolute value circuit of the first embodiment in Figure 1, Figures 3 and 4 are diagrams showing the configuration of the absolute value circuit of the second and third embodiments of the present invention, and Figure 5 is a diagram showing an example of the configuration of a conventional absolute value circuit. 121a, 124. 121 c・−・− negative AND circuit,
120.122.125... Exclusive negative OR circuit, 123a, 123b, 123c, 221-...
OR circuit, 126... Inverter, 127
a. 127b, 127C... Negative OR circuits. Applicant's Representative: Patent Attorney Takehiko Suzue

Claims (2)

【特許請求の範囲】[Claims] (1)ディジタル信号の絶対値の演算を行う絶対値回路
において、 入力信号の最下位ビットの値をそのまま出力する手段と
、 最上位ビットが“1”で、かつ前記最下位ビット以外の
所定のビットにおいてこのビットよりも下位のビットの
うち少なくとも1ビットが“1”の場合には、このビッ
トの値を極性を反転して出力する手段を具備することを
特徴とする絶対値回路。
(1) An absolute value circuit that performs calculations on the absolute value of a digital signal, comprising means for outputting the value of the least significant bit of the input signal as is, and means for outputting the value of the bit with its polarity reversed when the most significant bit is "1" and at least one bit lower than this bit is "1" among predetermined bits other than the least significant bit.
(2)最上位ビットの値が“1”であり、かつ最上位ビ
ットよりも下位のビットの値が全て“0”である場合、
最上位ビットの値は出力せず、最下位ビットの値を“0
”、最上位ビットと最下位ビットの間のビット値を“1
”として出力することを特徴とした第1項記載の絶対値
回路。
(2) If the value of the most significant bit is "1", and the values of all bits lower than the most significant bit are "0",
The most significant bit is not output, and the least significant bit is set to "0".
", the bit value between the most significant bit and the least significant bit is "1
The absolute value circuit described in item 1, characterized by outputting as ".
JP62243131A 1987-09-28 1987-09-28 Absolute value circuit Expired - Lifetime JP2558739B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62243131A JP2558739B2 (en) 1987-09-28 1987-09-28 Absolute value circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62243131A JP2558739B2 (en) 1987-09-28 1987-09-28 Absolute value circuit

Publications (2)

Publication Number Publication Date
JPS6484331A true JPS6484331A (en) 1989-03-29
JP2558739B2 JP2558739B2 (en) 1996-11-27

Family

ID=17099261

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62243131A Expired - Lifetime JP2558739B2 (en) 1987-09-28 1987-09-28 Absolute value circuit

Country Status (1)

Country Link
JP (1) JP2558739B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03156530A (en) * 1989-11-14 1991-07-04 Canon Inc Absolute value arithmetic circuit
JPH0580982A (en) * 1991-09-19 1993-04-02 Nec Corp Absolute value circuit

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6220028A (en) * 1985-07-15 1987-01-28 アールシーエー トムソン ライセンシング コーポレーシヨン Complementing apparatus

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6220028A (en) * 1985-07-15 1987-01-28 アールシーエー トムソン ライセンシング コーポレーシヨン Complementing apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03156530A (en) * 1989-11-14 1991-07-04 Canon Inc Absolute value arithmetic circuit
JPH0580982A (en) * 1991-09-19 1993-04-02 Nec Corp Absolute value circuit

Also Published As

Publication number Publication date
JP2558739B2 (en) 1996-11-27

Similar Documents

Publication Publication Date Title
US4761760A (en) Digital adder-subtracter with tentative result correction circuit
EP0328063A2 (en) Absolute value calculating circuit having a single adder
JP2558739B2 (en) Absolute value circuit
JPS61159827A (en) Digital-to-analog converter
JPH01279317A (en) Multi-bit digital threshold comparator circuit
US4899127A (en) Size comparing circuit
JPH08152994A (en) Multiplier and digital filter
JPS6057774B2 (en) Logical operation type digital compandor
JPH01180629A (en) Overflow detecting circuit
JPS5966790A (en) Operating circuit
JPH051498B2 (en)
JPS61105640A (en) Parallel complement circuit
JPS6374310A (en) digital arithmetic circuit
JPH0438520A (en) Binary data converter
JPH05257643A (en) Binary complementer
JPS615345A (en) Serial multiplication method
JPH0324619A (en) Binary negative number display converter
JP2000081967A (en) Square operation circuit
JPH02178831A (en) Circuit and method for multiplying data by-1
JPH03257622A (en) Multiplier circuit
JPS62297934A (en) Digital signal processor
JPH01158814A (en) High speed signal processor
JPS6399607A (en) digital arithmetic circuit
JPH03113632A (en) Digital signal processor
JPS63197227A (en) adder