JP2005128618A - Divider, exposure control device, and division method - Google Patents

Divider, exposure control device, and division method Download PDF

Info

Publication number
JP2005128618A
JP2005128618A JP2003360578A JP2003360578A JP2005128618A JP 2005128618 A JP2005128618 A JP 2005128618A JP 2003360578 A JP2003360578 A JP 2003360578A JP 2003360578 A JP2003360578 A JP 2003360578A JP 2005128618 A JP2005128618 A JP 2005128618A
Authority
JP
Japan
Prior art keywords
divisor
divider
dividend
division
integer
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
JP2003360578A
Other languages
Japanese (ja)
Inventor
Haruhisa Kurane
治久 倉根
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2003360578A priority Critical patent/JP2005128618A/en
Publication of JP2005128618A publication Critical patent/JP2005128618A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To realize a small and high speed divider without causing a system complication and a circuit scale increase. <P>SOLUTION: The divider 1 processes an operation of dividing a dividend X by a divisor K as an addition of given elements that are the dividend X multiplied by powers of two (2<SP>N</SP>) according to an approximation depending on the divisor K (refer to formula (8)). The approximation corresponds with given limited values that are each a possible input as the divisor K, and has the sufficient accuracy of the integral part of each element added. The division can be performed simply by bit shifts and additions to realize a small and high speed divider. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、除算演算を行うための除算回路、露出制御装置および除算方法に関する。   The present invention relates to a division circuit, an exposure control device, and a division method for performing a division operation.

従来、情報処理装置において除算演算を行うために、除算器が用いられている。
このような除算器では、除数をB、被除数をAとし、除算結果YとしてA/Bを算出する場合、被除数Aから除数Bを引き、その余りCをレジスタに格納し、再度余りCから除数Bを引くという動作を繰り返すことが通常行われている。
Conventionally, a divider is used to perform a division operation in an information processing apparatus.
In such a divider, when the divisor is B, the dividend is A, and A / B is calculated as the division result Y, the divisor B is subtracted from the dividend A, the remainder C is stored in a register, and the remainder C is divisored again. Usually, the operation of pulling B is repeated.

図8は、従来の除算器の概略構成を示すブロック図である。
図8において、被除数Aはシフタ201に入力され、除数Bは減算器203および除算制御器205に入力される。そして、予め設定された演算精度のビット数Dに応じて、被除数Aがシフタ201にてビットシフトされる。
また、マルチプレクサ202にて、シフタ201によりシフトされた被除数Aが選択され、この選択された被除数Aが減算器203に入力される。
FIG. 8 is a block diagram showing a schematic configuration of a conventional divider.
In FIG. 8, the dividend A is input to the shifter 201, and the divisor B is input to the subtracter 203 and the division controller 205. Then, the dividend A is bit-shifted by the shifter 201 in accordance with the number of bits D having a preset calculation accuracy.
The multiplexer 202 selects the dividend A shifted by the shifter 201 and inputs the selected dividend A to the subtracter 203.

そして、減算器203にて、被除数Aから除数Bが減算され、余りCがレジスタ204および除算制御器205に出力される。
そして、除算制御器205は、最初の除算サイクルが終了すると、余りCを格納させるための制御信号CSをレジスタ204に出力し、レジスタ204は制御信号CSを除算制御器205から受け取ると、余りCを格納する。
The subtractor 203 subtracts the divisor B from the dividend A, and outputs the remainder C to the register 204 and the division controller 205.
When the first division cycle ends, the division controller 205 outputs a control signal CS for storing the remainder C to the register 204. When the register 204 receives the control signal CS from the division controller 205, the remainder C Is stored.

そして、除算制御器205は、次サイクル以降、マルチプレクサ202からの減算器203への出力を、シフタ201側からレジスタ204に切り替えることにより、マルチプレクサ202を介してレジスタ204に格納されている余りCを減算器203に入力させる。
そして、余りCが減算器203に入力されると、減算器203にて、余りCから除数Bが減算され、その時の余りCがレジスタ204および除算制御器205に出力される。
以上の動作を繰り返し、余りCが除数Bよりも小さくなると、除算制御器205は計算を終了し、演算精度に応じて除算結果Yを算出し、外部に出力する。
なお、このような除算方法は、周知のものであり、例えば、特開2002−175178号公報等に記載されている。
特開2002−175178号公報
Then, after the next cycle, the division controller 205 switches the output from the multiplexer 202 to the subtracter 203 from the shifter 201 side to the register 204, so that the remainder C stored in the register 204 via the multiplexer 202 is obtained. Input to the subtractor 203.
When the remainder C is input to the subtractor 203, the subtractor 203 subtracts the divisor B from the remainder C, and the remainder C at that time is output to the register 204 and the division controller 205.
When the above operation is repeated and the remainder C becomes smaller than the divisor B, the division controller 205 ends the calculation, calculates the division result Y according to the calculation accuracy, and outputs it to the outside.
Such a division method is well known, and is described in, for example, Japanese Patent Application Laid-Open No. 2002-175178.
JP 2002-175178 A

