JPH03226831A - 2n fold arithmetic circuit - Google Patents

2n fold arithmetic circuit

Info

Publication number
JPH03226831A
JPH03226831A JP2249890A JP2249890A JPH03226831A JP H03226831 A JPH03226831 A JP H03226831A JP 2249890 A JP2249890 A JP 2249890A JP 2249890 A JP2249890 A JP 2249890A JP H03226831 A JPH03226831 A JP H03226831A
Authority
JP
Japan
Prior art keywords
data
point format
folds
shift
floating point
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
JP2249890A
Other languages
Japanese (ja)
Inventor
Noboru Kobayashi
登 小林
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2249890A priority Critical patent/JPH03226831A/en
Publication of JPH03226831A publication Critical patent/JPH03226831A/en
Pending legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

PURPOSE:To constitute the circuit so that a large number of steps of an instruc tion and many registers are unnecessary by constituting it so that an arithmetic shift instruction can be used at the time of executing 2<n> folds or 1/2<n> folds in a DSP for handling the data of a floating point format. CONSTITUTION:In a digital signal processing circuit (DSP) for handling the data of a floating point format, the number (n) of shifts designated by an arith metic shift instruction is inputted to an adding part 2, addition and subtraction are executed at the time of executing 2<n> folds and 1/2<n> folds, respectively, and a result of addition becomes an exponent of the data of the floating point format loaded to an accumulator 1. Accordingly, even in the case of the data of the floating point format, 2<n> folds 1/2<n> folds can be executed by an arithmetic shift instruction. In such a way, in the same way as the case of data of a fixed point format, the operation of 1/2<n> folds and 2<n> folds can be executed without having an instruction of three steps of the arithmetic shift and three registers.

Description

【発明の詳細な説明】 〔概 要] 浮動小数点形式のデータの2″倍演算回路に関し、 浮動小数点形式のデータを取り扱うDSPで、2″倍或
いは1/2”倍する時、算術シフト命令が使用出来る2
″倍演算回路の提供を目的とし、アキュムレータにロー
ドされた浮動小数点形式のデータの指数及び2″倍する
場合の指数nを加算部に入力し、加算結果を該アキュム
レータにロードされた浮動小数点形式のデータの指数と
するように構成する。
[Detailed Description of the Invention] [Summary] Regarding the 2'' multiplication circuit for floating point format data, when multiplying by 2'' or 1/2'' in a DSP that handles floating point format data, an arithmetic shift instruction is used. Usable 2
For the purpose of providing a multiplication circuit, the exponent of the floating-point format data loaded into the accumulator and the exponent n when multiplied by 2'' are input to the addition section, and the addition result is added to the floating-point format data loaded into the accumulator. Configure it so that it is an index of the data.

〔産業上の利用分野〕[Industrial application field]

本発明は、ディジタル信号処理回路(以下DSPと称す
)にて浮動小数点形式のデータを2″倍或いは1/2”
倍する場合、固定小数点形式のデータの場合と同様に算
術シフト命令にて可能とする2ガ倍演算回路に関する。
The present invention uses a digital signal processing circuit (hereinafter referred to as DSP) to convert data in floating point format to 2" or 1/2".
The present invention relates to a 2-gax arithmetic circuit which can be multiplied by an arithmetic shift instruction in the same way as in the case of fixed-point format data.

DSPは、現在固定小数点形式のデータを取り扱うもの
と、浮動小数点形式のデータを取り扱うものとに大別さ
れ、これ等は、必要とされる精度や、ダイナミックレン
ジにより選択される。
DSPs are currently broadly classified into those that handle fixed-point format data and those that handle floating-point format data, and these are selected depending on the required accuracy and dynamic range.

