JPH01159727A - Data processor - Google Patents
Data processorInfo
- Publication number
- JPH01159727A JPH01159727A JP31785587A JP31785587A JPH01159727A JP H01159727 A JPH01159727 A JP H01159727A JP 31785587 A JP31785587 A JP 31785587A JP 31785587 A JP31785587 A JP 31785587A JP H01159727 A JPH01159727 A JP H01159727A
- Authority
- JP
- Japan
- Prior art keywords
- data
- numerical data
- sign
- mantissa
- processing unit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Complex Calculations (AREA)
Abstract
Description
【発明の詳細な説明】
[発明の目的]
(産業上の利用分野)
この発明は、数値データの比較演算を行なうデータ処理
装置に関する。DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Industrial Application Field) The present invention relates to a data processing device that performs comparison operations on numerical data.
(従来の技術)
一般に、データベースマシンのような、さまざまな形式
のデータを処理するデータ処理装置では、形式の違う数
値データ間の比較演算を行なうことが多い。このような
場合、従来ではそれぞれの数値データの形式について符
号、位取り、精度等を考慮して比較する必要があった。(Prior Art) Generally, data processing devices such as database machines that process data in various formats often perform comparison operations between numerical data in different formats. In such cases, conventionally, it has been necessary to compare the formats of each numerical data by taking into consideration the sign, scale, precision, etc.
このため比較演算処理が複雑となり、比較演算を多用す
るデータ処理装置自体も複雑となり、これにより処理時
間が増大するという欠点があった。For this reason, the comparison calculation process becomes complicated, and the data processing device itself, which uses a lot of comparison calculations, also becomes complicated, which has the drawback of increasing the processing time.
(発明が解決しようとする問題点)
上記したように、従来のデータ処理装置では数値データ
の比較演算処理が多用されると処理時間が増大し、また
装置自体も複雑になるという欠点があった。(Problems to be Solved by the Invention) As mentioned above, conventional data processing devices have the disadvantage that processing time increases when numerical data comparison processing is frequently used, and the device itself becomes complicated. .
この発明は以上のような点に鑑みてなされたもので、形
式の異なる数値データの比較演算を簡単化し、処理速度
を向上させることができるデータ処理装置を提供するこ
とを目的とする。The present invention has been made in view of the above points, and it is an object of the present invention to provide a data processing device that can simplify comparison operations of numerical data of different formats and improve processing speed.
[発明の構成コ
(問題点を解決するための手段)
この発明は、数値データの比較演算処理を行なうデータ
処理装置において、数値データの内部表現を正規化され
た浮動少数点表示で表わし、この浮動少数点表示におけ
る符号ビットを仮数部が正または零のとき1、負のとき
は0とし、上記符号ビットを含んだ指数部、及び上記指
数部に連続する仮数部を処理単位の整数倍のビットで構
成されるように数値データを変換し、この変換された2
つの数値データを符号ビットから処理単位毎に比較し数
値データの大小を判定するように構成するものである。[Structure of the Invention (Means for Solving the Problems)] This invention represents the internal representation of numerical data in a normalized floating point representation in a data processing device that performs comparative calculation processing of numerical data, and The sign bit in floating point representation is 1 when the mantissa is positive or zero, and 0 when it is negative. Convert numeric data to consist of bits, and convert this converted 2
The system is configured to compare two numerical data for each processing unit starting from the code bit and determine the magnitude of the numerical data.
(作用)
このようにして構成されるデータ処理装置では、数値デ
ータの比較を行なう際に、データ形式について符号、位
取り、精度等を考慮する必要なしに、内部表現の先頭か
ら処理単位毎に単純に比較して大小を判定することがで
きるため、比較演算処理の簡略化が可能となる。(Function) In the data processing device configured in this way, when comparing numerical data, there is no need to consider the sign, scale, precision, etc. of the data format; Since it is possible to determine the magnitude by comparing with , it is possible to simplify the comparison calculation process.
(実施例) 以下、図面を参照してこの発明の一実施例を説明する。(Example) Hereinafter, one embodiment of the present invention will be described with reference to the drawings.
第1図はこの発明の一実施例に係わるデータ処理装置の
構成を示すブロック図である。FIG. 1 is a block diagram showing the configuration of a data processing device according to an embodiment of the present invention.
同図において11は処理データを記憶している記憶装置
であり、さまざまな形式の数値データが保持されている
。12はデータ変換部であり、上記記憶装置11で記憶
される数値データをコントローラ部13の指示により読
出し、後述する内部表現に変換する。14はデータ比較
部であり、上記コントローラ部13により制御され、上
記データ変換部12によって内部表現に変換された数値
データの2進比較演算を、適当な処理単位毎に行なう。In the figure, numeral 11 is a storage device that stores processed data, and holds numerical data in various formats. Reference numeral 12 denotes a data conversion section, which reads numerical data stored in the storage device 11 according to instructions from the controller section 13 and converts it into an internal representation to be described later. Reference numeral 14 denotes a data comparison section, which is controlled by the controller section 13 and performs a binary comparison operation on the numerical data converted into internal representation by the data conversion section 12 for each appropriate processing unit.
このようにして構成されるデータ処理装置の動作を説明
する。The operation of the data processing apparatus configured in this way will be explained.
まず、装置全体の制御を行なうコントローラ部13から
の指示により、記憶装置11に保持されている数値デー
タをデータ変換部12に呼出す。データ変換部12は、
この呼出された数値データをコントローラ部13から与
えられる底、及び指数部の長さ等に対応した内部表現に
変換する。この内部表現は第2図に示すような、一種の
浮動少数点表示に構成されている。同図において、最上
位ビット(MSB)が仮数部の正負を表わす符号ビット
であり、この符号ビットの次からnビットまでが指数部
を表わし、それ以降のn+1ビットからmビットまでが
仮数部を表わしている。上記符号ビットは仮数部が正ま
たは零のとき1、負のときoを示し、また符号ビットを
含む指数部のビット長n、及び仮数部のビット長m−n
が処理単位の整数倍となっている。また、この内部表現
は正規化されており、かつ指数部、及び符号を含む仮数
部ともにOであるとき最小値を示すように構成されてい
る。例えば指数部が7ビツトで構成される場合、−64
゜。、を示すにはビットが全て0となり、63.1o、
を示す場合は従来の表示形式で127、、。〉を示すも
のと同じビット構成となっている。First, numerical data held in the storage device 11 is called to the data conversion section 12 in accordance with an instruction from the controller section 13 that controls the entire apparatus. The data conversion unit 12 is
The called numerical data is converted into an internal representation corresponding to the base, the length of the exponent, etc. given from the controller section 13. This internal representation is configured as a type of floating point representation as shown in FIG. In the figure, the most significant bit (MSB) is a sign bit that indicates the significand, the n bits after this sign bit represent the exponent, and the n+1 to m bits thereafter represent the mantissa. It represents. The above sign bit indicates 1 when the mantissa is positive or zero, and o when it is negative, and the bit length n of the exponent part including the sign bit, and the bit length m-n of the mantissa part.
is an integral multiple of the processing unit. Further, this internal representation is normalized and is configured to indicate the minimum value when both the exponent part and the mantissa part including the sign are O. For example, if the exponent part consists of 7 bits, -64
゜. , all bits are 0, 63.1o,
127, , in the conventional display format. The bit configuration is the same as that shown in .
また、内部表現の底(浮動少数点表示)、及び仮数部の
符号を含めた指数部の長さは比較する2つのデータ間で
適切なものが1つ決められる。さらに、仮数部の長さは
各々のデータ毎に処理単位の整数倍で任意の長さで可変
となっている。Further, as for the base of internal representation (floating point representation) and the length of the exponent part including the sign of the mantissa part, one appropriate value is determined between the two data to be compared. Furthermore, the length of the mantissa part is variable and can be an arbitrary length that is an integer multiple of the processing unit for each data.
このように底や指数部の長さが、比較する2つの数値デ
ータ間で同一であるという条件下において任意であるた
め、例えば10進データを16進浮動少数点表示に変換
する際に発生する誤差やあぶれが発生しないように内部
表現を構成することができる。また、仮数部が各々のデ
ータ毎に可変ということは、数値データの比較の際に同
値の場合はデータ長の長い方が大と判断し正しい比較を
行なうことができるため、個々データの精度を考慮する
必要がない。さらに、数値データの内部表現は、データ
を構成するビットが全て0であるときが最少値となるよ
うにしているため、比較演算の際、処理単位毎に符号、
指数、仮数の順に単純な2進比較により数値データの大
小を簡単に効率良く判定することができる。In this way, the base and exponent lengths are arbitrary under the condition that the two numerical data being compared are the same, so this problem occurs, for example, when converting decimal data to hexadecimal floating point representation. It is possible to configure internal representations so that errors and confusion do not occur. In addition, since the mantissa is variable for each data, when comparing numerical data, if the values are the same, the longer data length can be determined to be larger and the comparison can be made correctly, which improves the accuracy of the individual data. No need to consider. Furthermore, the internal representation of numerical data is such that the minimum value is when all the bits constituting the data are 0, so during comparison operations, the sign and
The magnitude of numerical data can be easily and efficiently determined by simple binary comparison in the order of exponent and mantissa.
このように、形式の異なる数値データ間の比較を行なう
場合、上記のように構成した内部表現に変換したものを
比較することにより、位取り、符号、精度等を全く気に
することなく先頭からの処理単位毎の2進比較を行なう
だけで大小が決定できるので比較演算が簡単に行なえ、
比較演算を多用するデータ処理装置の処理速度の向上、
及び装置自体の簡略化が可能となる。さらに、底、及び
指数部の長さを適切に決定することにより、内部表現へ
の変換の際に生じる誤差やあぶれをなくすことができる
。In this way, when comparing numerical data in different formats, by comparing the data converted to the internal representation configured as above, it is possible to compare numerical data from the beginning without worrying about scale, sign, precision, etc. Comparison operations can be easily performed because the magnitude can be determined simply by performing a binary comparison for each processing unit.
Improving the processing speed of data processing devices that use a lot of comparison operations,
And the device itself can be simplified. Furthermore, by appropriately determining the lengths of the base and exponent part, it is possible to eliminate errors and blurs that occur during conversion to internal representation.
[発明の効果]
以上のようにこの発明によれば、データ処理装置におけ
る数値データの内部表現を正規化された浮動少数点表示
で表わし、仮数部の符号を含む指数部、及び仮数部の長
さを処理単位の整数倍とし、指数、及び符号を含む仮数
部が全て0で構成されるものが最少値を表現する数値デ
ータ形式とすることにより、内部表現の先頭から処理単
位毎に単純に2進比較することにより数値の大小が判定
できるので、比較演算処理の速度を向上させることがで
きる。[Effects of the Invention] As described above, according to the present invention, the internal representation of numerical data in a data processing device is expressed in normalized floating point representation, and the exponent part including the sign of the mantissa part and the length of the mantissa part are By using a numerical data format in which the value is an integer multiple of the processing unit, and the exponent and mantissa including the sign are all 0, the minimum value is expressed, it is possible to simply calculate each processing unit from the beginning of the internal representation. Since the magnitude of numerical values can be determined by binary comparison, the speed of comparison calculation processing can be improved.
第1図はこの発明の一実施例に係わるデータ処理装置の
構成を示すブロック図、第2図は同実施例における数値
データの内部表現の形式を示す図である。
11・・・記憶装置、12・・・データ変換部、13・
・・コントローラ部、14・・・データ比較部。
出願人代理人 弁理士 鈴江武彦FIG. 1 is a block diagram showing the configuration of a data processing apparatus according to an embodiment of the present invention, and FIG. 2 is a diagram showing the format of internal representation of numerical data in the embodiment. 11...Storage device, 12...Data converter, 13.
...Controller section, 14...Data comparison section. Applicant's agent Patent attorney Takehiko Suzue
Claims (1)
いて、数値データの内部表現を正規化された浮動少数点
表示で表わし、この浮動少数点表示における符号ビット
を仮数部が正または零のとき1、負のときは0とし、上
記符号ビットを含んだ指数部、及びこの指数部に連続す
る仮数部を処理単位の整数倍のビットで構成されるよう
に数値データを変換する数値データ変換手段と、上記数
値データ変換手段により変換された2つの数値データを
符号ビットから処理単位毎に比較し数値データの大小を
判定する数値データ比較手段とを具備したことを特徴と
するデータ処理装置。In a data processing device that performs comparison operations on numerical data, the internal representation of numerical data is expressed in a normalized floating point representation, and the sign bit in this floating point representation is set to 1 when the mantissa is positive or zero, and negative. , the numerical data conversion means converts the numerical data so that the exponent part including the sign bit and the mantissa part continuous to the exponent part are composed of bits that are an integral multiple of the processing unit; 1. A data processing device comprising: numerical data comparing means for comparing two numerical data converted by the numerical data converting means for each processing unit starting from the code bit, and determining the magnitude of the numerical data.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP31785587A JPH01159727A (en) | 1987-12-16 | 1987-12-16 | Data processor |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP31785587A JPH01159727A (en) | 1987-12-16 | 1987-12-16 | Data processor |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH01159727A true JPH01159727A (en) | 1989-06-22 |
Family
ID=18092811
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP31785587A Pending JPH01159727A (en) | 1987-12-16 | 1987-12-16 | Data processor |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH01159727A (en) |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS62154134A (en) * | 1985-12-27 | 1987-07-09 | Nippon Telegr & Teleph Corp <Ntt> | Data converter |
| JPS63158626A (en) * | 1986-12-23 | 1988-07-01 | Nec Corp | Arithmetic processing unit |
-
1987
- 1987-12-16 JP JP31785587A patent/JPH01159727A/en active Pending
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS62154134A (en) * | 1985-12-27 | 1987-07-09 | Nippon Telegr & Teleph Corp <Ntt> | Data converter |
| JPS63158626A (en) * | 1986-12-23 | 1988-07-01 | Nec Corp | Arithmetic processing unit |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH01159727A (en) | Data processor | |
| JPH0434784B2 (en) | ||
| JPH02165225A (en) | Arithmetic processing unit for floating point numeral with accuracy | |
| JPS6275838A (en) | Variable precision numerical data calculation device | |
| JPH03100722A (en) | Processing system for accuracy conversion instruction | |
| JPS58181142A (en) | M notation-n notation converting device | |
| JP2881318B2 (en) | Conversion circuit of distance value in character recognition device | |
| JP2574264B2 (en) | Trigonometric function operation unit | |
| JP3210356B2 (en) | Data zero judgment device | |
| JPH03100723A (en) | Processing system for accuracy conversion instruction | |
| JPH0743566B2 (en) | Angle calculator | |
| KR100215114B1 (en) | Inch-mm coverting method of numberic control program | |
| JPH01297721A (en) | Real number data converter | |
| JPH0628153A (en) | Low error calculation processor | |
| JPS60243742A (en) | arc calculation device | |
| JPH05128088A (en) | Desktop electronic calculator | |
| JPS59136849A (en) | Dividing device | |
| JPS6129075Y2 (en) | ||
| JPS61210426A (en) | Form converting circuit | |
| JP2001043068A (en) | Numerical value rounding processor | |
| JP2005031847A (en) | Integer arithmetic method, integer arithmetic program, and integer arithmetic device | |
| JPS5994143A (en) | Dividing circuit | |
| JPH1027011A (en) | Programmable controller | |
| JPS58225434A (en) | Processing method of integer value containing decimal point | |
| JPS63310019A (en) | data processing equipment |