Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0680487B2 - Processor - Google Patents
[go: Go Back, main page]

JPH0680487B2 - Processor - Google Patents

Processor

Info

Publication number
JPH0680487B2
JPH0680487B2 JP59169318A JP16931884A JPH0680487B2 JP H0680487 B2 JPH0680487 B2 JP H0680487B2 JP 59169318 A JP59169318 A JP 59169318A JP 16931884 A JP16931884 A JP 16931884A JP H0680487 B2 JPH0680487 B2 JP H0680487B2
Authority
JP
Japan
Prior art keywords
length
overflow
digit
ary
result
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
Application number
JP59169318A
Other languages
Japanese (ja)
Other versions
JPS6148036A (en
Inventor
達也 酒井
佐孝 石川
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP59169318A priority Critical patent/JPH0680487B2/en
Publication of JPS6148036A publication Critical patent/JPS6148036A/en
Publication of JPH0680487B2 publication Critical patent/JPH0680487B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods 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/491Computations with decimal numbers radix 12 or 20.
    • G06F7/492Computations with decimal numbers radix 12 or 20. using a binary weighted representation within each denomination
    • G06F7/493Computations with decimal numbers radix 12 or 20. using a binary weighted representation within each denomination the representation being the natural binary coded representation, i.e. 8421-code
    • G06F7/494Adding; Subtracting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/38Indexing scheme relating to groups G06F7/38 - G06F7/575
    • G06F2207/3804Details
    • G06F2207/3808Details concerning the type of numbers or the way they are handled
    • G06F2207/3828Multigauge devices, i.e. capable of handling packed numbers without unpacking them
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/492Indexing scheme relating to groups G06F7/492 - G06F7/496
    • G06F2207/4924Digit-parallel adding or subtracting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods 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/499Denomination or exception handling, e.g. rounding or overflow
    • G06F7/49905Exception handling
    • G06F7/4991Overflow or underflow

Landscapes

  • Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • General Engineering & Computer Science (AREA)

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明は演算処理装置に係り、詳しくは2個の可変長デ
ータについてN進演算を行い、得られた結果の有効デー
タ部分を可変長の格納領域へ出力する演算処理装置にお
いて、有効データ長が格納領域の長さよりも長いことを
検出するN進オーバーフロー検出手段に関する。以下、
一般的な10進演算命令の場合について説明する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an arithmetic processing device, and more specifically, it performs N-ary operation on two pieces of variable length data and stores the effective data portion of the obtained result in the variable length. The present invention relates to an N-ary overflow detecting means for detecting that an effective data length is longer than the length of a storage area in an arithmetic processing unit for outputting to an area. Less than,
The case of a general decimal operation instruction will be described.

〔発明の背景〕[Background of the Invention]

10進演算命令は、2進化10進形式で表わされた数の可変
長の第1オペランドと、同じく2進化10進形式で表わさ
れた可変長の第2オペランドの間で加算、減算、乗算及
び除算を行い、その結果が第1オペランド領域に格納さ
れるものである。命令形式は、演算の種類を指定するオ
ペレーションコード、第1及び第2オペランドの開始ア
ドレス並びに第1及び第2オペランドの長さを示す値と
からなる。例えば、10進加算命令の処理は、第2オペラ
ンドが第1オペランドへ加えられ、その結果が第1オペ
ランド領域に格納されることで終了する。この時、第1
オペランドの長さの値は、結果が格納されるべき領域の
長さをも表わしており、演算結果が第1オペランドの領
域に格納できず、有効な結果の一部が消失することがあ
る。たとえば、第オペランドの長さが第1オペランドよ
りも長い場合の加算結果には、データの消失が起こりう
る可能性がある。もっともオペランドの長さのみによっ
て有効なデータが消失しうるとは限らず、第2オペラン
ド長が比較的長くても、その上位桁に0が連続してある
ような場合には必ずしもデータが消失するとは限らな
い。
Decimal operation instructions are addition, subtraction between a variable-length first operand of the number expressed in the binary coded decimal format and a variable-length second operand also expressed in the binary coded decimal format, Multiplication and division are performed, and the result is stored in the first operand area. The instruction format includes an operation code that specifies the type of operation, start addresses of the first and second operands, and a value that indicates the length of the first and second operands. For example, the processing of a decimal addition instruction ends when the second operand is added to the first operand and the result is stored in the first operand area. At this time, the first
The value of the length of the operand also represents the length of the area in which the result is to be stored, and the operation result cannot be stored in the area of the first operand, and a part of the valid result may be lost. For example, data loss may occur in the addition result when the length of the first operand is longer than that of the first operand. However, it is not always possible to lose valid data only by the length of the operand, and even if the second operand length is relatively long, data will always be lost if there are consecutive 0s in the upper digits. Not necessarily.

10進演算結果がオーバーフローを起こし、データが消失
する場合、プログラム的に割込みを発生するか否かは、
割込み制御マスクにより制御されるが、オーバーフロー
の検出方式についてはハードウェア回路に依存してい
る。
When the decimal operation result overflows and data is lost, whether to programmatically generate an interrupt depends on
Although it is controlled by the interrupt control mask, the overflow detection method depends on the hardware circuit.

従来、演算結果がオーバーフローになったことを高速に
検出する方式として、特公昭57−46574号「オーバーサ
イズデータ検出装置」がある。これは、演算結果の全桁
について一桁ごとに有効データであるか否かのステータ
ス信号を生成し、次いで第1オペランド領域長のデコー
ド信号により前記ステータス信号のうち結果格納領域
(第1オペランド領域)の外に存在するステータス信号
だけを取り出してそのステータスを調べることにより、
高速にオーバーフロー検出を行えるように考慮されたも
のである。
Conventionally, Japanese Patent Publication No. 57-46574 "Oversize data detector" has been known as a method for rapidly detecting that an operation result has overflowed. This is to generate a status signal for every digit of all digits of the operation result whether or not it is valid data, and then use a decode signal of the first operand area length to generate a status signal in the result storage area (first operand area) of the status signal. ), Take out only the status signal that exists outside
This is designed so that overflow detection can be performed at high speed.

