JP2984606B2 - 3-input addition / subtraction circuit - Google Patents

3-input addition / subtraction circuit

Info

Publication number
JP2984606B2
JP2984606B2 JP8262136A JP26213696A JP2984606B2 JP 2984606 B2 JP2984606 B2 JP 2984606B2 JP 8262136 A JP8262136 A JP 8262136A JP 26213696 A JP26213696 A JP 26213696A JP 2984606 B2 JP2984606 B2 JP 2984606B2
Authority
JP
Japan
Prior art keywords
addition
result
input
output
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.)
Expired - Lifetime
Application number
JP8262136A
Other languages
Japanese (ja)
Other versions
JPH10105379A (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.)
NIPPON DENKI AISHII MAIKON SHISUTEMU KK
Original Assignee
NIPPON DENKI AISHII MAIKON SHISUTEMU KK
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 NIPPON DENKI AISHII MAIKON SHISUTEMU KK filed Critical NIPPON DENKI AISHII MAIKON SHISUTEMU KK
Priority to JP8262136A priority Critical patent/JP2984606B2/en
Publication of JPH10105379A publication Critical patent/JPH10105379A/en
Application granted granted Critical
Publication of JP2984606B2 publication Critical patent/JP2984606B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/50Adding; Subtracting
    • G06F7/505Adding; Subtracting in bit-parallel fashion, i.e. having a different digit-handling circuit for each denomination
    • G06F7/509Adding; Subtracting in bit-parallel fashion, i.e. having a different digit-handling circuit for each denomination for multiple operands, e.g. digital integrators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/499Denomination or exception handling, e.g. rounding or overflow
    • G06F7/49905Exception handling
    • G06F7/4991Overflow or underflow
    • G06F7/49921Saturation, i.e. clipping the result to a minimum or maximum value

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Mathematical Optimization (AREA)
  • General Engineering & Computer Science (AREA)
  • Processing Of Color Television Signals (AREA)
  • Controls And Circuits For Display Device (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、3つの入力データ
の加減算を行う3入力加減算回路に係り、特に画像処理
における動画処理の色差信号を三原色の色信号に変換す
る色空間変換技術に用いて好適な3入力加減算回路に関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a three-input addition / subtraction circuit for performing addition / subtraction of three input data, and more particularly to a three-input addition / subtraction circuit used in a color space conversion technique for converting a color difference signal of a moving image processing in image processing into a color signal of three primary colors. It relates to a suitable three-input addition / subtraction circuit.

【0002】[0002]

【従来の技術】画像処理における色の表現方法には、ビ
デオデータの記録等に使用されるYUV方式と、パーソ
ナルコンピュータ上で使用されるRGB方式がある。こ
こで、YUV方式の「Y」,「U」,「V」とは、それ
ぞれYが明るさ、Uが赤の色差、Vが青の色差を表して
いる。また、RGB方式の「R」,「G」,「B」と
は、Rが赤、Gが緑、Bが青を表し、この3つの信号の
数値範囲は、共に正の数値となる。
2. Description of the Related Art Color expression methods in image processing include a YUV method used for recording video data and the like and an RGB method used on a personal computer. Here, “Y”, “U”, and “V” in the YUV system represent Y, brightness, U, red color difference, and V, blue color difference, respectively. In the RGB system, "R", "G", and "B" represent R for red, G for green, and B for blue, and the numerical ranges of these three signals are all positive numerical values.

【0003】動画処理において、YUVからRGBへの
変換を行う場合、R=α1V+α2Y,B=β1U+β2
Y,G=γ1U+γ2V+γ3Y(α1,α2,β1,β2,
γ1,γ2,γ3は定数)なる変換演算を行う。この変換
式により、R信号とB信号については2入力加算、G信
号については3入力加算を行うことになる。また、上記
変換式において、「U」,「V」に関わる項の値、すな
わち、α1V,β1U,γ1U,γ2Vの値は正または負の
値を取り、「Y」に関わる項の値、すなわち、α2Y,
β2Y,γ3Yは正の値のみを取る。さらに変換演算は、
通常、同一ビット長の加算器によって行われている。
In the moving image processing, when converting from YUV to RGB, R = α1V + α2Y, B = β1U + β2
Y, G = γ1U + γ2V + γ3Y (α1, α2, β1, β2,
γ1, γ2, and γ3 are constants). According to this conversion equation, two-input addition is performed for the R signal and the B signal, and three-input addition is performed for the G signal. In the above conversion formula, the value of the term relating to “U” and “V”, that is, the value of α1V, β1U, γ1U, and γ2V takes a positive or negative value, and the value of the term relating to “Y”, that is, , Α2Y,
β2Y and γ3Y take only positive values. Furthermore, the conversion operation is
Usually, it is performed by an adder having the same bit length.

【0004】ここで、上述した変換演算においてG信号
への変換を行う場合のように、3入力加算を行うことが
できる加算器の一従来例について、図5を参照して説明
する。図5に示す加算器は、演算中に奇数回のオーバー
フローが生じた時に、貼り付け処理を行うことで、オー
バーフロー時の演算精度を上げるものである。ここで、
貼り付け処理とは、演算結果がオーバーフローを起こし
た場合、そのオーバーフローが、加算器の出力数値範囲
の上限値を上回るものであれば、演算結果として上限値
を出力し、出力数値範囲の下限値を下回るものであれ
ば、演算結果として下限値を出力する処理のことをとい
う。
Here, a conventional example of an adder which can perform three-input addition as in the case of performing conversion to a G signal in the above-described conversion operation will be described with reference to FIG. The adder shown in FIG. 5 increases the calculation accuracy at the time of overflow by performing a pasting process when an odd number of overflows occur during the calculation. here,
The paste process means that when the operation result overflows, if the overflow exceeds the upper limit value of the output numerical value range of the adder, the upper limit value is output as the operation result, and the lower limit value of the output numerical value range is output. If the value is lower than, the process of outputting the lower limit value as the calculation result is called.

【0005】図5において、401は加算回路であり、
4つのフル・アダーによって構成されており、累算レジ
スタ407に格納され、被加算データ端子412,41
3,414,415に出力される被加算データに、加算
データ入力端子408,409,410,411から入
力された加算データを加算する。また、加算回路410
による加算結果は、加算結果出力端子416,417,
418,419に出力され、累算レジスタ407に格納
される。なお、この図において、加算データ入力端子4
08、被加算データ端子412、および、加算結果出力
端子416は、それぞれ、加算データ、被加算データ、
および、加算結果のMSBとなる。
In FIG. 5, reference numeral 401 denotes an adding circuit.
It is composed of four full adders, stored in the accumulation register 407, and the augmented data terminals 412, 41
The addition data input from the addition data input terminals 408, 409, 410, 411 is added to the data to be added output to 3, 414, 415. Further, the addition circuit 410
Are output by the addition result output terminals 416, 417,
The signals are output to 418 and 419 and stored in the accumulation register 407. In this figure, the addition data input terminal 4
08, the augmented data terminal 412, and the addition result output terminal 416 are respectively
And the MSB of the addition result.

【0006】402は排他的論理和ゲートである単一オ
ーバーフロー検出器402であり、加算回路401によ
る演算結果がオーバーフローか否かを判別する。403
はオーバーフロー状態メモリであり、単一オーバーフロ
ー検出器402が“1”となった回数が、偶数か奇数か
を記憶する。404はDフリップフロップである極性符
号メモリであり、オーバーフロー状態メモリ403が偶
数を示し、単一オーバーフロー検出器402が再び
“1”となる毎に、加算回路401の最上位ビットを記
憶する。また、極性符号メモリ404の出力は、加算回
路401による加算結果がオーバーフローになった時、
そのオーバーフローが、加算結果範囲の上限値を超える
(プラス側オーバーフロー)ものか、下限値を下回る
(マイナス側オーバーフロー)ものかを判別する極性符
号信号としてオーバーフロー極性端子422へ出力され
る。
Reference numeral 402 denotes a single overflow detector 402 which is an exclusive OR gate, and determines whether or not the operation result of the adding circuit 401 is an overflow. 403
Is an overflow state memory, which stores whether the number of times the single overflow detector 402 has become "1" is an even number or an odd number. A polarity code memory 404 is a D flip-flop. The overflow state memory 403 indicates an even number, and stores the most significant bit of the addition circuit 401 every time the single overflow detector 402 becomes “1” again. Further, the output of the polarity code memory 404 is output when the addition result of the addition circuit 401 overflows.
The overflow code is output to the overflow polarity terminal 422 as a polarity code signal for determining whether the overflow exceeds the upper limit of the addition result range (plus overflow) or falls below the lower limit (minus overflow).

【0007】405はR−Sフリップフロップであるオ
ーバーフロー生起メモリであり、単一オーバーフロー検
出器402の出力、および、オーバーフロー状態メモリ
403の出力が共に“1”であり、かつ、加算回路40
1による加算結果の最上位ビットと極性符号メモリ40
4に蓄えられていたビットの内容が等しい時に、セット
される。406はオーバーフロー検出回路であり、オー
バーフロー状態メモリ403の出力と、オーバーフロー
生起メモリ405の出力との論理和を、オーバーフロー
端子425へ出力する。また、420,421,42
3,424は、それぞれ、累算レジスタ407,極性符
号メモリ421,オーバフロー生起メモリ405,オー
バーフロー状態メモリ403の内容をクリアするクリア
端子である。
An overflow occurrence memory 405 is an RS flip-flop. The output of the single overflow detector 402 and the output of the overflow state memory 403 are both "1".
Most significant bit of addition result by 1 and polarity code memory 40
Set when the contents of the bits stored in 4 are equal. Reference numeral 406 denotes an overflow detection circuit which outputs a logical sum of an output of the overflow state memory 403 and an output of the overflow occurrence memory 405 to the overflow terminal 425. 420, 421, 42
Reference numerals 3 and 424 denote clear terminals for clearing the contents of the accumulation register 407, the polarity code memory 421, the overflow occurrence memory 405, and the overflow state memory 403, respectively.

【0008】上述した加算器は、連続加算または減算を
実行する前に、累算レジスタ407,オーバーフロー状
態メモリ403,オーバーフロー生起メモリ405およ
び極性符号メモリ404をクリアし、連続加算または減
算実行後に、オーバーフロー検出回路406から“1”
が出力された場合は、連続加算または減算結果にオーバ
ーフローが発生したことを検出し、極性符号メモリ40
5によりプラス側もしくはマイナス側のオーバーフロー
であることを検出する、オーバーフロー検出器つき演算
回路である。なお、この加算器については、特公昭62
−30467号公報に詳しく開示されている。
The adder described above clears the accumulation register 407, the overflow state memory 403, the overflow occurrence memory 405, and the polarity code memory 404 before performing the continuous addition or subtraction, and performs the overflow after performing the continuous addition or subtraction. "1" from the detection circuit 406
Is output, it is detected that overflow has occurred in the result of continuous addition or subtraction, and the polarity code memory 40 is detected.
5 is an arithmetic circuit with an overflow detector for detecting the overflow on the plus side or the minus side. This adder is described in
This is disclosed in detail in Japanese Patent Publication No. -30467.

【0009】[0009]

【発明が解決しようとする課題】ところで、従来、動画
処理における色空間変換はフルビットで演算を行ってい
た。すなわち、例えば上述した加算器の場合、最上位ビ
ットは、数値の正負を表す符号フラグとして用いられる
ため、取り扱うことができる数値範囲は、入出力共に−
128〜127となる。このような場合において、YU
VからRGBへの変換を行うと、G信号の変換演算の
際、 γ1U+γ2V を演算した時点でオーバーフローが
起こると、R信号およびB信号との演算精度が大幅に異
なってしまい、変換前の画像と変換後の画像が異なると
いう問題が生じてしまう。
Conventionally, color space conversion in moving image processing has been performed with full bits. That is, for example, in the case of the above-described adder, the most significant bit is used as a sign flag indicating the sign of the numerical value.
128 to 127. In such a case, YU
When the conversion from V to RGB is performed, if the overflow occurs at the time of calculating γ1U + γ2V in the conversion calculation of the G signal, the calculation accuracy of the R signal and the B signal is significantly different, and the image before conversion is different from the image before conversion. There is a problem that the converted images are different.

【0010】例えばG信号への変換を行う時、γ1Uお
よびγ2Vの値が共に100(2進数で0110010
0)、γ3Y の値が50(2進数で00110010)
であった場合、γ1U+γ2Vを演算した時点で200と
なってプラス側にオーバーフローを起こす。そして、引
き続きγ3Y の値が加算されて変換演算が終了するが、
オーバーフローが1回だけ発生し、また、極性符号メモ
リ404の出力は“0”となるため、プラス側のオーバ
ーフローが発生したものと判断される。これにより、張
り付け処理が行われて演算結果は127(2進数で01
111111)となり、本来の数値である250(2進
数で11111010)から大幅にかけ離れてしまう。
For example, when converting into a G signal, the values of γ1U and γ2V are both 100 (0110010 in binary).
0), the value of γ3Y is 50 (00110010 in binary)
In this case, when the value of γ1U + γ2V is calculated, the value becomes 200, and an overflow occurs on the plus side. Then, the value of γ3Y is successively added, and the conversion operation ends.
Since the overflow occurs only once and the output of the polarity code memory 404 becomes “0”, it is determined that the overflow on the positive side has occurred. As a result, the pasting process is performed and the operation result is 127 (01 in binary number).
111111), which is far from the original value of 250 (11111010 in binary).

