JPH01183732A - Method and device for conversion between floating point number and integer - Google Patents

Method and device for conversion between floating point number and integer

Info

Publication number
JPH01183732A
JPH01183732A JP63008987A JP898788A JPH01183732A JP H01183732 A JPH01183732 A JP H01183732A JP 63008987 A JP63008987 A JP 63008987A JP 898788 A JP898788 A JP 898788A JP H01183732 A JPH01183732 A JP H01183732A
Authority
JP
Japan
Prior art keywords
data
floating point
addition
bits
point number
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
JP63008987A
Other languages
Japanese (ja)
Inventor
Shigesada Omoto
尾本 林貞
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.)
Daikin Industries Ltd
Original Assignee
Daikin Industries 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 Daikin Industries Ltd filed Critical Daikin Industries Ltd
Priority to JP63008987A priority Critical patent/JPH01183732A/en
Publication of JPH01183732A publication Critical patent/JPH01183732A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To shorten the time required to obtain the value transformed into an integer by making a hidden bit emerge into the mantissa data, setting the mantissa data at a position distant from the exponent data, and taking out only the prescribed number of bits of the lower rank side of the mantissa data. CONSTITUTION:A floating point number holding register 1 holds a normalized floating point number containing the mantissa data showing a part having the prescribed number of bits and less than a decimal point at the lower rank side of the exponent data having the prescribed number of bits. An addition number generating part 2 delivers an addition number where the mantissa data are all equal to 0 and at the same time the higher rank digits of the mantissa data are equal to 1. Then an addition part 3 adds the floating point number to the addition number to obtain the addition result in the form of a floating point number. Thus it is possible to make such a hidden bit that is never shown as it is emerge into the mantissa data and also to set the mantissa data at a position distant from the exponent data. Therefore only the prescribed number of bits can be taken out at the lower rank side of the mantissa data through a conversion data extracting part 4 and the value transformed into an integer can be obtained.

Description

【発明の詳細な説明】 〈産業上の利用分野〉 この発明は浮動小数点数から整数への変換装置および変
換方法に関し、さらに詳細にいえば、グラフィックデイ
スプレィ装置等において、浮動小数点数に対して座標変
換処理等を施すとともに、最終的に整数化された数値デ
ータを得る場合に特に好適な変換装置および変換方法に
関する。
[Detailed Description of the Invention] <Industrial Application Field> The present invention relates to a conversion device and method for converting floating point numbers into integers, and more specifically, the present invention relates to a conversion device and method for converting floating point numbers to integers, and more specifically, to The present invention relates to a conversion device and a conversion method particularly suitable for performing coordinate conversion processing and the like and finally obtaining numerical data converted into integers.

〈従来の技術、および発明が解決しようとする課題〉 従来から広いダイナミックレンジが要求されるとともに
、高い精度が要求される演算を行なう場合には、一般的
に整数演算よりも浮動小数点演算が行なわれる。即ち、
整数演算を行なう場合であっても、ビット数を増加させ
ることにより、ダイナミックレンジを広げ、かつ精度を
高めることができるのであるが、データバスのビット幅
より大−きいビット数で整数を表現すれば、データ転送
のために必要な時間が長くなってしまうという問題があ
るのに対して、浮動小数点数においては、仮数部のビッ
ト数を変化させなくても、指数部のビット数を1だけ増
加させることにより、ダイナミックレンジを2倍にする
ことができるのであるから、データ転送時間の増加を伴
なうことなく、簡単にダイナミックレンジを広げること
ができ、また、ダイナミックレンジを広げるために必要
なビット数が著しく少なくてよいので、仮数部のビット
数を可能な限り増加させることができ、この結、果、精
度をも向上させることができる。このような利点に着目
して、種々の用途において浮動小数点演算が一般的に使
用されるようになってきている。
<Prior art and problems to be solved by the invention> Conventionally, when performing calculations that require a wide dynamic range and high precision, floating point calculations are generally preferred to integer calculations. It will be done. That is,
Even when performing integer operations, it is possible to widen the dynamic range and improve precision by increasing the number of bits, but it is not possible to represent integers with a number of bits larger than the bit width of the data bus. For example, there is a problem that the time required for data transfer increases.In contrast, with floating point numbers, the number of bits in the exponent part can be changed by 1 without changing the number of bits in the mantissa part. By increasing the dynamic range, the dynamic range can be doubled, so the dynamic range can be easily expanded without increasing the data transfer time. Since the number of bits in the mantissa can be increased as much as possible, the precision can also be improved. Taking note of these advantages, floating point arithmetic has come into general use in various applications.