しかしながら、従来の除算器では、被除数Aおよび除数Bによっては、除算計算のサイクル数が異なるとともに、100〜1000サイクル以上要することがあり、高速な除算動作の妨げになると言う問題があった。また、このような除算器と、複数のコンパレータおよび乗算器とを併用することによって、演算を高速化することも考えられるが、システムの複雑化を招くと共に、回路規模が増大するという問題があった。
本発明の課題は、小型かつ高速な除算器を実現することである。
However, the conventional divider has a problem that depending on the dividend A and the divisor B, the number of division calculation cycles is different and may require 100 to 1000 cycles or more, which hinders a high-speed division operation. In addition, it is conceivable to speed up the operation by using such a divider together with a plurality of comparators and multipliers. However, there is a problem that the system becomes complicated and the circuit scale increases. It was.
An object of the present invention is to realize a small and high-speed divider.

以上の課題を解決するため、本発明は、
被除数Xを除数Kで除算した結果を算出する除算器であって、2/K(Lは整数)の整数部分を加算要素2(Nは正の整数)の和によって近似した近似値Mに基づいて、X×(M/2)なる演算を行うことにより除算結果を算出することを特徴としている。
ここで、2乗は除算の精度を規定する値であり、要求に応じて、任意に設定することが可能である。
In order to solve the above problems, the present invention provides:
An divider M for calculating a result of dividing the dividend X by a divisor K, and approximating an integer part of 2 L / K (L is an integer) by a sum of addition elements 2 N (N is a positive integer) Based on the above, the division result is calculated by performing an operation of X × (M / 2 L ).
Here, the power of 2 L is a value that defines the accuracy of division, and can be arbitrarily set as required.

このような構成により、ビットシフトおよび加算のみによって除算を行うことができるため、小型かつ高速な除算器を実現することが可能となる。
また、近似値Mは、除数Kに応じて用意されるものであるため、除算結果として、十分な精度を確保することが可能である。
また、前記除数Kによって定まるNまでの各整数について、被除数XのM/2ビットシフト値それぞれを出力するビットシフト値出力手段(例えば、図6のシフタ21およびその出力をビットシフトする配線処理部分)と、前記除数Kに対応して、所定の前記M/2ビットシフト値を選択する選択手段(例えば、図4の制御部10および図6のMUX22a〜22i)と、前記選択手段によって選択された前記M/2ビットシフト値それぞれを加算する加算手段(例えば、図6の加算器23a〜23h)とを含むことを特徴としている。
With such a configuration, division can be performed only by bit shift and addition, so that a small and high-speed divider can be realized.
Moreover, since the approximate value M is prepared according to the divisor K, it is possible to ensure sufficient accuracy as the division result.
For each integer up to N determined by the divisor K, bit shift value output means for outputting the M / 2 N bit shift values of the dividend X (for example, the shifter 21 in FIG. 6 and the wiring processing for bit shifting the output) Part), a selection unit (for example, the control unit 10 in FIG. 4 and the MUXs 22a to 22i in FIG. 6) for selecting the predetermined M / 2 N- bit shift value corresponding to the divisor K, and the selection unit And adding means (for example, adders 23a to 23h in FIG. 6) for adding each of the selected M / 2 N- bit shift values.

このような構成により、ビットシフト値出力手段の出力を、選択手段によって適切に選択した上で、加算手段によって加算することができるため、異なる除数Kによる除算に対応することが可能となる。
また、前記選択手段は、複数の前記除数Kについて、前記被除数XのM/2ビットシフト値それぞれのいずれを選択するかを示す選択情報(例えば、図5のLUT)を記憶しており、該選択情報に基づいて、入力された除数Kに対応する前記M/2ビットシフト値それぞれを選択することを特徴としている。
With such a configuration, since the output of the bit shift value output means can be selected by the selection means and then added by the addition means, it is possible to cope with division by different divisors K.
The selection means stores selection information (for example, the LUT in FIG. 5) indicating which of the M / 2 N- bit shift values of the dividend X is selected for a plurality of the divisors K. Each of the M / 2 N- bit shift values corresponding to the inputted divisor K is selected based on the selection information.

このような構成により、除数Kと、選択するべきM/2ビットシフト値とを容易に対応付けることができるため、入力される可能性がある除数Kの値あるいは除数Kの個数が変更された場合にも、変更後の除数Kに容易に対応することが可能となる。
また、本発明は、
上記除算器のいずれかを備え、映像の画素値を積算して得られる積算値を前記被除数X、該積算値に関わる画素数を前記除数Kとして除算を行うことにより輝度を算出し、該輝度に基づいて、前記映像の露出制御を行うことを特徴とする露出制御装置である。
With this configuration, the divisor K and the M / 2 N- bit shift value to be selected can be easily associated with each other, so the value of the divisor K or the number of divisors K that may be input is changed. Even in this case, it is possible to easily cope with the divisor K after the change.
The present invention also provides:
A luminance is calculated by performing division by using any of the above-mentioned dividers and dividing the integrated value obtained by integrating the pixel values of the video as the dividend X and the number of pixels related to the integrated value as the divisor K. The exposure control device is configured to perform exposure control of the video based on the above.

