JPS62216033A - Data conversion processing system - Google Patents

Data conversion processing system

Info

Publication number
JPS62216033A
JPS62216033A JP61058950A JP5895086A JPS62216033A JP S62216033 A JPS62216033 A JP S62216033A JP 61058950 A JP61058950 A JP 61058950A JP 5895086 A JP5895086 A JP 5895086A JP S62216033 A JPS62216033 A JP S62216033A
Authority
JP
Japan
Prior art keywords
data
decimal
base
floating point
conversion
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
JP61058950A
Other languages
Japanese (ja)
Inventor
Yasuko Matsushima
松島 康子
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 JP61058950A priority Critical patent/JPS62216033A/en
Publication of JPS62216033A publication Critical patent/JPS62216033A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To decrease the number of function parts for conversion of data by using as intervention the floating decimal point data containing the exponent value having 2<8> as its base when the conversion is carried out between several types of floating decimal point data and the pack decimal data. CONSTITUTION:The floating decimal point data 1 and 2 containing the exponent value having 2 as its base or the decimal point data 3 and 4 containing the exponent value having 2<4> as its base are converted into the pack decimal data 5. In such a case, the mantissa data of those data 1-4 are shifted so that 2<8> is defined as a base and then the exponent value is changed to secure a base of 2<8>. Thus the intermediate data 6 serving as the floating decimal point data containing the exponent value having 2<8> as its base is obtained and then multiplied by '10' for an integer part of the mantissa part. While the decimal part of the mantissa data is divided by '10' to obtain the pack decimal data 5. In the same way, the data 5 is converted into the data 6 when the data 5 is converted into the data 1-4. Thus the desired floating decimal point data is obtained.

Description

【発明の詳細な説明】 〔概要〕 第1群の浮動小数点データと第2群の浮動小数点データ
とパック10進データとのいずれか2者間でのデータ変
換を行うデータ処理装置において。
DETAILED DESCRIPTION OF THE INVENTION [Summary] A data processing device that performs data conversion between any two of floating point data of a first group, floating point data of a second group, and packed decimal data.

2Bを底とする指数値をもつ浮動小数点データである中
間データを得る変換処理部をそなえて、当該中間データ
を介在させて上記データ変換を行うよう構成し、データ
変換のための機能部の個数を少なくするようにしたデー
タ変換処理方式が開示されている。
The number of functional units for data conversion is provided with a conversion processing unit that obtains intermediate data that is floating point data having an exponent value with base 2B, and is configured to perform the data conversion using the intermediate data, and the number of functional units for data conversion. A data conversion processing method is disclosed that reduces the amount of data.

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

本発明は、データ変換処理方式、特に、複数種類の浮動
小数点データやパック10進データについてのいずれか
2者間のデータ変換に当って、中間データを得る過程を
介在させるようにしたデータ変換処理方式に関する。
The present invention relates to a data conversion processing method, particularly a data conversion processing that involves a process of obtaining intermediate data when converting data between any two types of floating point data or packed decimal data. Regarding the method.

〔従来の技術〕[Conventional technology]