このような傾向はグラフィックデイスプレィ装置におい
ても同様であり、浮動小数点数により表現された座標デ
ータに基いて必要な演算を行なわせることにより、高精
度の演算結果データを得るようにしている。しかし、グ
ラフィックデイスプレィ装置においては、最終的に得ら
れるデータを浮動小数点数とすることは、表示との関係
上非常に不都合が大きいので、浮動小数点数で表現され
た演算結果データを整数に変換しなければならないこと
になり、しかも、整数に変換すべき演算結果データの数
が著しく多いのであるから、表示速度を余り高速化する
ことができなくなってしまうという問題がある。さらに
詳細に説明すると、グラフィックデイスプレィ装置にお
いては、例えば、第6図に示すように、モデリング変換
、ビュー変換、投影変換、およびワークステーション変
換をこの順に行なった後、最終的に浮動小数点数から整
数への変換を行なうようにしているのであり、ワークス
テーション変換までの段階においては、浮動小数点数で
表現されたモデリング座標系データ、ワールド座標デー
タ、ビュー参照座標系データ、正規化投影座標系データ
に対して必要な演算処理を施すことにより広いダイナミ
ックレンジを確保するとともに、高い演算精度を確保す
るようにしているのであるが、最終的に表示されるのは
デイスプレィ平面上であるから、デイスプレィ平面に対
応するデバイス座標データに変換しなければならず、し
かも、デイスプレィ平面はフレームメモリにおける各画
素を最小単位としているのであるから、デバイス座標デ
ータは最終的に整数として表現されることになる。即ち
、ワークステーション変換により得られた浮動小数点数
で表現されたデバイス座標系データを整数で表現された
デバイス座標系データに変換することが必要になる。
This tendency is the same in graphic display devices, and high-precision calculation result data is obtained by performing necessary calculations based on coordinate data expressed in floating point numbers. However, in graphic display devices, it is very inconvenient to use floating point numbers as the final data in terms of display, so the operation result data expressed in floating point numbers is converted to integers. Moreover, since the number of calculation result data to be converted into integers is extremely large, there is a problem that the display speed cannot be increased much. To explain in more detail, in a graphic display device, for example, as shown in FIG. The conversion to integers is performed, and at the stage up to the workstation conversion, modeling coordinate system data, world coordinate data, view reference coordinate system data, and normalized projected coordinate system data expressed in floating point numbers are converted to integers. By applying the necessary arithmetic processing to the image, we ensure a wide dynamic range and high arithmetic accuracy. However, since the final display is on the display plane, Furthermore, since the display plane uses each pixel in the frame memory as the minimum unit, the device coordinate data will ultimately be expressed as an integer. That is, it is necessary to convert device coordinate system data expressed in floating point numbers obtained by workstation conversion into device coordinate system data expressed in integers.

したがって、著しく多数の座標データに対して座標変換
処理を施す必要があることは勿論、座標変換後の浮動小
数点数に対して整数化処理を施さなければならなくなり
、全ての画素について整数化されたデバイス座標データ
を得るための所要時間が著しく長くなってしまい、この
結果、表示速度が遅くなってしまうのである。
Therefore, not only is it necessary to perform coordinate transformation processing on a significantly large number of coordinate data, but also it is necessary to perform integer processing on floating point numbers after coordinate transformation, and it is necessary to perform integer processing on floating point numbers after coordinate conversion. The time required to obtain device coordinate data becomes significantly longer, and as a result, the display speed becomes slower.

