JPS6116325A - Floating point operating system - Google Patents

Floating point operating system

Info

Publication number
JPS6116325A
JPS6116325A JP59135176A JP13517684A JPS6116325A JP S6116325 A JPS6116325 A JP S6116325A JP 59135176 A JP59135176 A JP 59135176A JP 13517684 A JP13517684 A JP 13517684A JP S6116325 A JPS6116325 A JP S6116325A
Authority
JP
Japan
Prior art keywords
data
point
fixed
floating
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
JP59135176A
Other languages
Japanese (ja)
Inventor
Ryoichi Miyamoto
宮本 良一
Atsushi Shinpo
敦 新保
Kenichiro Hosoda
細田 賢一郎
Osamu Noguchi
修 野口
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 JP59135176A priority Critical patent/JPS6116325A/en
Publication of JPS6116325A publication Critical patent/JPS6116325A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To shorten the processing time by using a memory, where correspondence relations are stored, for mutual conversion between fixed point expression and floating point expression. CONSTITUTION:A sign SB of a data expression XB of fixed point expression of a multiplier B is set to data RAM4, and the magnitude part of the expression XB is used as the address to obtain a floating point expression from a ROM10. A multiplicand A is stored in the data RAM4. With respect to signs, exclusive OR is operated through an arithmetic logic circuit (ALU)1, and the result is stored in the RAM. Mantissa parts are multiplied through a multiplier 3, and data is stored in the RAM4. These results are combined through the ALU1 to address a ROM11, thereby obtaining the floating point expression of the operation result.

Description

【発明の詳細な説明】 (産業上の利用分野) この発明は浮動小数点演算方式に関し、より詳細にはデ
ジタルシグナルプロセッサにおける浮動小数点表示され
たデータと固定小数点表示されたデータとの相互変換方
式に関する。
[Detailed Description of the Invention] (Industrial Application Field) The present invention relates to a floating point arithmetic method, and more particularly to a mutual conversion method between floating point data and fixed point data in a digital signal processor. .

(従来の技術) 従来のデジタルシグナルプロセッサC以下DSPと称す
)では、演算法として浮動小数点データの演算と固定小
数点データの演算の混在は一般的には用いられず、どち
らかの演算法で統一して行なわれている。固定小数点デ
ータの演算を行なうDSPにおいて特に乗算を行なう場
合、固定小数点データのビット長により演算精度が決−
!V、精度を上げるためには浮動小数点表示による演算
を行なう必要が生じてくる。この場合一度固定小数点デ
ータをビットシフトおよびビットのマスキングを行なう
ことにより浮動小数点表示に直して符号部、指数部、仮
数部別に各々固定小数点演算をすることにより浮動小数
点演算を行なっている。
(Prior art) In conventional digital signal processors C (hereinafter referred to as DSP), it is generally not used to mix floating-point data calculations and fixed-point data calculations, and only one calculation method is used. It is carried out as follows. Especially when performing multiplication in a DSP that operates on fixed-point data, the bit length of the fixed-point data determines the operational accuracy.
! V. In order to increase precision, it becomes necessary to perform calculations using floating point representation. In this case, fixed-point data is converted into floating-point representation by bit shifting and bit masking, and floating-point calculations are performed by performing fixed-point calculations on each of the sign part, exponent part, and mantissa part.

そして演算結果を固定小数点表示に変換する時は、演算
結果の仮数部を指数部で表わさ力る数だけシフトして符
号を付与して編集することにより固定小数点表示のデー
タを求めることが行なわれている。
When converting the calculation result to fixed-point representation, the data in fixed-point representation is obtained by shifting the mantissa of the calculation result by the number represented by the exponent, adding a sign, and editing. ing.

第2図は従来のDSPの構成例である。DSPのアーキ
テクチャは種々の方法が考案されているが、その構成と
しては第2図に示すような例が一般的DSPの構成であ
る。構成要素としては算術論理演算器1(以下A L 
Uと称す)、アキュムレータ2(以下ACCと称す)9
乗算器3(以下MPYと称す)、データRAM4.デー
タT’LOM5、入出力インターフェース部7(以下I
10と称す)および命令プログラムROM 6 (以下
命令ROMと称す)とシーケンスコントローラ8が主要
なもので=l、それに加えてシフタ9.命令デコーダ1
2.  フラグレジスタ13.アドレス制御部14等が
通常備えられている。
FIG. 2 shows an example of the configuration of a conventional DSP. Although various methods have been devised for the DSP architecture, an example of the configuration shown in FIG. 2 is a typical DSP configuration. As a component, the arithmetic logic unit 1 (hereinafter referred to as A L
), accumulator 2 (hereinafter referred to as ACC) 9
Multiplier 3 (hereinafter referred to as MPY), data RAM 4. Data T'LOM5, input/output interface section 7 (hereinafter I
10), an instruction program ROM 6 (hereinafter referred to as instruction ROM), and a sequence controller 8 are the main ones, and in addition, a shifter 9. Instruction decoder 1
2. Flag register 13. An address control section 14 and the like are normally provided.