【0011】この発明は、このような事情に鑑みてなさ
れたものであり、2の補数で表現された値と絶対値で表
現された値とが混在する複数の入力データの加減算を行
う場合において、精度の高い演算結果を得ることができ
る3入力加減算回路を提供することを目的とする。
SUMMARY OF THE INVENTION The present invention has been made in view of such circumstances, and is intended to be used when adding or subtracting a plurality of input data in which a value represented by a two's complement and a value represented by an absolute value are mixed. It is another object of the present invention to provide a three-input addition / subtraction circuit capable of obtaining a highly accurate operation result.

【0012】[0012]

【課題を解決するための手段】請求項1に記載の発明
は、複数ビット単位で構成され、2の補数で表現された
データを含む少なくとも3つのデータを加算する3入力
加減算回路において、前記複数ビット単位で構成される
少なくとも3つのデータのうち、正または負の値を持つ
第1のデータと、正または負の値を持つ第2のデータと
を加算する第1の加算手段と、前記第1の加算手段の出
力と、前記複数ビット単位で構成される少なくとも3つ
のデータのうちの正の値を持つ第3のデータとを加算す
る第2の加算手段と、前記第1の加算手段の加算結果
が、正の値であるか負の値であるかを判断し、その判断
結果が正の値でかつ前記第2の加算手段の加算結果がオ
ーバーフローした場合プラス側にオーバーフローを起こ
したものと見なして貼り付け処理を行い、前記判断結果
が負の値でかつ前記第2の加算手段の加算結果がオーバ
ーフローしていない場合マイナス側にオーバーフローを
起こしたものと見なして貼り付け処理を行い、前記判断
結果が正の値でかつ前記第2の加算手段の加算結果がオ
ーバーフローしていない場合と前記判断結果が負の値で
かつ前記第2の加算手段の加算結果がオーバーフローし
ている場合には前記第2の加算手段の加算結果を、最終
出力として出力する貼り付け処理手段とを具備すること
を特徴とする。
According to a first aspect of the present invention, there is provided a three-input addition / subtraction circuit configured to add at least three pieces of data including data represented by two's complement and configured in units of a plurality of bits. First adding means for adding the first data having a positive or negative value and the second data having a positive or negative value among at least three pieces of data configured in bit units Second adding means for adding an output of the first adding means and third data having a positive value among the at least three pieces of data composed of a plurality of bits; It is determined whether the addition result of the adding means is a positive value or a negative value, the determination result is a positive value, and the addition result of the second adding means is
-When overflow occurs, overflow occurs on the plus side.
Paste processing is performed assuming that
Is a negative value and the addition result of the second addition means is over.
-If not, overflow on the minus side
Paste assuming that the
The result is a positive value, and the addition result of the second adding means is
-If the flow does not flow and the judgment result is a negative value
And the addition result of the second addition means overflows.
The final result of the addition by the second adding means
And a paste processing means for outputting as output .