即ち、輝度レベルの算出においては、多数の画素について積算された輝度値を、その多数の画素数で除算する処理が繰り返されることから、本発明に係る除算器の高速である特長がさらに有効なものとなる。また、本発明に係る除算器は、小型であることから、製造コストが低く、低消費電力なものとなり、露出制御にさらに適するものとなっている。
また、本発明は、
被除数Xを除数Kで除算した結果を算出するための除算方法であって、2/K(Lは整数)の整数部分を加算要素2(Nは正の整数)の和によって近似した近似値Mに基づいて、X×(M/2)なる演算を行うことにより除算結果を算出することを特徴としている。
本方法により、小型かつ高速な除算器を実現することが可能となる。
That is, in the calculation of the luminance level, the process of dividing the luminance value accumulated for a large number of pixels by the number of the large number of pixels is repeated, so that the high-speed feature of the divider according to the present invention is further effective. It will be a thing. Further, since the divider according to the present invention is small, the manufacturing cost is low, the power consumption is low, and the divider is more suitable for exposure control.
The present invention also provides:
A division method for calculating a result of dividing a dividend X by a divisor K, in which an integer part of 2 L / K (L is an integer) is approximated by a sum of addition elements 2 N (N is a positive integer) Based on the value M, a division result is calculated by performing an operation of X × (M / 2 L ).
With this method, a small and high-speed divider can be realized.

以下、図を参照して本発明に係る除算器の実施の形態を説明する。
初めに、本発明における除算方法について説明する。
本発明においては、撮像装置における露出制御のための輝度値の平均化処理等、除数がある程度固定されている場合を想定している。例えば、QVGA(Quarter Video Graphics Array)、CIF(Common Intermediate Format)、VGA(VideoGraphics Array)、SVGA(Super Video Graphics Array)、XGA(eXtended Graphics Array)、SXGA()SupereXtended Graphics Array)のサイズの画像において、輝度の平均値(各画素の輝度の積算値/総画素数)を算出する場合には、それぞれの画像において処理単位となるブロックの画素数が決まっていることから、除数が固定値となる。
Embodiments of a divider according to the present invention will be described below with reference to the drawings.
First, the division method in the present invention will be described.
In the present invention, it is assumed that the divisor is fixed to some extent, such as luminance value averaging processing for exposure control in the imaging apparatus. For example, in an image having a size of QVGA (Quarter Video Graphics Array), CIF (Common Intermediate Format), VGA (Video Graphics Array), SVGA (Super Video Graphics Array), XGA (eXtended Graphics Array), or SXGA () SupereXtended Graphics Array When calculating the average value of luminance (the integrated value of the luminance of each pixel / the total number of pixels), the divisor becomes a fixed value because the number of pixels of a block that is a processing unit in each image is determined. .

このような場合に、任意の除数で除算可能な汎用の除算器を用いるとすれば、冗長な回路構成となることから、機能を最適化し、回路規模の縮小および高速化を図ることとする。
即ち、本発明における除算方法においては、入力X(整数)を除数K(整数)で除算し、小数部を含む出力Yを得ることを目的とする。即ち、
Y=X×(1/K) (1)
ここで、(1)式を以下の(2)、(3)式のように表現する。
Y≒X×(M/220) (2)
1/K≒M/220 (3)
ここで、Mは整数であり、220は、除算における精度を規定する値である。
In such a case, if a general-purpose divider that can divide by an arbitrary divisor is used, a redundant circuit configuration is obtained. Therefore, the function is optimized, and the circuit scale is reduced and the operation speed is increased.
That is, an object of the division method according to the present invention is to divide an input X (integer) by a divisor K (integer) to obtain an output Y including a decimal part. That is,
Y = X × (1 / K) (1)
Here, the expression (1) is expressed as the following expressions (2) and (3).
Y≈X × (M / 2 20 ) (2)
1 / K≈M / 2 20 (3)
Here, M is an integer, and 2 20 is a value that defines the precision in division.

すると、(3)式より、
M=int(220/K+0.5) (4)
ここで、“int”は、括弧内の引数の整数部のみを出力する関数を表している。また、“0.5”を加えることにより、(4)式は、四捨五入を意味するものとなる。
次に、上述の整数Mの意味を説明する。
Then, from equation (3)
M = int (2 20 /K+0.5) (4)
Here, “int” represents a function that outputs only the integer part of the argument in parentheses. Further, by adding “0.5”, the equation (4) means rounding off.
Next, the meaning of the integer M will be described.

