JPH07168808A - Signal processor - Google Patents

Signal processor

Info

Publication number
JPH07168808A
JPH07168808A JP34286593A JP34286593A JPH07168808A JP H07168808 A JPH07168808 A JP H07168808A JP 34286593 A JP34286593 A JP 34286593A JP 34286593 A JP34286593 A JP 34286593A JP H07168808 A JPH07168808 A JP H07168808A
Authority
JP
Japan
Prior art keywords
output
selector
register
input
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.)
Pending
Application number
JP34286593A
Other languages
Japanese (ja)
Inventor
Tetsuo Nakazawa
哲夫 中澤
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP34286593A priority Critical patent/JPH07168808A/en
Publication of JPH07168808A publication Critical patent/JPH07168808A/en
Pending legal-status Critical Current

Links

Landscapes

  • Processing Of Color Television Signals (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Complex Calculations (AREA)
  • Image Processing (AREA)

Abstract

PURPOSE:To perform product sum arithmetic, accumulation of the absolute values of differences, and threshold value arithmetic by one unit. CONSTITUTION:A multiplier 100 multiplies two data. A 1st mathematical computing element 200 performs addition of and subtraction between the two data, outputs the arithmetic result as a plus value, and also outputs the sign flag of the arithmetic result. One selector 9 selects the respective outputs of the multiplier 100, 1st mathematical computing element 200, and a constant register 8, and an initial value. A 2nd mathematical computing element 300 inputs the outputs of one selector 9 and the other selector 10, performs the addition and subtraction, and outputs the arithmetic result as the plus value and also outputs the sign flag of the arithmetic result. A threshold value arithmetic part 400 has a 1st and a 2nd threshold arithmetic output value and selects and outputs those values, threshold values, and input data on the basis of the sign flags of the 1st mathematical computing element 200 and 2nd mathematical computing element 300.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、主として画像処理で行
われる積和演算、差の絶対値の累算、閾値演算、制限付
き演算を実行する信号処理装置に関する。に関するもの
である。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a signal processing apparatus which mainly performs product sum operation, image difference absolute value accumulation, threshold value operation, and restricted operation which are performed in image processing. It is about.

【0002】[0002]

【従来の技術】画像処理において、計算機内部での色デ
ータは、一般にRGB(Red ,Green,Blue)で扱われ
ることが多く、また、画像データの圧縮を行う場合に
は、RGBの色空間からYUVの色空間に変換すること
が一般的である。尚、ここで、Yは輝度、U,Vは色差
である。そして、この色変換は、次のように表される。
図2は、色変換に関する演算式の説明図である。即ち、
RGBからYUVへの色変換は、図中の式(1)に示さ
れる。また、式(1)中、[Ry、Gy、By][R
u、Gu、Bu][Rv、Gv、Bv]は、各色成分に
対応した変換係数である。
2. Description of the Related Art In image processing, color data inside a computer is generally treated in RGB (Red, Green, Blue), and when image data is compressed, it is converted from RGB color space. Conversion to the YUV color space is common. Here, Y is the luminance and U and V are the color differences. Then, this color conversion is expressed as follows.
FIG. 2 is an explanatory diagram of an arithmetic expression regarding color conversion. That is,
The color conversion from RGB to YUV is shown in equation (1) in the figure. Further, in the formula (1), [Ry, Gy, By] [R
u, Gu, Bu] [Rv, Gv, Bv] are conversion coefficients corresponding to each color component.

【0003】また、画像データの伸長を行う場合には、
YUVの色空間からRGBの色空間に変換することが一
般的であり、この色変換は図2中の式(2)に示されて
いる。また、式(2)中、[Yr、Ur、Vr][Y
g、Ug、Vg][Yb、Ub、Vb]は、各色成分に
対応した変換係数である。
When decompressing image data,
It is common to convert from the YUV color space to the RGB color space, and this color conversion is expressed by equation (2) in FIG. Further, in the formula (2), [Yr, Ur, Vr] [Y
g, Ug, Vg] [Yb, Ub, Vb] is a conversion coefficient corresponding to each color component.

【0004】このような色変換を行う構成について、従
来では、例えば特開平3−154980号公報や、特開
平4−21191号公報等に示されたものがあった。そ
して、このような色変換は、式(1)、(2)で示され
るように、積和演算となる。
Conventionally, there has been a configuration for performing such color conversion as disclosed in, for example, Japanese Patent Application Laid-Open Nos. 3-154980 and 4-21191. Then, such color conversion is a product-sum operation as shown by the equations (1) and (2).

【0005】次に、画像データの圧縮や伸長の手法とし
て、離散コサイン変換(DCT:Discrete Cosine Tran
sform )等の直交変換が知られている。これは、変換領
域で見た場合に、信号エネルギが特定の係数に集中する
ことを利用してこれらの係数を重点的に符号化伝送しよ
うとするものである。
Next, as a method for compressing or expanding image data, a discrete cosine transform (DCT) is used.
sform) and other orthogonal transforms are known. This seeks to intensively code and transmit these coefficients by utilizing the fact that the signal energy is concentrated on specific coefficients when viewed in the transform domain.

【0006】図3は、離散コサイン変換に関する演算式
の説明図である。例えば、N×N画素の画像データf
(i,j)(i=1〜N,j=1〜N)に対する離散コ
サイン変換は、図3中の式(3)で表される。また、逆
離散コサイン変換は図3中の式(4)で表される。そし
て、2次元の離散コサイン変換は、iについての1次元
の離散コサイン変換と、jについての1次元離散コサイ
ン変換に分割でき、これらは、図3中の式(5)、
(6)で表される。また、逆離散コサイン変換も同様
に、図3中の式(7)、(8)で表される。
FIG. 3 is an explanatory diagram of an arithmetic expression regarding the discrete cosine transform. For example, image data f of N × N pixels
The discrete cosine transform for (i, j) (i = 1 to N, j = 1 to N) is represented by Expression (3) in FIG. Further, the inverse discrete cosine transform is expressed by the equation (4) in FIG. Then, the two-dimensional discrete cosine transform can be divided into a one-dimensional discrete cosine transform for i and a one-dimensional discrete cosine transform for j, which are expressed by equation (5) in FIG.
It is represented by (6). Similarly, the inverse discrete cosine transform is also represented by the equations (7) and (8) in FIG.

【0007】このような離散コサイン変換を行う演算装
置については、従来では、例えば特開平4−531号公
報や特開平4−43461号公報等に示されるものがあ
った。そして、これらの演算は、式(3)〜(8)で示
されるように、積和演算となる。
Conventionally, as an arithmetic unit for performing such a discrete cosine transform, there has been one shown in, for example, Japanese Patent Application Laid-Open Nos. 4-531 and 4-43461. Then, these calculations are product-sum calculations as shown by the equations (3) to (8).

【0008】次に、画像のフィルタリング等では、2次
元コンボリューション処理が行われる。これは、輪郭の
ぼけを除去するエッジ強調処理等で用いる。図4は、2
次元コンボリューション処理に関する演算式の説明図で
ある。この2次元コンボリューション処理とは、注目画
素をP(i,j)、係数をW(x,y)とすると、コン
ボリューションPconv(i,j)は、図中の式(9)で
表される。但し、M=2m−1(m=2,3,4,…)
である。そして、これも、式(9)で示されるように積
和演算となり、このようなコンボリューションを行う装
置としては、例えば特開平3−282977号公報等に
示されている。
Next, in image filtering or the like, a two-dimensional convolution process is performed. This is used in edge enhancement processing for removing the blur of the contour. 4 is 2
It is explanatory drawing of the arithmetic expression regarding a dimensional convolution process. In this two-dimensional convolution processing, if the pixel of interest is P (i, j) and the coefficient is W (x, y), the convolution Pconv (i, j) is expressed by equation (9) in the figure. It However, M = 2m-1 (m = 2, 3, 4, ...)
Is. This is also a product-sum operation as shown in equation (9), and an apparatus for performing such convolution is disclosed in, for example, Japanese Patent Laid-Open No. 3-282977.

【0009】また、高能率な動画像圧縮符号化の手法と
して、例えば、“蓄積メディア用動画像符号化技術”
テレビジョン学会 Vol.45,No.7,p807
〜812,1991等に示されているように、動き補償
フレーム間予測符号化が知られている。これは、参照フ
レームに対する動きベクトルを求めて、この動きに対応
した位置の画素との差分と動きベクトルを符号化するも
のである。
As a highly efficient moving picture compression coding method, for example, "moving picture coding technique for storage media" is used.
Television Society Vol. 45, No. 7, p807
, 812, 1991 etc., motion compensation interframe predictive coding is known. In this method, a motion vector for a reference frame is obtained, and the difference between the motion vector and a pixel at a position corresponding to this motion and the motion vector are encoded.

【0010】図5は、動き補償フレーム間予測符号化に
関する演算式の説明図である。予測フレームのブロック
をPf(i+nx,j+ny):0≦nx≦k,0≦n
y≦kとし、Pf(i+nx,j+ny)に対する参照
フレームのブロックをSf{(i+nx)+mx,(j
+ny)+my}:−r≦mx≦+r,−r≦my≦+
rとすると、動きベクトルを検出するためのブロック間
の差分Msは、図中の式(10)で表される。これは、
式から明らかなように、差の絶対値の累算となる。そし
て、このような差の絶対値演算を行う演算装置として
は、例えば特開平4−84317号公報等に示されてい
る。
FIG. 5 is an explanatory diagram of an arithmetic expression relating to motion compensation interframe predictive coding. The block of the prediction frame is Pf (i + nx, j + ny): 0 ≦ nx ≦ k, 0 ≦ n
When y ≦ k, the block of the reference frame for Pf (i + nx, j + ny) is Sf {(i + nx) + mx, (j
+ Ny) + my}: -r≤mx≤ + r, -r≤my≤ +
If r is set, the difference Ms between blocks for detecting the motion vector is expressed by Expression (10) in the figure. this is,
As is clear from the formula, it is the accumulation of the absolute values of the differences. An arithmetic unit for performing such an absolute value difference calculation is disclosed, for example, in Japanese Patent Laid-Open No. 4-84317.

【0011】また、多値画像の2値化や多値画像の特定
の画素値領域に対する処理等では、閾値演算が必要とな
る。更に、画像データは通常整数で扱われるため、色変
換やDCTを整数演算器で行う場合、小数点の位置を変
更することになる。そのため、演算結果に対して小数点
の位置を元に戻すことが必要となる。
In addition, threshold value calculation is required for binarization of a multi-valued image, processing for a specific pixel value area of the multi-valued image, and the like. Further, since image data is usually handled as an integer, when performing color conversion or DCT with an integer arithmetic unit, the position of the decimal point is changed. Therefore, it is necessary to restore the position of the decimal point with respect to the calculation result.

【0012】そして、積和演算では、入力データビット
幅より大きい値を扱うことになる。例えば、8ビットの
画素データの積和演算で、32ビット幅の累算器を用
い、その結果を16ビットで出力する場合、オーバフロ
ーやアンダフローの発生が予想される。これに対し、画
像処理ではオーバフローやアンダフローを最大値や最小
値で出力することがあり、そのため、演算結果を目的と
する画素値の範囲に収めるために、上限や下限を設定し
た制限付き演算が必要となる。
The product-sum operation handles a value larger than the input data bit width. For example, when a 32-bit width accumulator is used in the product-sum operation of 8-bit pixel data and the result is output in 16 bits, overflow or underflow is expected to occur. On the other hand, in image processing, overflow or underflow may be output with the maximum value or the minimum value. Therefore, in order to keep the operation result within the range of the target pixel value, the restricted operation with the upper and lower limits is set. Is required.

【0013】[0013]

【発明が解決しようとする課題】上記のように、従来の
画像処理装置等の信号処理装置では、上記の積和演算、
差の絶対値の累算、閾値演算等の処理を行う必要がある
が、このような演算を行うためには、それぞれの演算に
対応した演算器を用意する必要があり、従って、構成が
複雑となり、コスト高となる問題があった。
As described above, in the signal processing device such as the conventional image processing device, the above-described product-sum operation,
It is necessary to perform processing such as accumulation of absolute value of difference and threshold value calculation, but in order to perform such calculation, it is necessary to prepare an arithmetic unit corresponding to each calculation, and therefore the configuration is complicated. Therefore, there is a problem that the cost becomes high.

【0014】本発明は、上記従来の問題点を解決するた
めになされたもので、画像処理等で行われる積和演算、
差の絶対値の累算、閾値演算等の処理を、一つの演算ユ
ニットで行うことができ、コスト低減を図ることのでき
る信号処理装置を提供することを目的とする。
The present invention has been made in order to solve the above-mentioned conventional problems, and a product-sum operation performed in image processing or the like,
It is an object of the present invention to provide a signal processing device capable of performing processing such as accumulation of absolute values of differences and threshold value calculation in a single calculation unit, thereby achieving cost reduction.

【0015】[0015]