【0013】請求項2に記載の発明は、請求項1に記載
の3入力加減算回路において、前記第1,第2の加算手
段のそれぞれは、加算結果が出力し得る最大値を超えた
場合に加算結果がオーバーフローしていることを示す
ャリ信号を出力する加算手段であって、前記貼り付け処
理手段は、前記第1の加算手段に入力される第1,第2
のデータの、各最上位ビットの状態と、前記第1の加算
手段からのキャリ信号とに基づいて、前記第1の加算手
段における加算結果が正の値であるか負の値であるかを
判断する第1の判断手段と、前記第1の判断手段の判断
結果と、前記第2の加算手段からのキャリ信号に基づ
いて、前記第2の加算手段における加算結果が、前記3
入力加減算回路が出力する演算結果の数値範囲の上限を
超えるか、または、下限を下回るかを判断する第2の判
断手段と、前記3入力加減算回路が出力する数値の最大
値および最小値、ならびに、前記第2の加算手段の加算
結果が供給され、前記第2の判断手段の判断結果に基づ
いていずれか1つの値を出力する選択手段とからなるこ
とを特徴とする。
According to a second aspect of the present invention, in the three-input addition / subtraction circuit according to the first aspect, each of the first and second adding means is provided when the addition result exceeds a maximum value which can be output. An adding unit that outputs a carry signal indicating that the addition result overflows , wherein the pasting processing unit includes first and second input units that are input to the first adding unit.
, Based on the state of each most significant bit of the data and the carry signal from the first addition means, determines whether the addition result of the first addition means is a positive value or a negative value. a first determination means for determining, result determination of the first determining means, based on a carry signal from the second adding means, the addition result in the second addition means, wherein 3
Second determining means for determining whether the numerical value range of the operation result output by the input addition / subtraction circuit exceeds the upper limit or falls below the lower limit; a maximum value and a minimum value of the numerical value output by the three-input addition / subtraction circuit; And a selection unit to which the addition result of the second addition unit is supplied and which outputs one of the values based on the determination result of the second determination unit.

【0014】請求項3に記載の発明は、請求項2に記載
の3入力加減算回路において、前記第1の判断手段は、
前記第1の加算手段に入力される第1,第2のデータの
最上位ビットが共に“1”である場合、または、第1,
第2のデータの最上位ビットがそれぞれ“0”,“1”
もしくは“1”,“0”でありかつ前記第1の加算手段
からキャリ信号が出力されなかった場合に、前記第1の
加算手段における加算結果が2の補数で表現された値に
なると判断し、前記第1の加算手段に入力される第1,
第2のデータの最上位ビットが共に“0”である場合、
または、第1,第2のデータの最上位ビットがそれぞれ
“0”,“1”もしくは“1”,“0”でありかつ前記
第1の加算手段からキャリ信号が出力された場合に、前
記第1の加算手段における加算結果が絶対値で表現され
た値になると判断することを特徴とする。
According to a third aspect of the present invention, in the three-input addition / subtraction circuit according to the second aspect, the first judging means comprises:
When the most significant bits of the first and second data input to the first addition means are both "1", or
The most significant bits of the second data are “0” and “1”, respectively.
Alternatively, if the carry signal is "1" or "0" and no carry signal is output from the first adding means, it is determined that the addition result of the first adding means is a value expressed in two's complement. , The first and second signals inputted to the first adding means.
When the most significant bits of the second data are both “0”,
Alternatively, when the most significant bits of the first and second data are “0” and “1” or “1” and “0”, respectively, and the carry signal is output from the first adding means, It is characterized in that it is determined that the result of the addition by the first adding means is a value expressed as an absolute value.

【0015】請求項4に記載の発明は、請求項2に記載
の3入力加減算回路において、前記第2の判断手段は、
前記第1の判断手段により、前記第1の加算手段におけ
る加算結果が2の補数で表現された値になると判断さ
れ、かつ前記第2の加算手段からキャリ信号が出力され
なかった場合、前記第2の加算手段における加算結果
が、前記3入力加減算回路が出力する演算結果の数値範
囲の下限を下回ると判断し、前記第1の判断手段によ
り、前記第1の加算手段における加算結果が絶対値で表
現された値になると判断され、かつ前記第2の加算手段
からキャリ信号が出力された場合、前記第2の加算手段
における加算結果が、前記3入力加減算回路が出力する
演算結果の数値範囲の上限を超えると判断することを特
徴とする。
According to a fourth aspect of the present invention, in the three-input addition / subtraction circuit according to the second aspect, the second determination means includes:
If the first determining means determines that the result of addition in the first adding means is a value represented by a two's complement, and the carry signal is not output from the second adding means, It is determined that the result of the addition by the adding means of 2 is below the lower limit of the numerical range of the operation result output by the three-input addition / subtraction circuit, and the result of addition by the first adding means is determined by the first determining means to be an absolute value Is determined to be a value represented by the following expression, and when the carry signal is output from the second addition means, the addition result in the second addition means is a numerical range of the operation result output from the three-input addition / subtraction circuit. Is determined to exceed the upper limit.

【0016】請求項5に記載の発明は、請求項1ないし
4のうち、いずれか1項に記載の3入力加減算回路にお
いて、前記複数ビットで構成される少なくとも3つのデ
ータが、全て同一ビット長から構成されていることを特
徴とする。
According to a fifth aspect of the present invention, in the three-input addition / subtraction circuit according to any one of the first to fourth aspects, all of the at least three data composed of a plurality of bits have the same bit length. It is characterized by being comprised from.