なお、説明のために、以下ではK=3072(QVGAの総画素数)であるものとする。このとき、(1)式は、
Y=X×(1/3072) (5)
となり、(4)式によれば、M=341となる。その結果、(2)式は、次式のように表される。
Y≒X×(341/220) (6)
さらに、(5)式は、次式のように表現できる。
Y≒Y’=X×((256+64+16+4+1)/220) (7)
即ち、
Y’=X×(1/212+1/214+1/216+1/218+1/220) (8)
この(7)式あるいは(8)式は、係数が2のべき乗で表されていることから、デジタル回路を構成することが容易なものである。
In the following description, it is assumed that K = 3072 (the total number of pixels of QVGA). At this time, the equation (1) is
Y = X × (1/3072) (5)
Thus, according to equation (4), M = 341. As a result, the equation (2) is expressed as the following equation.
Y≈X × (341/2 20 ) (6)
Furthermore, equation (5) can be expressed as:
Y≈Y ′ = X × ((256 + 64 + 16 + 4 + 1) / 2 20 ) (7)
That is,
Y ′ = X × (1/2 12 +1/2 14 +1/2 16 +1/2 18 +1/2 20 ) (8)
Since the coefficient (7) or (8) is expressed by a power of 2, it is easy to configure a digital circuit.

即ち、X/2(Nは自然数)の演算は、ビットシフトすることによって実行できるため、(7)式あるいは(8)式を実行する場合、入力Xをそれぞれ20ビット、18ビット、16ビット、14ビット、12ビット分シフトした値を算出し、その算出結果を加算することによって出力Y’(除算結果)を得ることができる。
したがって、(1)式を(7)式あるいは(8)式のような演算に変換することにより、除算処理をシフタおよび加算器によって実現することが可能となる。
That is, since the calculation of X / 2 N (N is a natural number) can be executed by bit shifting, when executing the expression (7) or (8), the input X is 20 bits, 18 bits, 16 bits, respectively. The output Y ′ (division result) can be obtained by calculating a value shifted by 14 bits and 12 bits and adding the calculated results.
Therefore, by converting the expression (1) into an operation like the expression (7) or the expression (8), the division process can be realized by a shifter and an adder.

上述の方法に従うと、例えば、前述の各画像形式の場合、“M”の値は予め把握することができる。
図1は、本実施の形態における各画像形式における除数Kを示す図である。
図1において、各形式の画像は、総画素数、処理単位となるブロックのサイズおよびブロックの総画素数が規定されている。なお、本実施の形態では、図2のように、1枚の画像を均等のサイズに25(5×5)分割したが、ブロックサイズは均等である必要はなく、ブロック総画素数が予め規定されればよい。
According to the above-described method, for example, in the case of each image format described above, the value of “M” can be grasped in advance.
FIG. 1 is a diagram showing the divisor K in each image format in the present embodiment.
In FIG. 1, for each type of image, the total number of pixels, the size of a block serving as a processing unit, and the total number of pixels of the block are defined. In this embodiment, as shown in FIG. 2, one image is divided into 25 (5 × 5) equal sizes, but the block sizes do not have to be equal, and the total number of pixels of the block is defined in advance. It only has to be done.

図3は、これら各画像形式の場合の除数K、220/K、M、値Mを2のべき乗で表した値をそれぞれ示す図である。
図3においては、各画像形式の除数Kに対応して、2のべき乗表現されたXの係数が固定値として規定されている。
したがって、2のべき乗の各項に対応するビット分、入力Xをビットシフトするシフタによって入力Xを所定ビットシフトした値を算出しておき、それらのうち、各画像形式に対応する値を選択して加算することにより、出力Yが得られることとなる。
FIG. 3 is a diagram showing divisors K, 2 20 / K, M, and values M representing values of powers of 2 for the respective image formats.
In FIG. 3, the coefficient of X expressed as a power of 2 is defined as a fixed value corresponding to the divisor K of each image format.
Therefore, a value obtained by shifting the input X by a predetermined bit is calculated by a shifter that bit-shifts the input X by a bit corresponding to each power-of-two term, and among these, a value corresponding to each image format is selected. Thus, the output Y is obtained.

以下、本方法を適用した除算器について説明する。
まず、構成を説明する。
図4は、本実施の形態に係る除算器1の機能構成を示す図である。
図4において、除算器1は、制御部10と、演算部20とを含んで構成される。
制御部10は、除数Kとして入力される可能性のある図3の各除数Kの値と、2のべき乗表現されたXの係数とが対応づけられているルックアップテーブル(LUT)を記憶している。このLUTは、より具体的には画像形式(除数K)を与えるコードと、Xの係数とが対応付けられたものである。そして、制御部10は、除数Kを与えるコードが入力されると、それに対応する2のべき乗の要素(X/2)に応じて、選択信号SEL-MUX0〜8を演算部20に出力する。具体的には、入力Xが所定ビットシフトされた値それぞれを選択するか否かを示す選択信号SEL-MUX0〜8を演算部20に出力する。(図6の演算部20の説明を参照)。
Hereinafter, a divider to which the present method is applied will be described.
First, the configuration will be described.
FIG. 4 is a diagram illustrating a functional configuration of the divider 1 according to the present embodiment.
In FIG. 4, the divider 1 includes a control unit 10 and a calculation unit 20.
The control unit 10 stores a lookup table (LUT) in which the value of each divisor K in FIG. 3 that may be input as the divisor K is associated with the coefficient of X expressed as a power of 2. ing. More specifically, the LUT is a code in which an image format (divisor K) is associated with an X coefficient. When the code that gives the divisor K is input, the control unit 10 outputs the selection signals SEL-MUX0 to 8 to the calculation unit 20 according to the corresponding power-of-two element (X / 2 N ). . Specifically, selection signals SEL-MUX0 to 8 indicating whether or not the input X selects each value shifted by a predetermined bit are output to the arithmetic unit 20. (Refer to the description of the arithmetic unit 20 in FIG. 6).