しかしながら、上記従来方式は、オーバーフロー検出の
ためだけに多大の専用ハードウェア回路を配置しなけれ
ばならないという欠点を有している。すなわち、同特許
公報第6図乃至第8図に示されているような、演算結果
の各バイトのステータス(オール0かオール1)を検出
するための回路、信号選択器及び非行先ステータス発生
器、さらに全バイトステータス発生器等を、オーバーフ
ロー検出のみに使用する専用のハードウェアとして用意
する必要がある。このように、オーバーフロー検出に特
定されるようなハードウェアの増加は、計算機のコスト
を引き上げ、さらにゲート数増加による信頼性の低下を
まねく要因になるものである。
However, the above conventional method has a drawback that a large number of dedicated hardware circuits must be arranged only for detecting overflow. That is, a circuit, a signal selector, and a non-destination status generator for detecting the status (all 0 or all 1) of each byte of the operation result as shown in FIGS. Moreover, it is necessary to prepare an all-byte status generator etc. as dedicated hardware used only for overflow detection. As described above, the increase in the hardware specified by the overflow detection raises the cost of the computer and causes the decrease in reliability due to the increase in the number of gates.

また。上記従来方式は、通常の10進演算命令で使用され
るパック形式の2進化10進データの他に、ゾーン形式の
2進化10進データや符号のついた可変長の純2進数形式
のデータについても、オーバーフローを検出することが
できる機構となっているが、後者の2つのオーバーフロ
ー検出は一般的な計算機においては不必要な機構で、通
常の10進演算オーバーフロー検出には最適な方式とはい
えない。
Also. The above conventional method is applied to zoned binary coded decimal data and coded variable-length pure binary coded format data in addition to packed binary coded decimal data used in ordinary decimal operation instructions. Although it is a mechanism that can detect overflow, the latter two overflow detections are unnecessary in a general computer and are not the most suitable method for normal decimal arithmetic overflow detection. Absent.

また、10進オーバーフローが検出された場合、プログラ
ム割込みは割込み制御マスクによって制御されるが、割
込みの発生は、演算結果の一部が消失されたデータを第
1オペランド領域へ格納された後でもよい。すなわち、
オーバーフローの起きた10進命令を完了した時点でよ
い。そのため演算結果の格納動作と並行してオーバーフ
ローが検出できればよく、上記特公昭57−46574号に開
示されているように、多大の専用ハードウェアを設けて
演算結果とほぼ同時にオーバーフローを検出する必要性
はない。
Further, when a decimal overflow is detected, the program interrupt is controlled by the interrupt control mask, but the interrupt may occur after the data in which a part of the operation result has been lost is stored in the first operand area. . That is,
It is sufficient to complete the decimal instruction that caused the overflow. Therefore, it suffices if the overflow can be detected in parallel with the operation result storing operation, and it is necessary to provide a large amount of dedicated hardware to detect the overflow almost simultaneously with the operation result as disclosed in Japanese Patent Publication No. 57-46574. There is no.