従来から、データ処理装置においては、第6図図示の如
(、「2を底とする指数値をもつ単精度浮動小数点デー
タJ1.r2を底とする指数値をもつ倍精度浮動小数点
データJ2.「2’を底とする指数値をもつ単精度浮動
小数点データ」3゜「24を底とする指数値をもつ倍精
度浮動小数点データ」4.「バック10進データ」5が
夫々用いられることがあり、かつ必要に応じて図示矢印
で示す如き相互データ変換を行うようにされる。
Conventionally, in a data processing device, as shown in FIG. "Single precision floating point data with an exponent value of base 2'" 3. "Double precision floating point data with an exponent value of base 24" 4. "Back decimal data" 5 can be used respectively. There is mutual data conversion as indicated by the arrows in the figure, as necessary.

なお、上記図示の場合、データ1とデータ2とを本明細
書において第1群の浮動小数点データと呼び、データ3
とデータ4とを第2群の浮動小数点データと呼んでいる
。そして、それら各データにおける指数部の・ビット数
と仮数部のビット数とは、夫々、第7図にまとめて示す
如きものである。
In the case shown above, data 1 and data 2 are referred to as the first group of floating point data in this specification, and data 3 is referred to as the first group of floating point data.
and data 4 are called the second group of floating point data. The number of bits of the exponent part and the number of bits of the mantissa part in each of these data are summarized in FIG. 7, respectively.

第7図から判る如く、データ1とデータ2とでは指数部
のビット数が異なるが、データ3とデータ4とでは指数
部のビット数が同じである。このことを考慮して、従来
においては、第6図図示矢印の如く変換を行う変換機能
部を合計7個用意するようにされていた。
As can be seen from FIG. 7, data 1 and data 2 have different numbers of bits in their exponent parts, but data 3 and data 4 have the same number of bits in their exponent parts. In consideration of this, in the past, a total of seven conversion function units were prepared as indicated by arrows in FIG. 6 for performing conversion.

第8図はパック10進データと浮動小数点データ(図示
の場合はデータ2の例)とのデータ形式%式% 第8図(A)に示すバック10進デークの場合には、#
9バイトの4ビット分が符号部を構成し。
Figure 8 shows the data format of packed decimal data and floating point data (in the case shown, data 2 is an example).
4 bits of 9 bytes constitute the code part.

かつ小数点位置を指示する2バイト分の2進データをも
つ。また第8図(B)に示す浮動小数点データの場合に
は、#7バイトの1ビット分が符号部を構成し、かつ続
く11ビツト分が指数部を構成し、かつ続く52ビツト
分が仮数部を構成している。図示符号部の内容をSとし
、指数部の内容をeとし、仮数部の内容をfとするとき
、当該浮動小数点データは (1)3 *2@−10!ff*(1,f)で表現され
得る。
It also has 2 bytes of binary data indicating the decimal point position. In the case of the floating point data shown in Figure 8(B), 1 bit of the #7 byte constitutes the sign part, the following 11 bits constitute the exponent part, and the following 52 bits constitute the mantissa. It makes up the department. When the content of the illustrated sign part is S, the content of the exponent part is e, and the content of the mantissa part is f, the floating point data is (1)3 *2@-10! It can be expressed as ff*(1, f).

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

従来、第6図に関連して説明した如く、各データ相互間
の変換を行う必要があり、夫々の変換を行うためのデー
タ変換機能部を用意することが必要となる。そして、第
6図図示以外の形式のデータが用いられる場合には、当
該データと各データとの間でのデータ変換機能部を用意
することが必要となる。
Conventionally, as explained in connection with FIG. 6, it is necessary to perform conversion between each data, and it is necessary to prepare a data conversion function unit for performing each conversion. If data in a format other than that shown in FIG. 6 is used, it is necessary to prepare a data conversion function unit between the data and each data.

〔問題点を解決するための手段〕[Means for solving problems]

本発明は、上記の点を解決しており、各種の浮動小数点
データとパック10進データとの間のデータ変換が行わ
れる場合に、28を底とする指数値をもつ浮動小数点デ
ータを得る過程が存在することに着目して、当該28を
底とする指数値をもつ浮動小数点データを中間データと
定め、各種の上記データと当該中間データとの間の変換
機能部を用意するようにしている。
The present invention solves the above points, and provides a process for obtaining floating point data with an exponent value of base 28 when data conversion between various types of floating point data and packed decimal data is performed. Focusing on the existence of , floating-point data with an exponent value with the base of 28 is defined as intermediate data, and a conversion function unit between various types of the above data and the intermediate data is prepared. .

第1図は本発明の原理構成図を示す。図中の符号lは「
2を底とする指数値をもつ単精度浮動小数点データ」、
2は「2を底とする指数値をもつ倍精度浮動小数点デー
タ」、3は「24を底とする指数値をもつ単精度浮動小
数点データ」、4は「24を底とする指数値をもつ倍精
度浮動小数点データ」、5はパック10進データ、6は
中間データであって「2°を底とする指数値をもつ浮動
小数点データ」を表わしている。また符号フないし11
は夫々相互変換機能部を表わしている。なお、中間デー
タ6は、指数部として2バイト(16ビツト)と仮数部
として8バイト (64ビツト)とをもつようにしてい
る。
FIG. 1 shows a basic configuration diagram of the present invention. The code l in the figure is “
"Single-precision floating point data with an exponent value to the base 2",
2 is "double-precision floating-point data with an exponent value of base 2", 3 is "single-precision floating-point data with an exponent value of base 24", and 4 is "with an exponent value of base 24". 5 is packed decimal data, and 6 is intermediate data, which represents "floating point data with an exponent value having a base of 2°." Also, the code ff to 11
each represents a mutual conversion function section. Note that the intermediate data 6 has 2 bytes (16 bits) as an exponent part and 8 bytes (64 bits) as a mantissa part.

〔作用〕[Effect]

第1図図示データ1やデータ2やデータ4を中間データ
6に変換するに当っては、 (i)データ1やデータ2
やデータ4の仮数データを28が底となるようにシフト
し、(ii)指数値が28を底とするように変更する(
8で割る)ようにし、 (iii )中間データ6を得
る。そして、このようにして得た中間データ6について
、仮数データのうちの整数部については10倍し、小数
部は10で割ってパック10進データ5を得るようにし
ている。
In converting data 1, data 2, and data 4 shown in Figure 1 into intermediate data 6, (i) Data 1 and data 2
Shift the mantissa data of data 4 so that the base is 28, and (ii) change the exponent value so that the base is 28 (
(divide by 8) and (iii) obtain intermediate data 6. Then, regarding the intermediate data 6 obtained in this manner, the integer part of the mantissa data is multiplied by 10, and the decimal part is divided by 10 to obtain packed decimal data 5.

またパック10進データ5を中間データ6に変換するに
当っては、 (i)パック10進データを小数以下のデ
ータを含めて整数値とみなして2進データに変換し、(
ii)最上位バイトがOでなくなるまでデータを下位か
ら上位にシフトした上でシフトした数の分だけ指数値を
減じ、  (iii)小数点位置の回数だけ10で割る
(正しい2進データに変換する)。そしてその上で所望
する浮動小数点データを得るようにする。即ち指数デー
タと2進データとを合成して浮動小数点データを作成す
るようにする。
In addition, when converting packed decimal data 5 to intermediate data 6, (i) convert packed decimal data to binary data by treating it as an integer value including data below the decimal number, and (
ii) Shift the data from low to high until the most significant byte is no longer O, then subtract the exponent value by the shifted number, (iii) Divide by 10 for the number of decimal point positions (convert to correct binary data) ). Then, the desired floating point data is obtained. That is, floating point data is created by combining exponent data and binary data.

〔実施例〕〔Example〕

第2図はパンク10進データから浮動小数点データに変
換する処理フローを表わし、第3図は浮動小数点データ
からバンク10進データを得る処理フローを表わしてい
る。即ち、第2図は第1図図示の変換機能部 11→(8又は9又は10) の処理フローに対応している。また第3図は、第1図図
示の変換機能部 (8又は9又は10)→11 の処理フローに対応している。
FIG. 2 shows a processing flow for converting punctured decimal data into floating point data, and FIG. 3 shows a processing flow for obtaining banked decimal data from floating point data. That is, FIG. 2 corresponds to the processing flow of the conversion function unit 11→(8 or 9 or 10) shown in FIG. Further, FIG. 3 corresponds to the processing flow of the conversion function unit (8 or 9 or 10)→11 shown in FIG.

第4図(A)(B)は、第2図図示のフローを具体的に
説明する説明図である。図は、値r12.5Jをもつパ
ック10進データから2を底とする指数値をもつ倍精度
浮動小数点データに変換する状況を表わしている。
4(A) and 4(B) are explanatory diagrams specifically explaining the flow shown in FIG. 2. FIG. The figure represents a situation in which packed decimal data with a value r12.5J is converted to double precision floating point data with a base 2 exponent value.

図中の符号20は値125のパック10進データを表わ
し、21は小数点位置を指示する2進データを表わして
いる。符号22.23は、小数以下のデータを含めて整
数値r125Jとみたデータ20について2進データに
変換した仮数データと指数データとを表わしている。符
号24.25は、仮数データ22について最上位バイト
がOでなくなるまでバイト単位でシフトした結果と、当
該シフトに対応して最上位バイトの指数値が変更された
結果を表わしている。そして、26,27゜28は組と
なって中間データ6を表わしている。
Reference numeral 20 in the figure represents packed decimal data with a value of 125, and 21 represents binary data indicating the decimal point position. Reference numerals 22 and 23 represent mantissa data and exponent data obtained by converting data 20, including data below the decimal number, into binary data, which is regarded as an integer value r125J. Reference numerals 24 and 25 represent the result of shifting the mantissa data 22 in units of bytes until the most significant byte is no longer O, and the result of changing the exponent value of the most significant byte corresponding to the shift. Further, 26, 27° and 28 form a set and represent intermediate data 6.

なおデータ26はデータ24について、データ21が示
す小数点位置の回数骨だけ10で割って得たものである
。またデータ27は上記データ25から計算された指数
データであり、データ28は符号データを表わしている
Note that data 26 is obtained by dividing data 24 by 10 by the number of times at the decimal point indicated by data 21. Further, data 27 is index data calculated from the above data 25, and data 28 represents code data.

符号29はデータ26の2進数表現を表わしている。符
号30は浮動小数点データに変換するためにデータ29
をシフトした結果を表わしている。
Reference numeral 29 represents the binary representation of the data 26. The code 30 is the data 29 for converting to floating point data.
It shows the result of shifting .

符号31は指数データであって、中間データの指数値(
データ27の値)に8を乗した上で7を加算しくOX8
+7)、上記データ29からデータ30への変換過程に
おいてシフトした分を減じ(7−4・)、いわゆる下駄
(値1023)をはかした(3+1023)結果のデー
タである。そして。
Reference numeral 31 is index data, and the index value of intermediate data (
Multiply the value of data 27) by 8 and add 7 to it.
+7), the amount shifted in the conversion process from data 29 to data 30 is subtracted (7-4.), and the so-called geta (value 1023) is removed (3+1023). and.