【0017】請求項6に記載の発明は、請求項1ないし
5のうち、いずれか1項に記載の3入力加減算回路にお
いて、動画処理におけるYUV方式からRGB方式への
変換演算の一つである G=γ1U+γ2V+γ3Yなる変
換演算を行うものであることを特徴とする。
According to a sixth aspect of the present invention, there is provided the three-input addition / subtraction circuit according to any one of the first to fifth aspects, wherein the three-input addition / subtraction circuit converts the YUV system to the RGB system in the moving image processing.
G = γ1U + γ2V + γ3Y which is one of the conversion operations
It is characterized by performing a transposition operation .

【0018】本発明の3入力加減算回路によれば、YU
VからRGBへの色空間変換において、G信号の変換演
算、すなわち、G=γ1U+γ2V+γ3Yの変換演算
で、γ1U+γ2V加算結果が正の時は、絶対値表現を結
果とし、負の時は2の補数表現を示すビット(サインフ
ラグ)を設け、Y信号加算時に、キャリー信号とサイン
フラグビットの論理を取ることでY信号加算後のオーバ
ーフロー処理を行う。これにより、例えば、Y信号加算
後のG信号の変換演算精度を、R信号およびB信号の変
換演算精度に合わせることができる。
According to the three-input addition / subtraction circuit of the present invention, YU
In the color space conversion from V to RGB, in the conversion operation of the G signal, that is, the conversion operation of G = γ1U + γ2V + γ3Y, when the addition result of γ1U + γ2V is positive, the absolute value expression is obtained, and when the addition result is negative, two's complement expression is used. (Sign flag) is provided, and at the time of addition of the Y signal, overflow processing after addition of the Y signal is performed by taking the logic of the carry signal and the sign flag bit. Thereby, for example, the conversion operation accuracy of the G signal after the addition of the Y signal can be matched with the conversion operation accuracy of the R signal and the B signal.

【0019】[0019]

【発明の実施の形態】次に本発明の実施の形態について
図面を参照して詳細に説明する。図1は、本発明が適用
される3入力加減算回路の構成を示すブロック図であ
る。また、図2は、YUVデータ変換回路である。図2
において、201はYUVデータ変換回路であり、入力
端子202,203,204へ入力されるY,U,Vの
データに、それぞれ定数α1,α2,β1,β2,γ1,γ
2,γ3 を乗算して、出力端子205,206,20
7,208,209,210,211から、α1V,α2
Y,β1U,β2Y,γ1U,γ2V,γ3Yのデータを出
力する。ここで、出力端子209から出力された γ1U
のデータは、図1の入力端子101に、出力端子210
から出力された γ2Vのデータは、図1の入力端子10
2に、出力端子211から出力された γ3Yのデータ
は、図1の入力端子107へ出力される。
Embodiments of the present invention will now be described in detail with reference to the drawings. FIG. 1 is a block diagram showing a configuration of a three-input addition / subtraction circuit to which the present invention is applied. FIG. 2 shows a YUV data conversion circuit. FIG.
In the figure, reference numeral 201 denotes a YUV data conversion circuit which adds constants α1, α2, β1, β2, γ1, γ to the Y, U, V data input to the input terminals 202, 203, 204, respectively.
2, γ3 and output terminals 205, 206, 20
7, 208, 209, 210, 211, α1V, α2
Y, β1U, β2Y, γ1U, γ2V, and γ3Y data are output. Here, γ1U output from the output terminal 209
Is input to the input terminal 101 of FIG.
Γ2V data output from the input terminal 10 shown in FIG.
2, the γ3Y data output from the output terminal 211 is output to the input terminal 107 in FIG.

【0020】また、図1において、1および2は、それ
ぞれ入出力ビット数が8ビットになっている8ビット加
算器(以下、単に加算器という)であり、加算器1は、
入力端子101へ入力されたγ1Uのデータと、入力端
子102へ入力されたγ2Vのデータとを加算してその
加算結果を加算器2の入力端子106へ出力する。ま
た、加算器2は、入力端子106へ入力された加算器1
の加算結果と、入力端子107へ入力されたγ3Y のデ
ータとを加算する。さらに、加算器1における加算結果
がFFHを超えた場合は、キャリ信号を出力する。ここ
で加算器1の入出力の数値範囲は−128〜127であ
り、入出力データの最上位ビットが“0”の時正の値を
示し、“1”の時は負の値を示している。加算器2の入
出力の数値範囲は0〜255であり、加算器1と同様、
加算結果がFFHを超えた時、キャリ信号を出力する。
In FIG. 1, reference numerals 1 and 2 denote 8-bit adders (hereinafter simply referred to as adders) each having 8 input / output bits.
The γ1U data input to the input terminal 101 and the γ2V data input to the input terminal 102 are added, and the result of the addition is output to the input terminal 106 of the adder 2. The adder 2 is the adder 1 input to the input terminal 106.
And the γ3Y data input to the input terminal 107 are added. Further, when the addition result in the adder 1 exceeds FFH, a carry signal is output. Here, the input / output numerical value range of the adder 1 is -128 to 127, and when the most significant bit of the input / output data is "0", it indicates a positive value, and when "1", it indicates a negative value. I have. The numerical value range of the input and output of the adder 2 is 0 to 255.
When the addition result exceeds FFH, a carry signal is output.

【0021】3はセレクタであり、3つの入力端子11
3,114,115を有し、選択信号出力回路6(後述
する)からの選択信号に従って、いずれか1つの入力端
子に入力されたデータを出力端子116から出力する。
ここでの入力端子113には加算器2の加算結果が、入
力端子114にはデータFFHが、入力端子115には
データ00Hが入力されているものとする。
Reference numeral 3 denotes a selector, and three input terminals 11
3, 114 and 115, and outputs data input to any one of the input terminals from an output terminal 116 in accordance with a selection signal from a selection signal output circuit 6 (described later).
Here, it is assumed that the addition result of the adder 2 is input to the input terminal 113, the data FFH is input to the input terminal 114, and the data 00H is input to the input terminal 115.

【0022】4は第1の論理回路であり、3つの入力端
子103,104,105を有し、それぞれ、加算器1
へ入力されるγ1Uのデータの最上位ビットと、γ2Vの
データの最上位ビットと、加算器1から出力されるキャ
リ信号が入力される。ここで、第1の論理回路4は、上
述した各入力信号に基づいて、加算器1における加算結
果が正の値となるか負の値となるかの判断を行う。
Reference numeral 4 denotes a first logic circuit having three input terminals 103, 104, and 105, each of which has an adder 1
, The most significant bit of the γ1U data, the most significant bit of the γ2V data, and the carry signal output from the adder 1. Here, the first logic circuit 4 determines whether the addition result in the adder 1 is a positive value or a negative value based on each of the input signals described above.

【0023】すなわち、図3の真理値表に示すように、
入力端子103の最上位ビットと入力端子104の最上
位ビットの論理が一致しなかった場合において、加算器
1からキャリ信号が出力されなかった(キャリ信号が
“0”)時は、加算器1における加算結果が負の値にな
ると判断して“1”を出力し、キャリ信号が出力された
(キャリ信号が“1”)時は、加算器1における加算結
果が正の値になると判断して“0”を出力する。
That is, as shown in the truth table of FIG.
If the logic of the most significant bit of the input terminal 103 and the logic of the most significant bit of the input terminal 104 do not match, and the carry signal is not output from the adder 1 (the carry signal is “0”), the adder 1 Is determined to be a negative value, and "1" is output. When the carry signal is output (the carry signal is "1"), it is determined that the addition result in the adder 1 is a positive value. To output "0".

