JPS6398071A - Arithmetic circuit - Google Patents
Arithmetic circuitInfo
- Publication number
- JPS6398071A JPS6398071A JP24203586A JP24203586A JPS6398071A JP S6398071 A JPS6398071 A JP S6398071A JP 24203586 A JP24203586 A JP 24203586A JP 24203586 A JP24203586 A JP 24203586A JP S6398071 A JPS6398071 A JP S6398071A
- Authority
- JP
- Japan
- Prior art keywords
- distance calculation
- accumulator
- circuit
- output
- bits
- 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
Links
- 238000004364 calculation method Methods 0.000 claims abstract description 34
- 238000009825 accumulation Methods 0.000 abstract description 6
- 230000000295 complement effect Effects 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 7
- 230000035508 accumulation Effects 0.000 description 5
- 239000013598 vector Substances 0.000 description 4
- 230000001186 cumulative effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 210000003127 knee Anatomy 0.000 description 2
- 238000013139 quantization Methods 0.000 description 2
- 238000000034 method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/76—Architectures of general purpose stored program computers
- G06F15/80—Architectures of general purpose stored program computers comprising an array of processing units with common control, e.g. single instruction multiple data processors
- G06F15/8053—Vector processors
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Complex Calculations (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は演算回路、特にディジタル信号処理プロセッサ
の演算回路に関するものである。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an arithmetic circuit, and particularly to an arithmetic circuit for a digital signal processor.
ディジタル信号処理においてベクトル量子化が注目を集
めている。このベクトル量子化で、多く用いられる演算
が2つの入力ベクトルの距離計算である。従来、積和演
算を高速に行うことができる汎用信号処理プロセッサが
ある。−例をあげれば、日本電気(株)のμPD772
0であり、詳細な説明は昭和61年1月発行のμP D
7720ファミリシグナル・プロセッサ ユーザーズ・
マニュアルに譲るが、演算ブロックについて言えば、1
6ビツト・の並列乗算器と、16ビツトの算術論理演算
回路があり、乗算器出力を累算する、いわゆる積和演算
が1インストラクシヨンサイクル毎に実行できる。Vector quantization is attracting attention in digital signal processing. In this vector quantization, an operation often used is distance calculation between two input vectors. Conventionally, there are general-purpose signal processing processors that can perform product-sum operations at high speed. - For example, NEC Corporation's μPD772
0, and a detailed explanation can be found in μP D published in January 1986.
7720 Family Signal Processor User's
I'll leave it to the manual, but when it comes to calculation blocks, 1.
There is a 6-bit parallel multiplier and a 16-bit arithmetic and logic circuit, and a so-called sum-of-products operation, which accumulates the multiplier outputs, can be executed every instruction cycle.
しかし、μP D7720の算術論理演算回路は1つし
かなく、また、1つの距離尺度である差の絶対値演算に
多(のステップ数を必要とする。例えば(1)式に示し
た128次元ベクトルの距離を計算する場合、
入力サンプル x(i): 1≦x(i)<1比較
パターン 5(i): L≦5(i)<1とすると
、累算後のダイナミックレンジは、O〈D<256とな
る。そこで、−1から1まであるいはOから2までの数
値しか表現できない演算回路で、オーバーフローを防ぐ
には入力サンプルおよび比較パターンにスケーリングを
施す必要がある。However, the μP D7720 has only one arithmetic and logic operation circuit, and requires a large number of steps to calculate the absolute value of the difference, which is one distance measure.For example, the 128-dimensional vector shown in equation (1) requires a large number of steps. When calculating the distance of Input sample x(i): 1≦x(i)<1 Comparison pattern 5(i): L≦5(i)<1, the dynamic range after accumulation is O〈 D<256. Therefore, in order to prevent overflow in an arithmetic circuit that can only express numerical values from -1 to 1 or from O to 2, it is necessary to scale the input samples and comparison patterns.
このスケーリングをより詳細に説明すると、先に示した
(1)式を(2)式に書き換えることである。To explain this scaling in more detail, it means rewriting equation (1) shown above into equation (2).
入力サンプル x(i)ニ
ー 1 /128≦x(i)/128 < 1/128
比較パターン 5(i)ニ
ー1/128≦s (i)/12B < 1/12Bと
することによって、累算後のダイナミックレンジをO<
D<2にすることができる。Input sample x(i) knee 1/128≦x(i)/128<1/128
Comparison pattern 5 (i) By setting knee 1/128≦s (i)/12B < 1/12B, the dynamic range after accumulation is O<
D<2.
本発明の目的は、スケーリングを必要とすることなく距
離計算式を1サンプルあたり1インストラクシヨンで直
接計算することができる演算回路を提供することにある
。An object of the present invention is to provide an arithmetic circuit that can directly calculate a distance calculation formula with one instruction per sample without requiring scaling.
本発明の演算回路は、2つの入力の距離計算回路と、前
記距離計算回路の出力に接続された累算器と、前記累算
器の出力に接続され、任意のビット数分だけ右シフトす
るバレルシフタと、前記バレルシフタにシフトするビッ
ト数を供給するレジスタとを備え、前記累算器の演算ビ
ット数が前記距離計算回路出力よりも上位側に多く存在
し、オーバーフローすることなしに演算が可能なことを
特徴としている。The arithmetic circuit of the present invention includes a two-input distance calculation circuit, an accumulator connected to the output of the distance calculation circuit, and an accumulator connected to the output of the accumulator, and shifts to the right by an arbitrary number of bits. It comprises a barrel shifter and a register that supplies the number of bits to be shifted to the barrel shifter, and the number of operation bits of the accumulator is higher than the output of the distance calculation circuit, and the operation can be performed without overflowing. It is characterized by
本発明によれば、入力サンプルと比較パターンがそれぞ
れ−1から1の間の値を取るものと仮定している。すな
わち、距離尺度として差の絶対値を用いた場合、出力は
Oから2の間になる。この距離計算回路をN個累算する
ことから、累算では0から2Nまでダイナミックレンジ
が拡大する。According to the invention, it is assumed that the input sample and the comparison pattern each take a value between -1 and 1. That is, if the absolute value of the difference is used as the distance measure, the output will be between 0 and 2. Since N distance calculation circuits are used for accumulation, the dynamic range is expanded from 0 to 2N.
そこで、本発明に係る累算器には、距離計算回路出力の
MSBよりも上位側にオーバーフローを防ぐための複数
個のビットが存在する。このことによって、入力サンプ
ルおよび比較パターンのスケーリングを行う必要がなく
、距離計算において回路規模が小さくてすむ。この時例
えば(1)式が定義された距離は、やはり、0から2ま
での値になるように、先に述べた累算個数Nで除算する
必要がある。しかし、一般の信号処理において、累算個
数Nは2のべきであることが多く、除算を行わずに右シ
フト演算によって除算の代わりを行うことができる。Therefore, in the accumulator according to the present invention, a plurality of bits for preventing overflow are present above the MSB of the distance calculation circuit output. This eliminates the need to scale input samples and comparison patterns, and reduces the circuit scale for distance calculations. At this time, for example, the distance defined by equation (1) needs to be divided by the cumulative number N mentioned above so that it becomes a value between 0 and 2. However, in general signal processing, the cumulative number N is often a power of 2, and the division can be replaced by a right shift operation instead of the division.
本発明の実施例を図に従って説明する。 Embodiments of the present invention will be described with reference to the drawings.
第1図は、本発明の一実施例を示すブロック図であり、
この演算回路は、距離計算回路3と、累算器4と、バレ
ルシフタ5と、バレルシフタ5ヘシフト量を供給するレ
ジスタ6とから構成される。FIG. 1 is a block diagram showing one embodiment of the present invention,
This arithmetic circuit includes a distance calculation circuit 3, an accumulator 4, a barrel shifter 5, and a register 6 that supplies a shift amount to the barrel shifter 5.
なお、1.2は距離計算回路の入力端子である。Note that 1.2 is an input terminal of the distance calculation circuit.
距離計算回路3は差の絶対値演算を行い、入力はそれぞ
れ8ビツトの2の補数表現で、出力は8ビツトの自然2
進数となる。この距離計算回路3の詳細については、後
述する。距離計算回路3の出力が8ビツトなのに対して
、累算器4は16ビツトの精度がある。累算器4の詳細
についても、後述する。また、バレルシフタ5は16ビ
ツト入力の内、3ビツトのレジスタ6によって指定され
る任意の位置から連続する8ビツトを出力するものであ
る。このバレルシフタ5はAMD社のAm25S10を
複数使用することで実現できる。Am25S10の詳細
はAMD社発行のバイポーラ マイクロプロセッサ ロ
ジック アンド インタフェース1985 データブ
ックに記載されている。The distance calculation circuit 3 calculates the absolute value of the difference, each input is an 8-bit two's complement representation, and the output is an 8-bit natural two's complement representation.
It becomes a base number. Details of this distance calculation circuit 3 will be described later. While the output of the distance calculation circuit 3 is 8 bits, the accumulator 4 has a precision of 16 bits. Details of the accumulator 4 will also be described later. Further, the barrel shifter 5 outputs consecutive 8 bits from an arbitrary position specified by the 3-bit register 6 among the 16 bits input. This barrel shifter 5 can be realized by using a plurality of Am25S10 manufactured by AMD. Details of the Am25S10 are described in the Bipolar Microprocessor Logic and Interface 1985 Data Book published by AMD.
第1図に示した演算回路を用いて(1)式の計算をする
場合、初期状態として、累算器4の保持している値は“
0”で、レジスタ6には1 /128をシフトで行うた
めのシフトi“7″が設定されているものとする。入力
端子1から入力サンプルx(0)、x(1)・・・x(
127)を、入力端子2から比較パターンs (0)
、 s (1) ・・・5(127)をそれぞれ同
時に入力する。この時のそれぞれの値は8ビツトの2の
補数表現で−1から1までの値をとる。これらの入力か
ら距離計算時間分の遅れの後に、距離計算回路3からは
1x(0)−s (0)l、lx (1)−s (1)
l・・・l x (127) −s (127) l
の出力が順次得られる。When calculating equation (1) using the arithmetic circuit shown in FIG. 1, as an initial state, the value held in the accumulator 4 is “
0", and shift i "7" is set in register 6 to perform a shift of 1/128. Input samples x(0), x(1)...x are input from input terminal 1. (
127) from input terminal 2 to comparison pattern s (0)
, s (1) ...5 (127) are input simultaneously. Each value at this time takes a value from -1 to 1 in 8-bit two's complement representation. After a delay of the distance calculation time from these inputs, the distance calculation circuit 3 outputs 1x(0)-s (0)l, lx (1)-s (1)
l...l x (127) -s (127) l
The output of is obtained sequentially.
これらの出力はすべて0から2の間の値であり8ビツト
の自然2進数で表現できる。累算器4では距離計算回路
3からの128個の出力を累算する。These outputs are all values between 0 and 2 and can be expressed as 8-bit natural binary numbers. The accumulator 4 accumulates 128 outputs from the distance calculation circuit 3.
この時、先に述べたように累算器4は、距離計算回路3
の出力よりも128倍大きい値が保持できるようにビッ
ト数があるため、Oから256までの数値を扱うことが
できる。このことから、累算器4ではオーバーフローす
ることなしに、累算が行える。128個の累算後、バレ
ルシフタ5で1 /128を実行する。バレルシフタ5
には、レジスタ6から1 /128であることを示す制
御信号が入力されており、バレルシフタ5の出力の8ビ
ツトは累算器4の出力の上位8ビツトを選択することに
より、1 /128が実現できる。At this time, as mentioned earlier, the accumulator 4 is connected to the distance calculation circuit 3.
Since the number of bits is such that it can hold a value 128 times larger than the output of , it can handle numbers from 0 to 256. From this, the accumulator 4 can perform accumulation without overflowing. After 128 accumulations, the barrel shifter 5 executes 1/128. barrel shifter 5
A control signal indicating that the output is 1/128 is input from the register 6, and by selecting the upper 8 bits of the output of the accumulator 4, the 8 bits of the output of the barrel shifter 5 are set to 1/128. realizable.
第2図は第1図の距離計算回路3の詳細な図である。こ
の距離計算回路3は、2の補数表現8ビット入力、9ビ
ツト出力の2個の減算器7.8と、選択回路9とにより
構成される。入力端子1は、減算器7のA入力と減算器
8のB入力に接続されている。同様に、入力端子2は、
減算器7のB入力と減算器8のA入力に接続されている
。この接続によって、減算器7では、(入力端子1から
の入力)−(入力端子2からの入力)が計算され、減算
器8では、(入力端子2からの入力)−(入力端子1か
らの入力)が計算される。減算器7および8の出力は2
の補数表現で9ビツトの精度があり、減算においてオー
バーフローが生じない。FIG. 2 is a detailed diagram of the distance calculation circuit 3 of FIG. 1. The distance calculation circuit 3 is comprised of two subtracters 7.8 each having an 8-bit input and a 9-bit output in two's complement representation, and a selection circuit 9. Input terminal 1 is connected to the A input of subtractor 7 and the B input of subtractor 8. Similarly, input terminal 2 is
It is connected to the B input of the subtractor 7 and the A input of the subtractor 8. With this connection, the subtracter 7 calculates (input from input terminal 1) - (input from input terminal 2), and the subtracter 8 calculates (input from input terminal 2) - (input from input terminal 1). input) is calculated. The output of subtractors 7 and 8 is 2
It has a precision of 9 bits in complement representation, and no overflow occurs during subtraction.
そのため、減算器7の出力のMSBを見ることにより、
減算器7の出力が正であるか負であるかが分かる。そこ
で、このMSBビットにより選択を制御される選択回路
9によって、正側の減算出力が選択できる。Therefore, by looking at the MSB of the output of subtractor 7,
It can be seen whether the output of the subtracter 7 is positive or negative. Therefore, the selection circuit 9 whose selection is controlled by this MSB bit can select the positive side subtraction output.
第3図は第1図の累算器4の詳細な説明図である。この
累算器4は、16ビツトの加算器10と16ビツトのレ
ジスタ11で構成される。加算器10は第1図の距離計
算回路3の出力8ビツトを上位8ビツトにゼロを拡張し
て、レジスタ11に保持されている値を加算する。そし
て、加算結果が加算器10の出力として得られ、レジス
タ11に保持される。FIG. 3 is a detailed explanatory diagram of the accumulator 4 of FIG. 1. This accumulator 4 is composed of a 16-bit adder 10 and a 16-bit register 11. The adder 10 extends the output 8 bits of the distance calculation circuit 3 shown in FIG. Then, the addition result is obtained as the output of the adder 10 and held in the register 11.
本発明により、固定少数点演算方式の演算回路によって
、(1)式で示されるような距離計算をオーバーフロー
することなく、実現できる。また、入力サンプルおよび
比較パターンのスケーリングが不要なために、距離計算
に必要な回路規模を小さくすることができる。According to the present invention, distance calculation as shown in equation (1) can be realized without overflow by using an arithmetic circuit using a fixed-point arithmetic method. Furthermore, since there is no need to scale input samples and comparison patterns, the circuit scale required for distance calculation can be reduced.
【図面の簡単な説明】
第1図は本発明の一実施例を示す図、
第2図は第1図の距離計算回路の構成を示す図、第3図
は第1図の累算器の構成を示す図である。
1.2・・・・・距離計算回路の入力端子3・・・・・
・・距離計算回路
4・・・・・・・累算器
5・・・・・・・バレルシフタ
6・・・・・・・レジスタ
第2図
第3図[BRIEF DESCRIPTION OF THE DRAWINGS] FIG. 1 is a diagram showing an embodiment of the present invention, FIG. 2 is a diagram showing the configuration of the distance calculation circuit in FIG. 1, and FIG. 3 is a diagram showing the configuration of the distance calculation circuit in FIG. FIG. 3 is a diagram showing the configuration. 1.2... Input terminal 3 of distance calculation circuit...
...Distance calculation circuit 4 ...Accumulator 5 ...Barrel shifter 6 ...Register Fig. 2 Fig. 3
Claims (1)
の出力に接続された累算器と、前記累算器の出力に接続
され、任意のビット数分だけ右シフトするバレルシフタ
と、前記バレルシフタにシフトするビット数を供給する
レジスタとを備え、前記累算器の演算ビット数が前記距
離計算回路出力よりも上位側に多く存在し、オーバーフ
ローすることなしに演算が可能な演算回路。(1) a two-input distance calculation circuit; an accumulator connected to the output of the distance calculation circuit; a barrel shifter connected to the output of the accumulator and shifted to the right by an arbitrary number of bits; and a register for supplying the number of bits to be shifted to a barrel shifter, wherein the number of operation bits of the accumulator is higher than the output of the distance calculation circuit, and the operation can be performed without overflowing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP24203586A JPS6398071A (en) | 1986-10-14 | 1986-10-14 | Arithmetic circuit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP24203586A JPS6398071A (en) | 1986-10-14 | 1986-10-14 | Arithmetic circuit |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS6398071A true JPS6398071A (en) | 1988-04-28 |
Family
ID=17083301
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP24203586A Pending JPS6398071A (en) | 1986-10-14 | 1986-10-14 | Arithmetic circuit |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS6398071A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009082071A (en) * | 2007-09-28 | 2009-04-23 | Daiwa Seiko Inc | Fishing reel |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS6010334A (en) * | 1983-06-30 | 1985-01-19 | Fujitsu Ltd | Integrating system |
JPS6027024A (en) * | 1983-07-22 | 1985-02-12 | Matsushita Electric Ind Co Ltd | Arithmetic device |
JPS6165362A (en) * | 1984-09-06 | 1986-04-03 | Ricoh Co Ltd | Digital signal processor |
-
1986
- 1986-10-14 JP JP24203586A patent/JPS6398071A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS6010334A (en) * | 1983-06-30 | 1985-01-19 | Fujitsu Ltd | Integrating system |
JPS6027024A (en) * | 1983-07-22 | 1985-02-12 | Matsushita Electric Ind Co Ltd | Arithmetic device |
JPS6165362A (en) * | 1984-09-06 | 1986-04-03 | Ricoh Co Ltd | Digital signal processor |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009082071A (en) * | 2007-09-28 | 2009-04-23 | Daiwa Seiko Inc | Fishing reel |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH07234778A (en) | Arithmetic circuit | |
JPH0690668B2 (en) | Fuzzy computing device | |
JPS6398071A (en) | Arithmetic circuit | |
JP2645422B2 (en) | Floating point processor | |
JP2951685B2 (en) | Fixed-point arithmetic unit | |
KR0176883B1 (en) | Complex number multiplier | |
JPH0251732A (en) | Floating point computing element | |
JPS63157269A (en) | Arithmetic circuit | |
JPS6312025A (en) | Adding and subtracting device | |
JP3078696B2 (en) | Reciprocal arithmetic unit | |
JP2530504B2 (en) | Floating point arithmetic unit | |
JP3277497B2 (en) | Divider | |
JPS6177964A (en) | Digital signal processor | |
JPH04346125A (en) | Shift addition and subtraction device | |
JPH029366B2 (en) | ||
JPS61118835A (en) | Hardware divider | |
JPH04107730A (en) | Floating point adder | |
JPH01111229A (en) | Floating point adder/subtractor | |
JPH08137829A (en) | Arithmetic unit | |
JPS5985539A (en) | Division processor | |
JPH01161437A (en) | Divider | |
JPH07261984A (en) | Arithmetic method and unit | |
JPH0552532B2 (en) | ||
JPH0449138B2 (en) | ||
JPH11134176A (en) | Reciprocal arithmetic circuit |