具体的には、浮動小数点数は、例えば、第5図に示すよ
うに、最上位ビットが浮動小数点数の正負を示す1ビツ
トのサインビットSであり、サインビットSに続く7ビ
ツトが、基数の累乗を示す指数部Eであり、残余の23
ビツトが仮数部Fである。但し、浮動小数点数の精度が
低下することを防止するために、仮数部Fの最上位ビッ
トが0にならないように正規化されている(例えば、I
EEE規格参照)。また、I EEE規格の浮動小数点
数の場合には、仮数部Fが小数点以下の部分のみを示し
ており、最上位の値“1°は浮動小数点数表示では全く
出現しない隠しビット(hiddenbit)となって
いる。
Specifically, in a floating point number, for example, as shown in FIG. The exponent part E indicates the power of , and the residual 23
The bit is the mantissa part F. However, in order to prevent the precision of floating point numbers from decreasing, the most significant bit of the mantissa part F is normalized so that it does not become 0 (for example, I
(See EEE standards). In addition, in the case of floating point numbers according to the IEEE standard, the mantissa part F shows only the part below the decimal point, and the highest value "1°" is a hidden bit that does not appear at all in floating point number representation. It has become.

したがって、上記I EEE規格に基く浮動小数点数の
値は、(−1) 8 (1,F)2”7の演算をプロセ
ッサ等において行なうことにより初めて得られるのであ
り、グラフィックデイスプレィ装置においては、多数の
画素データ毎に上記演算を行なわなければならず、しか
も、各画素毎に、2次元表示であればx、y座標につい
て、3次元表示であればX+Y+  z座標についてそ
れぞれ演算を行なわなければならないので、整数化され
たデバイス座標データを得るのに著しく長時間がかかっ
ていたのである。
Therefore, the value of a floating point number based on the above IEEE standard can only be obtained by performing the calculation (-1) 8 (1, F) 2"7 in a processor, etc., and in a graphic display device, The above calculation must be performed for each large number of pixel data, and for each pixel, calculations must be performed for the x and y coordinates for two-dimensional display, and for the X+Y+z coordinates for three-dimensional display. Therefore, it took an extremely long time to obtain device coordinate data converted into integers.

また、上記の不都合はグラフィックデイスプレィ装置に
おいて特に顕著に出現するのであるが、グラフィックデ
イスプレィ装置以外の装置であっても、浮動小数点数が
多く、しかも整数化することが必要なものにおいては、
同様の不都合が出現することになる。
Furthermore, the above-mentioned inconvenience is particularly noticeable in graphic display devices, but even in devices other than graphic display devices that contain many floating point numbers and need to be converted into integers,
Similar inconveniences will occur.

〈発明の目的〉 この発明は上記の問題点に鑑みてなされたものであり、
整数化すべき浮動小数点数が多い場合において、全体と
して浮動小数点数を整数化するのに必要な時間を著しく
短縮することができる浮動小数点数から整数への変換装
置および変換方法を提供することを目的としている。
<Object of the invention> This invention was made in view of the above problems,
An object of the present invention is to provide a conversion device and method for converting floating point numbers into integers that can significantly reduce the overall time required to convert floating point numbers into integers when there are many floating point numbers to be converted into integers. It is said that

く問題点を解決するための手段〉 上記の目的を達成するための、この発明の浮動小数点数
から整数への変換装置は、所定ビット数の指数データの
下位側に所定ビット数の、かつ小数点以下の部分のみを
示す仮数データを有する、正規化された浮動小数点数を
保持する浮動小数点数保持手段と、仮数データが全て0
で、かつ仮数データの上位桁が1になる加算数を出力す
る加算数出力手段と、浮動小数点数保持手段に保持され
ている浮動小数点数と加算数出力手段から出力された加
算数とを加算して浮動小数点数として表現される加算結
果を生成する加算手段と、浮動小数点数として表現され
る加算結果を構成する仮数データの下位所定ビットのみ
を変換データとして取出す変換データ取出し手段とを有
している。
Means for Solving the Problems> In order to achieve the above object, the floating point number to integer conversion device of the present invention has a predetermined number of bits and a decimal point on the lower side of exponent data of a predetermined number of bits. There are 0 floating -point retention methods that hold regular floating -point numbers, which have a fascal data indicating only the following parts
, and the addition number output means outputs an addition number in which the high-order digit of the mantissa data is 1, and the floating point number held in the floating point number holding means and the addition number output from the addition number output means are added together. and conversion data extraction means for extracting only lower predetermined bits of mantissa data constituting the addition result expressed as a floating point number as conversion data. ing.

但し、上記浮動小数点数、および変換データとしては、
共にn進数であってもよいが、共に2進数であることが
好ましい。
However, the above floating point numbers and conversion data are as follows:
Both may be n-ary numbers, but preferably both are binary numbers.

また、上記浮動小数点数が座標変換前のデータであり、
上記整数が座標変換後のデータであり、座標変換動作と
同時に、加算数出力手段による加算数の出力動作、およ
び加算手段による加算結果生成動作を行なうことが好ま
しい。
Also, the floating point number above is the data before coordinate conversion,
It is preferable that the above-mentioned integer is the data after coordinate transformation, and that the operation of outputting the addition number by the addition number output means and the operation of generating the addition result by the addition means are performed simultaneously with the coordinate transformation operation.

さらに、この発明の浮動小数点数から整数への変換方法
は、所定ビット数の指数データの下位側に所定ビット数
の、かつ小数点以下の部分のみを示す仮数データを有す
る、正規化された浮動小数点数に対して、仮数データが
全て0で、かつ仮数データの上位桁が1になる数を加算
し、浮動小数点数として表現される加算結果を構成する
仮数データの下位所定ビットのみを変換データとして取
出す方法である。
Furthermore, the method of converting a floating point number into an integer according to the present invention is a method for converting a floating point number into an integer using a normalized floating point number, which has mantissa data of a predetermined number of bits and indicating only the part below the decimal point on the lower side of exponent data of a predetermined number of bits. Add a number whose mantissa data is all 0 and the upper digit of the mantissa data is 1 to a number, and use only the lower predetermined bits of the mantissa data that constitute the addition result expressed as a floating point number as conversion data. This is how to take it out.

く作用〉 以上の浮動小数点数から整数への変換装置であれば、所
定ビット数の指数データの下位側に所定ビット数の、か
つ小数点以下の部分のみを示す仮数データを有する、正
規化された浮動小数点数を浮動小数点数保持手段に保持
させておき、加算数出力手段から、仮数データが全て0
で、かつ仮数データの上位桁が1になる加算数を出力す
る。そして、加算手段により上記浮動小数点数と加算数
とを加算して、浮動小数点数として表現される加算結果
を生成するので、そのままでは全く出現していない隠れ
ビットを仮数データ中に出現させることができるととも
に、仮数データを指数データから離れた側に位置させる
ことができる。したがって、変換データ取出し手段によ
り、この仮数データの下位側の所定数ビットのみを取出
すことにより、例えば、(−1)8 (1、F)2B−
127の演算を行なうことなく、整数化された値を得る
ことができる。
The above floating-point number to integer converter converts normalized data that has a predetermined number of bits of mantissa data on the lower side of the exponent data that has a predetermined number of bits and shows only the part below the decimal point. The floating point number is held in the floating point number holding means, and the mantissa data is all 0 from the addition output means.
, and outputs an addition number in which the upper digit of the mantissa data is 1. Then, the addition means adds the floating point number and the addition number to generate an addition result expressed as a floating point number, so hidden bits that would not otherwise appear at all can appear in the mantissa data. At the same time, the mantissa data can be located away from the exponent data. Therefore, by extracting only a predetermined number of lower bits of this mantissa data by the conversion data extracting means, for example, (-1)8 (1,F)2B-
An integer value can be obtained without performing 127 operations.

そして、上記浮動小数点数、および変換データが、共に
2進数である場合には、ディジタルコンピュータ等にお
いて広く使用されている2進演算に好適に適用すること
ができる。
When the floating point number and the conversion data are both binary numbers, the present invention can be suitably applied to binary operations widely used in digital computers and the like.

また、上記浮動小数点数が座標変換前のデータであり、
上記整数が座標変換後のデータであり、座標変換動作と
同時に、加算数出力手段による加算数の出力動作、およ
び加算手段による加算結果生成動作を行なう場合には、
座標変換を行なうことにより、座標変換が施され、かつ
整数化されたデータを得ることができる。
Also, the floating point number above is the data before coordinate conversion,
If the above integer is the data after coordinate transformation, and the addition output means outputs the addition number and the addition means generates the addition result at the same time as the coordinate transformation,
By performing the coordinate transformation, it is possible to obtain data that has been subjected to the coordinate transformation and has been converted into an integer.

さらに、以上の浮動小数点数から整数への変換方法であ
れば、所定ビット数の指数データの下位側に所定ビット
数の、かつ小数点以下の部分のみを示す仮数データを有
する、正規化された浮動小数点数に対して、仮数データ
が全て0で、かつ仮−数データの上位桁が1になる数を
加算すれば、全体として表現される浮動小数点数の値が
正確な加算結果にはならないのであるが、仮数データの
下位所定ビットのみに着目すれば、浮動小数点数を整数
に変換した値と等しくなっているので、この部分のデー
タのみを取出すことにより、整数化されたデータを得る
ことができる。
Furthermore, with the above conversion method from a floating point number to an integer, a normalized floating point number that has mantissa data of a predetermined number of bits and indicating only the part below the decimal point on the lower side of the exponent data of a predetermined number of bits. If you add a number whose mantissa data is all 0 and the high-order digit of the mantissa data is 1 to a decimal point number, the value of the floating point number expressed as a whole will not be an accurate addition result. However, if we focus only on the lower predetermined bits of the mantissa data, it is equal to the value converted from a floating point number to an integer, so by extracting only this part of the data, we can obtain the integer data. can.

さらに詳細に説明すると、2進数で表現された浮動小数
点数のサインビットが1ビツトであり、指数部がaビッ
トであり、仮数部がbビットである場合についてみれば
、指数部側に詰められた仮数部の値がFであれば、浮動
小数点数の値は、サインビットを無視すれば、(1,F
)の仮数に対して、2のE−(2b−1)乗を乗算した
値となり、そのままでは整数化された値を取出すことが
できない(第1図A参照)。しかし、本件発明者の新た
な知見によれば、仮数データが全て0で、かつ仮数デー
タの上位桁が1になる数、即ち、2bを加算することに
より、加算結果の仮数データが、上記1.Fに対応する
ビット配列を指数部から離れた側に詰めた状態になるこ
とが解った。
To explain in more detail, if we consider the case where the sign bit of a floating point number expressed in binary is 1 bit, the exponent part is a bit, and the mantissa part is b bits, the number is padded to the exponent part. If the value of the mantissa is F, the value of the floating point number is (1, F
) is multiplied by 2 to the power of E-(2b-1), and the integer value cannot be extracted as it is (see FIG. 1A). However, according to the new knowledge of the inventor of the present invention, by adding numbers whose mantissa data are all 0 and whose high-order digit is 1, that is, 2b, the mantissa data of the addition result can be changed to the above 1. .. It turns out that the bit array corresponding to F is packed to the side away from the exponent part.

したがって、この状態においては、隠れビットも顕在化
され、仮数データの下位側ビットがそのまま整数化デー
タを示すことになるので、指数部、仮数部の上位ビット
を無視して、該当部分のみを取出すことにより、簡単に
浮動小数点数の整数化を達成することができる。
Therefore, in this state, the hidden bits are also exposed and the lower bits of the mantissa data directly indicate the integer data, so the upper bits of the exponent and mantissa parts are ignored and only the relevant part is extracted. By doing this, it is possible to easily convert floating point numbers to integers.

〈実施例〉 以下、実施例を示す添付図面によって詳細に説明する。<Example> Hereinafter, embodiments will be described in detail with reference to the accompanying drawings showing examples.

第4図はこの発明の装置を組込んだグラフィックデイス
プレィ装置の座標変換過程を示すフローチャートであり
、ステップ■において、浮動小数点数で表現されたモデ
リング座標系データに対してモデリング変換を施し、不
動小数点数で表現されたワールド座標系データを得、ス
テップ■においてビュー変換を施すことにより、浮動小
数点数で表現されたビュー参照座標系データを得、ステ
ツプ■において投影変換を施すことにより、浮動小数点
数で表現された正規化投影座標系データを得、ステップ
■においてワークステーション変換を施すことにより、
整数で表現されたデバイス座標系データを得るようにし
ている。
FIG. 4 is a flowchart showing the coordinate transformation process of a graphic display device incorporating the device of the present invention. Obtain world coordinate system data expressed as a decimal point number, perform view transformation in step ■ to obtain view reference coordinate system data expressed as a floating point number, and perform projection transformation in step ■ to convert the floating point By obtaining normalized projected coordinate system data expressed in numbers and applying workstation transformation in step
I am trying to obtain device coordinate system data expressed as integers.

第3図はワークステーション変換部を詳細に示すフロー
チャートであり、指数データが7ビツトであり、しかも
仮数データが23ビツトである正規化投影座標系データ
に基くワークステーション変換を施す場合を示している
FIG. 3 is a flowchart showing the details of the workstation conversion section, showing the case where workstation conversion is performed based on normalized projected coordinate system data in which the exponent data is 7 bits and the mantissa data is 23 bits. .

ステップ■において、図示しない行列スタックメモリか
ら所定の座標変換マトリクス を読出すとともに、座標変換マトリクスの平行移動要素
d 1.d 2.d 3に対して223を加算する処理
に相当する変換を施して(具体的には、座標変換マトリ
クスの定数部に223を加算して)新たな座標変換マト
リクス を得、ステップ■において座標変換を施すべき点に対応
する3次元座標データx、y、zを読込み、ステップ■
■■においてそれぞれ X −a l x + b 1 y + c 1 z 
+ (d l+223)、Y = a 2 x + b
 2 y + c 2 z + (d 2+223)、
Z −a 3 x + b 3 y + c 3 z 
+ (d 3+223)の演算を行なうことにより、該
当する点に対応する3次元座標データx、y、zを算出
し、ステップ■において全ての点について座標変換が行
なわれたか否かを判別する。そして、座標変換が行なわ
れていない点が存在すると判別された場合には、そのま
まステップ■以下の処理を反復し、逆に、全ての点につ
いて座標変換が行なわれたと判別された場合には、その
まま一連の処理を終了する。
In step (2), a predetermined coordinate transformation matrix is read from a matrix stack memory (not shown), and the parallel movement element d of the coordinate transformation matrix is read out.1. d2. A new coordinate transformation matrix is obtained by performing a transformation equivalent to adding 223 to d3 (specifically, by adding 223 to the constant part of the coordinate transformation matrix), and the coordinate transformation is performed in step (■). Read the three-dimensional coordinate data x, y, z corresponding to the point to be applied, and proceed to step ■
In ■■, respectively, X −a l x + b 1 y + c 1 z
+ (d l+223), Y = a 2 x + b
2 y + c 2 z + (d 2 + 223),
Z −a 3 x + b 3 y + c 3 z
+ (d3+223) is performed to calculate the three-dimensional coordinate data x, y, z corresponding to the corresponding point, and in step (2) it is determined whether coordinate transformation has been performed for all the points. If it is determined that there are points for which coordinate transformation has not been performed, the process from step ① is repeated, and conversely, if it is determined that coordinate transformation has been performed for all points, The series of processing ends immediately.

そして、以上の座標変換マトリクスによる座標変換処理
を行なえば、デバイス座標系データへの変換が施される
と同時に整数化処理も施されたことになり、各データに
ついて特別に整数化処理を施す必要がなくなるので、全
体としての処理を簡素化することができるとともに、処
理所要時間を短縮することができる。
Then, if the coordinate transformation processing using the above coordinate transformation matrix is performed, integer processing is also performed at the same time as conversion to device coordinate system data, so it is necessary to perform special integer processing for each data. Since the process is eliminated, the overall process can be simplified and the time required for the process can be shortened.

第2図は浮動小数点数から整数への変換装置の一実施例
を示すブロック図であり、I EEE規格の浮動小数点
数を一時的に保持するレジスタ(1)と、仮数データが
全て0で、かつ仮数データの上位桁が1になる加算数を
生成する加算数主成部口)と、上記レジスタ(1)の内
容に対して加算数を加算する加算部(3)と、加算部(
3)により得られた浮動小数点数の下位所定数ビットの
みを変換データとして取出す変換データ取出し部(4)
とを有している。
FIG. 2 is a block diagram showing an embodiment of a floating point number to integer conversion device, which includes a register (1) for temporarily holding a floating point number according to the IEEE standard, a register (1) whose mantissa data is all 0, and an addition part (3) which adds the addition number to the contents of the register (1), and an addition part (
Conversion data extraction unit (4) that extracts only a predetermined number of low-order bits of the floating point number obtained by 3) as conversion data.
It has