【0024】また、入力端子103の最上位ビットと入
力端子104の最上位ビットの論理が、共に“1”であ
った場合、キャリ信号の有無に関わらず加算器1におけ
る加算結果が負の値になると判断して“1”を出力し、
共に“0”であった場合は、キャリ信号の有無に関わら
ず加算器1における加算結果が正の値になると判断して
“0”を出力する。
If the logic of the most significant bit of the input terminal 103 and the logic of the most significant bit of the input terminal 104 are both "1", the addition result in the adder 1 is a negative value regardless of the presence or absence of the carry signal. And outputs "1".
When both are "0", it is determined that the addition result in the adder 1 becomes a positive value regardless of the presence or absence of the carry signal, and "0" is output.

【0025】5は第2の論理回路であり、第1の論理回
路4の出力と、加算器2のキャリ信号とに基づいて、加
算器2における加算結果を最終出力として出力するか否
かの判断を行う。すなわち、図4の真理値表に示すよう
に、第1の論理回路4から“1”が出力(加算器1にお
ける加算結果が負と判断)された場合において、加算器
2からキャリ信号が出力されると、加算器2における加
算結果を最終出力として出力し、加算器2からキャリ信
号が出力されなければ、加算器2における加算結果を最
終出力として出力しない。
Reference numeral 5 denotes a second logic circuit, based on the output of the first logic circuit 4 and the carry signal of the adder 2, determines whether or not to output the addition result of the adder 2 as a final output. Make a decision. That is, as shown in the truth table of FIG. 4, when "1" is output from the first logic circuit 4 (the addition result in the adder 1 is determined to be negative), the carry signal is output from the adder 2. Then, the addition result in the adder 2 is output as a final output. If no carry signal is output from the adder 2, the addition result in the adder 2 is not output as the final output.

【0026】また、第1の論理回路4から“0”が出力
(加算器1における加算結果が正と判断)された場合に
おいて、加算器2からキャリ信号が出力されなければ、
加算器2における加算結果を最終出力として出力し、加
算器2からキャリ信号が出力されると、加算器2におけ
る加算結果を最終出力として出力しない。
When "0" is output from the first logic circuit 4 (the addition result in the adder 1 is determined to be positive), and if the carry signal is not output from the adder 2,
The addition result in the adder 2 is output as a final output, and when the carry signal is output from the adder 2, the addition result in the adder 2 is not output as the final output.

【0027】選択信号出力回路6は、インバータ7,8
と、ANDゲート9,10とによって構成されている。
そして、ANDゲート9,10のそれぞれ一方の入力端
には加算器2のキャリ信号が入力され、ANDゲート9
の他方の入力端にはインバータ8から出力される第2の
論理回路5の出力の反転信号が、また、ANDゲート1
0の他方の入力端には、インバータ7から出力される加
算器2のキャリ信号の反転信号が入力されている。
The selection signal output circuit 6 includes inverters 7 and 8
And AND gates 9 and 10.
The carry signal of the adder 2 is input to one input terminal of each of the AND gates 9 and 10, and the AND gate 9
An inverted signal of the output of the second logic circuit 5 output from the inverter 8 is supplied to the other input terminal of the AND gate 1.
To the other input terminal of 0, an inverted signal of the carry signal of the adder 2 output from the inverter 7 is input.

【0028】この選択信号出力回路6は、加算器2のキ
ャリ信号と、第2の論理回路5の出力とに基づいて、セ
レクタ3の入力端子114または115のいずれかに入
力されたデータを最終出力として出力させる。すなわ
ち、図4の真理値表に示すように、第2の論理回路5か
ら“0”が出力された場合において、加算器2からキャ
リ信号が出力されると、セレクタ3の入力端子114に
入力されたデータFFHを最終出力として出力し、キャ
リ信号が出力されなければ、セレクタ3の入力端子11
5に入力されたデータ00Hを最終出力として出力す
る。
Based on the carry signal of the adder 2 and the output of the second logic circuit 5, the selection signal output circuit 6 outputs the data input to either the input terminal 114 or 115 of the selector 3 to the final Output as output. That is, as shown in the truth table of FIG. 4, when “0” is output from the second logic circuit 5 and the carry signal is output from the adder 2, the input to the input terminal 114 of the selector 3 is performed. The output data FFH is output as the final output. If no carry signal is output, the input terminal 11 of the selector 3 is output.
The data 00H input to 5 is output as the final output.

【0029】次に上述した3入力加算器の動作について
説明する。 加算器1の加算結果が正の値になる場合 まず、加算器1へ入力されるデータが共に正の値であっ
た場合、加算器1の入力端子101,102に入力され
るデータの最上位ビットは共に“0”となるため、第1
の論理回路4は、加算器1からのキャリ信号の如何に関
わらず“0”を出力する。また、加算器1に入力される
データの一方が正の値(最上位ビットが“0”)で、他
方が負の値(最上位ビットが“1”)である場合におい
て、加算器1からキャリ信号が出力された場合に、加算
結果が正の値になる。この時、第1の論理回路4は
“0”を出力する。
Next, the operation of the above-described three-input adder will be described. When the Addition Result of Adder 1 has a Positive Value First, when the data input to adder 1 are both positive values, the highest order of the data input to input terminals 101 and 102 of adder 1 Since both bits are "0", the first
Logic circuit 4 outputs “0” regardless of the carry signal from the adder 1. When one of the data input to the adder 1 is a positive value (the most significant bit is “0”) and the other is a negative value (the most significant bit is “1”), When the carry signal is output, the addition result becomes a positive value. At this time, the first logic circuit 4 outputs “0”.

【0030】そして、加算器2は、加算器1における加
算結果と、加算器2の入力端子107に入力されたデー
タとを加算し、セレクタ3へ出力する。ここで、加算器
2における加算結果がオーバーフローを起こさなかった
場合、キャリ信号は出力されず、また、第1の論理回路
4は“0”を出力しているので、第2の論理回路5は
“1”を出力する。これにより、選択信号出力回路6か
らセレクタ3に対して、第2の論理回路5からの出力信
号“1”が出力され、また、ANDゲート9,10から
は共に“0”が出力されるので、セレクタ3は加算器2
の加算結果を最終出力として出力する。
Then, the adder 2 adds the addition result of the adder 1 and the data input to the input terminal 107 of the adder 2 and outputs the result to the selector 3. Here, when the addition result in the adder 2 does not cause an overflow, the carry signal is not output, and the first logic circuit 4 outputs “0”, so that the second logic circuit 5 Outputs “1”. As a result, the output signal “1” from the second logic circuit 5 is output from the selection signal output circuit 6 to the selector 3, and “0” is output from both the AND gates 9 and 10. , Selector 3 is adder 2
Is output as the final output.