【課題を解決するための手段】第1発明の信号処理装置
は、乗算器と、第1の算術演算器と、第2の算術演算器
と、閾値演算部と、定数レジスタと、一方の選択器と、
他方の選択器とを備え、前記乗算器は、任意の2データ
を入力して、乗算を行い、前記第1の算術演算器は、前
記任意の2データを入力し、加算または減算を行うと共
に、演算結果が負である時、符号を反転して正の値にし
て出力し、かつ演算結果の符号フラグを出力し、前記一
方の選択器は、前記乗算器の出力と、前記第1の算術演
算器の出力と、前記定数レジスタの出力と、初期値とを
選択し、前記他方の選択器は、前記閾値演算部から出力
される閾値演算出力値と、前記第2の算術演算器の出力
と、前記定数レジスタの出力と、前記初期値とを選択
し、前記定数レジスタは、任意の値を保持し、前記第2
の算術演算器は、前記一方の選択器の出力と、他方の選
択器の出力とを入力し、加算または減算を行うと共に、
演算結果が負である時、符号を反転して正の値にして出
力し、かつ演算結果の符号フラグを出力し、前記閾値演
算部は、第1、第2の閾値演算出力値を有し、閾値が一
つの場合、前記2データの入力を当該閾値と任意のデー
タとし、かつ、第1の算術演算器の符号フラグで前記第
1、第2の閾値演算出力値のいずれか一方を選択して閾
値演算出力値として、これを前記他方の選択器に出力
し、閾値が第1、第2の閾値である場合、前記2データ
の入力を、前記第1の閾値と任意のデータとすると共
に、前記定数レジスタの値を前記第2の閾値とし、か
つ、前記第1の算術演算器の符号フラグに基づき前記第
1、2の閾値の選択と、前記第1、2の閾値演算出力の
選択とを行い、かつ、前記第1の算術演算器の符号フラ
グと前記第2の算術演算器の符号フラグに基づき、前記
選択した第1または第2の閾値と前記任意のデータとの
いずれか一方の選択を行うと共に、前記第1または第2
の閾値演算出力値と前記任意のデータのいずれか一方の
選択を行い、かつ、これら選択結果のいずれか一方を選
択して閾値演算結果を出力することを特徴とするもので
ある。
A signal processing apparatus according to a first aspect of the present invention includes a multiplier, a first arithmetic operation unit, a second arithmetic operation unit, a threshold value operation unit, a constant register, and selection of one of them. A vessel,
The other selector is provided, the multiplier inputs arbitrary 2 data and performs multiplication, and the first arithmetic operation unit inputs the arbitrary 2 data and performs addition or subtraction. When the operation result is negative, the sign is inverted and output as a positive value, and the sign flag of the operation result is output, and the one selector outputs the output of the multiplier and the first selector. The output of the arithmetic operation unit, the output of the constant register, and the initial value are selected, and the other selector selects the threshold operation output value output from the threshold operation unit and the second arithmetic operation unit. An output, an output of the constant register, and the initial value are selected, the constant register holds an arbitrary value, and the second register
The arithmetic operation unit of (1) inputs the output of the one selector and the output of the other selector, performs addition or subtraction, and
When the calculation result is negative, the sign is inverted and output as a positive value, and the sign flag of the calculation result is output, and the threshold value calculation unit has first and second threshold value calculation output values. , If there is one threshold value, the input of the two data is the threshold value and arbitrary data, and one of the first and second threshold value calculation output values is selected by the sign flag of the first arithmetic operation unit. Then, this is output as the threshold value calculation output value to the other selector, and when the threshold values are the first and second threshold values, the input of the two data is the first threshold value and arbitrary data. At the same time, the value of the constant register is used as the second threshold value, and the selection of the first and second threshold values based on the sign flag of the first arithmetic operation unit and the output of the first and second threshold value operation outputs. And a sign flag of the first arithmetic operation unit and the second arithmetic operation. The basis of the sign flag, performs one of selection of the first or second threshold value and said any said selected data, said first or second
One of the threshold calculation output value and the arbitrary data is selected, and one of these selection results is selected and the threshold calculation result is output.

【0016】第2発明の信号処理装置は、第1発明にお
いて、出力処理部と、演算結果選択器とを備え、前記出
力処理部は、予め、出力ビット幅を設定すると共に、こ
のビット幅で表せる最大値と最小値とを有し、第2の算
術演算器の出力を入力して、当該第2の算術演算器の出
力が、前記出力ビット幅より大きい場合は前記最大値
を、前記第2の算術演算器の出力が、前記出力ビット幅
より小さい場合は前記最小値を出力し、前記演算結果選
択器は、前記出力処理部の出力と、閾値演算部の出力と
を選択して演算結果として出力することを特徴とするも
のである。
A signal processing apparatus according to a second aspect of the present invention is the signal processing apparatus according to the first aspect of the present invention, which includes an output processing section and a calculation result selector, and the output processing section sets an output bit width in advance and uses this bit width. When the output of the second arithmetic operation unit has a maximum value and a minimum value that can be expressed and the output of the second arithmetic operation unit is larger than the output bit width, the maximum value is set to the maximum value. When the output of the arithmetic operation unit 2 is smaller than the output bit width, the minimum value is output, and the operation result selector selects the output of the output processing unit and the output of the threshold value operation unit for operation. It is characterized by outputting as a result.

【0017】[0017]

【作用】第1発明の信号処理装置においては、積和演算
は、二つの入力データを乗算器に入力し乗算を行い、そ
の結果を第2の算術演算器の一方の入力レジスタに保持
する。これと同時に、次の乗算も続けて行う。第2の算
術演算器の他方の入力レジスタは、初期値として“0”
を設定しておく。そして、第2の算術演算器の二つの入
力レジスタの加算を行い、その結果を第2の算術演算器
の“0”を保持していた入力レジスタに入れ累算を行
う。そして、次の乗算器からの乗算結果と累算結果が保
持された入力レジスタとの加算を行い累算を続ける。こ
れを繰り返すことにより、積和演算を行うことができ
る。
In the signal processing device of the first aspect of the present invention, in the product-sum operation, two input data are input to the multiplier for multiplication, and the result is held in one input register of the second arithmetic operator. At the same time, the next multiplication is also continued. The other input register of the second arithmetic operation unit has “0” as an initial value.
Is set. Then, the two input registers of the second arithmetic operation unit are added, and the result is placed in the input register of the second arithmetic operation unit which holds "0" to perform accumulation. Then, the multiplication result from the next multiplier and the input register holding the accumulation result are added to continue the accumulation. By repeating this, the product-sum calculation can be performed.

【0018】差の絶対値の累算は、二つの入力データを
第1の算術演算器に入力して、一方のデータから他方の
データを減算し、その結果が負でない場合は演算結果を
そのまま、また、前記結果が負である場合は、符号を反
転し正の値にして差の絶対値演算を行い、第2の算術演
算器の一方のレジスタに保持する。これと同時に、次の
差の絶対値演算も続けて行う。第2の算術演算器の他方
の入力レジスタは、初期値として“0”を設定してお
く。そして、第2の算術演算器の二つの入力レジスタの
加算を行い、その結果を第2の算術演算器の“0”を保
持していた入力レジスタに入れ、累算を行う。そして、
次の第1の算術演算器からの差の絶対値演算の結果と、
累算結果が保持された入力レジスタとの加算を行い累算
を続ける。これを繰り返すことにより、差の絶対値の累
算を行うことができる。
To accumulate the absolute value of the difference, two pieces of input data are input to the first arithmetic operation unit, the other data is subtracted from one data, and when the result is not negative, the operation result is kept as it is. If the result is negative, the sign is inverted to a positive value, the absolute value of the difference is calculated, and the difference is held in one register of the second arithmetic operation unit. At the same time, the absolute value of the next difference is continuously calculated. The other input register of the second arithmetic operation unit is set to "0" as an initial value. Then, the two input registers of the second arithmetic operation unit are added, and the result is put into the input register of the second arithmetic operation unit that holds "0", and the accumulation is performed. And
The result of the absolute value operation of the difference from the following first arithmetic operation unit,
The addition is performed with the input register holding the accumulated result, and the accumulation is continued. By repeating this, the absolute value of the difference can be accumulated.

【0019】閾値演算は、閾値が一つの場合、閾値を一
方の入力から、データを他方の入力から第1の算術演算
器に入力し、減算を行い、その結果の符号フラグによ
り、閾値演算部の内部に設定されている第1、第2の閾
値演算出力値を選択し、他方の選択器に出力する。そし
て、選択制御部により、他方の選択器で閾値演算部から
の出力を選択し、第2の算術演算器の一方の入力レジス
タに入力する。また、選択制御部により一方の選択器で
値“0”を選択し、第2の算術演算部の他方の入力レジ
スタに入力する。第2の算術演算器で、両方の入力レジ
スタの加算を行う。これにより閾値演算を行うことがで
きる。
In the threshold value calculation, when there is one threshold value, the threshold value is input from one input, the data is input from the other input to the first arithmetic operation unit, subtraction is performed, and the threshold value calculation unit is determined by the sign flag of the result. The first and second threshold value calculation output values set inside are selected and output to the other selector. Then, the selection control unit selects the output from the threshold value calculation unit with the other selector, and inputs the output to one input register of the second arithmetic operation unit. Further, the value "0" is selected by one of the selectors by the selection control unit and input to the other input register of the second arithmetic operation unit. The second arithmetic operation unit adds both input registers. This enables threshold calculation.

【0020】閾値が二つの場合、第1の閾値を一方の入
力から入力すると共に、定数レジスタに第2の閾値を保
持してこれを入力し、かつ、第1の閾値を一方の入力か
ら、また、データを他方の入力から入力して、これらの
減算を行う第1の算術演算器の符号フラグに基づき、第
1、2の閾値の選択と、第1、2の閾値演算出力値の選
択とを行う。そして、第1の算術演算器の符号フラグ
と、第2の算術演算器の符号フラグに基づき、前記選択
した第1または第2の閾値と、データとのいずれか一方
を選択すると共に、前記第1または第2の閾値演算出力
値と、データとのいずれか一方を選択する。更に、これ
ら二つの選択結果のいずれか一方を選択して閾値演算結
果として出力する。これにより閾値が二つの場合も、そ
の閾値演算を行うことができる。
When there are two threshold values, the first threshold value is input from one input, the second threshold value is held in the constant register and input, and the first threshold value is input from one input. In addition, the first and second threshold values are selected and the first and second threshold value calculation output values are selected based on the sign flag of the first arithmetic operation unit that inputs data from the other input and performs the subtraction. And do. Then, based on the code flag of the first arithmetic operation unit and the code flag of the second arithmetic operation unit, either one of the selected first or second threshold value and data is selected, and Either one of the 1st or 2nd threshold value calculation output value and the data is selected. Further, either one of these two selection results is selected and output as the threshold value calculation result. Thereby, even if there are two thresholds, the threshold calculation can be performed.

【0021】第2発明の信号処理装置においては、第2
の算術演算器の出力が、出力処理部に入力レジスタを介
して入力される。出力処理部は、第2の算術演算器の演
算出力が出力ビット幅で表せる値よりも大きい場合は、
予め設定した最大値を出力し、第2の算術演算器の演算
出力が出力ビット幅で表せる値よりも小さい場合は、予
め設定した最小値を出力する。演算結果選択器は、出力
処理部の出力と、閾値演算部の演算結果出力を入力し、
いずれか一方を選択して、演算結果として出力する。
In the signal processing device of the second invention, the second
The output of the arithmetic operation unit is input to the output processing unit via the input register. The output processing unit, when the operation output of the second arithmetic operation unit is larger than the value that can be represented by the output bit width,
The preset maximum value is output, and when the operation output of the second arithmetic operation unit is smaller than the value that can be represented by the output bit width, the preset minimum value is output. The calculation result selector inputs the output of the output processing unit and the calculation result output of the threshold value calculation unit,
Either one is selected and output as the calculation result.

【0022】[0022]

【実施例】以下、本発明の実施例を図面を用いて詳細に
説明する。図1は、本発明の信号処理装置の構成図であ
る。図の装置は、乗算器100、第1の算術演算器20
0、第2の算術演算器300、閾値演算部400、出力
処理部500、乗算器入力選択器1、入力レジスタ2〜
6、11〜13、選択制御部7、定数レジスタ8、一方
の選択器9、他方の選択器10、演算結果選択器14、
出力レジスタ15からなる。
Embodiments of the present invention will now be described in detail with reference to the drawings. FIG. 1 is a configuration diagram of a signal processing device of the present invention. The apparatus shown in the figure has a multiplier 100 and a first arithmetic unit 20.
0, second arithmetic operation unit 300, threshold value operation unit 400, output processing unit 500, multiplier input selector 1, input register 2 to
6, 11-13, selection control unit 7, constant register 8, one selector 9, the other selector 10, the operation result selector 14,
It comprises an output register 15.

【0023】これらは、以下に示すように接続されてい
る。図において、S0、S1はこの信号処理装置への入
力である。乗算器入力選択器1は、S0と値“1”を入
力とし、一方を選択し、その選択結果を入力レジスタ2
に出力する。入力レジスタ2,3は乗算器100の入力
レジスタであり、入力レジスタ3にはS1が接続されて
いる。また、入力レジスタ4,5は第1の算術演算器2
00の入力レジスタであり、入力レジスタ4にはS0
が、入力レジスタ5にはS1が接続されている。
These are connected as shown below. In the figure, S0 and S1 are inputs to this signal processing device. The multiplier input selector 1 receives S0 and the value “1” as input, selects one and outputs the selection result to the input register 2
Output to. The input registers 2 and 3 are input registers of the multiplier 100, and S1 is connected to the input register 3. Further, the input registers 4 and 5 are the first arithmetic operation unit 2
00 is an input register, and the input register 4 has S0
However, S1 is connected to the input register 5.

【0024】乗算器100は、入力レジスタ2,3の値
を入力するよう構成されている。即ち、乗算器入力選択
器1の出力とS1とを入力し、出力を一方の選択器9の
入力に接続している。第1の算術演算器200は、S0
とS1を、入力レジスタ4,5を介して入力とし、出力
を一方の選択器9に接続する。一方の選択器9は、乗算
器100の出力と、第1の算術演算器200の出力と、
定数レジスタ8の出力と、値“0”とを入力とし、その
うちの一つを選択し、出力を第2の算術演算器300の
一方の入力と、閾値演算部400に接続する。他方の選
択器10は、定数レジスタ8の出力と、閾値演算部40
0からの閾値演算出力値と、第2の算術演算器300か
らの出力と、値“0”とを入力とし、そのうち一つを選
択し、出力を第2の算術演算器300の他方の入力に接
続する。
The multiplier 100 is configured to input the values of the input registers 2 and 3. That is, the output of the multiplier input selector 1 and S1 are input, and the output is connected to the input of one selector 9. The first arithmetic unit 200 is S0.
And S1 are input via the input registers 4 and 5, and the output is connected to one selector 9. One selector 9 outputs the output of the multiplier 100, the output of the first arithmetic operation unit 200,
The output of the constant register 8 and the value “0” are input, one of them is selected, and the output is connected to one input of the second arithmetic operation unit 300 and the threshold value operation unit 400. The other selector 10 includes the output of the constant register 8 and the threshold value calculation unit 40.
The threshold calculation output value from 0, the output from the second arithmetic operation unit 300, and the value “0” are input, one of them is selected, and the output is the other input of the second arithmetic operation unit 300. Connect to.