第1図は上記変換装置の動作を詳細に説明する図である
FIG. 1 is a diagram illustrating the operation of the conversion device in detail.

第1図Aはデバイス座標系データ“1”をIEEE規格
の浮動小数点数で表現した状態を示しているとともに、
第1図Bはデバイス座標系データ“1023”をI E
EE規格の浮動小数点数で表現した状態を示している。
Figure 1A shows the device coordinate system data “1” expressed as a floating point number according to the IEEE standard, and
Figure 1B shows device coordinate system data “1023”
It shows the state expressed as a floating point number according to the EE standard.

即ち、第1図Aにおいては、サインビットSが2進数の
“0”、指数データEが2進数の“01111111”
  (10進数の“127”)、仮数データFが、全て
のビットが“0°の2進数であり、第1図Bにおいては
、サインビットSが2進数の“01、指数データEが2
進数の“10001000” (10進数の“127+
9°)、仮数データFが、上記9ビツトがオール11m
であるとともに、下位ビットが全て“0”の2進数であ
る。
That is, in FIG. 1A, the sign bit S is "0" in binary, and the exponent data E is "01111111" in binary.
(“127” in decimal), the mantissa data F is a binary number in which all bits are “0°”, and in FIG. 1B, the sign bit S is “01” in binary and the exponent data E is 2
"10001000" in decimal number ("127+ in decimal number"
9°), the mantissa data F is all 11m in the above 9 bits.
In addition, it is a binary number in which the lower bits are all "0".