〔発明の目的〕[Object of the Invention]

本発明の目的は、2個の可変長データのN進演算におけ
る演算オーバフロー検出のために多大なハードウェアを
設けることのない演算処理装置を提供することにある。
An object of the present invention is to provide an arithmetic processing device that does not require a large amount of hardware for detecting an arithmetic overflow in N-ary arithmetic of two variable length data.

〔発明の概要〕[Outline of Invention]

本発明の演算処理装置の特徴とするところは、浮動小数
点演算の演算結果の正規化のために使用するデジット・
エンコーダを備えた情報処理装置において、演算対象の
各可変長データを下位の桁から予め定められた所定長の
桁数の部分に分割し、下位の方から所定長の桁数の部分
の演算を順次行い、その演算結果のキャリーを上位の所
定長の桁数の部分の演算に用いてN進演算を行う所定長
の桁数のN進加算器と、前記のデジット・エンコーダに
よりN進加算器の演算結果を検索して有効データの最上
位位置を示す値を出力する最上位有効桁位置出力手段
と、この最上位有効桁位置出力手段が出力する値および
格納領域の長さを示す値に基づいて、N進加算器の演算
結果の有効データ長が格納領域よりも長いことによりオ
ーバフローの発生を検出するとともに、N進加算器から
のN進演算に対する最終の所定長の桁数部分の演算結果
のキャリーと演算対象の可変長データの符号とN進演算
が加算あるいは減算のいずれであるかを示すビットとに
よりオーバフローの発生を検出するオーバフロー発生検
出手段とを備えることにある。
The feature of the arithmetic processing unit of the present invention is that the digit used for normalizing the arithmetic result of the floating point arithmetic
In an information processing device equipped with an encoder, each variable-length data to be operated is divided from the lower digit into a predetermined number of digits of a predetermined length, and the operation of the lower number of digits of a predetermined length is performed. An N-ary adder with a predetermined number of digits for performing N-ary operation by sequentially performing the carry of the operation results for the operation of the upper digit with a predetermined number of digits, and an N-ary adder with the digit encoder. The highest effective digit position output means for retrieving the calculation result of and outputting the value indicating the highest position of effective data, and the value output by this highest effective digit position output means and the value indicating the length of the storage area On the basis of this, the occurrence of overflow is detected because the effective data length of the operation result of the N-ary adder is longer than the storage area, and the operation of the final predetermined number of digits for the N-ary operation from the N-ary adder is performed. Result carry and operation pair Lies in and a overflow detection means codes the N-ary calculation of variable length data to detect the occurrence of the overflow by a bit indicating whether it is the addition or subtraction of.

〔発明の実施例〕Example of Invention

以下、本発明の一実施例を図面により詳細に説明する。 An embodiment of the present invention will be described in detail below with reference to the drawings.

第1図は本発明の一実施例の構成図で、16桁の10進演算
結果のオーバーフロー検出装置を示す。第1図におい
て、2は8バイト(64ビット)の2進加算器であり、そ
の各々入力に入力補正器1a,1bを有し、出力には出力補
正器3を有して2進加減算および10進加減算ができる一
般的な2進/10進併用加算器を構成している。2進加算
器2の最上位ビットからのキャリィは、キャリィ・レジ
スタ(CAR)4へ入力され、その出力は再び2進加算器
2の最下位ビットへ与えられると共にオーバーフロー決
定回路13へも供給されている。出力補正器3の出力は、
2進/10進併用加算器2の演算結果そのものでZバス5
によって結果格納部(図には明示していない)へ送られ
るとともに、オーバーフロー検出論理部15のデジット・
エンコーダ6へ供給される。デジット・エンコーダ6の
構成は第2図に示す如くであり、Zバス5上の64ビット
の演算結果をオア回路200〜215でデジット(4ビット)
毎にオアして16個の出力P0〜P15得、この出力P0〜P15
一般的な16ビット・プラィオリティエンコーダ30に与え
て、エンコード結果E0〜E4を得るものである。第3図に
エンコーダ30の論理動作を示す。
FIG. 1 is a block diagram of an embodiment of the present invention, showing an overflow detection device for a 16-digit decimal operation result. In FIG. 1, reference numeral 2 denotes an 8-byte (64-bit) binary adder, each of which has input compensators 1a and 1b at its input and an output compensator 3 at its output, and binary addition and subtraction It constitutes a general binary / decimal combined adder capable of decimal addition and subtraction. The carry from the most significant bit of the binary adder 2 is input to the carry register (CAR) 4, and its output is again provided to the least significant bit of the binary adder 2 and also supplied to the overflow decision circuit 13. ing. The output of the output corrector 3 is
Binary / decimal combination adder 2 operation result itself is Z bus 5
Sent to the result store (not explicitly shown in the figure) by the overflow detection logic 15
It is supplied to the encoder 6. The structure of the digit encoder 6 is as shown in FIG. 2, and the 64-bit operation result on the Z bus 5 is digitized by the OR circuits 200 to 215 (4 bits).
16 outputs P 0 to P 15 are obtained every time, and these outputs P 0 to P 15 are given to a general 16-bit priority encoder 30 to obtain encoding results E 0 to E 4. is there. FIG. 3 shows the logical operation of the encoder 30.