【0025】選択制御部7は、第1の算術演算器200
の出力する符号フラグに基づき、一方の選択器9と他方
の選択器10の入力の選択を決定する。定数レジスタ8
は、処理に応じて任意の値を保持する。第2の算術演算
器300は、一方の選択器9の出力と、他方の選択器1
0の出力を入力とし、その出力を入力レジスタ13と、
他方の選択器10に接続する。入力レジスタ13は出力
処理部500に入力するデータを保持するためのレジス
タである。
The selection control unit 7 includes a first arithmetic operation unit 200.
On the basis of the sign flag output by, the selection of the input of one selector 9 and the other selector 10 is determined. Constant register 8
Holds an arbitrary value depending on the processing. The second arithmetic operation unit 300 includes the output of one selector 9 and the other selector 1
The output of 0 is input, and the output is input to the input register 13,
Connect to the other selector 10. The input register 13 is a register for holding data input to the output processing unit 500.

【0026】出力処理部500の出力は演算結果選択器
14の一方の入力に接続され、演算結果選択器14の他
方の入力は閾値演算部400の閾値演算結果出力が接続
されている。出力レジスタ15は、演算結果選択器14
の出力、即ち演算結果を保持する。閾値演算部400
は、S0を入力レジスタ6に保持し、これを入力する。
また、第1の算術演算器200および第2の算術演算器
300の符号フラグと、定数レジスタ8の値とを入力
し、閾値演算出力値を他方の選択器10に出力する。
The output of the output processing unit 500 is connected to one input of the calculation result selector 14, and the other input of the calculation result selector 14 is connected to the threshold calculation result output of the threshold calculation unit 400. The output register 15 is a calculation result selector 14.
Holds the output, that is, the calculation result. Threshold calculation unit 400
Holds S0 in the input register 6 and inputs it.
Further, the sign flags of the first arithmetic operation unit 200 and the second arithmetic operation unit 300 and the value of the constant register 8 are input, and the threshold value operation output value is output to the other selector 10.

【0027】次に、各部の機能について説明する。上記
の乗算器100、第1の算術演算器200、第2の算術
演算器300、出力処理部500、閾値処理部400の
各入力部に接続された入力レジスタ2〜6、11〜13
によって、乗算器100〜出力処理部はそれぞれパイプ
ライン動作が可能となっている。
Next, the function of each unit will be described. Input registers 2 to 6 and 11 to 13 connected to the input units of the multiplier 100, the first arithmetic operation unit 200, the second arithmetic operation unit 300, the output processing unit 500, and the threshold value processing unit 400.
Thus, each of the multiplier 100 to the output processing unit is capable of pipeline operation.

【0028】第1の算術演算器200は、加算、減算の
機能と、演算結果が負である時、符号を反転し正の値に
して出力する機能を持つ。更に、演算結果の符号フラグ
を閾値演算部400に送る機能を有している。第2の算
術演算器300は、加算、減算の機能と、この出力を他
方の選択器10を通して入力レジスタ12に保持する累
算の機能を有すると共に、演算結果の符号フラグを閾値
演算部400に送る機能を有している。閾値演算部40
0は、第1の算術演算器200および第2の算術演算器
300の出力する符号フラグに基づき、閾値(T1,T
2)、閾値演算出力値(TR1,TR2)および入力デ
ータPを選択して出力する機能を有している。
The first arithmetic operation unit 200 has a function of addition and subtraction, and a function of inverting the sign and outputting a positive value when the operation result is negative. Further, it has a function of sending the sign flag of the calculation result to the threshold value calculation unit 400. The second arithmetic operation unit 300 has a function of addition and subtraction and a function of accumulation of holding the output in the input register 12 through the other selector 10, and stores the sign flag of the operation result in the threshold value operation unit 400. It has the function of sending. Threshold calculator 40
0 is the threshold value (T1, T1) based on the sign flag output from the first arithmetic operation unit 200 and the second arithmetic operation unit 300.
2) has a function of selecting and outputting the threshold value calculation output values (TR1, TR2) and the input data P.

【0029】出力処理部500は、第2の算術演算器3
00の出力に対し、シフト処理を行うと同時に、その結
果が出力データビット幅で表される値より大きい時、こ
の出力データビット幅で表される最大値を出力し、前記
結果が出力データビット幅で表される値より小さい時、
この出力データビット幅で表される最小値を出力するこ
とにより、制限付き演算を行う機能を有している。
The output processing section 500 includes a second arithmetic operation unit 3
The output value of 00 is simultaneously shifted, and when the result is larger than the value represented by the output data bit width, the maximum value represented by the output data bit width is output, and the result is the output data bit width. When it is less than the value represented by the width,
By outputting the minimum value represented by this output data bit width, it has a function of performing a limited operation.

【0030】次に、上記信号処理装置による積和演算、
差の絶対値の累算、閾値演算、制限付き演算の概要を説
明する。積和演算は、S0とS1を乗算器100に入力
し乗算を行い、その結果を第2の算術演算器300の一
方の入力レジスタ11に保持する。これと同時に、次の
乗算も続けて行う。第2の算術演算器300の他方の入
力レジスタ12は、初期値として“0”を設定してお
く。そして、第2の算術演算器300の二つの入力レジ
スタ11,12の加算を行い、その結果を第2の算術演
算器300の“0”を保持していた入力レジスタ12に
入れ累算を行う。そして、次の乗算器100からの乗算
結果と累算結果が保持された入力レジスタ12との加算
を行い累算を続ける。これを繰り返すことにより、積和
演算を行うことができる。
Next, the sum of products operation by the above signal processing device,
An outline of accumulation of absolute values of differences, threshold calculation, and limited calculation will be described. In the product-sum operation, S0 and S1 are input to the multiplier 100 to perform multiplication, and the result is held in the one input register 11 of the second arithmetic operation unit 300. At the same time, the next multiplication is also continued. The other input register 12 of the second arithmetic operation unit 300 is set to "0" as an initial value. Then, the two input registers 11 and 12 of the second arithmetic operation unit 300 are added, and the result is put into the input register 12 of the second arithmetic operation unit 300 which holds “0” to perform accumulation. . Then, the next multiplication result from the multiplier 100 and the input register 12 holding the accumulation result are added to continue the accumulation. By repeating this, the product-sum calculation can be performed.

【0031】差の絶対値の累算は、S0とS1を第1の
算術演算器200に入力して、S0からS1を減算し、
その結果が負でない場合は演算結果をそのまま、また、
前記結果が負である場合は、符号を反転し正の値にして
差の絶対値演算を行い、第2の算術演算器300の一方
のレジスタ11に保持する。これと同時に、次の差の絶
対値演算も続けて行う。第2の算術演算器300の他方
の入力レジスタ12は、初期値として“0”を設定して
おく。そして、第2の算術演算器300の二つの入力レ
ジスタ11,12の加算を行い、その結果を第2の算術
演算器300の“0”を保持していた入力レジスタ12
に入れ、累算を行う。そして、次の第1の算術演算器2
00からの差の絶対値演算の結果と、累算結果が保持さ
れた入力レジスタ12との加算を行い累算を続ける。こ
れを繰り返すことにより、差の絶対値の累算を行うこと
ができる。
To accumulate the absolute value of the difference, input S0 and S1 to the first arithmetic operation unit 200, subtract S1 from S0,
If the result is not negative, leave the result as is,
When the result is negative, the sign is inverted to make it a positive value, the absolute value of the difference is calculated, and the result is held in one register 11 of the second arithmetic operation unit 300. At the same time, the absolute value of the next difference is continuously calculated. The other input register 12 of the second arithmetic operation unit 300 is set to "0" as an initial value. Then, the two input registers 11 and 12 of the second arithmetic operation unit 300 are added, and the result is added to the input register 12 that holds “0” of the second arithmetic operation unit 300.
Put in and accumulate. Then, the following first arithmetic unit 2
The absolute value calculation result of the difference from 00 is added to the input register 12 in which the accumulated result is held, and the accumulation is continued. By repeating this, the absolute value of the difference can be accumulated.

【0032】閾値演算は、閾値が一つの場合、閾値Tを
S0から、入力データPをS1から第1の算術演算器2
00に入力し、減算を行い、その結果の符号フラグによ
り、閾値演算部400の内部に設定されている閾値演算
出力値TR1、TR2を選択し、他方の選択器10に出
力する。そして、選択制御部7により、他方の選択器1
0で閾値演算部400からの出力を選択し、第2の算術
演算器300の一方の入力レジスタ11に入力する。ま
た、選択制御部7により一方の選択器9で値“0”を選
択し、第2の算術演算部300の他方の入力レジスタ1
2に入力する。第2の算術演算器300で、両方の入力
レジスタ11,12の加算を行う。これにより閾値演算
を行うことができる。
When the number of thresholds is one, the threshold T is calculated from the threshold T from S0 and the input data P from S1 to the first arithmetic operation unit 2
00, subtraction is performed, and the threshold value calculation output values TR1 and TR2 set inside the threshold value calculation unit 400 are selected by the sign flag of the result, and output to the other selector 10. Then, the selection controller 7 controls the other selector 1
The output from the threshold value calculation unit 400 is selected with 0, and is input to one input register 11 of the second arithmetic operation unit 300. Further, the selection controller 7 selects the value “0” with one selector 9, and the other input register 1 of the second arithmetic operation unit 300.
Enter 2. The second arithmetic operation unit 300 adds both input registers 11 and 12. This enables threshold calculation.

【0033】閾値が二つの場合、第1の閾値T1をS0
から入力すると共に、定数レジスタ8に第2の閾値T2
を保持してこれを入力し、かつ、第1の閾値T1をS0
から、また、入力データPをS1から入力してこれらの
減算を行う第1の算術演算器200の符号フラグに基づ
き、第1、2の閾値T1、T2の選択と、第1、2の閾
値演算出力値TR1、TR2の選択とを行う。そして、
第1の算術演算器200の符号フラグと、第2の算術演
算器300の符号フラグに基づき、前記選択した第1ま
たは第2の閾値T1、T2と、入力データPとのいずれ
か一方を選択すると共に、前記第1または第2の閾値演
算出力値TR1、TR2と、入力データPとのいずれか
一方を選択する。更に、これら二つの選択結果のいずれ
か一方を選択して閾値演算結果として出力する。これに
より閾値が二つの場合も、その閾値演算を行うことがで
きる。
When there are two thresholds, the first threshold T1 is set to S0.
From the second threshold value T2 to the constant register 8
Is input and this is input, and the first threshold value T1 is set to S0.
From the above, and based on the sign flag of the first arithmetic operation unit 200 that inputs the input data P from S1 and subtracts them, the selection of the first and second threshold values T1 and T2 and the first and second threshold values. The calculation output values TR1 and TR2 are selected. And
Based on the sign flag of the first arithmetic operation unit 200 and the sign flag of the second arithmetic operation unit 300, one of the selected first or second threshold values T1 and T2 and the input data P is selected. At the same time, either one of the first or second threshold value calculation output values TR1 and TR2 and the input data P is selected. Further, either one of these two selection results is selected and output as the threshold value calculation result. Thereby, even if there are two thresholds, the threshold calculation can be performed.

【0034】制限付き演算は、上記の出力処理部500
の説明で示した機能により行うことができる。
The limited calculation is performed by the output processing unit 500 described above.
It can be performed by the function shown in the description.

【0035】次に、本発明の一実施例を図を用いて詳細
に説明する。図6は、図1に示した信号処理装置におけ
る乗算器100の内部構成を示す図である。図におい
て、101aおよび101bは、2段パイプラインから
なる乗算部であり、これら乗算部101a,101b間
にパイプラインレジスタ102が設けられている。尚、
乗算部101a,101bの代わりに、予め乗算結果を
ROMに格納し、これを出力するよう構成してもよい。
Next, an embodiment of the present invention will be described in detail with reference to the drawings. FIG. 6 is a diagram showing an internal configuration of multiplier 100 in the signal processing apparatus shown in FIG. In the figure, 101a and 101b are multiplying units each having a two-stage pipeline, and a pipeline register 102 is provided between these multiplying units 101a and 101b. still,
Instead of the multiplication units 101a and 101b, the multiplication result may be stored in the ROM in advance and output.

【0036】図7は、第1および第2の算術演算器20
0,300の内部構成を示す図である。これら第1、2
の算術演算器200,300は、演算部201、パイプ
ラインレジスタ202、203、符号反転回路204、
セレクタ205、AND回路206から構成されてい
る。演算部201は入力レジスタ4,5に保持されてい
る値を入力し、加算、減算を行うもので、その演算結果
をパイプラインレジスタ202に出力する。また、演算
部201は、その演算結果の符号をパイプラインレジス
タ203に出力し、パイプラインレジスタ203はこれ
を保持する。また、パイプラインレジスタ203の符号
は、符号フラグとして閾値演算部400に出力されると
共に、AND回路206に入力されている。
FIG. 7 shows the first and second arithmetic operation units 20.
It is a figure which shows the internal structure of 0,300. These first and second
The arithmetic operation units 200 and 300 of the above include an arithmetic unit 201, pipeline registers 202 and 203, a sign inversion circuit 204,
It is composed of a selector 205 and an AND circuit 206. The arithmetic unit 201 inputs the values held in the input registers 4 and 5 and performs addition and subtraction, and outputs the arithmetic result to the pipeline register 202. Further, the arithmetic unit 201 outputs the code of the arithmetic result to the pipeline register 203, and the pipeline register 203 holds it. Further, the code of the pipeline register 203 is output as a code flag to the threshold value calculation unit 400 and is also input to the AND circuit 206.

【0037】符号反転回路204は、パイプラインレジ
スタ202に保持されている値の符号反転を行うもので
ある。セレクタ205はパイプラインレジスタ202の
値と、符号反転回路204の値を、AND回路206の
出力に基づいて選択するセレクタであり、その出力は、
第1の算術演算器200では一方の選択器9に、また、
第2の算術演算器300では、入力レジスタ13と他方
の選択器10に接続されている。AND回路206は、
パイプラインレジスタ203の符号と絶対値演算信号を
入力し、その出力をセレクタ205に送出するものであ
る。
The sign inversion circuit 204 inverts the sign of the value held in the pipeline register 202. The selector 205 is a selector that selects the value of the pipeline register 202 and the value of the sign inversion circuit 204 based on the output of the AND circuit 206, and its output is
In the first arithmetic operation unit 200, one selector 9 is provided,
In the second arithmetic operation unit 300, it is connected to the input register 13 and the other selector 10. The AND circuit 206 is
The code of the pipeline register 203 and the absolute value operation signal are input, and the output is sent to the selector 205.