また、第1図Cは223をI EEE規格の浮動小数点
数で表現した状態を示しており、サインビットSが2進
数の“0″、指数データEが2進数の“1001011
0” (10進数の“127+23“)、仮数データF
が、全てのビットが“0“の2進数である。
Figure 1C shows 223 expressed as a floating point number according to the IEEE standard, where the sign bit S is "0" in binary and the exponent data E is "1001011" in binary.
0” (decimal number “127+23”), mantissa data F
is a binary number in which all bits are "0".

そして、第1図A1或は第1図Bの浮動小数点数と第1
図Cの浮動小数点数との加算を行なう場合には、先ず、
指数データEを大きい方に揃えるのであるから、第1図
A、Bの浮動小数点数は、共に、指数データEが強制的
に10進数で“127+23″にセットされる。したが
って、第1図Aの場合についてみれば、指数データEが
強制的に10進数で“23“だけ増加させられたことに
伴なって仮数データFが23ビット分だけ指数データE
から離れる方向にシフトされ、隠れビット“1”が最下
位ビット位置に顕在化される(第1図り参照)。また、
第1図Bの場合についてみれば、指数データEが強制的
に10進数で“14″だけ増加させられたことに伴なっ
て仮数データFが14ビット分だけ指数データEから離
れる方向にシフトされ、隠れビット“1”が下10桁目
のビット位置に顕在化される(第1図E参照)。
Then, the floating point number in Figure 1 A1 or Figure 1 B and the first
When performing addition with the floating point number in Figure C, first,
Since the exponent data E is aligned to the larger one, the exponent data E for both floating point numbers A and B in FIG. 1 is forcibly set to "127+23" in decimal notation. Therefore, in the case of FIG. 1A, the exponent data E is forcibly increased by "23" in decimal notation, and the mantissa data F is increased by 23 bits.
The hidden bit "1" is revealed at the least significant bit position (see the first diagram). Also,
In the case of Figure 1B, as the exponent data E is forcibly increased by "14" in decimal notation, the mantissa data F is shifted away from the exponent data E by 14 bits. , the hidden bit "1" is revealed at the lower 10th bit position (see FIG. 1E).