ディジット・エンコーダ6のエンコード結果は、演算結
果の有効行(ゼロでない値)の先頭位置がどこにあるか
を示しているため、いろいろな処理に使用される。例え
ば2進/10進併用加算器2が浮動小数点加算命令で2進
加算を行った場合、その演算結果の上位の不要なデジッ
トゼロを除去し、さらに除去したデジット相当の値を中
間指数部から減算するという正規化処理があるが、この
時の演算結果の上位の不要なデジットゼロを検出すると
きに上記エンコーダ6が使用される。また、エンコード
結果E0〜E4が全て1であると演算結果はオール0である
ことを示しているため、演算結果の状態でセットするコ
ンディションコードの条件として使用されたり、演算結
果がゼロであるか否かをテストしながら進むマイクロ命
令のテスト条件にも使用される。このようにエンコーダ
6は、オーバーフロー検出論理部15内に存在はしている
が、そのハードウェアは必ずしもオーバーフロー検出に
のみ使用されるのではない。
The encoding result of the digit encoder 6 indicates where the leading position of a valid row (non-zero value) of the operation result is, and is used for various processes. For example, when the binary / decimal combination adder 2 performs binary addition with a floating point addition instruction, unnecessary upper digit zero of the operation result is removed, and the removed digit equivalent value is output from the intermediate exponent part. Although there is a normalization process of subtraction, the encoder 6 is used when detecting the upper unnecessary digit zero of the operation result at this time. Further, if the encoding results E 0 to E 4 are all 1, it indicates that the operation result is all 0, so it is used as a condition of the condition code to be set in the operation result state, or the operation result is zero. It is also used as a test condition for microinstructions that proceed while testing whether or not they exist. Thus, although the encoder 6 resides within the overflow detection logic 15, its hardware is not necessarily used only for overflow detection.

ディジット・エンコーダ6の出力E0〜E4のうち、E0〜E3
は比較器9へ与えられ、E4は接続されない。すなわち、
10進演算のオーバーフロー検出には、第1オペランドの
格納領域がバイト単位で規定されているため、バイト内
のどちらのディジットかを示すE4は比較器9には不要で
ある。
Of the outputs E 0 to E 4 of the digit encoder 6, E 0 to E 3
Is fed to the comparator 9 and E 4 is not connected. That is,
Since the storage area of the first operand is defined in units of bytes for detecting the overflow of the decimal operation, the comparator 9 does not need E 4 indicating which digit in the byte.

比較器9はエンコーダ6の出力E0〜E3と第1オペランド
の格納領域長を示す値L10,L11,L12,L13を比較する回路
である。L10〜L13で示される値は、10進命令の第1オペ
ランド長として与えられるもので、一般の10進命令にお
いては、実際のバイト数よりも1バイトだけ短い値であ
る。例えばL10L11L12L13=0101であること、格納領域長
は5+1=6バイトであることを示す。
The comparator 9 is a circuit for comparing the outputs E 0 to E 3 of the encoder 6 with the values L1 0 , L1 1 , L1 2 and L1 3 indicating the storage area length of the first operand. Value indicated by L1 0 ~L1 3 is intended to be given as the first operand length decimal instructions, in general decimal instructions, a 1-byte only shorter than the actual number of bytes. For example, L1 0 L1 1 L1 2 L1 3 = 0101, and the storage area length is 5 + 1 = 6 bytes.