【0038】図8は、閾値演算部400の内部構成を示
す図である。閾値演算部400は、パイプラインレジス
タ401,406〜414、レジスタ403,404、
セレクタ402,405,415〜418、Ex−OR
回路419からなる。パイプラインレジスタ401は、
入力レジスタ6に保持されている入力データを保持する
レジスタである。セレクタ402は、第1の算術演算器
200におけるパイプラインレジスタ203からの符号
フラグに基づき、パイプラインレジスタ401からのデ
ータと、定数レジスタ8からのデータを選択するセレク
タであり、その出力をパイプラインレジスタ409に送
出するよう構成されている。レジスタ403、404は
閾値演算出力値TR1、TR2をそれぞれ設定するため
のレジスタである。
FIG. 8 is a diagram showing the internal structure of the threshold value calculation unit 400. The threshold value calculation unit 400 includes pipeline registers 401, 406 to 414, registers 403, 404,
Selectors 402, 405, 415-418, Ex-OR
The circuit 419. The pipeline register 401 is
This is a register for holding the input data held in the input register 6. The selector 402 is a selector that selects the data from the pipeline register 401 and the data from the constant register 8 based on the sign flag from the pipeline register 203 in the first arithmetic operation unit 200, and outputs the output from the pipeline. It is configured to send to the register 409. Registers 403 and 404 are registers for setting threshold value calculation output values TR1 and TR2, respectively.

【0039】セレクタ405は、第1の算術演算器20
0におけるパイプラインレジスタ203からの符号フラ
グに基づき、レジスタ403からのデータとレジスタ4
04からのデータとを選択するセレクタで、その出力
は、他方の選択器10の入力およびパイプラインレジス
タ408に接続されている。パイプラインレジスタ40
6は、第1の算術演算器200におけるパイプラインレ
ジスタ203からの符号フラグを保持ためのレジスタ、
パイプラインレジスタ407は、一方の選択器9からの
データを保持するレジスタである。
The selector 405 is the first arithmetic operation unit 20.
Based on the sign flag from pipeline register 203 at 0, the data from register 403 and register 4
A selector for selecting the data from 04, the output of which is connected to the input of the other selector 10 and the pipeline register 408. Pipeline register 40
6 is a register for holding the sign flag from the pipeline register 203 in the first arithmetic operation unit 200,
The pipeline register 407 is a register that holds the data from one selector 9.

【0040】また、パイプラインレジスタ410は、第
2の算術演算器300の符号フラグを保持するレジス
タ、パイプラインレジスタ411は、パイプラインレジ
スタ406のデータを保持するレジスタ、パイプライン
レジスタ412は、パイプラインレジスタ407からの
データを保持するレジスタ、パイプラインレジスタ41
3は、パイプラインレジスタ408からのデータを保持
するレジスタ、パイプラインレジスタ414は、パイプ
ラインレジスタ409からのデータを保持するレジスタ
である。
Further, the pipeline register 410 is a register holding the sign flag of the second arithmetic operation unit 300, the pipeline register 411 is a register holding the data of the pipeline register 406, and the pipeline register 412 is a pipe. A pipeline register 41, which is a register for holding data from the line register 407
Reference numeral 3 is a register that holds the data from the pipeline register 408, and pipeline register 414 is a register that holds the data from the pipeline register 409.

【0041】セレクタ415は、パイプラインレジスタ
410とパイプラインレジスタ411のデータを入力と
するEx−OR回路419の出力信号と、Ex−OR回
路419の反転出力信号を選択するセレクタである。セ
レクタ416は、セレクタ415からの出力信号に基づ
き、パイプラインレジスタ412のデータと、パイプラ
インレジスタ413のデータとを選択するセレクタであ
る。また、セレクタ417は、セレクタ416と同様
に、セレクタ415からの出力信号に基づき、パイプラ
インレジスタ412のデータと、パイプラインレジスタ
414のデータとを選択するセレクタである。更に、セ
レクタ418は、セレクタ416の出力とセレクタ41
7の出力を選択し、その出力を閾値演算結果として演算
結果選択器14の入力に送出するセレクタである。
The selector 415 is a selector for selecting the output signal of the Ex-OR circuit 419 which receives the data of the pipeline register 410 and the pipeline register 411 and the inverted output signal of the Ex-OR circuit 419. The selector 416 is a selector that selects the data in the pipeline register 412 and the data in the pipeline register 413 based on the output signal from the selector 415. Further, similarly to the selector 416, the selector 417 is a selector that selects the data of the pipeline register 412 and the data of the pipeline register 414 based on the output signal from the selector 415. Further, the selector 418 is connected to the output of the selector 416 and the selector 41.
It is a selector that selects the output of 7 and sends the output to the input of the calculation result selector 14 as the threshold calculation result.

【0042】図9は、出力処理部500の内部構成を示
す図である。出力処理部500は、シフタ502、レジ
スタ503,506,507、オーバフロー/アンダフ
ロー判定回路505、セレクタ508,509から構成
されている。図において、501は入力レジスタ13か
らのデータを模式的に示したもので、このデータ501
がシフタ502に入力されるよう構成されている。シフ
タ502は、入力レジスタ13からのデータをシフトす
る回路であり、レジスタ503に設定された大きさのシ
フトを行い、データ504として出力するものである。
尚、レジスタ503は、シフト量を設定するためのレジ
スタである。また、504aはデータ504におけるオ
ーバフロー/アンダフローを判定する部分のデータを示
している。
FIG. 9 is a diagram showing the internal configuration of the output processing section 500. The output processing unit 500 includes a shifter 502, registers 503, 506 and 507, an overflow / underflow determination circuit 505, and selectors 508 and 509. In the figure, reference numeral 501 schematically represents the data from the input register 13, and this data 501
Are input to the shifter 502. The shifter 502 is a circuit that shifts the data from the input register 13, shifts the size set in the register 503, and outputs it as data 504.
The register 503 is a register for setting the shift amount. Reference numeral 504a indicates the data of the portion of the data 504 for determining overflow / underflow.

【0043】オーバフロー/アンダフロー判定回路50
5は、データ504aに対し、オーバフローとアンダフ
ローを判定する回路であり、その判定出力をセレクタ5
08とセレクタ509のセレクト信号として出力するよ
う構成されている。レジスタ506、507は、制限付
き演算での上限値と下限値を設定するレジスタであり、
セレクタ508は、これら上限値と下限値を、オーバフ
ロー/アンダフロー判定回路505のセレクト信号に基
づき選択する。また、セレクタ509は、オーバフロー
/アンダフロー判定回路505のセレクト信号に基づ
き、セレクタ508の出力と、シフタ502からのデー
タを選択するセレクタで、その出力を演算結果選択器1
4の入力に送出するよう構成されている。
Overflow / underflow determination circuit 50
Reference numeral 5 is a circuit for judging overflow and underflow with respect to the data 504a.
08 and the selector 509 as a select signal. Registers 506 and 507 are registers for setting an upper limit value and a lower limit value in the limited calculation,
The selector 508 selects these upper limit value and lower limit value based on the select signal of the overflow / underflow determination circuit 505. The selector 509 is a selector that selects the output of the selector 508 and the data from the shifter 502 based on the select signal of the overflow / underflow determination circuit 505.
4 inputs.

【0044】次に、各演算を詳細に説明する。 《積和演算》S0を乗算器入力選択器1により選択し、
乗算器100の入力レジスタ2で保持する。これと同時
にS1を乗算器100の入力レジスタ3に保持する。次
に、乗算器100により、入力レジスタ2と入力レジス
タ3の各データを乗算する。パイプライン動作であるの
で、乗算部101aでの演算結果がパイプラインレジス
タ102に保持されると同時に、次のデータを入力レジ
スタ2,3に保持する。
Next, each operation will be described in detail. << Sum of products operation >> S0 is selected by the multiplier input selector 1,
It is held in the input register 2 of the multiplier 100. At the same time, S1 is held in the input register 3 of the multiplier 100. Next, the multiplier 100 multiplies each data in the input register 2 and the input register 3. Since it is a pipeline operation, the operation result of the multiplication unit 101a is held in the pipeline register 102, and at the same time, the next data is held in the input registers 2 and 3.

【0045】次に、一方の選択器9により乗算器100
の出力を選択し、第2の算術演算器300の入力レジス
タ11に保持する。この時、第2の算術演算器300の
入力レジスタ12の初期値として値“0”が設定されて
いるものとする。次に、第2の算術演算器300により
入力レジスタ11,12のデータを加算し、その結果を
第2の算術演算器300の入力レジスタ12に保持す
る。これと同時に次の乗算結果を一方の選択器9を通し
て入力レジスタ11に保持する。これを繰り返すこと
で、入力レジスタ12に累算結果が保持され、積和演算
を実行することができる。
Next, the multiplier 100 is selected by one of the selectors 9.
Is selected and held in the input register 11 of the second arithmetic operation unit 300. At this time, it is assumed that the value “0” is set as the initial value of the input register 12 of the second arithmetic operation unit 300. Next, the second arithmetic operation unit 300 adds the data in the input registers 11 and 12, and the result is held in the input register 12 of the second arithmetic operation unit 300. At the same time, the next multiplication result is held in the input register 11 through one selector 9. By repeating this, the accumulated result is held in the input register 12, and the product-sum operation can be executed.

【0046】尚、累算の回数は、図示省略したカウンタ
に設定する。また、累算結果は、まるめの処理を必要と
する場合、まるめに必要な値を定数レジスタ8に予め設
定しておき、演算結果を入力レジスタ13に保持する。
尚、出力処理部500での処理については、後述する。
The number of times of accumulation is set in a counter (not shown). When the rounding process is required for the accumulation result, the value required for rounding is set in the constant register 8 in advance, and the calculation result is held in the input register 13.
The processing in the output processing unit 500 will be described later.

【0047】《差の絶対値の累積演算》S0を第1の算
術演算器200の入力レジスタ4に、S1を入力レジス
タ5に保持する。次に、第1の算術演算器200により
入力レジスタ4から入力レジスタ5のデータを減算す
る。パイプライン動作であるので、演算部201での演
算結果がパイプラインレジスタ202に保持されると同
時に、次のデータを入力レジスタ4,5に保持する。次
に、パイプラインレジスタ202のデータに対して絶対
値処理を行う。符号反転回路204は、パイプラインレ
ジスタ202のデータの符号を反転し、その結果をセレ
クタ205の入力に送る。
<< Cumulative calculation of absolute difference value >> S0 is held in the input register 4 of the first arithmetic operation unit 200, and S1 is held in the input register 5. Next, the data of the input register 5 is subtracted from the input register 4 by the first arithmetic operation unit 200. Since this is a pipeline operation, the operation result of the operation unit 201 is held in the pipeline register 202, and at the same time, the next data is held in the input registers 4 and 5. Next, absolute value processing is performed on the data in the pipeline register 202. The sign inversion circuit 204 inverts the sign of the data in the pipeline register 202 and sends the result to the input of the selector 205.

【0048】ここで、演算部201での演算結果が負の
場合、セレクタ205は、符号フラグを保持したパイプ
ラインレジスタ203の信号と絶対値演算であることに
より作られたセレクト信号で、符号反転回路204の出
力を選択し、その結果を一方の選択器9の入力に送る。
また、演算部201での演算結果が正の場合、セレクタ
205は、符号フラグを保持したパイプラインレジスタ
203の信号と絶対値演算であることにより作られたセ
レクト信号で、パイプラインレジスタ202の出力を選
択し、その結果を一方の選択器9の入力に送る。
Here, when the operation result in the operation unit 201 is negative, the selector 205 uses the signal of the pipeline register 203 holding the sign flag and the select signal created by the absolute value operation to invert the sign. It selects the output of circuit 204 and sends the result to the input of one selector 9.
When the operation result of the operation unit 201 is positive, the selector 205 outputs the signal of the pipeline register 203 holding the sign flag and the output of the pipeline register 202 with the select signal created by the absolute value operation. , And sends the result to the input of one selector 9.

【0049】次に、一方の選択器9により第1の算術演
算器200の出力を選択し、第2の算術演算器300の
入力レジスタ11に保持する。この時、第3の算術演算
器300の入力レジスタ12の初期値として値“0”が
設定されているものとする。次に、第2の算術演算器3
00により入力レジスタ11,12のデータを加算し、
その結果を第2の算術演算器300の入力レジスタ12
に保持する。これと同時に次の絶対値演算の結果を、一
方の選択器9を通して入力レジスタ11に保持する。
Next, the output of the first arithmetic operation unit 200 is selected by the one selector 9 and held in the input register 11 of the second arithmetic operation unit 300. At this time, the value “0” is set as the initial value of the input register 12 of the third arithmetic operation unit 300. Next, the second arithmetic operation unit 3
The data of the input registers 11 and 12 are added by 00,
The result is input to the input register 12 of the second arithmetic operation unit 300.
Hold on. At the same time, the result of the next absolute value calculation is held in the input register 11 through one selector 9.

【0050】また、累算回数は、図示省略したカウンタ
に設定する。そして、累算結果は、まるめの処理を必要
とする場合、まるめに必要な値を定数レジスタ8に予め
設定しておき、入力レジスタ11のデータと、定数レジ
スタ8のデータを第2の算術演算器300で加算し、出
力処理部500の入力レジスタ13に保持する。尚、出
力処理部500での処理については、後述する。このよ
うにして差の絶対値の累算を行うことができる。
The number of times of accumulation is set in a counter (not shown). When the rounding process is required for the accumulation result, a value necessary for rounding is set in the constant register 8 in advance, and the data of the input register 11 and the data of the constant register 8 are subjected to the second arithmetic operation. The value is added by the device 300 and held in the input register 13 of the output processing unit 500. The processing in the output processing unit 500 will be described later. In this way, the absolute value of the difference can be accumulated.

【0051】《閾値演算》この実施例では、閾値が一つ
の場合と、二つの場合について説明する。図10は、閾
値が一つの場合で、入力Pに対する閾値Tの閾値演算機
能を示す図である。 (1)P<T の時、TR2 T≦Pの時、TR1 (2)P<T の時、 P T≦Pの時、TR1 (3)P<T の時、TR2 T≦Pの時、 P ここで、閾値演算出力値TR1はレジスタ403に、閾
値演算出力値TR2はレジスタ404に保持する。
<< Threshold Calculation >> In this embodiment, a case where there is one threshold and a case where there are two thresholds will be described. FIG. 10 is a diagram showing a threshold value calculation function of the threshold value T with respect to the input P in the case where there is one threshold value. (1) When P <T, when TR2 T ≦ P, TR1 (2) When P <T, when P T ≦ P, TR1 (3) When P <T, when TR2 T ≦ P, P Here, the threshold value calculation output value TR1 is held in the register 403, and the threshold value calculation output value TR2 is held in the register 404.