演算部20は、入力Xを所定ビットずつシフトした値を算出し、制御部10から入力される選択信号によって、それらの値を選択して加算することにより、出力Yを算出する。なお、ここでは、入力Xは符号なしの26ビットの整数値であることとする。
図5は、制御部10が記憶しているLUTの内容を示す図である。
図5において、LUTには、図6の演算部20の説明における0〜8ビット左シフトした出力それぞれを選択するか否かが、各画像形式について記憶されており、“0”は選択しないことを示し、“1”は選択することを示している。
The arithmetic unit 20 calculates a value obtained by shifting the input X by a predetermined bit, and calculates and outputs an output Y by selecting and adding these values according to a selection signal input from the control unit 10. Here, the input X is an unsigned 26-bit integer value.
FIG. 5 is a diagram showing the contents of the LUT stored in the control unit 10.
In FIG. 5, the LUT stores for each image format whether or not each of the outputs shifted to the left by 0 to 8 bits in the description of the arithmetic unit 20 in FIG. 6 is selected, and “0” is not selected. “1” indicates selection.

図6は、演算部20の回路構成例を示す図である。
図6において、演算部20は、シフタ21と、マルチプレクサ(MUX)22a〜22iと、加算器23a〜23hとを含んで構成される。
図6において、シフタ21は、入力Xを20ビット右シフトして、MUX22a〜22jに出力する。なお、入力Xを20ビット右シフトする処理は、式(7)の1/220の演算処理に相当する。
FIG. 6 is a diagram illustrating a circuit configuration example of the arithmetic unit 20.
In FIG. 6, the arithmetic unit 20 includes a shifter 21, multiplexers (MUX) 22a to 22i, and adders 23a to 23h.
In FIG. 6, the shifter 21 shifts the input X to the right by 20 bits and outputs it to the MUXs 22a to 22j. Note that the process of shifting the input X to the right by 20 bits corresponds to 1/2 20 of the expression (7).

各マルチプレクサには、シフタ21の出力が配線処理によって所定ビットシフトされた値として入力される。この処理は、例えば、式(7)の(256+64+16+4+1)の各加算要素に対応した乗算処理に相当する。具体的には、MUX22aには、シフタ21の出力が8ビット左シフトされた状態で入力され、同様に、MUX22b〜22iには、シフタ21の出力がそれぞれ7〜0ビットシフトされた状態で入力される。   The output of the shifter 21 is input to each multiplexer as a value shifted by a predetermined bit by wiring processing. This processing corresponds to, for example, multiplication processing corresponding to each addition element of (256 + 64 + 16 + 4 + 1) in Expression (7). Specifically, the output of the shifter 21 is input to the MUX 22a with the output shifted to the left by 8 bits. Similarly, the output of the shifter 21 is input to the MUXs 22b to 22i with the output of the shifter 21 shifted by 7 to 0 bits, respectively. Is done.

MUX22a〜22iには、上述のように、シフタ21の出力が配線処理によって所定ビット左シフトされた値が入力され、各MUX22a〜22iは、制御部10から入力される選択信号SEL-MUX0〜8によって、ビットシフトされたシフタ21の出力あるいは“0”のいずれかを選択して出力する。
加算器23a〜23hは、それぞれに入力された値を加算して出力する。そして、加算器23a〜23hが順次加算を行うことにより、最終的に、加算器23hによって出力Y(商)が出力されることとなる。この加算処理は、式(7)の(256+64+16+4+1)の処理に相当する。
As described above, the MUXs 22a to 22i are each input with a value obtained by shifting the output of the shifter 21 by a predetermined bit to the left by the wiring process, and each of the MUXs 22a to 22i receives selection signals SEL-MUX0 to 8 input from the control unit 10. Thus, either the output of the bit-shifted shifter 21 or “0” is selected and output.
The adders 23a to 23h add the values input to the adders and output the result. Then, when the adders 23a to 23h sequentially add, the output Y (quotient) is finally output by the adder 23h. This addition process corresponds to the process of (256 + 64 + 16 + 4 + 1) in Expression (7).

なお、図6においては、シフタ21によって20ビット右シフトした値を、さらに配線処理によって所定ビット左シフトする構成を示したが、これらのビットシフトをまとめたビットシフト結果を、配線処理によってMUX21a〜21iに入力することとしても良い。
図7は、図6におけるビットシフトをまとめた場合の演算部20の回路構成例を示す図である。
6 shows a configuration in which the value shifted 20 bits to the right by the shifter 21 is further shifted to the left by a predetermined bit by the wiring process. However, the bit shift result obtained by collecting these bit shifts is converted into the MUX 21a˜ It is good also as inputting into 21i.
FIG. 7 is a diagram illustrating a circuit configuration example of the arithmetic unit 20 when the bit shifts in FIG. 6 are combined.