第4図に比較器9の構成例を示す。第4図において、30
0〜307はアンド回路、310〜315はオア回路、230〜322は
インバータである。比較器9は第5図(a)(L10=1
のとき)、第5図(b)(L10=0のとき)に示す演算
でそれぞれの先頭ビットからのキャリィC0(L10=1の
とき)、C1(L10=0のとき)を求めて、L10=1のと
き、C0=0でOV0とL11=0のとき、C1=0でOV1 をそれぞれ出力する。OV0,OV1は各条件のもとでオーバ
ーフローが発生していることを示している。
FIG. 4 shows a configuration example of the comparator 9. In FIG. 4, 30
0 to 307 are AND circuits, 310 to 315 are OR circuits, and 230 to 322 are inverters. The comparator 9 is shown in FIG. 5 (a) (L1 0 = 1
When), FIG. 5 (b) (L1 0 = carry C 0 from the respective first bit operation shown in the time) of 0 (when L1 0 = 1), when the C 1 (L1 0 = 0) the seeking, when L1 0 = 1, when C 0 = 0 in OV0 and the L1 1 = 0, and outputs the OV1 in C 1 = 0, respectively. OV0 and OV1 indicate that an overflow has occurred under each condition.

比較器9の出力10(OV0,OV1)はオーバーフロー決定回
路13へ入力される。オーバーフロー決定回路13には、さ
らに第1オペランドの符号S1、第2オペランドの符号S
2、10進加算命令であることを示す信号Aが(10進減算
命令のときはA=0となる)が入力されている。オーバ
ーフロー決定回路13は、出力として10進演算のオーバー
フローが検出されたことを示す信号OVFを出力線14に出
力する。
The output 10 (OV0, OV1) of the comparator 9 is input to the overflow determination circuit 13. The overflow determination circuit 13 further includes a code S1 of the first operand and a code S of the second operand.
2. A signal A indicating that it is a decimal addition instruction (A = 0 when it is a decimal subtraction instruction) is input. The overflow determination circuit 13 outputs, as an output, a signal OVF indicating that a decimal operation overflow has been detected, to the output line 14.

第6図にオーバーフロー決定回路13の構成例を示す。第
6図において、400は排他的論理和回路、401はアンド回
路、402はオア回路である。すなわち、オーバーフロー
決定回路13は、 OVF=OV0+OV1+CAR・(S1S2A) の論理演算を行う。ここで、(S1S2A)は、10進加
算器が同符号の2つのデータ間で加算が行われることを
示す条件である。CAR・(S1S2A)は、同符号の2
つのデータ間で加算が行われたとき、2進加算器2の先
頭ビットからのキャリィCARがあったことを示し、それ
は、演算結果が8バイトまたは16バイトを越えることを
意味している。このとき第1オペランド長及び第2オペ
ランド長が共に8バイト以下であるときには、オーバー
フローが発生しており、また、第1オペランド長または
第2オペランド長のどちらかが8バイトを越えている場
合は、最初に後半8バイト分の演算を行うが、その時の
CARはオーバーフロー決定回路13へは与えず、2進加算
器2の最下位ビットへ供給するパスを通して次に行われ
る残りのバイト分の加算時に使用され、この時の演算で
発生したCARがオーバーフロー決定回路13へ与えられる
ようにすることにより、オーバーフローの検出を行うこ
とができる。
FIG. 6 shows a configuration example of the overflow decision circuit 13. In FIG. 6, 400 is an exclusive OR circuit, 401 is an AND circuit, and 402 is an OR circuit. That is, the overflow determination circuit 13 performs a logical operation of OVF = OV0 + OV1 + CAR · (S1S2A). Here, (S1S2A) is a condition indicating that the decimal adder performs addition between two pieces of data having the same sign. CAR ・ (S1S2A) is the same code 2
When an addition is made between two data, it indicates that there was a carry CAR from the first bit of the binary adder 2, which means that the operation result exceeds 8 bytes or 16 bytes. At this time, if the first operand length and the second operand length are both 8 bytes or less, an overflow has occurred, and if either the first operand length or the second operand length exceeds 8 bytes, , First, the latter half 8 bytes are calculated, but at that time
The CAR is not given to the overflow decision circuit 13 and is used at the time of the addition of the remaining bytes to be performed next through the path supplied to the least significant bit of the binary adder 2. The CAR generated at this time is decided as the overflow. By being provided to the circuit 13, the overflow can be detected.