符号32は、データ30とデータ31とを合成した浮動
小数点データである。なお符号33は、データ32を1
6進表現で表わしたものである。
Reference numeral 32 is floating point data obtained by combining data 30 and data 31. Note that the code 33 represents the data 32 as 1
It is expressed in hexadecimal notation.

第5図は、第3図図示のフローを具体的に説明する説明
図である。図は、値r12.5Jをもつデータ2からパ
ック10進データ5を得る状況を表わしている。
FIG. 5 is an explanatory diagram specifically explaining the flow shown in FIG. 3. The figure represents the situation in which packed decimal data 5 is obtained from data 2 with the value r12.5J.

図中の符号32.33は第4図に対応するものを表わし
ている。符号34,35.36は、データ32について
符号部と指数部と仮数部とに分解したものである。符号
37は、データ35から下駄(値1023)をはずした
結果であって省略されているビットに対しての指数値を
示している。
Reference numerals 32 and 33 in the figure represent those corresponding to FIG. Reference numerals 34, 35, and 36 indicate data 32 decomposed into a sign part, an exponent part, and a mantissa part. Reference numeral 37 is the result of removing geta (value 1023) from data 35, and indicates an exponent value for the omitted bit.

符号38は、最上位バイトに対する指数値に変換した結
果であり、このとき底を28となるようにしている。符
号39は5データ36に対して 2 nが底となるよう
にデータをシフトした結果を表わしている。なお図示デ
ータ38.39が中間データに対応している。
The code 38 is the result of converting the most significant byte into an exponent value, and the base is set to 28 at this time. Reference numeral 39 represents the result of shifting the data to 5 data 36 so that 2 n becomes the base. Note that illustrated data 38 and 39 correspond to intermediate data.