即ち、第1図り、Hの何れの場合においても、例えば、
下位16桁の内容のみを取出すことにより、整数化され
た状態に対応するデータを得ることができる。
That is, in both the first diagram and H, for example,
By extracting only the contents of the lower 16 digits, data corresponding to the integer state can be obtained.

以上の説明から明らかなように、ワークステーション変
換を行なうに当って、ワークステーション変換マトリク
スに223を加算して新たな変換マトリクスを生成する
ことが必要になるので、この点に着目すれば、負荷の増
大となり、整数化処理を行なう場合と比較して殆ど処理
効率の向上を達成することができないのであるが、ワー
クステーション変換を行なうべきデータ数が増加した場
合には、従来であれば、各データ毎に整数化処理を施す
ことが必要になるのに対して、上記実施例の場合には、
1回新たな変換マトリクスを生成するだけでよく、その
後は特別に整数化処理を施す必要がなくなるのであるか
ら、全体としてみれば、著しく処理負荷を低減させ、処
理効率を著しく向上させることができる。
As is clear from the above explanation, when converting a workstation, it is necessary to add 223 to the workstation conversion matrix to generate a new conversion matrix. However, when the number of data to be converted to workstations increases, in the past, each While it is necessary to perform integer processing for each data, in the case of the above example,
It is only necessary to generate a new transformation matrix once, and there is no need to perform special integer processing after that, so overall, the processing load can be significantly reduced and processing efficiency can be significantly improved. .

尚、この発明は上記の実施例に限定されるものではなく
、例えば、2進数以外の任意の進数に基く浮動小数点数
の整数化に適用°することが可能であるほか、浮動小数
点数のビット数が32ビツト以外の場合にも同様に適用
することが可能であり、また、加算数生成部(至)が加
算数算出部であってもよいほか、予め得られている加算
数を保持しておき、必要なタイミングで加算数を出力す
るものであってもよく、さらに、2次元グラフィ・ツク
デイスプレィ装置、グラフィックデイスプレィ装置以外
の装置に対しても同様に適用することが可能であり、そ
の他、この発明の要旨を変更しない範囲内において柾々
の設計変更を施すことが可能である。
Note that the present invention is not limited to the above-described embodiments, and can be applied, for example, to converting floating point numbers into integers based on any base other than binary numbers. It can be similarly applied to cases where the number is other than 32 bits, and the addition number generation unit (to) may be an addition number calculation unit, or it may hold the addition number obtained in advance. It may also be possible to output the addition number at the necessary timing, and it is also possible to apply it to devices other than two-dimensional graphic display devices and graphic display devices. In addition, it is possible to make various design changes without changing the gist of the invention.

〈発明の効果〉 以上のように第1の発明は、仮数データとして小数点以
下のデータのみを有する浮動小数点数に対して、仮数デ
ータが全て0で、かつ仮数データの上位桁が1になる数
を加算し、浮動小数点数として表現される加算結果を構
成する仮数データの下位所定ビットのみを変換データと
して取出すようにしているので、整数化のために特別の
演算を行なうことなく浮動小数点の整数化を達成するこ
とができ、特に整数化すべきデータ数が多い場合におい
て、処理負荷を大巾に低減し、処理効率を大巾に向上さ
せることができるという特有の効果を奏する。
<Effects of the Invention> As described above, the first invention provides a number in which the mantissa data is all 0 and the upper digit of the mantissa data is 1 for a floating point number having only data below the decimal point as mantissa data. , and only the lower predetermined bits of the mantissa data that make up the addition result expressed as a floating point number are extracted as conversion data. Especially when there is a large amount of data to be converted into integers, the processing load can be greatly reduced and the processing efficiency can be greatly improved.