以下第2図に基いて固定小数点表示データから浮動小数
点表示データへの変換処理、浮動小数点表示データの演
算処理および浮動小数点表示データから固定小数点表示
データへの変換処理について乗算AxB、=0(A被乗
数、8乗数、C積を示す)を例にして詳細に説明する。
Based on FIG. 2, the following describes the conversion process from fixed-point display data to floating-point display data, the arithmetic processing of floating-point display data, and the conversion process from floating-point display data to fixed-point display data. Multiplication AxB, = 0 (A The multiplicand, the 8 multiplier, and the C product will be explained in detail by taking as an example.

なお第3図に乗算処理におけるデータ形式を示しており
、(a)は固定小数点表示データ、 (t)) 、 (
c) 、 (d)idそれぞれ(a)を浮動小数点変換
したときの仮数部の符号表示データ、仮数部表示データ
および指数部表示データの形式を示しており、(e)は
(b) 、 (c) 、 (d)を一つのデータ形式に
寸とめて&m 4(’: L7たときの浮動小数点表示
データの形式を示している。(f)ld (c)(d)
を一つにまとめたものである。以下データAの(a)表
示XA。
Note that Figure 3 shows the data format in multiplication processing, where (a) is fixed-point display data, (t)), (
c) and (d) id respectively show the formats of sign display data, mantissa display data, and exponent display data of the mantissa part when (a) is converted to floating point, and (e) is (b), ( c) and (d) are reduced to one data format &m 4(': Shows the format of floating point display data when L7 is used. (f) ld (c) (d)
It is a collection of the following. (a) Display XA of data A below.

データBのCb)表示SB、(c)表示MB 、 (d
)表示EB、データCの(e)表示FCというように表
現する。
Cb) display SB of data B, (c) display MB, (d
) display EB, and (e) display FC of data C.

