JPH04301B2 - - Google Patents
Info
- Publication number
- JPH04301B2 JPH04301B2 JP57094834A JP9483482A JPH04301B2 JP H04301 B2 JPH04301 B2 JP H04301B2 JP 57094834 A JP57094834 A JP 57094834A JP 9483482 A JP9483482 A JP 9483482A JP H04301 B2 JPH04301 B2 JP H04301B2
- Authority
- JP
- Japan
- Prior art keywords
- format
- mantissa
- floating point
- bits
- exponent
- 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.)
- Expired - Lifetime
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/483—Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/499—Denomination or exception handling, e.g. rounding or overflow
- G06F7/49905—Exception handling
- G06F7/4991—Overflow or underflow
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computational Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Nonlinear Science (AREA)
- General Engineering & Computer Science (AREA)
Description
【発明の詳細な説明】
発明の対象
本発明は浮動小数点演算方式に係り、特に通常
の浮動小数点表示による数値と、これによつては
表示し得ず別個の浮動小数点表示を必要とする数
値とを混在させて、しかも効率よく処理するのに
好適な浮動小数点演算方式に関するものである。DETAILED DESCRIPTION OF THE INVENTION Object of the Invention The present invention relates to floating point arithmetic systems, and in particular to numbers that are expressed in normal floating point numbers and numbers that cannot be displayed using this method and require separate floating point numbers. The present invention relates to a floating-point arithmetic system suitable for efficiently processing a mixture of .
従来技術
第1図は現在多くのデータ処理装置で用いられ
ている浮動小数点表示の一例で、1は1ビツトの
符号、2は7ビツトの64余りコードによる指数
部、3は56ビツトよりなる16進14桁の仮数部であ
る。浮動小数点表示は通常正規化して使用され、
仮数部3の最上位の4ビツトからなる桁は表示の
全ビツトが0である真の0の場合を除いて一般に
0ではない。この状態で第1図の表示で表現でき
る絶対値最大の数をΩ、絶対値最小の数をωとす
ると
Ω=(1−16-14)1663
ω=16-1・16-64=16-65
である。従つて、演算結果の絶対値がΩを超えた
り、ω未満になることがある。Ωを越えると上位
溢れ、0でなくかつω未満になると下位溢れの状
態となる。データ処理装置における処理は上位溢
れの場合には割込みを起して、以後の扱いはプロ
グラムに季せ、下位溢れの場合にはプログラマの
選択によつて割込みを起させて以後プログラムで
処理するか、あるいは割込みを起させないで結果
を強制的に真の0にして演算を続行する。この方
式では、プログラムで処理する場合にはユーザの
負担となり、また下位溢れの場合、結果を真の0
にすれば精度が悪くなるという欠点があつた。従
つてより広い範囲の数値を表示できる方式が望ま
れる理由がある。Prior Art Figure 1 is an example of a floating point representation currently used in many data processing devices, where 1 is a 1-bit sign, 2 is an exponent part with a 7-bit 64 remainder code, and 3 is a 56-bit 16 It is a 14-digit mantissa. Floating point representations are usually normalized and used
The most significant 4-bit digit of the mantissa 3 is generally not 0 except in the case of a true 0 in which all bits of the representation are 0. In this state, if the maximum absolute value that can be expressed in the display in Figure 1 is Ω, and the minimum absolute value is ω, then Ω = (1-16 -14 ) 16 63 ω = 16 -1・16 -64 = 16 -65 . Therefore, the absolute value of the calculation result may exceed Ω or be less than ω. When Ω is exceeded, the upper half overflows, and when it is not 0 and less than ω, the lower half overflows. In the case of upper overflow, the processing in the data processing device causes an interrupt and the subsequent handling is left to the program; in the case of lower overflow, the programmer selects whether to cause an interrupt and handle the subsequent processing by the program. , or force the result to be a true 0 without causing an interrupt and continue the operation. This method imposes a burden on the user when processing with a program, and in the case of low-order overflow, the result is set to true 0.
The disadvantage was that the accuracy deteriorated. Therefore, there is a reason why a system that can display numerical values over a wider range is desired.
第2図は実際の計算機に組込まれたことはない
が、教料書などに示されている方式で、より広い
範囲の数値を表示できるように考えられたもので
ある。第2図において、4は1ビツトの符号、5
は可変長の指数部、6は可変長の仮数部、7は指
数部の長さを指定するための表示制御部である。
この方式は表示すべき数値によつて指数部5と仮
数部6の境界を動的に移動させ、大きな指数部を
必要とする数値については仮数部の精度は減少す
るがこれを短かくすることによつて対処するもの
で、シミユレーシヨンによつてその有効性が示さ
れている。しかしながら大きな欠点として第1図
に示すような現用されている通常の浮動小数点表
示方式と全く異る方式であり、従来の蓄積されて
きたプログラムが全然使えなくなるということが
ある。シミユレーシヨンによる有効性が示されて
いながら、実際に計算機に組込まれないのはこの
理由による。 Although the system shown in Fig. 2 has never been incorporated into an actual computer, it is a method shown in textbooks, etc., and was designed to be able to display a wider range of numerical values. In Figure 2, 4 is a 1-bit code, 5
is a variable-length exponent part, 6 is a variable-length mantissa part, and 7 is a display control part for specifying the length of the exponent part.
This method dynamically moves the boundary between the exponent part 5 and the mantissa part 6 depending on the value to be displayed, and for numbers that require a large exponent part, the precision of the mantissa part decreases, but this can be shortened. The effectiveness of this method has been demonstrated through simulation. However, a major drawback is that this system is completely different from the normal floating point display system currently in use as shown in FIG. 1, and that conventional programs that have been stored cannot be used at all. This is the reason why it is not actually incorporated into computers, even though its effectiveness has been shown through simulation.
発明の目的
本発明の目的は前記の欠点を除い、従来用いら
れている通常の浮動小数点表示を基本形式として
使用し、基本形式では表示できない範囲の数値が
生じたとき基本形式とは区別し得る特別形式によ
つてこれを表示することにより、従来のプログラ
ムの蓄積がそのまゝ使用でき、しかもユーザは溢
れを意識せずまた精度を失なうことなく使用でき
る浮動小数点演算方式を提供することにある。Purpose of the Invention The purpose of the present invention is to eliminate the above-mentioned drawbacks, use the conventional floating point representation as a basic format, and make it possible to distinguish it from the basic format when a numerical value in a range that cannot be displayed in the basic format occurs. To provide a floating point arithmetic method which allows the accumulation of conventional programs to be used as is by displaying this in a special format, and which allows the user to use it without being aware of overflow or losing precision. It is in.
発明の総括的説明
上記の目的を達成するためには、従来用いられ
ている通常の浮動小数点表示方式を全く変更する
ことなく、そのまゝ基本形式として採用し、しか
もこれと区別し得る特別形式を案出する必要があ
る。例えば基本形式の指数部に相当する部分の全
ビツトが1の場合には特別形式とするという方式
が一応は考えられるが、指数部の全ビツトが1で
ある表示は通常の浮動小数点表示方式で許されて
いる表示であるから、これを基本形式から除外す
れば、従来のプログラムは使用できないことにな
る。本発明では浮動小数点表示のもとで数値は通
常は正規化されていて、仮数部の最上位の桁は0
ではないことに注目し、特別形式では基本形式の
仮数部に相当する部分の最上位桁を0とすること
により、従来のプログラムはそのまゝ使用でき
て、なおかつ基本形式と特別形式とを区別して演
算する方式である。General Description of the Invention In order to achieve the above object, the conventional floating point representation system is adopted as its basic format without any changes, and a special format that can be distinguished from this is adopted. It is necessary to devise a. For example, if all the bits in the part corresponding to the exponent part of the basic format are 1, it may be possible to use a special format; Since this is a permissible display, if this is excluded from the basic format, conventional programs will no longer be usable. In the present invention, numbers are normally normalized under floating point representation, and the most significant digit of the mantissa is 0.
By noting that this is not the case, and by setting the most significant digit of the part corresponding to the mantissa of the basic format to 0 in the special format, conventional programs can be used as is, and it is still possible to distinguish between the basic format and the special format. This is a method of calculating separately.
発明の実施例
以下、本発明の一実施例を図面を参照して詳細
に説明する。Embodiment of the Invention Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.
第3図および第4図は本発明の一実施例で採用
される浮動小数点の表示形式を示す。 3 and 4 show floating point display formats employed in one embodiment of the present invention.
第3図は第1図に一例を示した現在多くの電子
計算機に用いられている浮動小数点表示に合致さ
せた基本形式で、1は1ビツトの符号(ビツト
0)、2は7ビツトよりなる64余りコードによる
指数部(ビツト1−7)、3は56ビツトよりなる
16進14桁の仮数部(ビツト12−63)、8は仮数部
3の一部分で仮数部の最上位桁(4ビツト)であ
る。浮動小数点表示は精度を保持するために通常
正規化して用いられ、仮数部の最上位桁8は通常
0ではない。例外は符号1、指数部2、仮数部3
各部のすべてのビツトが0である真の0である。
この実施例での浮動小数点表示の基本形式とは、
第3図に示す形式で、真の0を表示し、また真の
0でない場合は部分8の4ビツトのうち少くとも
1ビツトが1であるようなすべてのビツトパター
ンを指すものである。 Figure 3 shows a basic format that matches the floating point display currently used in many electronic computers, an example of which is shown in Figure 1. 1 is a 1-bit sign (bit 0), and 2 is a 7-bit sign. Exponent part (bits 1-7) with 64 remainder code, 3 consists of 56 bits
A 14-digit hexadecimal mantissa (bits 12-63), 8 is part of the mantissa 3 and is the most significant digit (4 bits) of the mantissa. Floating point representations are usually normalized to maintain precision, and the most significant digit 8 of the mantissa is usually not 0. The exception is sign 1, exponent 2, mantissa 3
A true 0 in which all bits in each part are 0.
The basic format of floating point representation in this example is:
In the format shown in FIG. 3, it refers to all bit patterns that display a true 0 and, if not a true 0, at least one bit out of the four bits of portion 8 is 1.
第4図はこの基本形式に対応する特別形式を示
し、9は常に0である4ビツトからなり、第3図
の基本形式の仮数部の最上位桁8と同じビツト位
置にあるタブ部(ビツト8−11)で、特別形式
を基本形式から区別するためのものであり、10
は1ビツトの符号(ビツト0)、11は指数部、
12は仮数部の最上位桁(ビツト4−7)、13
は仮数部の残りの桁、14は3ビツトからなる非
数表示部である。指数部11の長さは基本形式の
指数部より十分長くとり、基本形式で上位溢れあ
るいは下位溢れとなる数値を実用上殆んどすべて
の場合に表示し得るものである。例えば指数部に
は20〜32ビツトを与えることが可能である。仮数
部は最上位桁12に続く残りの桁13によつて構
成され、指数部に20ビツトを与えれば、仮数部は
16進9桁、32ビツトを与えても6桁となり、実用
上多くの場合になお十分な精度を保つことができ
る。正規化により仮数部の最上位桁12の4ビツ
トのうち少くとも1ビツトは1であるから、これ
によつて基本形式の真の0と区別することができ
る。特別形式ではこのように基本形式に較べて指
数部を十分長くとつてはいるが、その範囲は有限
であるから、この指数部でもなお上位溢れ、ある
いは下位溢れを生ずる場合がある。これらの場合
のために本実施例の特別形式には第4図に示す非
数表示部14を設け、無限大、無限小、不定、な
どの表示ができるようになつている。 Figure 4 shows a special format corresponding to this basic format, where 9 consists of 4 bits that are always 0, and the tab part (bit 9) is located at the same bit position as the most significant digit 8 of the mantissa in the basic format in 8-11) to distinguish the special form from the basic form, and 10
is the 1-bit sign (bit 0), 11 is the exponent part,
12 is the most significant digit of the mantissa (bits 4-7), 13
are the remaining digits of the mantissa, and 14 is a non-number display part consisting of 3 bits. The length of the exponent part 11 is sufficiently longer than the exponent part in the basic format, so that numerical values that overflow in the upper or lower positions in the basic format can be displayed in almost all practical cases. For example, it is possible to give 20 to 32 bits to the exponent. The mantissa consists of the most significant digit 12 and the remaining digit 13. If 20 bits are given to the exponent, the mantissa becomes
Even if 9 hexadecimal digits and 32 bits are given, the result will be 6 digits, which can still maintain sufficient accuracy in many practical cases. Due to normalization, at least one bit out of the four bits of the most significant digit 12 of the mantissa is 1, so it can be distinguished from a true 0 in the basic form. Although the special format has a sufficiently long exponent part compared to the basic format, its range is finite, so even this exponent part may still cause upper or lower overflow. For these cases, the special format of this embodiment is provided with a non-number display section 14 shown in FIG. 4, so that infinity, infinitesimal, indeterminate, etc. can be displayed.
本発明では本実施例に示すように従来用いられ
ている通常の浮動小数点表示をそのまゝ基本形式
として採用しているので、蓄積されている従来の
プログラムは変更することなくそのまゝ使用する
ことができる。基本形式で下位溢れあるいは上位
溢れが生じた場合に、従来の演算制御装置ではこ
れを検出し、現在実行中のプログラムに割込みを
起し得るようになつている。本実施例では演算制
御装置を第5図にその一例を示す構成とすること
により、割込みを起させる代わりに、その信号を
利用して結果を特別形式に切換え、またこのよう
にして生成された特別形式の浮動小数点表示と、
基本形式の表示を混在させて使用して、オペラン
ドとして何れの形式が与えられるかによつて演算
機構をそれぞれの形式に適合するように切換え
る。以下これらの機構の一実施例である第5図に
ついて説明する。 As shown in this embodiment, the present invention employs the conventional floating-point representation as its basic format, so the stored conventional programs can be used as they are without modification. be able to. When a lower overflow or an upper overflow occurs in the basic format, conventional arithmetic and control units can detect this and cause an interrupt to the currently executing program. In this embodiment, the arithmetic and control unit has a configuration as shown in FIG. 5, and instead of causing an interrupt, the signal is used to switch the result to a special format, and the result generated in this way is special format floating point representation,
A mixture of representations of the basic formats is used, and the arithmetic mechanism is switched to suit each format depending on which format is given as an operand. FIG. 5, which is an embodiment of these mechanisms, will be described below.
第5図において15,16は演算に先つてそれ
ぞれ第1オペランド、第2オペランドを収容する
レジスタ、17,18はそれぞれ第1オペラン
ド、第2オペランドが基本形式、特別形式のいず
れであるかを検出する回路、19,20は第1オ
ペランド、第2オペランドをそれぞれの形式検出
回路17,18の制御に基いて仮数と指数に分解
する回路、21,22はそれぞれ第1オペランド
の仮数、指数を収容するレジスタ、23,24は
それぞれ第2オペランドの仮数、指数を収容する
レジスタ、25,26はこのように分解された仮
数同志、指数同志に対してそれぞれ浮動小数点演
算命令によつて指定された演算を施す回路、27
は演算結果について基本形式では上位あるいは下
位の溢れが起るかどうかを検出する回路、28は
結果を溢れ検出回路27の制御に従つていずれか
の形式に合成する回路である。 In FIG. 5, 15 and 16 are registers that accommodate the first and second operands, respectively, prior to the operation, and 17 and 18 detect whether the first and second operands are in the basic format or special format, respectively. circuits 19 and 20 decompose the first and second operands into a mantissa and an exponent under the control of the format detection circuits 17 and 18, respectively; 21 and 22 accommodate the mantissa and exponent of the first operand, respectively; The registers 23 and 24 contain the mantissa and exponent of the second operand, respectively, and the registers 25 and 26 contain the operations specified by the floating-point operation instruction for the mantissa and exponent decomposed in this way, respectively. circuit for applying, 27
28 is a circuit for detecting whether upper or lower overflow occurs in the basic form of the calculation result, and 28 is a circuit for synthesizing the result into one of the forms under the control of the overflow detection circuit 27.
さて浮動小数点演算命令の実行に際してオペラ
ンドがレジスタ15および16に与えられると、
形式検出回路17および18はそれぞれ与えられ
たオペランドが基本形式か特別形式かを検出す
る。この検出は基本形式および特別形式の仮数部
の最上位桁に相当する部分を参照することにより
行なう。即ちオペランドのビツト4−11(第3
図、第4図参照)を参照する。基本形式の仮数部
の最上位桁に相当する部分(ビツト8−11)が
0であり、かつ特別形式の仮数部の最上位桁に相
当する部分(ビツト4−7)が0でないならば特
別形式のオペランドと検出する。このケース以
外、即ちビツト4−11がいずれも0の場合、あ
るいはビツト8−11が0でない場合は基本形式
と検出する。形式検出回路17および18は検出
した形式に応じて演算機構を動作させる。まず検
出回路17および18は分解回路19および20
に検出した形式を伝える。分解回路18,19は
これに従つて指数部と仮数部に分解し、それぞれ
レジスタ21,23,22,24に送る。勿論第
1および第2オペランドが共に基本形式か特別形
式であつてもよいし、一方が基本形式で他方が特
別形式であつてもよい。 Now, when operands are given to registers 15 and 16 when executing a floating point arithmetic instruction,
Format detection circuits 17 and 18 each detect whether a given operand is a basic format or a special format. This detection is performed by referring to the part corresponding to the most significant digit of the mantissa part of the basic format and special format. That is, bits 4-11 (third
4). If the part corresponding to the most significant digit of the mantissa in the basic form (bits 8-11) is 0, and the part corresponding to the most significant digit of the mantissa in the special form (bits 4-7) is not 0, then it is special. Detects operands of the form. Other than this case, that is, when bits 4-11 are all 0, or when bits 8-11 are not 0, the basic format is detected. The format detection circuits 17 and 18 operate the arithmetic mechanism according to the detected format. First, the detection circuits 17 and 18 are replaced by the decomposition circuits 19 and 20.
tells the detected format to . The decomposition circuits 18 and 19 decompose it into an exponent part and a mantissa part in accordance with this, and send them to registers 21, 23, 22, and 24, respectively. Of course, both the first and second operands may be in the basic form or the special form, or one may be in the basic form and the other in the special form.
仮数演算回路25と指数演算回路26はそれぞ
れ21,23と22と24の仮数、指数に対して
指定した演算を施す。演算にあたつて両オペラン
ドの桁合わせをして行なう。結果合成回路28は
両演算回路25,26からの演算結果を溢れ検出
回路27の制御に従つていずれかの形式に合成す
る。溢れ検出回路27は基本形式では溢れが生ず
る演算結果が得られると、溢れが上位であるか下
位であるかの表示も伴なつて結果合成回路28に
信号を与える。結果合成回路28は溢れ検出回路
27から信号が与えられないと基本形式で表示す
るようにし、信号が与えられると特別形式で表示
するように動作を切換える。この結果は第5図で
は第1オペランドを収容していたレジスタ15に
戻すようになつているが、勿論、記憶装置に書込
むこともできる。このようにして基本形式による
表示と特別形式による表示は混在して用いられる
ことになる。 The mantissa calculation circuit 25 and the exponent calculation circuit 26 perform specified calculations on the mantissas and exponents of 21, 23, 22, and 24, respectively. The digits of both operands are aligned during the operation. The result synthesis circuit 28 synthesizes the calculation results from both the calculation circuits 25 and 26 into one of the formats under the control of the overflow detection circuit 27. In the basic form, when the overflow detection circuit 27 obtains an operation result that causes an overflow, it supplies a signal to the result synthesis circuit 28 together with an indication as to whether the overflow is in the upper or lower order. The result synthesis circuit 28 switches its operation to display in the basic format when no signal is given from the overflow detection circuit 27, and to display in the special format when the signal is given. Although this result is returned to the register 15 that contained the first operand in FIG. 5, it can of course also be written to a storage device. In this way, the display in the basic format and the display in the special format are used together.
以上の説明ではオペランドが特別形式で非数で
ある場合について触れていない。この場合形式検
出回路17はまず特別形式であることを検出した
のち、第4図の非数表示部14の3ビツトのう
ち、少くとも1ビツトが1であることを検出し、
非数の処理に入る。非数の場合の処理は第5図の
例に較べて極めて簡単なものであり、本発明の本
質的な部分ではないのでこゝでは省略する。 The above explanation does not mention the case where the operand is a special form and is non-numeric. In this case, the format detection circuit 17 first detects that it is a special format, and then detects that at least one bit of the three bits in the non-number display section 14 in FIG. 4 is 1,
Start processing non-numbers. The processing for non-numbers is much simpler than the example shown in FIG. 5, and is not an essential part of the present invention, so it will be omitted here.
上記の実施例では特別形式の合成も、分解もと
もにハードウエアによつて行つているが、溢れの
検出と形式の検出はハードウエアで行い、検出信
号によつて現在実行中のプログラムに割込んで、
特別形成を合成することおよびこれを分解するこ
との一方あるいは双方を割込処理プログラムに季
ねることも可能である。溢れ検出回路27はもと
もと現在の大部分の計算機に備わつているので、
新らしくハードウエアとして用意するのは形式検
出回路17および18およびこれの信号による割
込機構だけで、演算装置の大部分については基本
形式だけを扱う現用のものでよいことになる。 In the above embodiment, both special format synthesis and decomposition are performed by hardware, but overflow detection and format detection are performed by hardware, and the currently running program is interrupted by the detection signal. in,
It is also possible to provide an interrupt handling program with the task of composing and/or disassembling the special configuration. Since the overflow detection circuit 27 is originally included in most modern computers,
The only new hardware that needs to be prepared is the format detection circuits 17 and 18 and an interrupt mechanism based on their signals, and most of the arithmetic units can be of the current type that handles only the basic format.
また特別形式についても、第4図に示したもの
は一実施例にすぎず、種々の変形が考えられる。
第6図に変形による一実施例を示す。第6図にお
いて、9,10,11は第4図と同じであり、2
9は仮数のアドレス部、30は仮数、31,32
はともに用途を定めていない未使用部である。こ
の実施例では仮数部の桁数を基本形式と同じにし
て精度を保つために、仮数は別の語に収容し、2
9にそのアドスを収容している。真の0との区別
は未使用部31に1ビツトこれを区別するビツト
を設けてもよいが、29のアドレスから全ビツト
が0のアドレスを除いておいてもよい。同様に非
数表示部を31に設けてもよいが、仮数アドレス
の一部を非数の指定に当ててもよい。 Regarding the special format, the one shown in FIG. 4 is only one example, and various modifications can be considered.
FIG. 6 shows a modified embodiment. In Figure 6, 9, 10, 11 are the same as in Figure 4, and 2
9 is the address part of the mantissa, 30 is the mantissa, 31, 32
Both are unused parts for which no purpose has been determined. In this example, in order to maintain precision by keeping the number of digits in the mantissa the same as in the basic format, the mantissa is stored in a separate word, and 2
9 houses the addos. To distinguish it from a true 0, one bit may be provided in the unused portion 31 to distinguish it, but addresses in which all bits are 0 may be excluded from the 29 addresses. Similarly, a non-number display section 31 may be provided, but a part of the mantissa address may be used to specify a non-number.
さらにこれらの実施例は、現在多くの電子計算
機で用いられている浮動小数点表示の第1図に示
す一例に基本形式を合致させたものであるが、正
規化した浮動小数点表示で、仮数の最上位桁が0
でない表示であれば、常に現用の形式を基本形式
とし、その仮数部の最上位桁に相当する部分をタ
グ部として特別形式を作ることができる。なお、
第1図の表示では基数は16であつたが、2を基
数とする表示で、正規化されている場合には、仮
数部の最上位ビツトが常に1であることから、こ
のビツトを省略する表示があるが、この表示には
本発明の方式は適用できない。しかしこの表示を
採用している電子計算機は稀れである。 Furthermore, these examples have a basic format that matches the example shown in Figure 1 of the floating point representation currently used in many electronic computers, but the maximum number of the mantissa is Upper digit is 0
If the display is not, a special format can be created by always using the current format as the basic format and using the part corresponding to the most significant digit of the mantissa as the tag section. In addition,
In the display in Figure 1, the base number was 16, but in a display with a base of 2 and normalization, the most significant bit of the mantissa is always 1, so this bit is omitted. Although there is a display, the method of the present invention cannot be applied to this display. However, electronic computers that use this display are rare.
また浮動小数点表示を正規化して使用するのが
原則であるが、演算結果を正規化しないで残す命
令をも持つていて、正規化されていないオペラン
ドを許している電子計算機もある。この種の電子
計算機に本発明を適用する場合には、非正規化演
算命令を使用しないようにすることが一つの方法
であるが、それではこれらの命令をすでに使用し
ているプログラムが使えなくなるので、別の方法
としてこれらの命令が正規化命令と同機能になる
ようにハードウエアを変更することが考えられ
る。この変更を行つても大部分のプログラムの動
作には支障がなく、プログラムの変更は極く一部
の特殊なものに止まる。 In addition, although floating point numbers are generally used in normalized form, some electronic computers have instructions that leave the result of an operation without being normalized, and some electronic computers allow non-normalized operands. When applying the present invention to this type of electronic computer, one way is to avoid using denormalized operation instructions, but this would make programs that already use these instructions unusable. Another method would be to change the hardware so that these instructions have the same functionality as the normalization instructions. Even if this change is made, there is no problem with the operation of most programs, and the changes to the program are limited to a few special cases.
発明の効果
本発明によれば、従来のプログラムを使用して
より広い範囲の数値も表示できる異なる形式もと
ることができ、しかもユーザは溢れを意識せずま
た精度を失なうことなく使用できる。Effects of the Invention According to the present invention, a conventional program can be used in a different format that can display a wider range of numerical values, and the user can use it without being aware of overflow or losing accuracy. .
第1図は現在多く用いられている浮動小数点表
示を示す図、第2図は他の浮動小数点表示を示す
図、第3図および第4図は本発明を説明するため
の浮動小数点表示を示す図、第5図は本発明の一
実施例を示すブロツク図、第6図は本発明を説明
する他の浮動小数点表示を示す図である。
1および10……符号、2および11……指数
部、3,12,13……仮数部、8および12…
…仮数部の最上位桁、15および16……オペラ
ンドレジスタ、17および18……形式検出回
路、19および20……分解回路、21および2
3……仮数レジスタ、22および24……指数レ
ジスタ、25……仮数演算回路、26……指数演
算回路、27……溢れ検出回路、28……結果合
成回路。
Figure 1 shows a floating point representation that is currently widely used, Figure 2 shows another floating point representation, and Figures 3 and 4 show floating point representations for explaining the present invention. 5 is a block diagram showing one embodiment of the present invention, and FIG. 6 is a diagram showing another floating point representation for explaining the present invention. 1 and 10... sign, 2 and 11... exponent part, 3, 12, 13... mantissa part, 8 and 12...
...Most significant digit of mantissa, 15 and 16...Operand register, 17 and 18...Format detection circuit, 19 and 20...Decomposition circuit, 21 and 2
3... Mantissa register, 22 and 24... Exponent register, 25... Mantissa calculation circuit, 26... Exponent calculation circuit, 27... Overflow detection circuit, 28... Result synthesis circuit.
Claims (1)
点表示の数値を扱うデータ処理装置において、浮
動小数点表示の形式として、上記指数部、仮数部
および符号の全ビツトが0である真の0を除いて
仮数部の最上位桁が0でない第1の形式と、該第
1の形式と指数部、仮数部のビツト数が異なり、
該第1の形式の仮数部の最上位桁に相当する部分
が0とされ、かつ仮数部の最上位桁が0でない第
2の形式とを有し、上記第1および第2の形式の
仮数部の最上位桁に相当する部分から表示形式を
検出し、これに応じて演算機構を動作させること
を特徴とする浮動小数点演算方式。 2 上記演算機構における演算結果に応じていず
れかの表示形式をとることを特徴とする特許請求
の範囲第1項記載の浮動小数点演算方式。[Scope of Claims] 1. In a data processing device that handles numerical values in floating point representation consisting of an exponent part, a mantissa part, and a sign, all bits of the exponent part, mantissa part, and sign are 0 as a floating point representation format. A first format in which the most significant digit of the mantissa part is not 0 except for true 0, and the number of bits of the exponent part and the mantissa part are different from the first format,
and a second format in which the part corresponding to the most significant digit of the mantissa part of the first format is 0, and the most significant digit of the mantissa part is not 0, and the mantissa of the first and second formats A floating point arithmetic method that detects the display format from the part corresponding to the most significant digit of the part and operates the arithmetic mechanism accordingly. 2. The floating point arithmetic system according to claim 1, wherein one of the display formats is adopted depending on the arithmetic result in the arithmetic mechanism.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP57094834A JPS58213339A (en) | 1982-06-04 | 1982-06-04 | Floating-point arithmetic system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP57094834A JPS58213339A (en) | 1982-06-04 | 1982-06-04 | Floating-point arithmetic system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS58213339A JPS58213339A (en) | 1983-12-12 |
| JPH04301B2 true JPH04301B2 (en) | 1992-01-07 |
Family
ID=14121067
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP57094834A Granted JPS58213339A (en) | 1982-06-04 | 1982-06-04 | Floating-point arithmetic system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS58213339A (en) |
-
1982
- 1982-06-04 JP JP57094834A patent/JPS58213339A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS58213339A (en) | 1983-12-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5825678A (en) | Method and apparatus for determining floating point data class | |
| US5696709A (en) | Program controlled rounding modes | |
| EP0540150A2 (en) | Improved arithmetic logic unit | |
| JPH0844557A (en) | Data processing device | |
| GB1108800A (en) | Improvements in or relating to electronic data processing machines | |
| JPH0769783B2 (en) | Exception handling method | |
| US6370639B1 (en) | Processor architecture having two or more floating-point status fields | |
| JP2970821B2 (en) | Data processing device | |
| KR960011277B1 (en) | Programmable controller | |
| US4373182A (en) | Indirect address computation circuit | |
| US6212539B1 (en) | Methods and apparatus for handling and storing bi-endian words in a floating-point processor | |
| US4942547A (en) | Multiprocessors on a single semiconductor chip | |
| JPH04301B2 (en) | ||
| EP0265948B1 (en) | Data processor capable of immediately calculating branch address in relative address branch | |
| US4473886A (en) | Data processing apparatus with algebraic memory operation and entry sequence | |
| JP3137636B2 (en) | Data processing device | |
| JP6332091B2 (en) | Electronic control unit | |
| JPS6349259B2 (en) | ||
| CA1257706A (en) | Multiprocessors on a single semiconductor chip | |
| US4907185A (en) | Program-controlled computer with an interrupt capability for floating-point operation | |
| JPH0338724A (en) | Information processor capable of carrying out plural floating point type arithmetic operation | |
| JP4193773B2 (en) | Arithmetic control device and program | |
| JP4428778B2 (en) | Arithmetic device, arithmetic method, and computing device | |
| JP3588368B2 (en) | Timer update assist method and timer device | |
| JP3123545B2 (en) | Data processing device |