図7においては、ビットシフトをまとめた結果、シフタ21が不要な構成となっている。
また、演算部20を図7の回路構成とした場合にも、制御部10がMUX22a〜22iを選択するパターンには影響がないため、除数Kに応じて、上述の選択信号SEL-MUX0〜8と同様の選択信号を入力すれば良い。
In FIG. 7, as a result of collecting the bit shifts, the shifter 21 is unnecessary.
7 does not affect the pattern in which the control unit 10 selects the MUXs 22a to 22i, so that the selection signals SEL-MUX0 to 8 described above according to the divisor K. The same selection signal may be input.

次に、動作を説明する。
図1において、除算器1には、除数Kを与えるコードと被除数Xとが入力され、除数Kを与えるコードは制御部10に、被除数Xは演算部20に渡される。
制御部10では、除数Kを与えるコードが入力されると、LUTを参照することにより、MUX22a〜22iそれぞれの入力(左シフトされたシフタ21の出力あるいは“0”)のいずれかを選択するための選択信号SEL-MUX0〜8をMUX22a〜22iに出力する。
Next, the operation will be described.
In FIG. 1, a code that gives a divisor K and a dividend X are input to the divider 1, and a code that gives the divisor K is passed to the control unit 10, and the dividend X is passed to the calculation unit 20.
When a code giving the divisor K is input, the control unit 10 refers to the LUT to select one of the inputs of the MUXs 22a to 22i (the output of the shifter 21 shifted to the left or “0”). The selection signals SEL-MUX0 to 8 are output to the MUXs 22a to 22i.

また、演算部20では、入力された除数Xをシフタ21が20ビット右シフトし、その出力が、配線処理による左シフトを経て、各MUX22a〜22iに入力される。
すると、各MUX22a〜22iは、それぞれに入力されている選択信号SEL-MUX0〜8に応じて、左シフトされたシフタ21の出力あるいは“0”のいずれかを選択して出力する。
In addition, in the arithmetic unit 20, the shifter 21 shifts the input divisor X by 20 bits to the right, and the output is input to each of the MUXs 22a to 22i through the left shift by the wiring process.
Then, each of the MUXs 22a to 22i selects and outputs either the output of the shifter 21 shifted to the left or “0” in accordance with the selection signals SEL-MUX0 to 8 input thereto.

例えば、QVGAの画像であれば、図5より、MUX22a,22c,22e,22g,22iには、左シフトされたシフタ21の出力を選択させる選択信号が入力され、それ以外のマルチプレクサには、“0”を選択させる選択信号が入力される。
そして、各MUX22a〜22iの出力が、加算器23a〜22hによって順次加算されていき、加算器23hの出力が、被除数Xを除数Kで除算した商として出力される。
For example, in the case of a QVGA image, from FIG. 5, a selection signal for selecting the output of the shifter 21 shifted to the left is input to the MUXs 22a, 22c, 22e, 22g, and 22i. A selection signal for selecting 0 ″ is input.
The outputs of the MUXs 22a to 22i are sequentially added by the adders 23a to 22h, and the output of the adder 23h is output as a quotient obtained by dividing the dividend X by the divisor K.

以上のように、本実施の形態に係る除算器1は、被除数Xを除数Kで除算する演算を、除数Kに応じた近似に基づいて、被除数Xを2のべき乗(2)倍した所定要素の加算として処理する((8)式参照)。また、このとき行われる近似は、除数Kとして入力される可能性がある限定された所定値に対応するものであり、加算される各要素における整数部分については十分な精度を有するものである。 As described above, the divider 1 according to the present embodiment has a predetermined value obtained by multiplying the dividend X by a power of 2 (2 N ) based on the approximation according to the divisor K for dividing the dividend X by the divisor K. Processed as addition of elements (see equation (8)). The approximation performed at this time corresponds to a limited predetermined value that may be input as the divisor K, and has sufficient accuracy for the integer part of each element to be added.

したがって、ビットシフトおよび加算のみによって除算を行うことができるため、小型かつ高速な除算器を実現することが可能となる。
また、除数Kとして入力される可能性がある値あるいは個数が仮に変更された場合であっても、LUTの内容を変更することのみで対応できるため、汎用性を確保することも可能となる。
Therefore, since division can be performed only by bit shift and addition, a small and high-speed divider can be realized.
In addition, even if the value or number that can be input as the divisor K is changed, it can be dealt with only by changing the contents of the LUT, so that versatility can be ensured.

また、本実施の形態に係る除算器1を電子カメラ等の露出制御に用いる場合、輝度レベルの算出においては、多数の画素について積算された輝度値を、その多数の画素数で除算する処理が繰り返されることから、高速である特長がさらに有効なものとなる。また、本発明に係る除算器1は、小型であることから、製造コストが低く、低消費電力なものとなり、電子カメラ等の露出制御にさらに適するものとなっている。   Further, when the divider 1 according to the present embodiment is used for exposure control of an electronic camera or the like, in the calculation of the luminance level, a process of dividing the luminance value accumulated for a large number of pixels by the large number of pixels. Since it is repeated, the feature of high speed becomes more effective. Further, since the divider 1 according to the present invention is small, the manufacturing cost is low, the power consumption is low, and the divider 1 is more suitable for exposure control of an electronic camera or the like.