まず被乗gりAは(bl (cl、 (d)表示!/(
よりそn、ぞ)1SA 、 MA 、 EAとして別々
に、また乗数Bは(a)表示XBとしてそれぞれデータ
R,AM 4に格納されているとする。乗算AxBを行
なうためには、乗数Bを浮動小数点表現に変換する必要
がある。従来この処理を行なうにはデータRAM4から
取り出されたデータBの(a)表示XBとデータROM
5から引かれたビットのマスクパターン(10・・・・
0)をALUlに入力して小数点以下側ビット目に”1
パが立っているか順次XT3をシフタ9を通してシフト
する処理によりデータBの(d)表示EBをカウントア
ツプして決め、しかる後にEBにより決まる数だけXB
をシフタ9によυ左シフトしてlI+が立つているビッ
トを先頭に持ってさらに右詰にするため右シフトしてデ
ータBの(C)表示MBを得る。またデータBの(1)
)表示SBはXBの符号を抜き出して得られ、これらS
B 、 EB 、 、MBがデータRAM4に格納され
る。次に乗算処理は符号についてはSAとSBをALU
 1を通して排他論理和演算を行ない、結果をデータT
(AM、iにデータCのQ))表示Scとして格納する
。指数部について(はEA、l!:EBをALU IM
PY3を通して固定小数点乗算を行ない演算結果を(c
)表示になるようにシフタ9でシフトを行ないデータR
AM4に格納する。
First, the multiplier g A is (bl (cl, (d) display!/(
Assume that the multiplier B is stored in data R and AM 4 as (a) display XB, respectively, as SA, MA, and EA. To perform the multiplication AxB, it is necessary to convert the multiplier B to floating point representation. Conventionally, in order to perform this process, (a) display XB of data B taken out from data RAM 4 and data ROM
Mask pattern of bits subtracted from 5 (10...
0) into ALU1 and put "1" in the bit below the decimal point.
(d) display EB of data B is counted up and determined by sequentially shifting XT3 through the shifter 9, and then XB is determined by the number determined by EB.
is shifted to the left by the shifter 9, the bit where lI+ is set is placed at the beginning, and further shifted to the right to be right-aligned to obtain (C) display MB of data B. Also, data B (1)
) Display SB is obtained by extracting the sign of XB, and these S
B, EB, , MB are stored in the data RAM 4. Next, the multiplication process uses SA and SB as ALU for the sign.
Exclusive OR operation is performed through 1, and the result is stored as data T.
(Q of data C in AM, i)) Store as display Sc. Regarding the exponent part (is EA, l!:EB is ALU IM
Fixed-point multiplication is performed through PY3 and the result is converted to (c
) is displayed using shifter 9 and data R is displayed.
Store in AM4.

以上のような処理により浮動小数点表示による乗算が行
なわれている。そしてデータCを浮動小数点表示8c、
;7 MO、&から固定小数点表示Xcに変換する場合
は、データRAM4からSc、Mc、Bcを引いてきて
まず(C)表示M(、をEcにより決まる数だけ’AL
U1およびシフタ9を通して左シフトする演算処理をし
て、その結果にScを付加することによりXCを求める
Multiplication using floating point representation is performed through the processing described above. Then data C is displayed as a floating point number 8c,
;7 To convert from MO, & to fixed-point representation
XC is obtained by performing arithmetic processing to shift left through U1 and shifter 9, and adding Sc to the result.

(発明が解決しようとする問題点) しかしながら、このような従来の方式[6っては、上記
の説明かられかるように、固定小数点表示から浮動小数
点表示に変換する処理ステップ数及びその逆の変換処理
ステップ数は多く、従って処理時間が長くなりDSPの
処理能力に限界が生じ、複雑な処理が困難であるという
問題点があった0 従って、この発明の目的はこれらの従来の問題点を解消
することにある。
(Problem to be Solved by the Invention) However, as can be seen from the above explanation, such a conventional method [6] requires the number of processing steps for converting from fixed-point representation to floating-point representation and vice versa. The number of conversion processing steps is large, which increases the processing time, limits the DSP processing ability, and makes complex processing difficult. Therefore, the purpose of the present invention is to solve these conventional problems. The goal is to eliminate it.

C問題点を解決するための手段) この発明は、固定小数点表示されたデータの演算を行な
う際に、演算されるべきデータを浮動小数点表示に変換
して指数部と仮数部を個別に演算し、演算結果の浮動小
数点表示を固定小数点表示に変換する演算方式において
、前記固定小数点表示と浮動小数点表示との相互の変換
を、個々の固定小数点表示と浮動小数点表示との対応関
係を格納する記憶手段を用いて行なう浮動小数点演算方
式にある。
Means for Solving Problem C) This invention, when performing arithmetic operations on data expressed in fixed point numbers, converts the data to be operated on to floating point expressions and calculates the exponent and mantissa parts separately. , in an arithmetic method for converting a floating point representation of an arithmetic result into a fixed point representation, a memory for storing correspondence between each fixed point representation and floating point representation for mutual conversion between the fixed point representation and the floating point representation; It is a floating point arithmetic method that uses means.

(作用) この発明の技術的手段は次のとおり作用する。(effect) The technical means of this invention operates as follows.

個々の固定小数点表示と浮動小数点表示との相互関係は
予め記憶手段に格納されて(/−する。従って、変換時
に必要とす十関係を記憶手段から読出す動作だけで所望
の変換が簡単に得られる。
The correlation between each fixed-point representation and floating-point representation is stored in advance in the storage means (/-). Therefore, the desired conversion can be easily performed by simply reading out the ten relationships required at the time of conversion from the storage means. can get.

(実施例) 以下、この発明を一実施例に基づき図面を参照して詳細
に説明する。
(Example) Hereinafter, the present invention will be described in detail based on an example with reference to the drawings.

第1図は、この発明の一実施例のブロック図である。図
中、第2図と同一の構成要素は同一の参照番号を付す。
FIG. 1 is a block diagram of one embodiment of the present invention. In the figure, the same components as in FIG. 2 are given the same reference numerals.

この実施例の特徴は、破線で囲まれた固定小数点表示に
対応した浮動小数点表示を格納するFLP−ROMl0
及び小数点表示に対応した固定小数点表示を格納するF
IX・ROM11を設けたことにある。
The feature of this embodiment is that the FLP-ROM 10, which stores floating point representations corresponding to fixed point representations surrounded by broken lines, is
and F that stores fixed decimal point display corresponding to decimal point display.
This is due to the provision of IX・ROM11.

次に、前述の乗算を例にして動作を説明すると、データ
Bの(a)表示XBの符号SBを予めデータRAM4に
セットしておき、XBのマグニチーード部分をアドレス
として(f)表示による符号を除く浮動小数点表示をF
LIP−ROM10よジ得られる。このようにマグニチ
ーード部分だけでアドレスすることによりROMのワー
ド数削減につながる。そして乗数BをSB 、 MB 
、 EBとして分離してデータRAM4て格納する。被
乗数Aは既にSA 、 MA 、 BAとしてデータR
AM4に格納されているので浮動小数点表示の乗算は、
符号についてはSAとSBをAT、Ulを通して排他論
理和演算を行ない結果をデータRAM4にデータCの(
+))表示Scとして格納する。
Next, to explain the operation using the above-mentioned multiplication as an example, (a) the sign SB of the displayed XB of the data B is set in advance in the data RAM 4, and (f) the sign according to the display is set using the magnicido part of XB as an address. F excluding floating point representation
LIP-ROM10 is obtained. In this way, addressing only the magniceed portion leads to a reduction in the number of words in the ROM. And the multiplier B is SB, MB
, EB and stored in the data RAM 4. Multiplicand A is already data R as SA, MA, BA
Since it is stored in AM4, multiplication in floating point representation is
Regarding the sign, perform exclusive OR operation on SA and SB through AT and Ul, and store the result in data RAM 4 of data C (
+)) Stored as display Sc.

指数部はEAとEBをAT、Ulを通して加算を行ない
データCの(d)表示ECとしてデータR,AM4に格
納する。仮数部ばMAとMBをMPYaを通して固定小
数点乗算を行ない、演算結果を(C)表示になるようシ
フタ9でシフトしてデータRAM4に格納する。こうし
て得られたデータAとBの乗算結果Cの固定小数点表示
を求めるには、演算結果の浮動小数点表示sc、 EC
,McをALUを通して結合して編集しデータ0の(e
)表示としてFIX−ROMIIをアドレスすることに
よりデータCの(a)表示Xcが多くの処理を必要とせ
ず簡単に求めることができる。なお、浮動小数点表示の
指数部表示の(d)(e)(flのEのビット数を、(
a)表示Xcを表現するのに必要なビット数より1ビッ
ト多く持つことにより、浮動小数点表示の乗算等で桁が
オーバフローした場合の適切なオーバーフロー処理を、
浮動小数点表示から固定小数点表示に変換するFIX4
0Mに含ませて行なうことができる。
The exponent part adds EA and EB through AT and Ul, and stores it in data R and AM4 as (d) display EC of data C. Fixed-point multiplication is performed on the mantissa parts MA and MB through MPYa, and the result of the operation is shifted by the shifter 9 so as to be displayed in (C) and stored in the data RAM 4. To obtain the fixed point representation of the multiplication result C of data A and B obtained in this way, the floating point representation of the calculation result sc, EC
, Mc are combined and edited through ALU, and data 0 (e
) By addressing FIX-ROMII as a display, (a) display Xc of data C can be easily obtained without requiring much processing. Note that the number of bits of E in (d), (e), and (fl) in the exponent part of the floating point representation is (
a) By having one bit more than the number of bits required to express the display
FIX4 to convert from floating point display to fixed point display
It can be carried out by including it in 0M.

この実施例によれば、固定小数点表示のDSPによる浮
動小数点演算において、固定小数点表示のデータを浮動
小数点表示に変換する処理および浮動小数点表示のデー
タを固定小数点表示に変換する処理を各々ROMを用い
て行なうことにより大巾な処理ステップの軽減を計れる
利点がある。
According to this embodiment, in floating point calculations by a DSP with fixed point representation, the ROM is used for the processing of converting data in fixed point representation to floating point representation and the processing of converting data in floating point representation to fixed point representation. By doing so, there is an advantage that a large number of processing steps can be reduced.

また固定小数点表示から浮動小数点表示に変換する場合
、マグニチュードのみでROMを参照し符号はROMを
引いた結果に付与して処理するのでワード長が減ってR
OMの削減につながる。さらに浮動小数点表示から固定
小数点表示に変換するときは、指数部のビット長を1ビ
ット多く持つことにより適切なオーバーフロ一対策をと
ることが可能−となる。
Also, when converting from fixed-point representation to floating-point representation, the ROM is referenced only by the magnitude, and the sign is added to the result of subtracting the ROM, so the word length is reduced and the R
This leads to a reduction in OM. Furthermore, when converting from floating point representation to fixed point representation, it is possible to take appropriate measures against overflow by increasing the bit length of the exponent part by one bit.

(発明の効果) 以上説明したように、この発明によれば、デジタルシグ
ナルプロセッサを用いて処理時間が短かい浮動小数点演
算方式を提供することができる。
(Effects of the Invention) As described above, according to the present invention, it is possible to provide a floating point arithmetic method that uses a digital signal processor and has a short processing time.

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

第1図はこの発明の一実施例のブロック図、第る処理デ
ータ形式を示す図である。 1・・・算術論理演算器(AT、T、J)、2・・・ア
キエム1/−タ(ACO)、3・・・乗算器(MPY)
、 4・・・データR,A−M。 5・・・データROM。 6・・・命令ROM。 7・入出力インターフェース部(Ilo)、8 シーケ
ンスコントローラ、 9・・・シック、 10・・・FLP−11(、OM。 11・・・FIX−ROM。 12・・・命令デコーダ、 13・・フラグレジスタ、 14・・・アドレス制御部、 RO−TL4−・・・レジスタ、 80、81 、・・セレクタ〇
FIG. 1 is a block diagram of an embodiment of the present invention and a diagram showing a first processing data format. 1... Arithmetic logic unit (AT, T, J), 2... Akyem 1/-ta (ACO), 3... Multiplier (MPY)
, 4...Data R, A-M. 5...Data ROM. 6...Instruction ROM. 7. Input/output interface unit (Ilo), 8 Sequence controller, 9... Thick, 10... FLP-11 (, OM. 11... FIX-ROM. 12... Instruction decoder, 13... Flag Register, 14...Address control unit, RO-TL4-...Register, 80, 81,...Selector〇

Claims (1)

【特許請求の範囲】[Claims] 固定小数点表示されたデータの演算を行なう際に、演算
されるべきデータを浮動小数点表示に変換して指数部と
仮数部を個別に演算し、演算結果の浮動小数点表示を固
定小数点表示に変換する演算方式において、前記固定小
数点表示と浮動小数点表示との相互の変換を、個々の固
定小数点表示と浮動小数点表示との対応関係を格納する
記憶手段を用いて行なうことを特徴とする浮動小数点演
算方式。
When performing calculations on fixed-point data, convert the data to be calculated into floating-point representation, calculate the exponent and mantissa parts separately, and convert the floating-point representation of the calculation result to fixed-point representation. A floating point arithmetic method characterized in that the mutual conversion between the fixed point representation and the floating point representation is performed using a storage means for storing the correspondence between each fixed point representation and floating point representation. .
JP59135176A 1984-07-02 1984-07-02 Floating point operating system Pending JPS6116325A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59135176A JPS6116325A (en) 1984-07-02 1984-07-02 Floating point operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59135176A JPS6116325A (en) 1984-07-02 1984-07-02 Floating point operating system

Publications (1)

Publication Number Publication Date
JPS6116325A true JPS6116325A (en) 1986-01-24

Family

ID=15145608

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59135176A Pending JPS6116325A (en) 1984-07-02 1984-07-02 Floating point operating system

Country Status (1)

Country Link
JP (1) JPS6116325A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02126317A (en) * 1988-11-04 1990-05-15 Fujitsu Ltd Data format converting system
JP2004213622A (en) * 2002-12-27 2004-07-29 Arm Ltd Data processing device and method converting number between fixed point display and floating point display

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02126317A (en) * 1988-11-04 1990-05-15 Fujitsu Ltd Data format converting system
JP2004213622A (en) * 2002-12-27 2004-07-29 Arm Ltd Data processing device and method converting number between fixed point display and floating point display

Similar Documents

Publication Publication Date Title
US5220524A (en) Machine method to perform newton iterations for reciprocals
US4969118A (en) Floating point unit for calculating A=XY+Z having simultaneous multiply and add
JPH10214176A (en) Device for quickly calculating transcendental function
US5206823A (en) Apparatus to perform Newton iterations for reciprocal and reciprocal square root
US6115729A (en) Floating point multiply-accumulate unit
US5157624A (en) Machine method to perform newton iterations for reciprocal square roots
CN109901813A (en) A kind of floating-point operation device and method
US5144576A (en) Signed digit multiplier
JPH07234778A (en) Arithmetic circuit
JPS6116325A (en) Floating point operating system
JPH0540605A (en) Floating point multiplier
JPH04172526A (en) Floating point divider
JP3517162B2 (en) Division and square root arithmetic unit
JPH0831024B2 (en) Arithmetic processor
JPH0578049B2 (en)
JPS6285333A (en) Round-off processing system for floating point multiplier
JP3137131B2 (en) Floating point multiplier and multiplication method
JPS6149234A (en) Multiplier circuit for floating point
JP4428778B2 (en) Arithmetic device, arithmetic method, and computing device
JP3201097B2 (en) Multiplication prescription method in multiplier
JP2624738B2 (en) Rounding method
JPS63254525A (en) Dividing device
JPH06301710A (en) Method and device for double precision product-sum operation
JP3522387B2 (en) Pipeline arithmetic unit
JPH0383126A (en) Floating-point multiplier