<実施例の動作> 2個の可変長の2進化10進データは、一つはXバス、他
の一つはYバスからそれぞれ入力補正器1a,1bを通って
2進加算器2へ与えられる。2進加算器2による2進加
算結果にもとづいて出力補正器3にて、出力補正され、
その演算結果がZバス5へ供給される。この演算結果は
結果格納部へ送られ、そこで格納動作が開始される。一
方、Zバス5の内容はデジット・エンコーダ6へ与えら
れ、最上位有効桁の位置を示すエンコード出力E0〜E4
信号線7に得られる。このエンコード出力のうちE0〜E3
が比較器9へ与えられて第1オペランド長を示す値L10L
11L12L13と比較される。比較器9のしくみは第5図に示
した通りであり、格納領域のバイト数(L10L11L12L13
1)から演算結果の有効バイト数(
1)を引いたものである。この時、格納領域が8バイト
を越えているときには、キャリィC0がないとオーバーフ
ローになり、格納領域が8バイト以下であるときには、
キャリィC1がないとオーバーフローとなる。ただし、格
納領域が8バイトを越えるときには、最初の後半の8バ
イトを演算するが、この時、デジット・エンコーダ6は
通常どおりの動作を行うが、次に残りのバイトを演算し
たとき、その演算結果に対するデジットエンコードの出
力のE0が0のときは(この中に有効桁がある)、残りバ
イトの演算結果のデジットエンコードの比較器9へ送出
するが、E0が1のときは(残りバイト演算の中に有効桁
はない)、E1〜E4は先のデジットエンコーダ結果を使用
するようにする。このように格納領域の大きさによりデ
ジットエンコードの出力を切り分けることが生じるが、
それは、最大16バイトまで存在するデータに対して8バ
イト演算器を使用していることによるもので、16バイト
演算器を用いれば、このようなことは生じない。したが
って、デジットエンコーダ6の出力を切り変えること
は、本発明の基本にかかわるものではない。デジットエ
ンコーダは、あくまでも先頭の有効桁を検出する手段と
してのみ使用しているものである。
<Operation of Embodiment> Two pieces of variable-length binary coded decimal data are given to the binary adder 2 from the X bus and the Y bus through the input correctors 1a and 1b, respectively. To be The output is corrected by the output corrector 3 based on the result of the binary addition by the binary adder 2,
The calculation result is supplied to the Z bus 5. The result of this calculation is sent to the result storage unit, where the storage operation is started. On the other hand, the contents of the Z bus 5 are supplied to the digit encoder 6, and the encoded outputs E 0 to E 4 indicating the position of the most significant digit are obtained on the signal line 7. Of this encoded output, E 0 to E 3
Is given to the comparator 9 to indicate the value L1 0 L indicating the first operand length.
Compared to 1 1 L1 2 L1 3 . The mechanism of the comparator 9 is as shown in FIG. 5, and the number of bytes in the storage area (L1 0 L1 1 L1 2 L1 3 +
1) From the number of effective bytes of the operation result ( 0 1 2 3 +
1) is subtracted. At this time, if the storage area exceeds 8 bytes, overflow occurs if there is no carry C 0 , and if the storage area is 8 bytes or less,
Without carry C 1 overflows. However, when the storage area exceeds 8 bytes, the first 8 bytes of the latter half are operated. At this time, the digit encoder 6 operates normally, but when the remaining bytes are operated next, the operation is performed. When E 0 of the digit-encoded output for the result is 0 (there is a significant digit), it is sent to the digit-encoded comparator 9 of the operation result of the remaining bytes, but when E 0 is 1 (the remaining digit is There is no significant digit in the byte operation), and E 1 to E 4 use the previous digit encoder result. In this way, the digit-encoded output may be divided depending on the size of the storage area.
This is because the 8-byte arithmetic unit is used for the data existing up to 16 bytes, and if the 16-byte arithmetic unit is used, such a thing does not occur. Therefore, switching the output of the digit encoder 6 is not the basis of the present invention. The digit encoder is used only as a means for detecting the leading significant digit.