【0052】先ず、(1)の場合の演算についてその動
作を説明する。閾値TをS0から入力し、第1の算術演
算器200の入力レジスタ4に、入力データPをS1か
ら入力し、第1の算術演算器200の入力レジスタ5に
保持する。次に、第1の算術演算器200により入力レ
ジスタ4の値(=T)から、入力レジスタ5の値(=
P)を減算する。パイプライン動作であるので、乗算部
201での演算による符号フラグをパイプラインレジス
タ203に保持すると同時に、次のデータを入力レジス
タ4,5に保持する。
First, the operation of the calculation in the case of (1) will be described. The threshold value T is input from S0, the input data P is input to the input register 4 of the first arithmetic operation unit 200 from S1, and the input data P is held in the input register 5 of the first arithmetic operation unit 200. Next, the value of the input register 4 (= T) is converted to the value of the input register 5 (=
P) is subtracted. Since this is a pipeline operation, the code flag calculated by the multiplication unit 201 is held in the pipeline register 203, and at the same time, the next data is held in the input registers 4 and 5.

【0053】そして、パイプラインレジスタ203の値
が正である場合(P<T)、セレクタ405によりレジ
スタ404(=TR2)を選択し、その出力を他方の選
択器10の入力に送る。また、パイプラインレジスタ2
03の値が正でない場合(T≦P)、セレクタ405に
よりレジスタ403(=TR1)を選択し、その出力を
他方の選択器10の入力に送る。
When the value of the pipeline register 203 is positive (P <T), the selector 405 selects the register 404 (= TR2) and sends the output to the input of the other selector 10. In addition, pipeline register 2
When the value of 03 is not positive (T ≦ P), the selector 405 selects the register 403 (= TR1) and sends its output to the input of the other selector 10.

【0054】また、(1)の閾値演算の場合は、選択制
御部7により、一方の選択器9は、値“0”を選択し、
他方の選択器10は、閾値演算部400からのデータを
選択するように設定する。そして、一方の選択器9の出
力を第2の算術演算器300の入力レジスタ11に、他
方の選択器10の出力を第2の算術演算器300の入力
レジスタ12に保持する。
Further, in the case of the threshold value calculation of (1), one selector 9 selects the value "0" by the selection controller 7.
The other selector 10 is set to select the data from the threshold value calculation unit 400. Then, the output of one selector 9 is held in the input register 11 of the second arithmetic operation unit 300, and the output of the other selector 10 is held in the input register 12 of the second arithmetic operation unit 300.

【0055】次に、第2の算術演算器300により、入
力レジスタ11,12のデータを加算し、その結果を出
力処理部500の入力レジスタ13に保持する。尚、出
力処理部500での処理については、後で述べる。この
ようにして(1)の閾値演算を行うことができる。
Next, the second arithmetic operation unit 300 adds the data in the input registers 11 and 12 and holds the result in the input register 13 of the output processing section 500. The processing in the output processing unit 500 will be described later. In this way, the threshold value calculation of (1) can be performed.

【0056】次に、(2)の場合の演算についてその動
作を説明する。閾値TをS0から入力し、第1の算術演
算器200の入力レジスタ4に、入力データPをS1か
ら入力し、第1の算術演算器200の入力レジスタ5
と、乗算器100の入力レジスタ3に、そして、乗算器
入力選択器1で値“1”を選択し、入力レジスタ2に保
持する。
Next, the operation of the calculation in the case of (2) will be described. The threshold value T is input from S0, the input data P is input to the input register 4 of the first arithmetic operation unit 200 from S1, and the input register 5 of the first arithmetic operation unit 200 is input.
Then, the value “1” is selected by the input register 3 of the multiplier 100 and by the multiplier input selector 1 and held in the input register 2.

【0057】次に、第1の算術演算器200により、入
力レジスタ4の値(=T)から、入力レジスタ5の値
(=P)を減算すると同時に、乗算器100により、入
力レジスタ2の値(=1)と入力レジスタ3の値(=
P)の乗算を行う。パイプライン動作であるので、演算
部201での演算による符号フラグをパイプラインレジ
スタ203に保持すると同時に、乗算部101aでの演
算による結果を、パイプラインレジスタ102に保持す
ると同時に、次のデータを入力レジスタ4,5,および
入力レジスタ2,3に保持する。
Next, the value of the input register 5 (= P) is subtracted from the value of the input register 4 (= T) by the first arithmetic unit 200, and at the same time, the value of the input register 2 is calculated by the multiplier 100. (= 1) and the value of input register 3 (=
P) is multiplied. Since this is a pipeline operation, the code flag calculated by the calculation unit 201 is held in the pipeline register 203, and the result calculated by the multiplication unit 101a is held in the pipeline register 102, and the next data is input. It is held in registers 4, 5 and input registers 2, 3.

【0058】そして、パイプラインレジスタ203の値
が正である場合(P<T)、選択制御部7により、一方
の選択器9は、乗算器100からのデータ(=P)を選
択し、他方の選択器10は、値“0”を選択する。ま
た、パイプラインレジスタ203の値が正でない場合
(T≦P)、セレクタ405により、レジスタ403
(TR1)を選択し、その出力を他方の選択器10の入
力に送ると同時に、選択制御部7により、一方の選択器
9は、値“0”を選択し、他方の選択器10は、閾値演
算部400からのデータを選択する。
When the value of the pipeline register 203 is positive (P <T), the selection control unit 7 causes one selector 9 to select the data (= P) from the multiplier 100, and the other one. Selector 10 selects the value "0". When the value of the pipeline register 203 is not positive (T ≦ P), the selector 405 causes the register 403.
(TR1) is selected and its output is sent to the input of the other selector 10, and at the same time, the selection controller 7 causes one selector 9 to select the value "0" and the other selector 10 to The data from the threshold calculator 400 is selected.

【0059】そして、一方の選択器9の出力を、第2の
算術演算器300の入力レジスタ11に、他方の選択器
10の出力を、第2の算術演算器300の入力レジスタ
12に保持する。
The output of one selector 9 is held in the input register 11 of the second arithmetic operation unit 300, and the output of the other selector 10 is held in the input register 12 of the second arithmetic operation unit 300. .

【0060】次に、第2の算術演算器300により、入
力レジスタ11,12のデータを加算し、その結果を出
力処理部500の入力レジスタ13に保持する。尚、出
力処理部での処理については、後で述べる。このように
して(2)の閾値演算を行うことができる。
Next, the second arithmetic operation unit 300 adds the data in the input registers 11 and 12 and holds the result in the input register 13 of the output processing section 500. The processing in the output processing unit will be described later. In this way, the threshold value calculation of (2) can be performed.

【0061】次に、(3)の場合の演算についてその動
作を説明する。閾値TをS0から入力し、第1の算術演
算器200の入力レジスタ4に、入力データPをS1か
ら入力し、第1の算術演算器200の入力レジスタ5
と、乗算器100の入力レジスタ3に、そして乗算器入
力選択器1で値“1”を選択し、入力レジスタ2に保持
する。
Next, the operation of the calculation in the case of (3) will be described. The threshold value T is input from S0, the input data P is input to the input register 4 of the first arithmetic operation unit 200 from S1, and the input register 5 of the first arithmetic operation unit 200 is input.
Then, the value “1” is selected by the input register 3 of the multiplier 100 and by the multiplier input selector 1 and held in the input register 2.

【0062】次に、第1の算術演算器200により、入
力レジスタ4の値から入力レジスタ5の値を減算すると
同時に、乗算器100により、入力レジスタ2の値と入
力レジスタ3の値の乗算を行う。パイプライン動作であ
るので、演算部201での演算による符号フラグをパイ
プラインレジスタ203に保持すると同時に、乗算部1
01aでの演算による結果をパイプラインレジスタ10
2に保持すると同時に、次のデータを入力レジスタ4,
5および入力レジスタ2,3に保持する。
Next, the first arithmetic operation unit 200 subtracts the value of the input register 5 from the value of the input register 4, and at the same time, the multiplier 100 multiplies the value of the input register 2 by the value of the input register 3. To do. Since this is a pipeline operation, the sign flag calculated by the operation unit 201 is held in the pipeline register 203, and at the same time, the multiplication unit 1
The result of the operation at 01a is the pipeline register 10
2 at the same time, the next data is input register 4,
5 and the input registers 2 and 3.

【0063】そして、パイプラインレジスタ203の値
が正である場合(P<T)、セレクタ405により、レ
ジスタ404(TR2)を選択し、その出力を他方の選
択器10の入力に送ると同時に、選択制御部7により、
一方の選択器9は、値“0”を選択し、他方の選択器1
0は、閾値演算部400からのデータを選択する。
When the value of the pipeline register 203 is positive (P <T), the selector 405 selects the register 404 (TR2) and sends its output to the input of the other selector 10 at the same time. By the selection control unit 7,
One selector 9 selects the value "0" and the other selector 1
0 selects the data from the threshold value calculation unit 400.

【0064】また、パイプラインレジスタ203の値が
正でない場合(T≦P)、選択制御部7により、一方の
選択器9は、乗算器100からのデータ(=P)を選択
し、他方の選択器10は、値“0”を選択する。そし
て、一方の選択器9の出力を第2の算術演算器300の
入力レジスタ11に、他方の選択器10の出力を第2の
算術演算器300の入力レジスタ12に保持する。
When the value of the pipeline register 203 is not positive (T ≦ P), the selection control unit 7 causes one selector 9 to select the data (= P) from the multiplier 100 and the other selector 9 to select the other data. The selector 10 selects the value “0”. Then, the output of one selector 9 is held in the input register 11 of the second arithmetic operation unit 300, and the output of the other selector 10 is held in the input register 12 of the second arithmetic operation unit 300.

【0065】次に、第2の算術演算器300により、入
力レジスタ11,12のデータを加算し、その結果を出
力処理部500の入力レジスタ13に保持する。尚、出
力処理部での処理については、後で述べる。このように
して(3)の閾値演算を行うことができる。
Next, the second arithmetic operation unit 300 adds the data in the input registers 11 and 12 and holds the result in the input register 13 of the output processing section 500. The processing in the output processing unit will be described later. In this way, the threshold value calculation of (3) can be performed.

【0066】次に、閾値が二つの場合を説明する。図1
1は、閾値が二つの場合で、入力Pに対する閾値T1,
T2(T2≦T1)の閾値演算機能を示す図である。 (1) T1≦Pの時、TR1 T2≦P<T1 の時、 P P<T2 の時、TR2 (2) T1≦Pの時、 P T2≦P<T1 の時、TR2 P<T2 の時、 P (3) T1≦Pの時、T1 T2≦P<T1 の時、 P P<T2 の時、T2 (4) T1≦Pの時、 P T2≦P<T1 の時、T2 P<T2 の時、 P
Next, the case where there are two thresholds will be described. Figure 1
1 is the case where there are two threshold values, and the threshold value T1,
It is a figure which shows the threshold value calculation function of T2 (T2 <= T1). (1) When T1 ≦ P, TR1 When T2 ≦ P <T1, When P P <T2, TR2 (2) When T1 ≦ P, When P T2 ≦ P <T1, When TR2 P <T2 , P (3) When T1 ≦ P, T1 When T2 ≦ P <T1, When P P <T2, T2 (4) When T1 ≦ P, P T2 ≦ P <T1, T2 P <T2 When, P

【0067】ここで、TR1は、レジスタ403に、T
R2は、レジスタ404に、閾値T2は、定数レジスタ
8に保持し、閾値T1は、S0から入力し、選択制御部
7により、一方の選択器9は、乗算器100からのデー
タを選択し、他方の選択器10は、定数レジスタ8から
のデータを選択し、演算結果選択器14は、セレクタ4
18を選択する。
Here, TR1 stores T in the register 403.
R2 is held in the register 404, threshold T2 is held in the constant register 8, threshold T1 is input from S0, and one selector 9 selects the data from the multiplier 100 by the selection controller 7. The other selector 10 selects the data from the constant register 8, and the operation result selector 14 selects the selector 4
Select 18.

【0068】先ず、上記(1)の場合の演算についてそ
の動作を説明する。閾値T1をS0から入力し、第1の
算術演算器200の入力レジスタ4に、入力データPを
S1から入力し、第1の算術演算器200の入力レジス
タ5と、乗算器100の入力レジスタ3に、そして乗算
器入力選択器1で値“1”を選択し、入力レジスタ2に
保持する。
First, the operation of the calculation in the above case (1) will be described. The threshold T1 is input from S0, the input data P is input from S1 to the input register 4 of the first arithmetic operation unit 200, the input register 5 of the first arithmetic operation unit 200 and the input register 3 of the multiplier 100 are input. , And the value “1” is selected by the multiplier input selector 1 and held in the input register 2.

【0069】次に、第1の算術演算器200により、入
力レジスタ4の値から入力レジスタ5の値を減算すると
同時に、乗算器100により、入力レジスタ2の値と入
力レジスタ3の値の乗算を行う。パイプライン動作であ
るので、演算部201での演算による符号フラグをパイ
プラインレジスタ203に保持すると同時に、乗算部1
01aでの演算による結果をパイプラインレジスタ10
2に保持すると同時に、次のデータを入力レジスタ4,
5および入力レジスタ2,3に保持する。
Next, the first arithmetic unit 200 subtracts the value of the input register 5 from the value of the input register 4, and at the same time, the multiplier 100 multiplies the value of the input register 2 by the value of the input register 3. To do. Since this is a pipeline operation, the sign flag calculated by the operation unit 201 is held in the pipeline register 203, and at the same time, the multiplication unit 1
The result of the operation at 01a is the pipeline register 10
2 at the same time, the next data is input register 4,
5 and the input registers 2 and 3.