【0031】一方、加算器2における加算結果がオーバ
ーフローを起こした場合、加算器2からキャリ信号が出
力される。また、第1の論理回路4は“0”を出力して
いるので、第2の論理回路5は“0”を出力する。これ
により、選択信号出力回路6からセレクタ3に対し、A
NDゲート9から“1”が、ANDゲート10から
“0”が出力されるので、セレクタ3はその入力端子1
14に入力されているデータFFHを最終出力として出
力する。
On the other hand, when the result of the addition in the adder 2 causes an overflow, the adder 2 outputs a carry signal. Further, since the first logic circuit 4 outputs “0”, the second logic circuit 5 outputs “0”. As a result, the selection signal output circuit 6 sends A
Since "1" is output from the ND gate 9 and "0" is output from the AND gate 10, the selector 3 has its input terminal 1
Then, the data FFH input to the terminal 14 is output as a final output.

【0032】このように、加算器1における加算結果が
正の値になる場合は、加算器2における加算結果がオー
バーフローを起こさない限り、加算器2の加算結果が最
終出力として出力される。すなわち、図1に示す3入力
加減算回路においては、加算器1における加算結果が正
の値になると判断された場合、その加算結果を絶対値値
で表現された値(数値範囲が0〜255の値)として扱
うので、加算器2においてキャリ信号が出力された場合
は、プラス側にオーバフローを起こしたものと見なして
張り付け処理を行う。
As described above, when the addition result of the adder 1 is a positive value, the addition result of the adder 2 is output as a final output unless the addition result of the adder 2 causes an overflow. That is, in the three-input addition / subtraction circuit shown in FIG. 1, when it is determined that the addition result in the adder 1 is a positive value, the addition result is represented by a value represented by an absolute value (a numerical value range of 0 to 255). Therefore, when a carry signal is output from the adder 2, it is assumed that an overflow has occurred on the plus side, and the pasting process is performed.

【0033】加算器1の加算結果が負の値になる場合 まず、加算器1へ入力されるデータが共に負の値であっ
た場合、加算器1の入力端子101,102に入力され
るデータの最上位ビットは共に“1”となるため、第1
の論理回路4は、加算器1からのキャリ信号の如何に関
わらず“1”を出力する。また、加算器1に入力される
データの一方が正の値(最上位ビットが“0”)で、他
方が負の値(最上位ビットが“1”)である場合におい
て、加算器1からキャリ信号が出力されなかった時は、
加算器1における加算結果が負の値になる。この時、第
1の論理回路4は“1”を出力する。
When the Addition Result of Adder 1 is Negative First, if the data input to adder 1 are both negative values, the data input to input terminals 101 and 102 of adder 1 Are both "1", the first bit of
The logic circuit 4 outputs “1” regardless of the carry signal from the adder 1. When one of the data input to the adder 1 is a positive value (the most significant bit is “0”) and the other is a negative value (the most significant bit is “1”), When no carry signal is output,
The addition result in the adder 1 becomes a negative value. At this time, the first logic circuit 4 outputs "1".

【0034】そして、加算器2は、加算器1における加
算結果と、加算器2の入力端子107に入力されたデー
タとを加算し、セレクタ3へ出力する。ここで、加算器
2における加算結果がオーバーフローを起こした場合、
キャリ信号が出力され、また、第1の論理回路4は
“1”を出力しているので、第2の論理回路5は“1”
を出力する。これにより、選択信号出力回路6からセレ
クタ3に対して、第2の論理回路5からの出力信号
“1”が出力され、また、ANDゲート9,10からは
共に“0”が出力されるので、セレクタ3は加算器2の
加算結果を最終出力として出力する。
The adder 2 adds the result of the addition performed by the adder 1 to the data input to the input terminal 107 of the adder 2 and outputs the result to the selector 3. Here, when the addition result in the adder 2 overflows,
Since the carry signal is output and the first logic circuit 4 outputs "1", the second logic circuit 5 outputs "1".
Is output. As a result, the output signal “1” from the second logic circuit 5 is output from the selection signal output circuit 6 to the selector 3, and “0” is output from both the AND gates 9 and 10. , The selector 3 outputs the addition result of the adder 2 as a final output.

【0035】一方、加算器2における加算結果がオーバ
ーフローを起こさなかった場合、加算器2からキャリ信
号が出力されない。また、第1の論理回路4は“1”を
出力しているので、第2の論理回路5は“0”を出力す
る。これにより、選択信号出力回路6からセレクタ3に
対し、ANDゲート10から“1”が、ANDゲート9
から“0”が出力されるので、セレクタ3はその入力端
子115に入力されているデータ00Hを最終出力とし
て出力する。
On the other hand, if the addition result in the adder 2 does not cause an overflow, the carry signal is not output from the adder 2. Further, since the first logic circuit 4 outputs “1”, the second logic circuit 5 outputs “0”. As a result, “1” is output from the AND gate 10 to the selector 3 from the selection signal output circuit 6 and the AND gate 9 is output.
Is output from the selector 3, and the selector 3 outputs the data 00H input to the input terminal 115 as a final output.

【0036】このように、加算器1における加算結果が
負の値になる場合は、加算器2における加算結果がオー
バーフローを起こした時に限って、加算器2の加算結果
が最終出力として出力される。すなわち、図1に示す3
入力加減算回路においては、加算器1における加算結果
が負の値になると判断された場合、その加算結果を2の
補数で表現された値(数値範囲が−128〜127の
値)として扱うので、加算器2においてキャリ信号が出
力されなかった場合は、マイナス側にオーバフローを起
こしたものと見なして張り付け処理を行う。
As described above, when the addition result in the adder 1 becomes a negative value, the addition result of the adder 2 is output as the final output only when the addition result in the adder 2 overflows. . That is, 3 shown in FIG.
In the input addition / subtraction circuit, when it is determined that the addition result in the adder 1 is a negative value, the addition result is treated as a value represented by a two's complement (a numerical value range is -128 to 127). If the adder 2 does not output a carry signal, it is assumed that an overflow has occurred on the minus side, and the attaching process is performed.

【0037】[0037]

【発明の効果】請求項1ないし4に記載の発明における
3入力加減算回路によれば、それぞれ正または負の値を
持つ第1,第2のデータが第1の加算手段によって加算
された後、その加算結果と正の値を持つ第3のデータが
第2の加算手段で加算されると共に、第1の加算手段に
よる加算結果が正の値であるか負の値であるかを判断
し、その判断結果が正の値でかつ前記第2の加算手段の
加算結果がオーバーフローした場合プラス側にオーバー
フローを起こしたものと見なして貼り付け処理を行い、
前記判断結果が負の値でかつ前記第2の加算手段の加算
結果がオーバーフローしていない場合マイナス側にオー
バーフローを起こしたものと見なして貼り付け処理を行
い、前記判断結果が正の値でかつ前記第2の加算手段の
加算結果がオーバーフローしていない場合と前記判断結
果が負の値でかつ前記第2の加算手段の加算結果がオー
バーフローしている場合には前記第2の加算手段の加算
結果を、最終出力として出力するので、2の補数で表現
された値と絶対値で表現された値とが混在する複数の入
力データの加減算を行う場合において、最終的に得られ
る演算結果を絶対値で表現した値で出力することが可能
となり、結果的に演算精度を1ビット分向上させること
ができる。
According to the three-input addition / subtraction circuit according to the first to fourth aspects of the present invention, each of the positive and negative values is
After the first and second data are added by the first addition means, the addition result and third data having a positive value are added by the second addition means, and the first addition means is added. It is determined whether the addition result is a positive value or a negative value, and the determination result is a positive value and the second addition means
If the result of the addition overflows
Assuming that the flow has occurred, perform the paste process,
The judgment result is a negative value and the addition by the second adding means is performed.
If the result has not overflown,
Paste assuming that a bar flow has occurred
The result of the determination is a positive value and the value of the second
If the addition result does not overflow,
The result is a negative value and the addition result of the second addition means is
In the case of a bar flow, the addition of the second adding means
Since the result is output as the final output, when performing addition / subtraction of a plurality of input data in which a value represented by a two's complement and a value represented by an absolute value are mixed, the operation result finally obtained is determined by an absolute value. It is possible to output a value represented by a value, and as a result, the calculation accuracy can be improved by one bit.