比較器9の出力OV0,OV1は信号線10によりオーバーフロ
ー決定回路13へ与えられ、そのうちのどちらかがオンに
なれば、オーバーフローが検出される。しかし、比較器
9にて検出できない場合があるので、それを検出するた
めの論理がオーバーフロー決定回路13に付加されてい
る。それは、例えば演算結果がオール0となり(E0〜E3
=1111)、2進加算器2のキャリィCARが発生するよう
なケース、すなわち、同符号の2つのデータが加算され
たケースの先頭ビットからのキャリィがあるようなケー
スである。この時のキャリィは、演算結果が格納領域に
入らないことを示しており、比較器9の出力はそれを検
出できない。したがって、第6図に示した如く、CAR・
(S1S2A)なる条件と、比較器9の出力OV0とOV1と
の論理和によってオーバーフローを検出することにな
る。しかしながら、演算器巾が16バイトで出力17バイト
を求め、その出力に対してエンコーダを設け、有効桁を
検出するようにすれば、比較器9と同様の方式でオーバ
ーフローを検出できる。
The outputs OV0, OV1 of the comparator 9 are given to the overflow determination circuit 13 by the signal line 10, and if either of them is turned on, the overflow is detected. However, since there is a case where the comparator 9 cannot detect it, a logic for detecting it is added to the overflow determination circuit 13. For example, the calculation result becomes all 0 (E 0 to E 3
= 1111) This is the case where the carry CAR of the binary adder 2 occurs, that is, the carry from the first bit in the case where two data of the same sign are added. The carry at this time indicates that the operation result does not enter the storage area, and the output of the comparator 9 cannot detect it. Therefore, as shown in FIG.
Overflow is detected by the condition (S1S2A) and the logical sum of the outputs OV0 and OV1 of the comparator 9. However, if the arithmetic unit width is 16 bytes and the output is 17 bytes, and an encoder is provided for the output to detect the significant digit, overflow can be detected in the same manner as the comparator 9.

以上の10進演算のオーバーフロー検出は、演算結果の格
納動作と並行して行われ、格納が完了して該当命令が完
了するまでに、オーバーフローは検出されることにな
る。
The above-described decimal operation overflow detection is performed in parallel with the operation result storage operation, and the overflow is detected by the time the storage is completed and the corresponding instruction is completed.

〔発明の効果〕〔The invention's effect〕

本発明によれば、可変長データを所定長に分割して所定
長の演算を繰り返すことによりN進演算を実行するとと
もに、浮動小数点演算の演算結果の正規化のために使用
するデジット・エンコーダをオーバフロー検出に流用す
るので、少ないハードウェア量でオーバフローを検出す
ることができる。したがって、計算機全体としてみれ
ば、ハードウェア量を低減することができる。
According to the present invention, a digit encoder used for normalizing an operation result of a floating-point operation while executing variable N data by dividing variable-length data into a predetermined length and repeating an operation of a predetermined length. Since it is used for overflow detection, overflow can be detected with a small amount of hardware. Therefore, the amount of hardware can be reduced in the computer as a whole.

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