【0070】そして、パイプラインレジスタ203の値
が正である場合(P<T1)、セレクタ405により、
レジスタ404(TR2)を選択し、その出力をパイプ
ラインレジスタ408に送る。また、パイプラインレジ
スタ203の値が正でない場合(T1≦P)、セレクタ
405により、レジスタ403(TR1)を選択し、そ
の出力をパイプラインレジスタ408に送る。
When the value of the pipeline register 203 is positive (P <T1), the selector 405 causes the
Select register 404 (TR2) and send its output to pipeline register 408. When the value of the pipeline register 203 is not positive (T1 ≦ P), the selector 405 selects the register 403 (TR1) and sends its output to the pipeline register 408.

【0071】そして、一方の選択器9の出力(=P)
を、第2の算術演算器300の入力レジスタ11と、閾
値演算部400のパイプラインレジスタ407に、他方
の選択器10の出力(T2)を、第2の算術演算器30
0の入力レジスタ12に、パイプラインレジスタ203
からの値を、パイプラインレジスタ406に、セレクタ
405からの値を、パイプラインレジスタ408に保持
する。
The output of one selector 9 (= P)
To the input register 11 of the second arithmetic operation unit 300 and the pipeline register 407 of the threshold value operation unit 400, and the output (T2) of the other selector 10 to the second arithmetic operation unit 30.
0 to the input register 12 and the pipeline register 203
To the pipeline register 406, and the value from the selector 405 to the pipeline register 408.

【0072】次に、第2の算術演算器300により、入
力レジスタ12の値から入力レジスタ11の値を減算
し、その演算による符号フラグをパイプラインレジスタ
410に保持すると同時に、パイプラインレジスタ40
6のデータをパイプラインレジスタ411に保持すると
同時に、パイプラインレジスタ407のデータをパイプ
ラインレジスタ412に保持すると同時に、パイプライ
ンレジスタ408のデータをパイプラインレジスタ41
3に保持する。
Next, the value of the input register 11 is subtracted from the value of the input register 12 by the second arithmetic operation unit 300, and the code flag resulting from the operation is held in the pipeline register 410 and, at the same time, the pipeline register 40.
6 is held in the pipeline register 411, the data in the pipeline register 407 is held in the pipeline register 412, and the data in the pipeline register 408 is held in the pipeline register 41 at the same time.
Hold at 3.

【0073】また、(1)の閾値演算の場合には、セレ
クタ415は、パイプラインレジスタ410と411の
Ex−ORを選択し、セレクタ418は、セレクタ41
6の出力を選択する。
Further, in the case of the threshold value calculation of (1), the selector 415 selects the Ex-OR of the pipeline registers 410 and 411, and the selector 418 selects the selector 41.
6 output is selected.

【0074】そして、パイプラインレジスタ410の値
が正で、かつパイプラインレジスタ411の値が正の場
合(P<T2)、セレクタ415からの信号により、セ
レクタ416でパイプラインレジスタ413(TR2)
を選択し、その出力をセレクタ418に送る。
When the value of the pipeline register 410 is positive and the value of the pipeline register 411 is positive (P <T2), a signal from the selector 415 causes the selector 416 to pipeline register 413 (TR2).
Is selected and its output is sent to the selector 418.

【0075】また、パイプラインレジスタ410の値が
正でなく、かつパイプラインレジスタ411の値が正の
場合(T2≦P<T1)、セレクタ415からの信号に
より、セレクタ416でパイプラインレジスタ412
(P)を選択し、その出力をセレクタ418に送る。
When the value of the pipeline register 410 is not positive and the value of the pipeline register 411 is positive (T2≤P <T1), the signal from the selector 415 causes the selector 416 to output the pipeline register 412.
(P) is selected and its output is sent to the selector 418.

【0076】更に、パイプラインレジスタ411の値が
正でない場合(T1≦P)、セレクタ415からの信号
により、セレクタ416でパイプラインレジスタ413
(TR1)を選択し、その出力をセレクタ418に送
る。そして、セレクタ418でセレクタ416の出力を
選択し、その出力を演算結果選択器14に送る、そし
て、演算結果選択器14で、セレクタ418の出力を選
択し、その出力をパイプラインレジスタ15に保持す
る。このようにして(1)の閾値演算を行うことができ
る。
Further, when the value of the pipeline register 411 is not positive (T1 ≦ P), the signal from the selector 415 causes the selector 416 to cause the pipeline register 413 to execute.
(TR1) is selected and its output is sent to the selector 418. Then, the selector 418 selects the output of the selector 416, sends the output to the operation result selector 14, and the operation result selector 14 selects the output of the selector 418 and holds the output in the pipeline register 15. To do. In this way, the threshold value calculation of (1) can be performed.

【0077】次に(2)の場合の演算についてその動作
を説明する。閾値T1をS0から入力し、第1の算術演
算器200の入力レジスタ4に、入力データPをS1か
ら入力し、第1の算術演算器200の入力レジスタ5
と、乗算器100の入力レジスタ3に、そして乗算器入
力選択器1で値“1”を選択し、入力レジスタ2に保持
する。
Next, the operation of the calculation in the case of (2) will be described. The threshold value T1 is input from S0, the input data P is input from S1 to the input register 4 of the first arithmetic operation unit 200, and the input register 5 of the first arithmetic operation unit 200 is input.
Then, the value “1” is selected by the input register 3 of the multiplier 100 and by the multiplier input selector 1 and held in the input register 2.

【0078】次に、第1の算術演算器200により、入
力レジスタ4の値から入力レジスタ5の値を減算すると
同時に、乗算器100により、入力レジスタ2の値と入
力レジスタ3の値の乗算を行う。パイプライン動作であ
るので、演算部201での演算による符号フラグをパイ
プラインレジスタ203に保持すると同時に、乗算部1
01aでの演算による結果をパイプラインレジスタ10
2に保持すると同時に、次のデータを入力レジスタ4,
5および入力レジスタ2,3に保持する。
Next, the first arithmetic unit 200 subtracts the value of the input register 5 from the value of the input register 4, and at the same time, the multiplier 100 multiplies the value of the input register 2 by the value of the input register 3. To do. Since this is a pipeline operation, the sign flag calculated by the operation unit 201 is held in the pipeline register 203, and at the same time, the multiplication unit 1
The result of the operation at 01a is the pipeline register 10
2 at the same time, the next data is input register 4,
5 and the input registers 2 and 3.

【0079】そして、パイプラインレジスタ203の値
が正である場合(P<T1)、セレクタ405により、
レジスタ404(TR2)を選択し、その出力をパイプ
ラインレジスタ408に送る。
When the value of the pipeline register 203 is positive (P <T1), the selector 405 causes
Select register 404 (TR2) and send its output to pipeline register 408.

【0080】また、パイプラインレジスタ203の値が
正でない場合(T1≦P)、セレクタ405により、レ
ジスタ403(TR1)を選択し、その出力をパイプラ
インレジスタ408に送る。
When the value of the pipeline register 203 is not positive (T1 ≦ P), the selector 405 selects the register 403 (TR1) and sends the output to the pipeline register 408.

【0081】更に、一方の選択器9の出力(P)を、第
2の算術演算器300の入力レジスタ11と、閾値演算
部400のパイプラインレジスタ407に、他方の選択
器10の出力(T2)を、第2の算術演算器300の入
力レジスタ12に、パイプラインレジスタ203からの
値を、パイプラインレジスタ406に、セレクタ405
からの値を、パイプラインレジスタ408に保持する。
Further, the output (P) of one selector 9 is input to the input register 11 of the second arithmetic operation unit 300 and the pipeline register 407 of the threshold value calculation unit 400, and the output (T2) of the other selector 10 is set. ) To the input register 12 of the second arithmetic operation unit 300, the value from the pipeline register 203 to the pipeline register 406, and the selector 405.
The values from 1 to are held in the pipeline register 408.

【0082】次に、第2の算術演算器300により、入
力レジスタ12の値から入力レジスタ11の値を減算
し、その演算による符号フラグをパイプラインレジスタ
410に保持すると同時に、パイプラインレジスタ40
6のデータをパイプラインレジスタ411に保持すると
同時に、パイプラインレジスタ407のデータをパイプ
ラインレジスタ412に保持すると同時に、パイプライ
ンレジスタ408のデータをパイプラインレジスタ41
3に保持する。
Next, the value of the input register 11 is subtracted from the value of the input register 12 by the second arithmetic operation unit 300, and the code flag by the operation is held in the pipeline register 410, and at the same time, the pipeline register 40.
6 is held in the pipeline register 411, the data in the pipeline register 407 is held in the pipeline register 412, and the data in the pipeline register 408 is held in the pipeline register 41 at the same time.
Hold at 3.

【0083】また、(2)の閾値演算の場合には、セレ
クタ415は、パイプラインレジスタ410とパイプラ
インレジスタ411のEx−ORの反転を選択し、セレ
クタ418は、セレクタ416の出力を選択する。
Further, in the case of the threshold value calculation of (2), the selector 415 selects the inversion of Ex-OR of the pipeline register 410 and the pipeline register 411, and the selector 418 selects the output of the selector 416. .

【0084】そして、パイプラインレジスタ410の値
が正で、かつパイプラインレジスタ411の値が正の場
合(P<T2)、セレクタ415からの信号により、セ
レクタ416でパイプラインレジスタ412(P)を選
択し、その出力をセレクタ418に送る。
When the value of the pipeline register 410 is positive and the value of the pipeline register 411 is positive (P <T2), the signal from the selector 415 causes the selector 416 to open the pipeline register 412 (P). Select and send the output to the selector 418.

【0085】また、パイプラインレジスタ410の値が
正でなく、かつパイプラインレジスタ411の値が正の
場合(T2≦P<T1)、セレクタ415からの信号に
より、セレクタ416でパイプラインレジスタ413
(TR2)を選択し、その出力をセレクタ418に送
る。
If the value of the pipeline register 410 is not positive and the value of the pipeline register 411 is positive (T2≤P <T1), the signal from the selector 415 causes the selector 416 to cause the pipeline register 413 to perform the processing.
(TR2) is selected and its output is sent to the selector 418.

【0086】更に、パイプラインレジスタ411の値が
正でない場合(T1≦P)、セレクタ415からの信号
により、セレクタ416でパイプラインレジスタ412
(P)を選択し、その出力をセレクタ418に送る。
Further, when the value of the pipeline register 411 is not positive (T1 ≦ P), the signal from the selector 415 causes the selector 416 to output the pipeline register 412.
(P) is selected and its output is sent to the selector 418.

【0087】そして、セレクタ418でセレクタ416
の出力を選択し、その出力を演算結果選択器14に送
る。更に、演算結果選択器14で、セレクタ418の出
力を選択し、その出力をパイプラインレジスタ15に保
持する。このようにして(2)の閾値演算を行うことが
できる。
Then, the selector 418 selects the selector 416.
Output is sent to the operation result selector 14. Further, the calculation result selector 14 selects the output of the selector 418 and holds the output in the pipeline register 15. In this way, the threshold value calculation of (2) can be performed.

【0088】次に、(3)の場合の演算についてその動
作を説明する。閾値T1をS0から入力し、第1の算術
演算器200の入力レジスタ4と、閾値演算部の入力レ
ジスタ6に、入力データPをS1から入力し、第1の算
術演算器200の入力レジスタ5と、乗算器100の入
力レジスタ3に、そして乗算器入力選択器1で値“1”
を選択し、入力レジスタ2に保持する。
Next, the operation of the calculation in the case of (3) will be described. The threshold value T1 is input from S0, the input data P is input from S1 to the input register 4 of the first arithmetic operation unit 200 and the input register 6 of the threshold value operation unit, and the input register 5 of the first arithmetic operation unit 200 is input. To the input register 3 of the multiplier 100 and to the value “1” in the multiplier input selector 1.
Is selected and held in the input register 2.

【0089】次に、第1の算術演算器200により、入
力レジスタ4の値から入力レジスタ5の値を減算すると
同時に、乗算器100により、入力レジスタ2の値と入
力レジスタ3の値の乗算を行う。パイプライン動作であ
るので、演算部201での演算による符号フラグをパイ
プラインレジスタ203に保持すると同時に、乗算部1
01aでの演算による結果をパイプラインレジスタ10
2に保持すると同時に、入力レジスタ6のデータをパイ
プラインレジスタ401に保持すると同時に、次のデー
タを入力レジスタ4,5,2,3および入力レジスタ6
に保持する。
Next, the first arithmetic operation unit 200 subtracts the value of the input register 5 from the value of the input register 4, and at the same time, the multiplier 100 multiplies the value of the input register 2 by the value of the input register 3. To do. Since this is a pipeline operation, the sign flag calculated by the operation unit 201 is held in the pipeline register 203, and at the same time, the multiplication unit 1
The result of the operation at 01a is the pipeline register 10
2 at the same time, the data in the input register 6 is held in the pipeline register 401, and at the same time, the next data is held in the input registers 4, 5, 2, 3 and the input register 6.
Hold on.

【0090】そして、パイプラインレジスタ203の値
が正である場合(P<T1)、セレクタ402により、
定数レジスタ8(T2)を選択し、その出力をパイプラ
インレジスタ409に送る。
When the value of the pipeline register 203 is positive (P <T1), the selector 402
The constant register 8 (T2) is selected and its output is sent to the pipeline register 409.

【0091】また、パイプラインレジスタ203の値が
正でない場合(T1≦P)、セレクタ402により、パ
イプラインレジスタ401(T1)を選択し、その出力
をパイプラインレジスタ409に送る。
When the value of the pipeline register 203 is not positive (T1 ≦ P), the selector 402 selects the pipeline register 401 (T1) and sends its output to the pipeline register 409.

【0092】そして、一方の選択器9の出力(P)を、
第2の算術演算器300の入力レジスタ11と、閾値演
算部400のパイプラインレジスタ407に、他方の選
択器10の出力(T2)を、第2の算術演算器300の
入力レジスタ12に、パイプラインレジスタ203から
の値を、パイプラインレジスタ406に、セレクタ40
2からの値を、パイプラインレジスタ409に保持す
る。
Then, the output (P) of one selector 9 is
Pipe the output (T2) of the other selector 10 to the input register 11 of the second arithmetic operation unit 300 and the pipeline register 407 of the threshold value operation unit 400 to the input register 12 of the second arithmetic operation unit 300. The value from the line register 203 is sent to the pipeline register 406 and the selector 40
The value from 2 is held in the pipeline register 409.