第2の発明は、ディジタルコンピュータ等において広く
使用されている2進演算に好・適に適用することができ
るという特有の効果をも奏する。
The second invention also has the unique effect that it can be suitably applied to binary operations widely used in digital computers and the like.

第3の発明は、座標変換を行なうことにより、座標変換
が施され、かつ整数化されたデータを得ることができ、
この結果、座標変換所要時間を著しく短縮することがで
きるという特有の効果をも奏する。
The third invention is that by performing coordinate transformation, it is possible to obtain data that has been subjected to coordinate transformation and has been converted into an integer,
As a result, a unique effect is achieved in that the time required for coordinate transformation can be significantly shortened.

第4の発明においても、整数化のために特別の演算を行
なうことなく浮動小数点の整数化を達成することができ
、特に整数化すべきデータ数が多い場合において、処理
負荷を大巾に低減し、処理効率を大巾に向上させること
ができるという特有の効果を奏する。
In the fourth invention as well, it is possible to convert a floating point number into an integer without performing any special operation for converting it into an integer, and the processing load can be greatly reduced, especially when there is a large amount of data to be converted into an integer. This has the unique effect of greatly improving processing efficiency.

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

第1図は浮動小数点数から整数への変換動作を説明する
図、 第2図は浮動小数点数から整数への変換装置の一実施例
を示すブロック図、 第3図は座標変換処理と同時に整数化処理を行なう場合
の動作を説明するフローチャート、第4図はこの発明の
整数化方法を適用するグラフィックデイスプレィ装置に
おける座標変換処理を説明するフローチャート、 第5図はI EEE規格の浮動小数点数のフォーマット
を説明する図、 第6図は従来のグラフィックデイスプレィ装置における
座標変換処理を説明するフローチャート。 (1)・・・レジスタ、■・・・加算数算出部、(3)
・・・加算部、(4)・・・変換データ取出し部、E・
・・指数データ、F・・・仮数データ特許出願人  ダ
イキン工業株式会社 代  理  人   弁理士  津  川  友  士
手  続  補  正  書(自発) 昭和63年12月29日 昭和63年特許願第8987号 2、発明の名称 浮動小数点数から整数への変換装置および変換方法3、
補正をする者 事件との関係  特許出願人 住 所   大阪市北区中崎西2丁目4番12号梅田セ
ンタービル名 称    (285)  ダイキン工業
株式会社代表者  山  1)   稔 4、代理人 5、補正会合の日付(自発) 6、補正の対象 明細書中、発明の詳細な説明の欄、および図面7、補正
の内容 (1)  明細書中、第10頁第7行と第8行の間に「
尚、仮数データが全て0で、かつ仮数データの上位桁が
1になる数は、仮数データを整数値とみなし力感[有]
Figure 1 is a diagram explaining the conversion operation from a floating point number to an integer, Figure 2 is a block diagram showing an example of a device for converting a floating point number to an integer, and Figure 3 is a diagram explaining the operation of converting a floating point number to an integer. FIG. 4 is a flowchart explaining the coordinate conversion process in a graphic display device to which the integer conversion method of the present invention is applied. FIG. FIG. 6 is a flowchart illustrating coordinate conversion processing in a conventional graphic display device. (1)...Register, ■...Addition number calculation unit, (3)
... Addition section, (4) ... Conversion data extraction section, E.
... Index data, F... Mantissa data Patent applicant: Daikin Industries, Ltd. Agent Patent attorney: Tomo Tsugawa Amendment (voluntary) December 29, 1988 Patent Application No. 8987 2. Name of the invention Apparatus and method for converting floating point numbers to integers 3.
Relationship with the case of the person making the amendment Patent applicant address Umeda Center Building, 2-4-12 Nakazaki Nishi, Kita-ku, Osaka Name (285) Daikin Industries, Ltd. Representative Yama 1) Minoru 4, Agent 5, Amendment meeting Date of (voluntary) 6. In the specification to be amended, the Detailed Description of the Invention column and Drawing 7. Contents of the amendment (1) In the specification, between lines 7 and 8 on page 10, "
In addition, for numbers where the mantissa data is all 0 and the high-order digit of the mantissa data is 1, the mantissa data is regarded as an integer value, and the number has a force feeling [Yes].

Claims (1)