両者とも、演算命令の殆どは共通であるが、固定小数点
形式のデータを2・倍或いは1/2″倍する場合に用い
られる、レジスタは少な(でよ(、ステップ数も少ない
算術シフト命令は、浮動小数点形式のデータに用いても
意味がない。
Most of the arithmetic instructions are the same for both, but the arithmetic shift instructions, which are used to multiply fixed-point format data by 2 or 1/2'' and require fewer registers, have fewer steps. , there is no point in using it for data in floating point format.

一方、様々な信号処理では、ハードウェア簡単化の為に
、2r′倍或いは1/2”倍に近似なものは、2’倍或
いは1/2′″倍とする為に、2″倍或いは1/2’倍
とするアルゴリズムが多く、浮動小数点形式のデータの
場合でも算術シフト命令にて2″倍或いは1/2”倍出
来るものであることが望ましい。
On the other hand, in various signal processing, in order to simplify the hardware, things that approximate 2r' times or 1/2'' times are converted to 2' times or 1/2'' times. There are many algorithms that multiply by 1/2', and even in the case of floating point format data, it is desirable to be able to multiply by 2" or 1/2" using an arithmetic shift instruction.

〔従来の技術〕[Conventional technology]

第3図は固定小数点形式のデータの表現及び算術シフト
及び2″倍する時のシフト命令を示す図、第4図は1例
の浮動小数点形式のデータの表現及び2n′倍する時の
命令を示す図、第5回は従来例の浮動小数点形式のデー
タの加算回路である。
Figure 3 shows the representation of data in fixed-point format and the arithmetic shift and shift instructions for multiplying by 2'', and Figure 4 shows the representation of data in an example of floating-point format and the instruction for multiplying by 2n'. The fifth diagram shown in the figure is a conventional example of an addition circuit for floating-point format data.

固定小数点形式のデータは第3図(A)(a)に示す如
く、2の補数表現の固定小数点で表されており先頭は符
号ビットであり、数式で示すと第3図(A)(b)に示
す通りである。
Data in fixed-point format is expressed as a fixed-point number in two's complement representation, as shown in Figure 3(A)(a), and the beginning is a sign bit. ) as shown.

固定小数点形式のデータを、算術右シフトすると、第3
図(B)に示す如く、符号を拡張して行い、nビットシ
フトすることは、元の値を1/27倍することに等しく
、nビット算術左シフトすることは、元の値を2”倍す
ることに等しい。
When fixed-point format data is arithmetic shifted to the right, the third
As shown in Figure (B), extending the sign and shifting it by n bits is equivalent to multiplying the original value by 1/27, and arithmetic left shifting by n bits means changing the original value by 2''. It's equivalent to multiplying.

2″倍する時の命令を示すと、第3図(C)に示す如(
で、(1)アキュムレータに2″倍するデータをロード
、(2)左にnビットシフト、(3)アキュムレータか
らメモリにロード、となり、3ステツプで可能となる。
The command for multiplying by 2″ is shown in Figure 3 (C).
Then, (1) load data multiplied by 2'' into the accumulator, (2) shift n bits to the left, and (3) load from the accumulator to memory, which can be done in 3 steps.

勿論、1/2”倍する時は、左シフトを、右にnビット
シフトとする命令とすることで可能となる。
Of course, when multiplying by 1/2'', it is possible to do so by changing the left shift to an n-bit shift to the right.

浮動小数点形式のデータは第4図(A)(a)に示す如
く、符号ビット、指数部の指数e、仮数部の仮数fを示
す部分よりなり、指数は、正の数とする為にオフセット
値a(例えば127)を加えた値eとなっている。
As shown in Figure 4 (A) (a), floating point format data consists of a sign bit, an exponent e in the exponent part, and a mantissa f in the mantissa part, and the exponent is offset to make it a positive number. The value e is obtained by adding the value a (for example, 127).

これを数式で示すと、第4図(A)(b)に示す通りで
ある。
This can be expressed numerically as shown in FIGS. 4(A) and (b).

この場合算術シフトすることは意味がなく、20倍する
時の命令を示すと、第4図(B)に示す如く、(1)被
乗数レジスタAに2n倍するデータをロード、(2)2
”倍の値を乗数レジスタBにロード、(3)乗算、(4
)乗算結果をレジスタPにロードの4ステツプとステッ
プ数が算術シフトの場合より1ステップ多くなり、又レ
ジスタとしてA、B、Pが必要でレジスタ数が多くなる
In this case, there is no point in performing an arithmetic shift, and the instructions for multiplying by 20 are as shown in Figure 4 (B): (1) Load multiplicand register A with data multiplied by 2n; (2) 2
”Load the double value into multiplier register B, (3) Multiply, (4
) Loading the multiplication result into register P involves 4 steps, which is one more step than in the case of arithmetic shift, and also requires registers A, B, and P, which increases the number of registers.

ここで、浮動小数点形式のデータの加算回路につき第5
図を用いて説明しておく。
Here, for the addition circuit of floating point format data, the fifth
Let me explain using a diagram.

第5図は、アキュムレータ1にロードした第1の浮動小
数点形式のデータXと、レジスタ3にロードした第2の
浮動小数点形式のデータYとの加算を行うもので、X、
Yの符号はセレクタ4に入力し、又X、Yの指数はセレ
クタ5及び減算器6に入力し、セレクタ4.5では絶対
値の大きな指数の方のものを選択し、選択された符号は
セレクタ12に入力し、選択された指数は減算器2に入
力し、減算器6では指数の差が求められ、求められた値
は右シフト部9に入力する。
In FIG. 5, data X in the first floating point format loaded into the accumulator 1 and data Y in the second floating point format loaded into the register 3 are added.
The sign of Y is input to selector 4, and the exponents of The selected exponent is input to the selector 12 and input to the subtracter 2, the difference between the exponents is determined by the subtracter 6, and the determined value is input to the right shift section 9.

又X、Yの仮数はセレクタ7.8に入力し、セレクタ8
では指数の大きい方を選択して加算器1■に入力し、セ
レクタ7では指数の小さい方を選択し右シフト部9に入
力し、減算器6より人力する指数の差だけ右シフトし、
反転制御部10に入力し、減算となる時は反転制御し、
加算器11に入力する。
In addition, the mantissas of X and Y are input to selector 7.8, and
Then select the larger exponent and input it to the adder 1■, use the selector 7 to select the smaller exponent and input it to the right shift section 9, and use the subtracter 6 to manually shift it to the right by the difference in exponents.
It is input to the inversion control section 10, and when it becomes subtraction, it is inverted and controlled.
Input to adder 11.

加算器11では、加算の時は加算し、減算の時はキャリ
入力1を入力して加算し、加算結果を補数器13に入力
し、又符号はセレクタ12に入力する。
The adder 11 performs addition when performing addition, inputs carry input 1 and performs addition during subtraction, inputs the addition result to complementer 13, and inputs the sign to selector 12.

補数器13では、加算器11での加算結果が負の時は補
数をとり、正の時はその侭、左シフト部16及びブライ
オリチイエンコーダ14に入力する。
In the complementer 13, when the addition result in the adder 11 is negative, it is complemented, and when it is positive, it is inputted to the left shift section 16 and the bias encoder 14.

ブライオリチイエンコーダ14では、最初の1がどこに
あるかを見つけ、左シフト部16に入力した値を1.f
の形にするように左シフトし、仮数として出力する。
In the Brioliichi encoder 14, find where the first 1 is and change the value input to the left shift section 16 to 1. f
Shift it to the left so that it has the form , and output it as the mantissa.

又この左シフトする値を、プライオリチイエンコーダ1
4より減算器2に入力し、セレクタ5より入力している
指数との減算を行い指数として出力する。
Also, this value to be shifted to the left is set to the priority encoder 1.
4 to the subtracter 2, subtracts it from the exponent input from the selector 5, and outputs it as an exponent.

セレクタ12では、X、Yの指数が等しい時は、加算器
11よりの符号を選択し、X、 Yの指数が等しくない
時はセレクタ4よりの符号を選択し、符号として出力す
る。
The selector 12 selects the code from the adder 11 when the exponents of X and Y are equal, and selects the code from the selector 4 when the exponents of X and Y are not equal, and outputs it as a code.

出力された加算結果の、符号、指数、仮数はアキュムレ
ータlにロードされる。
The sign, exponent, and mantissa of the output addition result are loaded into the accumulator l.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

しかしながら、上記説明の如く、従来の浮動小数点形式
のデータを取り扱うDSPでは、2″倍或いは1/2・
倍する時、算術シフト命令が使用出来なく、2″倍或い
は1/2″倍する時の命令のステップ数が多く又レジス
タが多く必要となる問題点がある。
However, as explained above, in DSPs that handle conventional floating point data,
When multiplying, an arithmetic shift instruction cannot be used, and when multiplying by 2'' or 1/2'', the number of instruction steps is large and many registers are required.

本発明は、浮動小数点形式のデータを取り扱うDSPで
、2″倍或いは1/2’倍する時、算術シフト命令が使
用出来る2″倍演算回路の提供を目的としている。
The present invention aims to provide a 2'' arithmetic circuit that can use an arithmetic shift instruction when multiplying by 2'' or 1/2' in a DSP that handles data in floating point format.

〔課題を解決するための手段〕[Means to solve the problem]

第1図は本発明の原理ブロック図である。 FIG. 1 is a block diagram of the principle of the present invention.

第1図に示す如く、アキュムレータ1にロードされた浮
動小数点形式のデータの指数及び2″倍する場合の指数
nを加算部2に入力し、加算結果を該アキュムレータ1
にロードされた浮動小数点形式のデータの指数とする。
As shown in FIG.
be the exponent of the floating-point format data loaded into .

〔作 用〕[For production]

本発明によれば、算術シフト命令により指定されたシフ
ト数nは、加算部2に入力し、20倍する時は加算1/
2’倍する時は減算し、加算結果は、アキュムレータ1
にロードされた浮動小数点形式のデータの指数となるの
で、固定小数点形式のデータを、2″倍或いは1/2n
倍する時の、第3図(C)に示す3ステツプの命令で実
行可能となり、又レジスタも、アキュムレータがあれば
可能となり、レジスタは不要となる。
According to the present invention, the shift number n specified by the arithmetic shift instruction is input to the adder 2, and when multiplied by 20, the shift number n is inputted to the adder 2.
When multiplying by 2', subtract and add the result to accumulator 1.
This is the exponent of the floating point format data loaded into the fixed point format data by 2'' or 1/2n
When multiplying, it can be executed with the 3-step instruction shown in FIG. 3(C), and the register can also be executed if there is an accumulator, so no register is required.

〔実施例〕〔Example〕

路を追加したブロック図である。 FIG.

第2図にて、第5図の従来例の加算回路と異なる点は、
加算以外に、1/2n倍又−1i9−2″倍演算を行う
ようにする為に、ブライオリチイエンコーダ14の出力
か、算術シフト命令にて指示されたシフト数nかを選択
して減算器2へ入力させるセレクタ15及び、加算回路
の出力の符号が、アキュムレータ1にロードしたデータ
の符号かを選択出力するセレクタ17及び、加算回路の
出力の仮数か、アキュムレータlにロードしたデータの
仮数かを選択出力するセレクタ18を設け、1/2″倍
の演算又←2″倍の演算を行う時は、セレクタ15は、
算術シフト命令にて指示されたシフト数nを選択出力し
、セレクタ17は、アキュムレータ1にロードしたデー
タの符号を選択出力し、セレクタ18は、アキュムレー
タ1にロードしたデータの仮数を選択出力するようにし
た点であり、この異なる点を中心に以下説明する。
In Fig. 2, the difference from the conventional adder circuit in Fig. 5 is as follows.
In addition to addition, in order to perform 1/2n times or -1i9-2'' times operations, subtraction is performed by selecting either the output of the Brioliarity encoder 14 or the shift number n specified by the arithmetic shift instruction. a selector 15 that selects and outputs whether the sign of the output of the adder circuit is the sign of the data loaded into the accumulator 1; and a selector 17 that selects and outputs whether the sign of the output of the adder circuit is the sign of the data loaded into the accumulator 1, and the mantissa of the output of the adder circuit or the mantissa of the data loaded into the accumulator l. A selector 18 is provided to select and output either of the following:
The selector 17 selectively outputs the shift number n specified by the arithmetic shift instruction, the selector 17 selectively outputs the sign of the data loaded into the accumulator 1, and the selector 18 selectively outputs the mantissa of the data loaded into the accumulator 1. This point will be explained below, focusing on this different point.

算術シフト命令を用いる時は、強制的にアキュムレータ
1の指数を、セレクタ5を通して減算器2に入力する。
When using an arithmetic shift instruction, the exponent of accumulator 1 is forcibly input to subtracter 2 through selector 5.

セレクタ15は、算術シフト命令にて指示されたシフト
数nを選択出力して減算器2に入力するようにし、セレ
クタ1718では、アキュムレータ1にロードした符号
、仮数を選択出力するようにする。
The selector 15 selectively outputs the shift number n specified by the arithmetic shift instruction and inputs it to the subtracter 2, and the selector 1718 selectively outputs the sign and mantissa loaded into the accumulator 1.

そして、固定小数点形式のデータを1/2”倍2″倍す
る場合と同じく、第3図(C)に示す、(1)アキュム
レータに2″倍(又は1/2”倍)するデータをロード
、(2)1/2”倍の時はn、2fi倍の時は−nシフ
ト、(3)アキュムレータからメモリにロードの命令を
出すと、減算器2にて、アキュムレータ1にロードされ
ているデータの指数より、nが減算されたり、加算され
、アキュムレータ1にロードされているデータの指数と
置き代えられ、メモリにロードされる。
Then, in the same way as when multiplying fixed-point format data by 1/2" times 2", as shown in Figure 3 (C), (1) Load the data to be multiplied by 2" (or 1/2") into the accumulator. , (2) Shift n for 1/2'' times, -n shift for 2fi times, (3) When a load instruction is issued from the accumulator to memory, it is loaded into accumulator 1 by subtractor 2. n is subtracted from or added to the data index, replaced with the data index loaded into accumulator 1, and loaded into memory.

即ち、固定小数点形式のデータの場合と同様に0 算術シフトの3ステツプの命令及び3つのレジスタを持
たなくとも172″倍、2′倍の演算が可能となる。
That is, as in the case of fixed-point format data, operations of 172'' and 2' can be performed without the need for a three-step instruction for 0 arithmetic shift and three registers.

[発明の効果〕 以上詳細に説明せる如く本発明によれば、浮動小数点形
式のデータを1/2″倍、2″倍する場合、固定小数点
形式のデータの場合と同様に算術シフトの3ステツプの
命令及び3つのレジスタを持たなくとも1/2”倍、2
・倍の演算が可能となる効果がある。
[Effects of the Invention] As explained in detail above, according to the present invention, when multiplying floating-point format data by 1/2'' or 2'', the three steps of arithmetic shift are performed as in the case of fixed-point format data. instructions and three registers, 1/2” times, 2
・It has the effect of making it possible to perform double calculations.

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

第1図は本発明の原理ブロック図、 加したブロック図、 第3図は固定小数点形式のデータの表現及び算術シフト
及び2′″倍する時のシフト命令を示す図、第4図は1
例の浮動小数点形式のデータの表現及び2″倍する時の
命令を示す図、 第5図は従来例の浮動小数点形式のデータの加算回路で
ある。 図において、 1はアキュムレータ、 2は加算部、減算器、 3はレジスタ、 4.5,7,8.12 15 17 18はセレクタ、 6は減算器、 9は右シフト部、 10は反転制御部、 11は加算器、 13は補数器、 14はプライオリチイエンコーダ、 16は左シフト部を示す。
Fig. 1 is a block diagram of the principle of the present invention; Fig. 3 is a diagram showing fixed-point format data representation and arithmetic shift and shift instructions for multiplying by 2''; Fig. 4 is a block diagram of the present invention.
Figure 5 is a diagram showing an example of the representation of floating point data and an instruction for multiplying it by 2''. Figure 5 is a conventional example of an addition circuit for floating point data. In the figure, 1 is an accumulator, and 2 is an adder. , subtractor, 3 is a register, 4.5, 7, 8.12 15 17 18 is a selector, 6 is a subtracter, 9 is a right shift section, 10 is an inversion control section, 11 is an adder, 13 is a complementer, 14 is a priority encoder, and 16 is a left shift section.

Claims (1)

【特許請求の範囲】[Claims] アキュムレータ(1)にロードされた浮動小数点形式の
データの指数及び2^n倍する場合の指数nを加算部(
2)に入力し、加算結果を該アキュムレータ(1)にロ
ードされた浮動小数点形式のデータの指数とすることを
特徴とする2^n倍演算回路。
Adder unit (
2) and uses the addition result as an exponent of floating point format data loaded into the accumulator (1).
JP2249890A 1990-02-01 1990-02-01 2n fold arithmetic circuit Pending JPH03226831A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2249890A JPH03226831A (en) 1990-02-01 1990-02-01 2n fold arithmetic circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2249890A JPH03226831A (en) 1990-02-01 1990-02-01 2n fold arithmetic circuit

Publications (1)

Publication Number Publication Date
JPH03226831A true JPH03226831A (en) 1991-10-07

Family

ID=12084411

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2249890A Pending JPH03226831A (en) 1990-02-01 1990-02-01 2n fold arithmetic circuit

Country Status (1)

Country Link
JP (1) JPH03226831A (en)

Similar Documents

Publication Publication Date Title
EP0182963B1 (en) An adder for floating point data
KR920005226B1 (en) Floating point arithmetic units
US5963461A (en) Multiplication apparatus and methods which generate a shift amount by which the product of the significands is shifted for normalization or denormalization
JP4482052B2 (en) Arithmetic apparatus and arithmetic method
JPH04290122A (en) Numerical expression conversion device
JPH0690668B2 (en) Fuzzy computing device
JPH01209530A (en) Arithmetic unit for exponent function
JPH0346024A (en) Floating point computing element
JPH03226831A (en) 2n fold arithmetic circuit
JPH04172526A (en) Floating point divider
JPH0251732A (en) Floating point computing element
US6792442B1 (en) Signal processor and product-sum operating device for use therein with rounding function
JP2951685B2 (en) Fixed-point arithmetic unit
JPH0225924A (en) Floating point arithmetic processor
JPH0291724A (en) Arithmetic unit
JPH0357488B2 (en)
JPH04160533A (en) Microprocessor
JPH01111229A (en) Floating point adder/subtractor
JPH04205559A (en) Vector arithmetic unit
JPS6177964A (en) Digital signal processor
JPH0361224B2 (en)
JPH0644041A (en) Floating point arithmetic unit
JPS5958542A (en) Multiplying circuit
JPH1069372A (en) Arithmetic executing method and arithmetic unit
JPH0239233A (en) Floating point adder