【0038】また、請求項5に記載の発明における3入
力加減算回路によれば、3入力加減算回路に入力される
データのビット長が統一されているので、演算処理速度
を高速化することができ、高速性を要求される画像処理
に適している。
According to the three-input addition / subtraction circuit according to the fifth aspect of the present invention, since the bit length of data input to the three-input addition / subtraction circuit is unified, the arithmetic processing speed can be increased. It is suitable for image processing requiring high speed.

【0039】また、請求項6に記載の発明における3入
力加減算回路によれば、上記の3入力加減算回路におい
て、動画処理におけるYUV方式からRGB方式への変
換演算の一つである G=γ1U+γ2V+γ3Yなる変換
演算を行うので、精度の高い変換が可能となる。
Further, according to the three input adder circuit in the invention of claim 6, said three-input adder circuit odor
Change from YUV system to RGB system in moving image processing
G = γ1U + γ2V + γ3Y which is one of the conversion operations
Since the calculation is performed, highly accurate conversion can be performed.

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

【図1】 本発明の一実施形態における3入力加減算回
路の構成を示すブロック図である。
FIG. 1 is a block diagram illustrating a configuration of a three-input addition / subtraction circuit according to an embodiment of the present invention.

【図2】 同3入力加減算回路へデータを出力するYU
Vデータ変換回路の入出力データを説明するための説明
図である。
FIG. 2 is a YU that outputs data to the 3-input addition / subtraction circuit.
FIG. 4 is an explanatory diagram for explaining input / output data of a V data conversion circuit.

【図3】 同3入力加減算回路に用いられる第1の論理
回路の入出力関係を示す真理値表を表した図である。
FIG. 3 is a diagram showing a truth table showing an input / output relationship of a first logic circuit used in the three-input addition / subtraction circuit.

【図4】 同3入力加減算回路に用いられる第2の論理
回路の入出力関係を示す真理値表を表した図である。
FIG. 4 is a diagram showing a truth table indicating an input / output relationship of a second logic circuit used in the three-input addition / subtraction circuit.

【図5】 従来の連続加算を行う加算回路の構成を示す
ブロック図である。
FIG. 5 is a block diagram illustrating a configuration of a conventional addition circuit that performs continuous addition.

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

1,2 加算器 3 セレクタ 4,5 論理回路 6 選択信号出力回路 7,8 インバータ 9,10 ANDゲート 1, 2 adder 3 selector 4, 5 logic circuit 6 selection signal output circuit 7, 8 inverter 9, 10 AND gate

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.6 識別記号 FI H04N 9/67 G06F 7/00 101U (58)調査した分野(Int.Cl.6,DB名) G06F 7/50 G06F 7/00 G09G 5/00 510 G09G 5/00 520 G09G 5/02 H04N 9/67 ──────────────────────────────────────────────────続 き Continued on the front page (51) Int.Cl. 6 identification code FI H04N 9/67 G06F 7/00 101U (58) Fields investigated (Int.Cl. 6 , DB name) G06F 7/50 G06F 7 / 00 G09G 5/00 510 G09G 5/00 520 G09G 5/02 H04N 9/67