【0093】次に、第2の算術演算器300により、入
力レジスタ12の値から入力レジスタ11の値を減算
し、その演算による符号フラグをパイプラインレジスタ
410に保持すると同時に、パイプラインレジスタ40
6のデータをパイプラインレジスタ411に保持すると
同時に、パイプラインレジスタ407のデータをパイプ
ラインレジスタ412に保持すると同時に、パイプライ
ンレジスタ409のデータをパイプラインレジスタ41
4に保持する。
Next, the value of the input register 11 is subtracted from the value of the input register 12 by the second arithmetic operation unit 300, and the code flag resulting from the operation is held in the pipeline register 410, and at the same time, the pipeline register 40.
6 is held in the pipeline register 411, the data in the pipeline register 407 is held in the pipeline register 412, and the data in the pipeline register 409 is held in the pipeline register 41 at the same time.
Hold at 4.

【0094】また、(3)の閾値演算の場合には、セレ
クタ415は、パイプラインレジスタ410と411の
Ex−ORを選択し、セレクタ418は、セレクタ41
7の出力を選択する。
Further, in the case of the threshold value calculation of (3), the selector 415 selects the Ex-OR of the pipeline registers 410 and 411, and the selector 418 selects the selector 41.
7 output is selected.

【0095】そして、パイプラインレジスタ410の値
が正で、かつパイプラインレジスタ411の値が正の場
合(P<T2)、セレクタ415からの信号により、セ
レクタ417でパイプラインレジスタ414(T2)を
選択し、その出力をセレクタ418に送る。
When the value of the pipeline register 410 is positive and the value of the pipeline register 411 is positive (P <T2), the signal from the selector 415 causes the selector 417 to switch the pipeline register 414 (T2). Select and send the output to the selector 418.

【0096】また、パイプラインレジスタ410の値が
正でなく、かつパイプラインレジスタ411の値が正の
場合(T2≦P<T1)、セレクタ415からの信号に
より、セレクタ417でパイプラインレジスタ412
(P)を選択し、その出力をセレクタ418に送る。
If the value of the pipeline register 410 is not positive and the value of the pipeline register 411 is positive (T2 ≦ P <T1), the signal from the selector 415 causes the selector 417 to output the pipeline register 412.
(P) is selected and its output is sent to the selector 418.

【0097】更に、パイプラインレジスタ411の値が
正でない場合(T1≦P)、セレクタ415からの信号
により、セレクタ417でパイプラインレジスタ414
(T1)を選択し、その出力をセレクタ418に送る。
Further, when the value of the pipeline register 411 is not positive (T1 ≦ P), the signal from the selector 415 causes the selector 417 to cause the pipeline register 414 to operate.
(T1) is selected and its output is sent to the selector 418.

【0098】そして、セレクタ418でセレクタ416
の出力を選択し、その出力を演算結果選択器14に送
る。更に、演算結果選択器14で、セレクタ418の出
力を選択し、その出力をパイプラインレジスタ15に保
持する。このようにして(3)の閾値演算を行うことが
できる。
Then, the selector 418 selects the selector 416.
Output is sent to the operation result selector 14. Further, the calculation result selector 14 selects the output of the selector 418 and holds the output in the pipeline register 15. In this way, the threshold value calculation of (3) can be performed.

【0099】次に(4)の場合の演算についてその動作
を説明する。閾値T1をS0から入力し、第1の算術演
算器200の入力レジスタ4と、閾値演算部の入力レジ
スタ6に、入力データPをS1から入力し、第1の算術
演算器200の入力レジスタ5と、乗算器100の入力
レジスタ3に、そして乗算器入力選択器1で値“1”を
選択し、入力レジスタ2に保持する。
Next, the operation of the calculation in the case of (4) will be described. The threshold value T1 is input from S0, the input data P is input from S1 to the input register 4 of the first arithmetic operation unit 200 and the input register 6 of the threshold value operation unit, and the input register 5 of the first arithmetic operation unit 200 is input. Then, the value “1” is selected by the input register 3 of the multiplier 100 and by the multiplier input selector 1 and held in the input register 2.

【0100】次に、第1の算術演算器200により、入
力レジスタ4の値から入力レジスタ5の値を減算すると
同時に、乗算器100により、入力レジスタ2の値と入
力レジスタ3の値の乗算を行う。パイプライン動作であ
るので、演算部201での演算による符号フラグをパイ
プラインレジスタ203に保持すると同時に、乗算部1
01aでの演算による結果をパイプラインレジスタ10
2に保持すると同時に、入力レジスタ6のデータをパイ
プラインレジスタ401に保持すると同時に、次のデー
タを入力レジスタ4,5,2,3および入力レジスタ6
に保持する。
Next, the first arithmetic unit 200 subtracts the value of the input register 5 from the value of the input register 4, and at the same time, the multiplier 100 multiplies the value of the input register 2 by the value of the input register 3. To do. Since this is a pipeline operation, the sign flag calculated by the operation unit 201 is held in the pipeline register 203, and at the same time, the multiplication unit 1
The result of the operation at 01a is the pipeline register 10
2 at the same time, the data in the input register 6 is held in the pipeline register 401, and at the same time, the next data is held in the input registers 4, 5, 2, 3 and the input register 6.
Hold on.

【0101】そして、パイプラインレジスタ203の値
が正である場合(P<T1)、セレクタ402により、
定数レジスタ8の値(T2)を選択し、その出力パイプ
ラインレジスタ409に送る。
When the value of the pipeline register 203 is positive (P <T1), the selector 402
The value (T2) of the constant register 8 is selected and sent to its output pipeline register 409.

【0102】また、パイプラインレジスタ203の値が
正でない場合(T1≦P)、セレクタ402により、パ
イプラインレジスタ401(T1)を選択し、その出力
をパイプラインレジスタ409に送る。
When the value of the pipeline register 203 is not positive (T1≤P), the selector 402 selects the pipeline register 401 (T1) and sends its output to the pipeline register 409.

【0103】そして、一方の選択器9の出力(P)を、
第2の算術演算器300の入力レジスタ11と、閾値演
算器400のパイプラインレジスタ407に、他方の選
択器10の出力(T2)を、第2の算術演算器300の
入力レジスタ12に、パイプラインレジスタ203から
の値を、パイプラインレジスタ406に、セレクタ40
2からの値を、パイプラインレジスタ409に保持す
る。
Then, the output (P) of one selector 9 is
Pipe the output (T2) of the other selector 10 to the input register 11 of the second arithmetic operation unit 300 and the pipeline register 407 of the threshold value arithmetic unit 400 to the input register 12 of the second arithmetic operation unit 300. The value from the line register 203 is sent to the pipeline register 406 and the selector 40
The value from 2 is held in the pipeline register 409.

【0104】次に、第2の算術演算器300により、入
力レジスタ12の値から入力レジスタ11の値を減算
し、その演算による符号フラグをパイプラインレジスタ
410に保持すると同時に、パイプラインレジスタ40
6のデータをパイプラインレジスタ411に保持すると
同時に、パイプラインレジスタ407のデータをパイプ
ラインレジスタ412に保持すると同時に、パイプライ
ンレジスタ409のデータをパイプラインレジスタ41
4に保持する。
Next, the value of the input register 11 is subtracted from the value of the input register 12 by the second arithmetic operation unit 300, and the code flag resulting from the operation is held in the pipeline register 410, and at the same time, the pipeline register 40.
6 is held in the pipeline register 411, the data in the pipeline register 407 is held in the pipeline register 412, and the data in the pipeline register 409 is held in the pipeline register 41 at the same time.
Hold at 4.

【0105】また、(4)の閾値演算の場合には、セレ
クタ415は、パイプラインレジスタ410と411の
Ex−ORの反転を選択し、セレクタ418は、セレク
タ417の出力を選択する。
In the case of the threshold value calculation of (4), the selector 415 selects the inversion of Ex-OR of the pipeline registers 410 and 411, and the selector 418 selects the output of the selector 417.

【0106】そして、パイプラインレジスタ410の値
が正で、かつ413の値が正の場合(P<T2)、セレ
クタ415からの信号により、セレクタ417でパイプ
ラインレジスタ412(P)を選択し、その出力をセレ
クタ418に送る。
When the value of the pipeline register 410 is positive and the value of 413 is positive (P <T2), the selector 417 selects the pipeline register 412 (P) by the signal from the selector 415, The output is sent to the selector 418.

【0107】また、パイプラインレジスタ410の値が
正でなく、かつ411の値が正の場合(T2≦P<T
1)、セレクタ415からの信号により、セレクタ41
7でパイプラインレジスタ414(T2)を選択し、そ
の出力をセレクタ418に送る。
When the value of the pipeline register 410 is not positive and the value of 411 is positive (T2≤P <T
1), the signal from the selector 415 causes the selector 41
At 7, the pipeline register 414 (T2) is selected and its output is sent to the selector 418.

【0108】更に、パイプラインレジスタ411の値が
正でない場合(T1≦P)、セレクタ415からの信号
により、セレクタ417でパイプラインレジスタ412
(P)を選択し、その出力をセレクタ418に送る。
Further, when the value of the pipeline register 411 is not positive (T1≤P), the signal from the selector 415 causes the selector 417 to output the pipeline register 412.
(P) is selected and its output is sent to the selector 418.

【0109】そして、セレクタ418でセレクタ416
の出力を選択し、その出力を演算結果選択器14に送
る。
Then, the selector 418 selects the selector 416.
Output is sent to the operation result selector 14.

【0110】また、演算結果選択器14で、セレクタ4
18の出力を選択し、その出力をパイプラインレジスタ
15に保持する。このようにして(4)の閾値演算を行
うことができる。
In the calculation result selector 14, the selector 4
18 outputs are selected and the outputs are held in the pipeline register 15. In this way, the threshold value calculation of (4) can be performed.

【0111】《制限付き演算》積和演算では、入力デー
タビット幅より大きい値を扱うことになる。例えば、従
来の技術で示したように、8ビットの画素データの積和
演算で、32ビット幅の累算器を使い、その結果を16
ビットで出力する場合、オーバフローやアンダフローの
発生が予想される。これに対し画像処理では、オーバフ
ローやアンダフローを最大値や最小値で出力することが
あり、そのため、演算結果を目的とする画素値の範囲に
収めるために上限や下限を設定した制限付き演算が必要
となる。
<< Limited operation >> In the product-sum operation, a value larger than the input data bit width is handled. For example, as shown in the prior art, a 32-bit wide accumulator is used in the product-sum operation of 8-bit pixel data, and the result is 16
When outputting in bits, overflow or underflow is expected to occur. On the other hand, in image processing, overflow or underflow may be output with the maximum value or the minimum value. Therefore, in order to keep the calculation result within the target pixel value range, there is a limited calculation that sets the upper and lower limits. Will be needed.

【0112】第2の算術演算器300は、32ビットの
結果を出力し、そのビット幅のデータが入力レジスタ1
3に保持されているとする。そして、図9に示す出力処
理部500は、16ビット幅の結果を出力し、シフトは
右シフトで、シフト量は、15ビット以下で、シフタ5
02からの出力のLSBの16ビットがセレクタ402
の入力となり、上限は506に、下限は507に設定さ
れているものとする。
The second arithmetic unit 300 outputs a 32-bit result, and the bit width data is input to the input register 1
Suppose that it is held at 3. Then, the output processing unit 500 shown in FIG. 9 outputs the result of 16-bit width, the shift is right shift, the shift amount is 15 bits or less, and the shifter 5
16 bits of LSB of the output from 02 are selectors 402
Is input, and the upper limit is set to 506 and the lower limit is set to 507.

【0113】入力レジスタ13からのデータは、シフタ
502によりレジスタ503に設定されたシフト量のシ
フトを行う。シフタ502は、レジスタ503に設定さ
れた大きさの右シフトを行う。シフタ502の出力は、
データ504で示すように、LSBの16ビットは、セ
レクタ509の入力となる。
The data from the input register 13 is shifted by the shift amount set in the register 503 by the shifter 502. The shifter 502 shifts right by the size set in the register 503. The output of the shifter 502 is
As indicated by the data 504, 16 bits of the LSB are input to the selector 509.

【0114】また、データ504aは、データ504a
=32(レジスタ503に設定された値)−16+1で
求められる。シフタ502の出力から、データ504a
のビット幅の部分を、オーバフロー/アンダフロー判定
回路505に取り、オーバフロー/アンダフローの判定
を行う。その結果により、上限値/下限値を設定したレ
ジスタ506,507をセレクタ508により選択し、
その出力をセレクタ509の入力として送る。
Further, the data 504a is the data 504a.
= 32 (value set in the register 503) -16 + 1. From the output of the shifter 502, the data 504a
The bit width portion of is taken into the overflow / underflow determination circuit 505, and overflow / underflow determination is performed. Based on the result, the selector 508 selects the registers 506 and 507 in which the upper limit value / lower limit value is set,
The output is sent as the input of the selector 509.

【0115】そして、シフタ502からの出力が、16
ビットの最大値を超える値である時、オーバフロー/ア
ンダフロー判定回路505により、セレクタ509でセ
レクタ508の出力を選択し、その出力をセレクタ50
9の入力に送る。更に、オーバフロー/アンダフロー判
定回路505により、セレクタ509でセレクタ508
を選択し、その出力を演算結果選択器14の入力に送
る。
The output from the shifter 502 is 16
When the value exceeds the maximum value of the bits, the overflow / underflow determination circuit 505 selects the output of the selector 508 by the selector 509, and the output is selected by the selector 50.
Send to 9 inputs. Further, the overflow / underflow determination circuit 505 causes the selector 509 to select the selector 508.
Is selected and its output is sent to the input of the operation result selector 14.

【0116】また、シフタ502からの出力が、16ビ
ットの最小値より小さい値である時、オーバフロー/ア
ンダフロー判定回路505により、セレクタ508でレ
ジスタ507を選択し、その出力をセレクタ509の入
力に送る。そして、オーバフロー/アンダフロー判定回
路505により、セレクタ509でセレクタ508の出
力を選択し、その出力を演算結果選択器14の入力に送
る。
When the output from the shifter 502 has a value smaller than the minimum value of 16 bits, the overflow / underflow determination circuit 505 selects the register 507 by the selector 508 and outputs the output to the input of the selector 509. send. Then, the overflow / underflow determination circuit 505 selects the output of the selector 508 by the selector 509 and sends the output to the input of the operation result selector 14.