符号40は、データ39について整数部を取出したもの
であり、整数部分のデータを10で割り。
The code 40 is the integer part extracted from the data 39, and the integer part data is divided by 10.

整数データを外部10進の形で取出したものである。即
ち5図示の場合には。
This is integer data extracted in external decimal form. That is, in the case shown in 5.

00001100  ÷ 00001010を行い、商
00000001と剰余00000010とを得て、当
該剰余を10進数に変換して値「F2」を得ている。ま
た 00000001  ÷ 00001010を行い、商
ooooooooと剰余00000001とを得て、当
該剰余を10進数に変換して値「Fl」を得ている。
00001100 ÷ 00001010 is performed to obtain a quotient of 00000001 and a remainder of 00000010, and the remainder is converted to a decimal number to obtain the value "F2". Further, 00000001 ÷ 00001010 is performed to obtain the quotient oooooooo and the remainder 00000001, and the remainder is converted to a decimal number to obtain the value "Fl".

符号41は、データ39について小数部分のデータを1
0倍しながら取出したものであり2図示の場合には。
The code 41 is the decimal part of the data 39.
In the case shown in 2, it is taken out while being multiplied by 0.

10000000  X  00001010を行い、
結果 000001010000・・・ 1バイト桁あふれ部分 を得て、当該桁あふれ部分を10進数に変換して値rF
5Jを得ている。
Do 10000000 x 00001010,
Result 000001010000... Obtain the 1-byte overflow part, convert the overflow part to a decimal number, and get the value rF
I'm getting 5J.