【特許請求の範囲】 1、所定ビット数の指数データ(E)の下位側に所定ビ
ット数の、かつ小数点以下の部分のみを示す仮数データ
(F)を有する、正規化された浮動小数点数を保持する
浮動小数点数保持手段(1)と、仮数データが全て0で
、かつ仮数データの上位桁が1になる加算数を出力する
加算数出力手段(2)と、浮動小数点数保持手段に保持
されている浮動小数点数と加算数出力手段から出力され
た加算数とを加算して浮動小数点数として表現される加
算結果を生成する加算手段(3)と、浮動小数点数とし
て表現される加算結果を構成する仮数データ(F)の下
位所定ビットのみを変換データとして取出す変換データ
取出し手段(4)とを有することを特徴とする浮動小数
点数から整数への変換装置。 2、浮動小数点数、および変換データが共に2進数であ
る上記特許請求の範囲第1項記載の浮動小数点数から整
数への変換装置。 3、浮動小数点数が座標変換前のデータであり、整数が
座標変換後のデータであり、 座標変換動作と同時に、加算数出力手段(2)による加
算数の出力動作、および加算手段(3)による加算結果
生成動作を行なう上記特許請求の範囲第1項、または第
2項に記載の浮動小数点数から整数への変換装置。 4、所定ビット数の指数データ(E)の下位側に所定ビ
ット数の、かつ小数点以下の部分のみを示す仮数データ
(F)を有する、正規化された浮動小数点数に対して、
仮数データが全て0で、かつ仮数データの上位桁が1に
なる数を加算し、浮動小数点数として表現される加算結
果を構成する仮数データ(F)の下位所定ビットのみを
変換データとして取出すことを特徴とする浮動小数点数
から整数への変換方法。
[Claims] 1. A normalized floating point number having mantissa data (F) of a predetermined number of bits and indicating only the part below the decimal point on the lower side of exponent data (E) of a predetermined number of bits. Floating point number holding means (1) for holding, addition number output means (2) for outputting an added number in which the mantissa data is all 0 and the high-order digit of the mantissa data is 1, and the floating point number holding means holds an addition means (3) for generating an addition result expressed as a floating point number by adding the floating point number output from the addition number output means and the addition number outputted from the addition number output means; and an addition result expressed as a floating point number. 1. A converting device for converting a floating point number into an integer, comprising: converting data extracting means (4) for extracting only lower predetermined bits of mantissa data (F) constituting the mantissa data (F) as converted data. 2. The floating point number to integer conversion device according to claim 1, wherein both the floating point number and the conversion data are binary numbers. 3. The floating point number is the data before the coordinate transformation, and the integer is the data after the coordinate transformation. Simultaneously with the coordinate transformation operation, the addition number output means (2) outputs the addition number, and the addition means (3) A converting device from a floating point number to an integer according to claim 1 or 2, which performs an addition result generation operation according to the above claim 1 or 2. 4. For a normalized floating point number that has mantissa data (F) of a predetermined number of bits and indicating only the part below the decimal point on the lower side of exponent data (E) of a predetermined number of bits,
Adding numbers whose mantissa data are all 0 and where the high-order digit of the mantissa data is 1, and extracting only the lower predetermined bits of the mantissa data (F) that constitute the addition result expressed as a floating point number as conversion data. A method of converting floating point numbers to integers featuring the following.
JP63008987A 1988-01-18 1988-01-18 Method and device for conversion between floating point number and integer Pending JPH01183732A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63008987A JPH01183732A (en) 1988-01-18 1988-01-18 Method and device for conversion between floating point number and integer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63008987A JPH01183732A (en) 1988-01-18 1988-01-18 Method and device for conversion between floating point number and integer

Publications (1)

Publication Number Publication Date
JPH01183732A true JPH01183732A (en) 1989-07-21

Family

ID=11708042

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63008987A Pending JPH01183732A (en) 1988-01-18 1988-01-18 Method and device for conversion between floating point number and integer

Country Status (1)

Country Link
JP (1) JPH01183732A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021028839A (en) * 2009-06-19 2021-02-25 シンギュラー コンピューティング、エルエルシー Processing using compact arithmetic processing elements

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021028839A (en) * 2009-06-19 2021-02-25 シンギュラー コンピューティング、エルエルシー Processing using compact arithmetic processing elements
US11327714B2 (en) 2009-06-19 2022-05-10 Singular Computing Llc Processing with compact arithmetic processing element
US11327715B2 (en) 2009-06-19 2022-05-10 Singular Computing Llc Processing with compact arithmetic processing element
US11354096B2 (en) 2009-06-19 2022-06-07 Singular Computing Llc Processing with compact arithmetic processing element
US11768660B2 (en) 2009-06-19 2023-09-26 Singular Computing Llc Processing with compact arithmetic processing element
US11768659B2 (en) 2009-06-19 2023-09-26 Singular Computing Llc Processing with compact arithmetic processing element
US11842166B2 (en) 2009-06-19 2023-12-12 Singular Computing Llc Processing with compact arithmetic processing element

Similar Documents

Publication Publication Date Title
JP3658079B2 (en) Arithmetic processing device and data processing device
TW436729B (en) Computing method and computing apparatus
US6288723B1 (en) Method and apparatus for converting data format to a graphics card
US10810281B2 (en) Outer product multipler system and method
US20070180004A1 (en) Apparatus and method for precision binary numbers and numerical operations
Upneja et al. Fast computation of Jacobi-Fourier moments for invariant image recognition
US5402533A (en) Method and apparatus for approximating a signed value between two endpoint values in a three-dimensional image rendering device
JPH03105614A (en) Matrix computation circuit
JPH01183732A (en) Method and device for conversion between floating point number and integer
US20050168462A1 (en) Method and apparatus for generating m-degree forms in a n-dimension space
KR102559930B1 (en) Systems and methods for computing mathematical functions
CN115827555A (en) Data processing method, computer device, storage medium and multiplier structure
JP3458963B2 (en) Image conversion device
US5870322A (en) Multiplier to selectively perform unsigned magnitude multiplication or signed magnitude multiplication
JP2000148447A (en) Multiplier and arithmetic method therefor
EP3923132A1 (en) Device for performing multiply/accumulate operations
CN115908678B (en) Bone model rendering method and device, electronic equipment and storage medium
JPH01251133A (en) Multiplying circuit and method
JPH0371331A (en) Multiplier
JP3114289B2 (en) Character pattern generator
JP2889244B2 (en) Image processing device
JPS6386083A (en) Affine converting system
CN111951336A (en) Three-dimensional large coordinate processing method based on GPU
JP2650271B2 (en) How to store contour information
JPH04182731A (en) Arithmetic method and arithmetic unit