【0117】一方、シフタ502からの出力が、16ビ
ットで表せる値である時、オーバフロー/アンダフロー
判定回路505により、セレクタ509でシフタ502
からの出力のLSBの16ビットを選択し、その出力を
演算結果選択器14の入力に送る。このようにして、制
限付き演算を行うことができる。
On the other hand, when the output from the shifter 502 has a value that can be represented by 16 bits, the overflow / underflow determination circuit 505 causes the selector 509 to shift the shifter 502.
16 bits of the LSB of the output from are selected and the output is sent to the input of the operation result selector 14. In this way, limited operations can be performed.

【0118】また、シフト量が16ビットの場合は、デ
ータ504のLSBの16ビットをセレクタ509で選
択し、シフト量が16ビットを超える場合は、算術右シ
フトにより符号拡張を行うことで同様の演算ができる。
When the shift amount is 16 bits, 16 bits of the LSB of the data 504 are selected by the selector 509, and when the shift amount exceeds 16 bits, the sign extension is performed by the arithmetic right shift to obtain the same result. You can calculate.

【0119】尚、上記実施例では、信号処置装置として
画像処置装置の場合を説明したが、これに限定されるも
のではなく、積和演算、差の絶対値の累積、閾値演算、
制限付き演算を行う装置であれば、種々の信号処理に適
用可能である。
In the above embodiment, the case of the image processing apparatus as the signal processing apparatus has been described, but the present invention is not limited to this, and the product sum calculation, the accumulation of the absolute value of the difference, the threshold calculation,
Any device that performs limited arithmetic can be applied to various signal processes.

【0120】[0120]

【発明の効果】以上説明した第1発明の信号処理装置に
よれば、乗算器と、第1の算術演算器と、第2の算術演
算器と、閾値演算部と、定数レジスタと、一方の選択器
と、他方の選択器とを備え、これらの信号接続を制御す
ることによって、積和演算、差の絶対値の累積および閾
値演算を行うようにしたので、各演算毎に演算ユニット
を必要とせず、上記各演算を行う装置を構成する場合
に、本発明の信号処理装置のみで構成することができ、
構成の簡素化が図れ、コスト低減に寄与することができ
る。また、本発明の信号処理装置を複数用いることによ
って、各演算が同一の演算ユニットで行えるため、低コ
スト化を図りながら、処理を高速に行うことができる。
According to the signal processing device of the first invention described above, a multiplier, a first arithmetic operation unit, a second arithmetic operation unit, a threshold value operation unit, a constant register, and one of Since a selector and the other selector are provided and these signal connections are controlled to perform the product sum operation, the accumulation of the absolute value of the difference, and the threshold value operation, an operation unit is required for each operation. Instead, when configuring a device that performs each of the above calculations, it can be configured only with the signal processing device of the present invention,
The configuration can be simplified and the cost can be reduced. Further, by using a plurality of signal processing devices of the present invention, each calculation can be performed by the same calculation unit, so that the processing can be performed at high speed while reducing the cost.

【0121】第2発明の信号処理装置によれば、第1発
明の信号処理装置に加えて、制限付き演算を行う出力処
理部を設けたので、例えば画像処理における制限付き演
算等を含む演算を一つの演算ユニットで構成でき、更
に、信号処理の効率化および低コスト化を図ることがで
きる。
According to the signal processing apparatus of the second invention, in addition to the signal processing apparatus of the first invention, the output processing unit for performing the restricted arithmetic operation is provided. Therefore, for example, the arithmetic operation including the restricted arithmetic operation in the image processing can be performed. It can be configured by one arithmetic unit, and the efficiency and cost of signal processing can be further improved.

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

【図1】本発明の信号処理装置の構成図である。FIG. 1 is a configuration diagram of a signal processing device of the present invention.

【図2】色変換に関する演算式の説明図である。FIG. 2 is an explanatory diagram of an arithmetic expression regarding color conversion.

【図3】離散コサイン変換に関する演算式の説明図であ
る。
FIG. 3 is an explanatory diagram of an arithmetic expression regarding discrete cosine transform.

【図4】2次元コンボリューション処理に関する演算式
の説明図である。
FIG. 4 is an explanatory diagram of an arithmetic expression regarding two-dimensional convolution processing.

【図5】動き補償フレーム間予測符号化に関する演算式
の説明図である。
[Fig. 5] Fig. 5 is an explanatory diagram of an arithmetic expression regarding motion-compensated interframe predictive coding.

【図6】本発明の信号処理装置における乗算器の内部構
成を示すブロック図である。
FIG. 6 is a block diagram showing an internal configuration of a multiplier in the signal processing device of the present invention.

【図7】本発明の信号処理装置における第1,2の算術
演算器の内部構成を示すブロック図である。
FIG. 7 is a block diagram showing an internal configuration of first and second arithmetic operation units in the signal processing device of the present invention.

【図8】本発明の信号処理装置における閾値演算部の内
部構成を示すブロック図である。
FIG. 8 is a block diagram showing an internal configuration of a threshold value calculation unit in the signal processing device of the present invention.

【図9】本発明の信号処理装置における出力処理部の内
部構成を示すブロック図である。
FIG. 9 is a block diagram showing an internal configuration of an output processing unit in the signal processing device of the present invention.

【図10】本発明の信号処理装置における閾値が一つの
場合の説明図である。
FIG. 10 is an explanatory diagram when the signal processing device of the present invention has one threshold value.

【図11】本発明の信号処理装置における閾値が二つの
場合の説明図である。
FIG. 11 is an explanatory diagram when the signal processing device of the present invention has two threshold values.

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

100 乗算器 200 第1の算術演算器 300 第2の算術演算器 400 閾値演算部 500 出力処理部 8 定数レジスタ 9 一方の選択器 10 他方の選択器 100 Multiplier 200 First Arithmetic Operation Unit 300 Second Arithmetic Operation Unit 400 Threshold Value Operation Unit 500 Output Processing Unit 8 Constant Register 9 One Selector 10 Another Selector

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.6 識別記号 庁内整理番号 FI 技術表示箇所 G06T 5/00 5/20 H04N 7/30 9/74 Z G06F 15/66 M 15/68 310 A 400 J H04N 7/133 Z ─────────────────────────────────────────────────── ─── Continuation of front page (51) Int.Cl. 6 Identification code Internal reference number FI Technical display location G06T 5/00 5/20 H04N 7/30 9/74 Z G06F 15/66 M 15/68 310 A 400 J H04N 7/133 Z

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 乗算器と、第1の算術演算器と、第2の
算術演算器と、閾値演算部と、定数レジスタと、一方の
選択器と、他方の選択器とを備え、 前記乗算器は、任意の2データを入力して、乗算を行
い、 前記第1の算術演算器は、前記任意の2データを入力
し、加算または減算を行うと共に、演算結果が負である
時、符号を反転して正の値にして出力し、かつ演算結果
の符号フラグを出力し、 前記一方の選択器は、前記乗算器の出力と、前記第1の
算術演算器の出力と、前記定数レジスタの出力と、初期
値とを選択し、 前記他方の選択器は、前記閾値演算部から出力される閾
値演算出力値と、前記第2の算術演算器の出力と、前記
定数レジスタの出力と、前記初期値とを選択し、 前記定数レジスタは、任意の値を保持し、 前記第2の算術演算器は、前記一方の選択器の出力と、
他方の選択器の出力とを入力し、加算または減算を行う
と共に、演算結果が負である時、符号を反転して正の値
にして出力し、かつ演算結果の符号フラグを出力し、 前記閾値演算部は、第1、第2の閾値演算出力値を有
し、 閾値が一つの場合、 前記2データの入力を当該閾値と任意のデータとし、か
つ、第1の算術演算器の符号フラグで前記第1、第2の
閾値演算出力値のいずれか一方を選択して閾値演算出力
値として、これを前記他方の選択器に出力し、 閾値が第1、第2の閾値である場合、 前記2データの入力を、前記第1の閾値と任意のデータ
とすると共に、前記定数レジスタの値を前記第2の閾値
とし、かつ、前記第1の算術演算器の符号フラグに基づ
き前記第1、2の閾値の選択と、前記第1、2の閾値演
算出力の選択とを行い、かつ、前記第1の算術演算器の
符号フラグと前記第2の算術演算器の符号フラグに基づ
き、前記選択した第1または第2の閾値と前記任意のデ
ータとのいずれか一方の選択を行うと共に、前記第1ま
たは第2の閾値演算出力値と前記任意のデータのいずれ
か一方の選択を行い、かつ、これら選択結果のいずれか
一方を選択して閾値演算結果を出力することを特徴とす
る信号処理装置。
1. A multiplication unit, a first arithmetic operation unit, a second arithmetic operation unit, a threshold value operation unit, a constant register, one selector, and the other selector, The unit inputs arbitrary 2 data and performs multiplication, and the first arithmetic operation unit inputs the arbitrary 2 data and performs addition or subtraction, and when the operation result is negative, the sign And outputs a sign flag of the calculation result, and the one selector selects the output of the multiplier, the output of the first arithmetic calculator, and the constant register. And an initial value, and the other selector selects a threshold value calculation output value output from the threshold value calculation unit, an output of the second arithmetic operation unit, and an output of the constant register, The initial value is selected, the constant register holds an arbitrary value, the second arithmetic The arithmetic unit is the output of the one selector,
The output of the other selector is input, addition or subtraction is performed, and when the operation result is negative, the sign is inverted and output as a positive value, and the sign flag of the operation result is output, The threshold value calculation unit has first and second threshold value calculation output values. When the number of threshold values is one, the input of the two data is the threshold value and arbitrary data, and the code flag of the first arithmetic operation unit. If either one of the first and second threshold value calculation output values is selected as the threshold value calculation output value and is output to the other selector, and if the threshold values are the first and second threshold values, The input of the 2 data is the first threshold value and arbitrary data, the value of the constant register is the second threshold value, and the first flag is based on the sign flag of the first arithmetic operation unit. Selection of the second threshold value and selection of the first and second threshold value calculation outputs. And, based on the code flag of the first arithmetic operation unit and the code flag of the second arithmetic operation unit, either one of the selected first or second threshold value and the arbitrary data is selected. In addition to performing the selection, either one of the first or second threshold value calculation output value and the arbitrary data is selected, and one of these selection results is selected and the threshold value calculation result is output. Signal processing device.
【請求項2】 出力処理部と、演算結果選択器とを備
え、 前記出力処理部は、 予め、出力ビット幅を設定すると共に、このビット幅で
表せる最大値と最小値とを有し、 第2の算術演算器の出力を入力して、当該第2の算術演
算器の出力が、前記出力ビット幅より大きい場合は前記
最大値を、前記第2の算術演算器の出力が、前記出力ビ
ット幅より小さい場合は前記最小値を出力し、 前記演算結果選択器は、 前記出力処理部の出力と、閾値演算部の出力とを選択し
て演算結果として出力することを特徴とする請求項1記
載の信号処理装置。
2. An output processing unit and an operation result selector are provided, wherein the output processing unit sets an output bit width in advance and has a maximum value and a minimum value that can be represented by the bit width. When the output of the second arithmetic operation unit is input and the output of the second arithmetic operation unit is larger than the output bit width, the maximum value is set, and the output of the second arithmetic operation unit is set to the output bit. When the width is smaller than the width, the minimum value is output, and the operation result selector selects the output of the output processing unit and the output of the threshold value operation unit and outputs the result as an operation result. The signal processing device described.
JP34286593A 1993-12-15 1993-12-15 Signal processor Pending JPH07168808A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP34286593A JPH07168808A (en) 1993-12-15 1993-12-15 Signal processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP34286593A JPH07168808A (en) 1993-12-15 1993-12-15 Signal processor

Publications (1)

Publication Number Publication Date
JPH07168808A true JPH07168808A (en) 1995-07-04

Family

ID=18357100

Family Applications (1)

Application Number Title Priority Date Filing Date
JP34286593A Pending JPH07168808A (en) 1993-12-15 1993-12-15 Signal processor

Country Status (1)

Country Link
JP (1) JPH07168808A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009099119A (en) * 2007-05-30 2009-05-07 Avago Technologies Ecbu Ip (Singapore) Pte Ltd Buffer management for adaptive buffer value using accumulation and averaging
US7554556B2 (en) 2004-05-17 2009-06-30 Murata Kikai Kabushiki Kaisha Color image processing device and color image processing method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7554556B2 (en) 2004-05-17 2009-06-30 Murata Kikai Kabushiki Kaisha Color image processing device and color image processing method
JP2009099119A (en) * 2007-05-30 2009-05-07 Avago Technologies Ecbu Ip (Singapore) Pte Ltd Buffer management for adaptive buffer value using accumulation and averaging

Similar Documents

Publication Publication Date Title
JP4231620B2 (en) Image processing method and apparatus
US7162090B2 (en) Image processing apparatus, image processing program and image processing method
JPH05502534A (en) Digital image denoising system and method
JPH0613914A (en) Method and apparatus for discrete cosine conversion which does not require multiplication
JP3356516B2 (en) Video encoding device
EP0523924B1 (en) Image signal processing apparatus
CN102271251B (en) Lossless image compression method
JPH05260313A (en) Data processing method of discrete cosine transform (dct), dct method, and dct data processing circuit
US5748793A (en) Quick image processor of reduced circuit scale with high image quality and high efficiency
JP2001028691A (en) Image processing unit
JPH07168808A (en) Signal processor
JP3288811B2 (en) Post-processing filter control method and post-processing filter control circuit in video codec
JP3695451B2 (en) Image size changing method and apparatus
KR20030025058A (en) A circuit and method for full search block matching
KR100231901B1 (en) Method and apparatus for calculating the average of two integer numbers rounded towards zero in a single instruction cycle
JP2001204044A (en) Image processing method and image processing unit
JP2885039B2 (en) Motion vector detection circuit
JPH08204957A (en) Image processing method
JP3652380B2 (en) Discrete cosine transform device and inverse discrete cosine transform device
JP3669052B2 (en) Discrete cosine transform device
JP3911784B2 (en) Image compression apparatus and image compression method
JP2002197075A (en) Data processor, its control method, data processing method and computer readable memory
JPH08305684A (en) Butterfly operation device and inverse discrete cosine transformer
JP3895031B2 (en) Matrix vector multiplier
JP2698824B2 (en) Discrete cosine converter