なお、本実施の形態においては、入力Xが符号なしの26ビットの整数であり、それをシフタによって20ビット右シフトし、さらに、最大で8ビット左シフトされることから、(26−20)+8=14ビットの整数部となる。ただし、後段の加算処理のために、1ビット符号ビットを付加して、最終的には15ビットの整数部となる。この場合、20ビットシフトにより発生する20ビットの小数部と合わせて、35ビットのダイナミックレンジを有する演算を行うものとなる。   In the present embodiment, the input X is an unsigned 26-bit integer, which is shifted 20 bits to the right by the shifter and further left-shifted by a maximum of 8 bits, so (26-20) + 8 = 14-bit integer part. However, a 1-bit code bit is added for the subsequent addition process, and finally an integer part of 15 bits is obtained. In this case, an operation having a 35-bit dynamic range is performed together with the 20-bit decimal part generated by the 20-bit shift.

一方、より低い演算精度で足りる場合には、例えば、整数部を符号なしの15ビット、小数部を固定小数点の4ビットの合計19ビットのダイナミックレンジとすることが可能となり、このような場合には、加算器23a〜23hの入力ダイナミックレンジを変更することで対応可能である。
また、本実施の形態においては、(4)式に示すように、“M”を算出する際に小数点以下を四捨五入するものとして説明したが、小数点以下を切り捨てたり、切り上げたりすることによっても、ほぼ同様の演算精度を確保することが可能である。
On the other hand, if lower calculation accuracy is sufficient, for example, the integer part can be made into a dynamic range of 15 bits with no sign and the fractional part can be made into a fixed 19-bit dynamic range of 4 bits. Can be handled by changing the input dynamic range of the adders 23a to 23h.
Further, in the present embodiment, as shown in the equation (4), it is described that “M” is rounded off after the decimal point. However, by rounding down or rounding up the decimal point, It is possible to ensure almost the same calculation accuracy.

各画像形式における除数Kを示す図である。It is a figure which shows the divisor K in each image format. 実施形態において規定した除数の背景となる画像の領域分割を示す図である。It is a figure which shows the area | region division of the image used as the background of the divisor prescribed | regulated in embodiment. 各画像形式の場合の除数K、220/K、M、値Mを2のべき乗で表した値をそれぞれ示す図である。It is a figure which shows the value which represented the divisor K in the case of each image format, 2 < 20 > / K, M, and the value M by the power of 2, respectively. 本実施の形態に係る除算器1の機能構成を示す図である。It is a figure which shows the function structure of the divider 1 which concerns on this Embodiment. 制御部10が記憶しているLUTの内容を示す図である。It is a figure which shows the content of LUT which the control part 10 has memorize | stored. 演算部20の回路構成例を示す図である。3 is a diagram illustrating a circuit configuration example of a calculation unit 20. FIG. 図6におけるビットシフトをまとめた場合の演算部20の回路構成例を示す図である。It is a figure which shows the circuit structural example of the calculating part 20 at the time of putting together the bit shift in FIG. 従来の除算器の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the conventional divider.

符号の説明Explanation of symbols

1 除算器、10 制御部、20 演算部、21,201 シフタ、22a〜22i,202 マルチプレクサ(MUX)、23a〜23h 加算器、203 減算器、204 レジスタ、205 除算制御器 DESCRIPTION OF SYMBOLS 1 Divider, 10 Control part, 20 Operation part, 21,201 Shifter, 22a-22i, 202 Multiplexer (MUX), 23a-23h Adder, 203 Subtractor, 204 Register, 205 Division controller

Claims (5)