符号42は小数点の桁数を表わしている。そして符号4
3は変換された結果のパック10進データを表わしてい
る。
Reference numeral 42 represents the number of digits of the decimal point. and code 4
3 represents packed decimal data as a result of conversion.

〔発明の効果〕〔Effect of the invention〕

以上説明した如く1本発明によれば2例えば第1図およ
び第6図図示の例で言えば、変換機能部の個数を7個か
ら5個に減少することが可能となっている。
As explained above, according to the present invention, it is possible to reduce the number of conversion function sections from seven to five, for example in the examples shown in FIGS. 1 and 6.

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

第1図は本発明の原理構成図、第2図はパック10進デ
ータを浮動小数点データに変換する一実施例フロー、第
3図は浮動小数点データをパンク10進データに変換す
る一実施例処理フロー、第4図(A)(B)および第5
図は処理例、第6図は従来の場合を説明する説明図、第
7図および第8図はデータの表現B様を説明する説明図
を示す。 図中、1.2は第1群の浮動小数点データ、3゜4は第
2群の浮動小数点データ、5はパック10進データ、6
は中間データ、フないし11は夫々変換機能部を表わし
ている。 特許出願人   富士通株式会社 代理人弁理士  森 1) 寛(外1名)オミ各6!]
月の菖1や七1ツ12町国方 1 圓 処、tlフロー(III 処理)11)−(11η 3 閃 箔2閃 枠 舊!、′e月図ffl 171Xl
Figure 1 is a diagram of the principle configuration of the present invention, Figure 2 is an example flow of converting packed decimal data to floating point data, and Figure 3 is an example process of converting floating point data to punctured decimal data. Flow, Figures 4 (A) (B) and 5
The figure shows an example of processing, FIG. 6 is an explanatory diagram for explaining the conventional case, and FIGS. 7 and 8 are explanatory diagrams for explaining type B of data representation. In the figure, 1.2 is the first group of floating point data, 3°4 is the second group of floating point data, 5 is the packed decimal data, and 6 is the floating point data of the second group.
denotes intermediate data, and F to 11 denote conversion function units, respectively. Patent applicant Fujitsu Ltd. Representative Patent Attorney Mori 1) Hiroshi (1 other person) Omi 6 each! ]
Moon's irises 1 and 71 12 town Kunikata 1 Endokoro, tl flow (III processing) 11) - (11η 3 Sengaku 2 Sengaku 舊!,'e Tsukizu ffl 171Xl

Claims (1)