Claims (6)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 複数ビット単位で構成され、2の補数で
表現されたデータを含む少なくとも3つのデータを加算
する3入力加減算回路において、 前記複数ビット単位で構成される少なくとも3つのデー
タのうち、正または負の値を持つ第1のデータと、正ま
たは負の値を持つ第2のデータとを加算する第1の加算
手段と、 前記第1の加算手段の出力と、前記複数ビット単位で構
成される少なくとも3つのデータのうちの正の値を持つ
第3のデータとを加算する第2の加算手段と、 前記第1の加算手段の加算結果が、正の値であるか負の
値であるかを判断し、その判断結果が正の値でかつ前記
第2の加算手段の加算結果がオーバーフローした場合プ
ラス側にオーバーフローを起こしたものと見なして貼り
付け処理を行い、前記判断結果が負の値でかつ前記第2
の加算手段の加算結果がオーバーフローしていない場合
マイナス側にオーバーフローを起こしたものと見なして
貼り付け処理を行い、前記判断結果が正の値でかつ前記
第2の加算手段の加算結果がオーバーフローしていない
場合と前記判断結果が負の値でかつ前記第2の加算手段
の加算結果がオーバーフローしている場合には前記第2
の加算手段の加算結果を、最終出力として出力する貼り
付け処理手段とを具備することを特徴とする3入力加減
算回路。
1. A three-input addition / subtraction circuit configured to add at least three pieces of data including data represented by a two's complement and configured in a plurality of bits, wherein: a first data having a positive or negative value signifies positive
A first adding means for adding second data having a negative value or a negative value; an output of the first adding means; and a positive value among at least three pieces of data composed of a plurality of bits. A second adder for adding third data having the following formula: and determining whether the addition result of the first adder is a positive value or a negative value. And the determination result is a positive value and
If the addition result of the second addition means overflows,
Paste as if the overflow occurred on the lath side
And the judgment result is a negative value and the second
The addition result of the addition means does not overflow
Assuming that overflow has occurred on the negative side
Paste processing, the judgment result is a positive value and the
The addition result of the second adding means does not overflow.
The case and the judgment result are negative values and the second addition means
If the result of the addition overflows, the second
3. A three-input addition / subtraction circuit, comprising: a pasting processing means for outputting the addition result of the addition means as a final output .
【請求項2】 請求項1に記載の3入力加減算回路にお
いて、 前記第1,第2の加算手段のそれぞれは、加算結果が出
力し得る最大値を超えた場合に加算結果がオーバーフロ
ーしていることを示すキャリ信号を出力する加算手段で
あって、 前記貼り付け処理手段は、 前記第1の加算手段に入力される第1,第2のデータ
の、各最上位ビットの状態と、前記第1の加算手段から
のキャリ信号とに基づいて、前記第1の加算手段におけ
る加算結果が正の値であるか負の値であるかを判断する
第1の判断手段と、 前記第1の判断手段の判断結果と、前記第2の加算手段
からのキャリ信号に基づいて、前記第2の加算手段に
おける加算結果が、前記3入力加減算回路が出力する演
算結果の数値範囲の上限を超えるか、または、下限を下
回るかを判断する第2の判断手段と、 前記3入力加減算回路が出力する数値の最大値および最
小値、ならびに、前記第2の加算手段の加算結果が供給
され、前記第2の判断手段の判断結果に基づいていずれ
か1つの値を出力する選択手段とからなることを特徴と
する3入力加減算回路。
2. The three-input addition / subtraction circuit according to claim 1, wherein each of said first and second addition means overflows when the addition result exceeds a maximum value that can be output.
Adding means for outputting a carry signal indicating that the first and second data input to the first adding means are in a state of the most significant bit of each of the first and second data input to the first adding means. And first determining means for determining whether the result of addition in the first adding means is a positive value or a negative value, based on a carry signal from the first adding means; results and determination of the first determining means, based on a carry signal from the second adding means, the addition result in the second addition means, the numerical range of the result of the three-input adder circuit outputs Second determining means for determining whether the value exceeds the upper limit or falls below the lower limit; the maximum value and the minimum value of the numerical value output by the three-input addition / subtraction circuit; and the addition result of the second adding means are supplied. And the result of the judgment by the second judgment means is And a selecting means for outputting any one value based on the result.
【請求項3】 請求項2に記載の3入力加減算回路にお
いて、 前記第1の判断手段は、 前記第1の加算手段に入力される第1,第2のデータの
最上位ビットが共に“1”である場合、または、第1,
第2のデータの最上位ビットがそれぞれ“0”,“1”
もしくは“1”,“0”でありかつ前記第1の加算手段
からキャリ信号が出力されなかった場合に、前記第1の
加算手段における加算結果が2の補数で表現された値に
なると判断し、 前記第1の加算手段に入力される第1,第2のデータの
最上位ビットが共に“0”である場合、または、第1,
第2のデータの最上位ビットがそれぞれ“0”,“1”
もしくは“1”,“0”でありかつ前記第1の加算手段
からキャリ信号が出力された場合に、前記第1の加算手
段における加算結果が絶対値で表現された値になると判
断することを特徴とする3入力加減算回路。
3. The three-input addition / subtraction circuit according to claim 2, wherein the first determination unit determines that both of the most significant bits of the first and second data input to the first addition unit are “1”. "Or the first,
The most significant bits of the second data are “0” and “1”, respectively.
Alternatively, if the carry signal is "1" or "0" and no carry signal is output from the first adding means, it is determined that the addition result of the first adding means is a value expressed in two's complement. The most significant bits of the first and second data input to the first addition means are both "0", or
The most significant bits of the second data are “0” and “1”, respectively.
Alternatively, when the carry signal is "1" or "0" and the carry signal is output from the first adding means, it is determined that the addition result in the first adding means is a value expressed as an absolute value. Characteristic 3-input addition / subtraction circuit.
【請求項4】 請求項2に記載の3入力加減算回路にお
いて、 前記第2の判断手段は、 前記第1の判断手段により、前記第1の加算手段におけ
る加算結果が2の補数で表現された値になると判断さ
れ、かつ前記第2の加算手段からキャリ信号が出力され
なかった場合、前記第2の加算手段における加算結果
が、前記3入力加減算回路が出力する演算結果の数値範
囲の下限を下回ると判断し、 前記第1の判断手段により、前記第1の加算手段におけ
る加算結果が絶対値で表現された値になると判断され、
かつ前記第2の加算手段からキャリ信号が出力された場
合、前記第2の加算手段における加算結果が、前記3入
力加減算回路が出力する演算結果の数値範囲の上限を超
えると判断することを特徴とする3入力加減算回路。
4. The three-input addition / subtraction circuit according to claim 2, wherein said second judging means is configured such that, by said first judging means, an addition result in said first adding means is represented by a two's complement number. If the carry signal is not output from the second adder, the result of the addition by the second adder is set to the lower limit of the numerical range of the operation result output by the three-input addition / subtraction circuit. It is determined that the value is less than the above, and the first determining means determines that the addition result in the first adding means is a value expressed as an absolute value,
When the carry signal is output from the second addition means, it is determined that the addition result in the second addition means exceeds the upper limit of the numerical range of the operation result output from the three-input addition / subtraction circuit. 3 input addition / subtraction circuit.
【請求項5】 請求項1ないし4のうち、いずれか1項
に記載の3入力加減算回路において、 前記複数ビットで構成される少なくとも3つのデータ
が、全て同一ビット長から構成されていることを特徴と
する3入力加減算回路。
5. The three-input addition / subtraction circuit according to claim 1, wherein at least three pieces of data composed of a plurality of bits have the same bit length. Characteristic 3-input addition / subtraction circuit.
【請求項6】 動画処理におけるYUV方式からRGB
方式への変換演算の一つである G=γ1U+γ2V+γ3
Yなる変換演算を行うものであることを特徴とする請求
項1ないし5のうち、いずれか1項に記載の3入力加減
算回路。
6. A moving image processing system from a YUV system to an RGB system.
G = γ1U + γ2V + γ3 which is one of the conversion operations to the system
Wherein a conversion operation of Y is performed.
Item 6. The three-input addition / subtraction circuit according to any one of Items 1 to 5 .
JP8262136A 1996-10-02 1996-10-02 3-input addition / subtraction circuit Expired - Lifetime JP2984606B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8262136A JP2984606B2 (en) 1996-10-02 1996-10-02 3-input addition / subtraction circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8262136A JP2984606B2 (en) 1996-10-02 1996-10-02 3-input addition / subtraction circuit

Publications (2)

Publication Number Publication Date
JPH10105379A JPH10105379A (en) 1998-04-24
JP2984606B2 true JP2984606B2 (en) 1999-11-29

Family

ID=17371562

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8262136A Expired - Lifetime JP2984606B2 (en) 1996-10-02 1996-10-02 3-input addition / subtraction circuit

Country Status (1)

Country Link
JP (1) JP2984606B2 (en)

Also Published As

Publication number Publication date
JPH10105379A (en) 1998-04-24

Similar Documents

Publication Publication Date Title
US4953115A (en) Absolute value calculating circuit having a single adder
JP2001084366A (en) Image interpolation device
US5457805A (en) Microcomputer enabling high speed execution of product-sum operation
JPH0375900B2 (en)
JPH07110041B2 (en) Image processing device
US3976866A (en) Addition control system
JP2984606B2 (en) 3-input addition / subtraction circuit
US5917739A (en) Calculating the average of four integer numbers rounded towards zero in a single instruction cycle
EP0520378A2 (en) Overflow detection system and its circuit for use in addition and subtraction
US5710732A (en) Calculating the average of four integer numbers rounded away from zero in a single instruction cycle
US5671022A (en) Image processing system and method for converting YCbCr data composed of luminance and chroma into RGB data of three primary colors
JPH07168696A (en) Overflow and underflow processing circuit of binary adder
US4860235A (en) Arithmetic unit with alternate mark inversion (AMI) coding
US6007232A (en) Calculating the average of two integer numbers rounded towards zero in a single instruction cycle
US5546335A (en) Absolute value calculation method and circuit
US5905428A (en) N-bit comparator using count leading 1 circuits
JP3033277B2 (en) Frequency distribution calculator
JP3235125B2 (en) Digital signal processing circuit
US5831886A (en) Calculating a + sign(A) in a single instruction cycle
US5483477A (en) Multiplying circuit and microcomputer including the same
JP2907276B2 (en) Arithmetic processing unit
JPS6132436Y2 (en)
JP2980341B2 (en) Floating point alignment circuit
JPH1153346A (en) Discontinuous signal interpolation circuit
JPH0580982A (en) Absolute value circuit

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19990907