第1図は本発明の一実施例の全体構成図、第2図は第1
図におけるデジットエンコーダの詳細構成図、第3図は
デジットエンコーダ内の16ビット、プラィオリティエン
コーダの動作説明図、第4図は第1図における比較器の
詳細構成図、第5図は比較器の動作説明図、第6図は第
1図におけるオーバーフロー決定回路の詳細構成図であ
る。 2……2進加算器、4……キャリィ・レジスタ、6……
デジットエンコーダ、9……比較器、13……オーバーフ
ロー決定回路、15……オーバーフロー検出論理部。
FIG. 1 is an overall configuration diagram of an embodiment of the present invention, and FIG.
FIG. 3 is a detailed configuration diagram of the digit encoder, FIG. 3 is an operation explanatory diagram of the 16-bit priority encoder in the digit encoder, FIG. 4 is a detailed configuration diagram of the comparator in FIG. 1, and FIG. 5 is a comparator. 6 is a detailed configuration diagram of the overflow determination circuit in FIG. 2 ... Binary adder, 4 ... Carry register, 6 ...
Digit encoder, 9 ... comparator, 13 ... overflow decision circuit, 15 ... overflow detection logic section.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】浮動小数点演算の演算結果の正規化のため
に使用するデジット・エンコーダを備えた情報処理装置
において、2個の可変長データについてN進演算を行
い、その演算結果の指定された部分を可変長の格納領域
へ出力する演算処理装置であって、前記可変長データの
各々を下位の桁から予め定められた所定長の桁数の部分
に分割し、下位の方から前記所定長の桁数の部分の演算
を順次行い、その演算結果のキャリーを上位の前記所定
長の桁数の部分の演算に用いて前記N進演算を行う前記
所定長の桁数のN進加算器と、前記デジット・エンコー
ダにより前記N進加算器の演算結果を検索して有効デー
タの最上位位置を示す値を出力する最上位有効桁位置出
力手段と、前記最上位有効桁位置出力手段が出力する値
および前記格納領域の長さを示す値に基づいて、前記N
進加算器の演算結果の有効データ長が前記格納領域より
も長いことによりオーバフローの発生を検出するととも
に、前記N進加算器からの前記N進演算に対する最後の
前記所定長の桁数部分の演算結果のキャリーと前記2個
の可変長データの符号と前記N進演算が加算あるいは減
算のいずれであるかを示すビットとによりオーバフロー
の発生を検出するオーバフロー発生検出手段とを備える
ことを特徴とする演算処理装置。
1. An information processing apparatus equipped with a digit encoder used for normalizing the operation result of a floating point operation, performs N-ary operation on two variable length data, and specifies the operation result. An arithmetic processing unit for outputting a portion to a variable-length storage area, wherein each of the variable-length data is divided from a lower digit into a portion having a predetermined number of digits, and the predetermined length is given from the lower digit. An N-ary adder having a predetermined number of digits for performing the N-ary operation by sequentially performing the operation of the number of digits of , The digit encoder determines the operation result of the N-ary adder and outputs the value indicating the highest position of the effective data, and the highest effective digit position output means outputs the value. Value and storage area Based on the value indicating the length, the N
The occurrence of overflow is detected when the effective data length of the operation result of the binary adder is longer than the storage area, and the operation of the last digit part of the predetermined length with respect to the N-ary operation from the N-ary adder is performed. Overflow occurrence detecting means for detecting occurrence of an overflow by a carry of the result, a code of the two pieces of variable-length data, and a bit indicating whether the N-ary operation is addition or subtraction. Processing unit.
JP59169318A 1984-08-15 1984-08-15 Processor Expired - Lifetime JPH0680487B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59169318A JPH0680487B2 (en) 1984-08-15 1984-08-15 Processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59169318A JPH0680487B2 (en) 1984-08-15 1984-08-15 Processor

Publications (2)

Publication Number Publication Date
JPS6148036A JPS6148036A (en) 1986-03-08
JPH0680487B2 true JPH0680487B2 (en) 1994-10-12

Family

ID=15884315

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59169318A Expired - Lifetime JPH0680487B2 (en) 1984-08-15 1984-08-15 Processor

Country Status (1)

Country Link
JP (1) JPH0680487B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0792741B2 (en) * 1988-11-04 1995-10-09 株式会社東芝 Differential barrel shifter
JPH0778723B2 (en) * 1988-11-08 1995-08-23 日本電気株式会社 Information processing equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5924343A (en) * 1982-07-30 1984-02-08 Toshiba Corp Decimal arithmetic device

Also Published As

Publication number Publication date
JPS6148036A (en) 1986-03-08

Similar Documents

Publication Publication Date Title
KR100239029B1 (en) Result normalizers and result normalization methods for use with adders and data processors including them
KR0169264B1 (en) An operation apparatus and method thereof
US3986015A (en) Arithmetic unit for use in a digital data processor and having an improved system for parity check bit generation and error detection
JPH0542011B2 (en)
US5761521A (en) Processor for character strings of variable length
EP0487814A2 (en) Overflow determination for three-operand alus in a scalable compound instruction set machine
EP0529101B1 (en) Floating-point dividing circuit
US5506800A (en) Self-checking complementary adder unit
EP0436905A2 (en) High performance adder using carry predictions
JPH0680487B2 (en) Processor
US5748518A (en) Data processing divider
US5274830A (en) Zero warranty circuit for data path having different bit width from the length of packed decimal operand
US7467178B2 (en) Dual mode arithmetic saturation processing
US7016928B2 (en) Floating point status information testing circuit
JP3257278B2 (en) Normalizer using redundant shift number prediction and shift error correction
KR100252766B1 (en) Sticky signal generator operating at high-speed
JPH0216632A (en) Fixed point number/floating point number converting circuit
JPS61282928A (en) floating point arithmetic unit
US4141077A (en) Method for dividing two numbers and device for effecting same
JP2591250B2 (en) Data processing device
JPS61160134A (en) Exponential underflow detection circuit
RU1784971C (en) Floating point number adding-subtracting device
JPH07104777B2 (en) Floating point adder / subtractor
JPH02148140A (en) Conditional branching control method in information processing equipment
JP3522387B2 (en) Pipeline arithmetic unit