【特許請求の範囲】 少なくとも、2を底とする指数値をもつ第1群の浮動小
数点データ(1、2)と、2^4を底とする指数値をも
つ第2群の浮動小数点データ(3、4)と、パック10
進データ(5)との間でデータ変換を行うデータ処理装
置において、 2^8を底とする指数値をもつ浮動小数点データである
中間データ(6)を得る変換処理部をそなえ、 当該中間データを得る変換処理部は、当該中間データと
上記第1群の浮動小数点データとの間の相互変換機能部
(8、9)と、 当該中間データと上記第2群の浮動小数点データとの間
の相互変換機能部(10)と、 当該中間データと上記パック10進データとの間の相互
変換機能部(11)と、を少なくともそなえ、 上記第1群の浮動小数点データと上記第2群の浮動小数
点データと上記パック10進データとのいずれか2者間
でのデータ変換に当って、上記変換処理部による中間デ
ータを介在せしめて、変換を行うようにした ことを特徴とするデータ変換処理方式。
[Claims] At least a first group of floating point data (1, 2) with an exponent value of base 2, and a second group of floating point data (1, 2) with an exponent value of base 2^4. 3, 4) and pack 10
A data processing device that performs data conversion to and from decimal data (5), comprising a conversion processing unit that obtains intermediate data (6) that is floating point data with an exponent value having a base of 2^8, and converts the intermediate data into The conversion processing unit that obtains the above includes a mutual conversion function unit (8, 9) between the intermediate data and the floating point data of the first group, and a mutual conversion function unit (8, 9) between the intermediate data and the floating point data of the second group. a mutual conversion function unit (10); and a mutual conversion function unit (11) between the intermediate data and the packed decimal data; A data conversion processing method characterized in that when converting data between any two of the decimal point data and the packed decimal data, the conversion is performed by intervening intermediate data from the conversion processing section. .
JP61058950A 1986-03-17 1986-03-17 Data conversion processing system Pending JPS62216033A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61058950A JPS62216033A (en) 1986-03-17 1986-03-17 Data conversion processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61058950A JPS62216033A (en) 1986-03-17 1986-03-17 Data conversion processing system

Publications (1)

Publication Number Publication Date
JPS62216033A true JPS62216033A (en) 1987-09-22

Family

ID=13099106

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61058950A Pending JPS62216033A (en) 1986-03-17 1986-03-17 Data conversion processing system

Country Status (1)

Country Link
JP (1) JPS62216033A (en)

Similar Documents

Publication Publication Date Title
Maini Digital electronics: principles, devices and applications
US7685214B2 (en) Order-preserving encoding formats of floating-point decimal numbers for efficient value comparison
US5572207A (en) Method and apparatus for numeric-to-string conversion
US6525679B1 (en) Binary to decimal coder/decoder
JPS59149539A (en) Fixed-to-floating point converting device
JPS62216033A (en) Data conversion processing system
EP0332215B1 (en) Operation circuit based on floating-point representation
Sasidharan et al. VHDL Implementation of IEEE 754 floating point unit
Yokoo Overflow/underflow-free floating-point number representations with self-delimiting variable-length exponent field
Matula et al. An order preserving finite binary encoding of the rationals
Maini Digital Electronics: Principles and Integrated Circuits
JPH0216632A (en) Fixed point number/floating point number converting circuit
GB2094525A (en) Programmable read-only memory adder
JPH0831024B2 (en) Arithmetic processor
SU894699A1 (en) Binary-to binary coded decimal code converter
US6128636A (en) Method for interfacing floating point and integer processes in a computer system
Krishnamurthy Complementary two-way algorithms for negative radix conversions
JP2606580B2 (en) Numerical data calculation method
WO1996027831A1 (en) Floating point conversion circuit
Kanner Number base conversion in a significant digit arithmetic
CN117632857A (en) Data processing method, device and equipment
JPH01237822A (en) Decimal converter for floating point data
KR100493010B1 (en) High accuracy division method for digital signal processing
JPH03100722A (en) Processing system for accuracy conversion instruction
JPH03102519A (en) Divider