被除数Xを除数Kで除算した結果を算出する除算器であって、
/K(Lは整数)の整数部分を加算要素2(Nは正の整数)の和によって近似した近似値Mに基づいて、X×(M/2)なる演算を行うことにより除算結果を算出することを特徴とする除算器。
A divider for calculating a result of dividing a dividend X by a divisor K;
By performing an operation of X × (M / 2 L ) based on an approximate value M obtained by approximating the integer part of 2 L / K (L is an integer) by the sum of addition elements 2 N (N is a positive integer) A divider characterized by calculating a division result.
前記除数Kによって定まるNまでの各整数について、被除数XのM/2ビットシフト値それぞれを出力するビットシフト値出力手段と、
前記除数Kに対応して、所定の前記M/2ビットシフト値を選択する選択手段と、
前記選択手段によって選択された前記M/2ビットシフト値それぞれを加算する加算手段と、
を含むことを特徴とする請求項1記載の除算器。
Bit shift value output means for outputting M / 2 N bit shift values of the dividend X for each integer up to N determined by the divisor K;
Selecting means for selecting the predetermined M / 2 N- bit shift value corresponding to the divisor K;
Adding means for adding each of the M / 2 N- bit shift values selected by the selecting means;
The divider according to claim 1, comprising:
前記選択手段は、複数の前記除数Kについて、前記被除数XのM/2ビットシフト値それぞれのいずれを選択するかを示す選択情報を記憶しており、該選択情報に基づいて、入力された除数Kに対応する前記M/2ビットシフト値それぞれを選択することを特徴とする請求項2記載の除算器。 The selection means stores selection information indicating which of the M / 2 N- bit shift values of the dividend X is to be selected for a plurality of the divisor K, and is input based on the selection information 3. The divider according to claim 2, wherein each of the M / 2 N- bit shift values corresponding to the divisor K is selected. 請求項1から3のいずれか1項に記載の除算器を備え、
映像の画素値を積算して得られる積算値を前記被除数X、該積算値に関わる画素数を前記除数Kとして除算を行うことにより輝度を算出し、該輝度に基づいて、前記映像の露出制御を行うことを特徴とする露出制御装置。
A divider according to any one of claims 1 to 3,
The luminance is calculated by dividing the integrated value obtained by integrating the pixel values of the video as the dividend X and the number of pixels related to the integrated value as the divisor K, and based on the luminance, exposure control of the video is performed. An exposure control device characterized in that:
被除数Xを除数Kで除算した結果を算出するための除算方法であって、
/K(Lは整数)の整数部分を加算要素2(Nは正の整数)の和によって近似した近似値Mに基づいて、X×(M/2)なる演算を行うことにより除算結果を算出することを特徴とする除算方法。
A division method for calculating a result of dividing a dividend X by a divisor K,
By performing an operation of X × (M / 2 L ) based on an approximate value M obtained by approximating the integer part of 2 L / K (L is an integer) by the sum of addition elements 2 N (N is a positive integer) A division method characterized by calculating a division result.
JP2003360578A 2003-10-21 2003-10-21 Divider, exposure control device, and division method Pending JP2005128618A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003360578A JP2005128618A (en) 2003-10-21 2003-10-21 Divider, exposure control device, and division method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003360578A JP2005128618A (en) 2003-10-21 2003-10-21 Divider, exposure control device, and division method

Publications (1)

Publication Number Publication Date
JP2005128618A true JP2005128618A (en) 2005-05-19

Family

ID=34640851

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003360578A Pending JP2005128618A (en) 2003-10-21 2003-10-21 Divider, exposure control device, and division method

Country Status (1)

Country Link
JP (1) JP2005128618A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013206268A (en) * 2012-03-29 2013-10-07 Jvc Kenwood Corp Av signal processing reduction device, av signal processing reduction method, and av signal processing reduction program
JP2013206269A (en) * 2012-03-29 2013-10-07 Jvc Kenwood Corp Av signal processing reduction device, av signal processing reduction method, and av signal processing reduction program
JP7435044B2 (en) 2020-03-06 2024-02-21 京セラドキュメントソリューションズ株式会社 image forming device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013206268A (en) * 2012-03-29 2013-10-07 Jvc Kenwood Corp Av signal processing reduction device, av signal processing reduction method, and av signal processing reduction program
JP2013206269A (en) * 2012-03-29 2013-10-07 Jvc Kenwood Corp Av signal processing reduction device, av signal processing reduction method, and av signal processing reduction program
JP7435044B2 (en) 2020-03-06 2024-02-21 京セラドキュメントソリューションズ株式会社 image forming device

Similar Documents

Publication Publication Date Title
JP3778517B2 (en) Method and apparatus for color space conversion using blend logic
JP2002152498A (en) Method and device for processing image
US20060204139A1 (en) Image processing device, image processing method, display controller, and electronic instrument
JP2005269613A (en) Signal processing method and circuit
JP4856445B2 (en) Image composition apparatus and image composition method therefor
JP2005128618A (en) Divider, exposure control device, and division method
KR100294676B1 (en) Apparatus for universal image format converting
JP2008067233A (en) Digital-watermarking embedding method, program, and computer-readable recording medium
JP2005260405A (en) Image processor and image processing method
JP3899994B2 (en) Image signal processing apparatus and image signal processing method
JP2010033406A (en) Image processing device, image device, and image processing method
JP2009049752A (en) Video signal processing device, video signal processing method and display device
CN116227507B (en) Arithmetic device for performing bilinear interpolation processing
JP2005189663A (en) Multi-layer image composing system
JP2013243528A (en) Image processing apparatus
JP2005215612A (en) Gradation correcting circuit, image display device and image processing method
JP2009282684A (en) Floating decimal arithmetic unit and dda arithmetic processing method
JP4528532B2 (en) Color conversion circuit, image display device, and image processing method
JP2006203288A (en) Image processing circuit and image processing method
JP4203480B2 (en) Image processor
EP2264591A1 (en) Process for emulating Single Instruction Multiple Data (SIMD) instructions on a generic Arithmetic and Logical Unit (ALU), and image processing circuit for doing the same
JP2010206301A (en) Image processing apparatus and imaging apparatus
JP3323166B2 (en) Interpolation device
JP5169406B2 (en) Arithmetic processing apparatus, image display apparatus using the same, and arithmetic processing method
JP3566568B2 (en) Sample data string conversion method, distribution point value calculation method, sample data division method, and program recording medium