JPH06168098A - Decimal number checking device - Google Patents

Decimal number checking device

Info

Publication number
JPH06168098A
JPH06168098A JP4319947A JP31994792A JPH06168098A JP H06168098 A JPH06168098 A JP H06168098A JP 4319947 A JP4319947 A JP 4319947A JP 31994792 A JP31994792 A JP 31994792A JP H06168098 A JPH06168098 A JP H06168098A
Authority
JP
Japan
Prior art keywords
decimal number
detection
decimal
check
circuit
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
JP4319947A
Other languages
Japanese (ja)
Inventor
Hiroshi Shikame
洋志 鹿目
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP4319947A priority Critical patent/JPH06168098A/en
Publication of JPH06168098A publication Critical patent/JPH06168098A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To attain the high speed of check processing for an unpack type or a pack type decimal number. CONSTITUTION:Non-decimal number detection. incorrect zone detection and non-normalized code detection are executed in parallel for each digit of a decimal number by a decimal number check circuit 22 constituted of a non-decimal number detection circuit, an incorrect zone detection circuit, and an unnormalized code detection circuit. Then, the detected result of each digit is edited by a decimal number check signal selection and editing circuit 25 correspondingly about the non-decimal number detection, the incorrect zone detection, and the unnormalized code detection, and the validity of the decimal number is checked in conformity with this edited result. Accordingly, the check processing can be executed in parallel for plural digits to constitute the decimal number, and the check of the decimal number can be executed at high speed compared with the case that it is checked one digit at a time.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】この発明は十進数チェック装置に
関し、特に十進数チェック命令の高速化と十進演算命令
実行時の十進数チェックの高速化技術に係わる。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a decimal number checking device, and more particularly to a technique for speeding up a decimal number checking instruction and a speed for checking a decimal number when executing a decimal arithmetic instruction.

【0002】[0002]

【従来の技術】十進数にはパック形式とアンパック形式
があり、それぞれ次のように与えられる。 (1)パック形式十進数 例えば、4バイトデータの場合には、「ddddddds」 d :十進数 s :符号 このパック形式十進数は4bitを1桁とし、最下位桁
に符号が格納される。 (2)アンパック形式十進数 例えば、4バイトデータの場合には、「zdzdzdsd」 d :十進数 s :符号 z :ゾーン
2. Description of the Related Art Decimal numbers have a packed format and an unpacked format, which are given as follows. (1) Decimal number in packed format For example, in the case of 4-byte data, "ddddddds" d: decimal number s: sign This packed format decimal number has 4 bits as one digit, and the code is stored in the least significant digit. (2) Decimal number in unpack format For example, in the case of 4-byte data, "zdzdzdsd" d: Decimal number s: Code z: Zone

【0003】このアンパック形式十進数は8bitを1
桁とし、8bitの上位4bitにゾーン(0x0
3)、下位4bitに十進数が格納される。符号は最下
位桁のゾーン部に格納される。このような十進数のチェ
ックのための仕様は次の通りである。 (イ)符号の正規化 符号が正の場合は0x3 負の場合は0xBとする。 (ロ)十進数チェック命令仕様 十進数を扱う命令のオペランドアクセス方法は、オペラ
ンドのLSB側のワードからMSB側のワードにむかっ
てアクセスする降順アクセスである。 (ハ)パック形式十進数チェック命令 パック形式のフォーマットに従って、符号部が正規化さ
れているか、桁部に非十進数がないかをチェックし状態
指示子を設定する。 (ニ)アンパック形式十進数チェック命令
In this unpacked decimal number, 8 bits is 1
Digit, and zone (0x0
3), a decimal number is stored in the lower 4 bits. The code is stored in the zone part of the least significant digit. The specifications for such a decimal check are as follows. (B) Normalization of code When the code is positive, it is 0x3, and when it is negative, it is 0xB. (B) Decimal number check instruction specification The operand access method of an instruction that handles a decimal number is a descending order access in which the word on the LSB side of the operand is accessed toward the word on the MSB side. (C) Pack format decimal number check instruction According to the pack format, it is checked whether the code part is normalized or there is a non-decimal number in the digit part, and the status indicator is set. (D) Unpacked decimal check instruction

【0004】アンパック形式のフォーマットに従って、
符号部が正規化されているか、桁部に非十進数がない
か、ゾーン部に不正ゾーンがないかををチェックし状態
指示子を設定する。従来、CPU内部にレジスタファイ
ルをもつCPUで、パック形式十進数チェック命令処理
は、図5のフローに示すように行なわれていた。
According to the unpack format,
The state indicator is set by checking whether the code part is normalized, the digit part has a non-decimal number, and the zone part has no illegal zone. Conventionally, in a CPU having a register file inside the CPU, pack format decimal number check instruction processing has been performed as shown in the flow of FIG.

【0005】すなわち、オペランドデータをCPU内の
レジスタファイルに読み込み(ステップS11)、レジ
スタファイルに読み込んだオペランドデータの1桁を桁
チェックレジスタRMLに取り出し(ステップS1
2)、符号の正規化/正負チェックを行ない(ステップ
S13)、次の桁を取り出し十進数チェックを行なう
(ステップS14、S15)。
That is, the operand data is read into the register file in the CPU (step S11), and one digit of the operand data read into the register file is taken out to the digit check register RML (step S1).
2) The code is normalized / positive / negative is checked (step S13), the next digit is taken out, and a decimal number is checked (steps S14 and S15).

【0006】オペランドデータが残っている場合、次の
桁を取り出し十進数チェックするという動作を2回ずつ
オペランドデータ全てを処理するまで繰り返す(ステッ
プS17,18、ステップS19,20、ステップS2
1)。そして、オペランドデータ全てが処理し終わるか
非十進数を発見した場合に命令処理を終了する(ステッ
プS22)。サブルーチンのチェック結果は状態指示子
に反映される。
When the operand data remains, the operation of extracting the next digit and checking the decimal number is repeated twice every time until all the operand data are processed (steps S17, S18, S19, S20, S2).
1). Then, when all the operand data have been processed or a non-decimal number is found, the instruction processing is ended (step S22). The check result of the subroutine is reflected in the status indicator.

【0007】アンパック形式十進数チェック命令処理の
場合も基本的にパック形式十進数チェック命令処理と同
じであるが、図6に示されているように、最初の桁は十
進数チェック(ステップS31)、2桁目は符号の正規
化/正負チェック(ステップS32)、以降、十進数チ
ェック(ステップS33)とゾーンチェック(ステップ
S34)を繰り返す。図6のサブルーチンも図5と同様
にそのチェック結果は状態指示子に反映される。
The unpacked decimal check command processing is basically the same as the packed decimal check instruction processing, but as shown in FIG. 6, the first digit is a decimal check (step S31). The second digit repeats the sign normalization / plus / minus check (step S32), and then the decimal number check (step S33) and the zone check (step S34). The check result of the subroutine of FIG. 6 is reflected in the status indicator as in the case of FIG.

【0008】このように、従来の十進数チェック処理で
は、オペランドデータが1桁ずつ検査される。このた
め、ファームウェアの実行ステップ数が多くなる。ま
た、従来の演算器を使用して十進数チェックを行なった
場合もファームウェアの実行ステップが多い等の問題が
あった。
As described above, in the conventional decimal number check processing, the operand data is inspected digit by digit. Therefore, the number of execution steps of firmware increases. Further, even when a decimal number check is performed using a conventional arithmetic unit, there are problems such as a large number of firmware execution steps.

【0009】[0009]

【発明が解決しようとする課題】従来では、オペランド
データを1桁ずつ検査しているため、ファームウェアの
実行ステップ数が多くなり、十進数を構成する桁数が多
くなるとその十進数チェックに多くの時間が必要となる
欠点があった。
Conventionally, since the operand data is inspected one digit at a time, the number of execution steps of the firmware increases, and if the number of digits forming the decimal number increases, the decimal number check is often performed. It had the drawback of requiring time.

【0010】この発明はこのような点に鑑みてなされた
ものであり、十進数を構成する複数の桁について並列に
チェックできるようにして、十進数チェックを高速に行
なうことができる十進数チェック装置を提供することを
目的とする。
The present invention has been made in view of the above point, and a decimal number check device capable of performing a decimal number check at high speed by enabling parallel checking of a plurality of digits forming a decimal number. The purpose is to provide.

【0011】[0011]

【課題を解決するための手段および作用】この発明は、
複数桁から構成されるパック形式またはアンパック形式
の十進数の正当性を検査する十進数チェック装置におい
て、前記十進数を構成する複数桁が並列に入力され、前
記複数桁内の対応する各桁に対して非十進数検出、不正
ゾーン検出、および非正規化符号検出が並行して実行さ
れるように、複数の非十進数検出回路、不正ゾーン検出
回路、および非正規化符号検出回路から構成される十進
数チェック手段と、この十進数チェック手段から得られ
る各桁の検出結果を前記非十進数検出、不正ゾーン検
出、および非正規化符号検出にそれぞれ対応させて編集
し、その編集結果に従って十進数の正当性を検査する手
段とを具備することを特徴とする。
Means and Actions for Solving the Problems
In a decimal number check device for checking the legitimacy of a packed or unpacked decimal number consisting of a plurality of digits, a plurality of digits constituting the decimal number are input in parallel, and each corresponding digit in the plurality of digits is input. In order to perform non-decimal number detection, illegal zone detection, and denormalization code detection in parallel, it is composed of multiple non-decimal number detection circuits, illegal zone detection circuits, and denormalization code detection circuits. The decimal number checking means and the detection result of each digit obtained from the decimal number checking means are edited in correspondence with the non-decimal number detection, the illegal zone detection, and the denormalization code detection, respectively, and the decimal result is edited according to the edited result. And a means for checking the correctness of the base number.

【0012】この十進数チェック装置においては、複数
の非十進数検出回路、不正ゾーン検出回路、および非正
規化符号検出回路から構成される十進数チェック手段に
よって、各桁に対して非十進数検出、不正ゾーン検出、
および非正規化符号検出が並行して実行される。そし
て、各桁の検出結果が非十進数検出、不正ゾーン検出、
および非正規化符号検出についてそれぞれ対応して編集
され、その編集結果に従って十進数の正当性が検査され
る。したがって、十進数を構成する複数の桁について並
列にチェック処理が実行でき、1桁ずつ検査する場合に
比し、十進数チェックを高速に行なうことが可能にな
る。
In this decimal number checking device, a non-decimal number is detected for each digit by a decimal number checking means composed of a plurality of non-decimal number detecting circuits, an illegal zone detecting circuit, and a denormalization code detecting circuit. , Illegal zone detection,
And denormalized code detection is performed in parallel. And the detection result of each digit is non-decimal number detection, illegal zone detection,
And the denormalized code detection are edited correspondingly, and the correctness of the decimal number is checked according to the edited result. Therefore, the check process can be executed in parallel for a plurality of digits forming a decimal number, and the decimal number check can be performed at a higher speed than in the case of checking the digits one by one.

【0013】[0013]

【実施例】以下、図面を参照してこの発明の実施例を説
明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0014】図1にはこの発明の一実施例に係わる十進
数チェック装置の構成が示されている。この十進数チェ
ック装置は、バイトシフタ21、十進数チェック回路2
2、命令デコード回路23、1stオペランドシフトタ
イミング生成回路24、および十進数チェック信号選択
編集回路25を備えている。
FIG. 1 shows the configuration of a decimal number check device according to an embodiment of the present invention. This decimal number check device includes a byte shifter 21 and a decimal number check circuit 2.
2, an instruction decode circuit 23, a first operand shift timing generation circuit 24, and a decimal number check signal selection editing circuit 25.

【0015】バイトシフタ21は、メモリリードデータ
のフィル制御とバイトシフトを行なうためのものであ
り、メモリから読み込んだオペランドデータをワード境
界に合うようにフィル制御(フィルキャラクタはアンパ
ック形式十進数の時は0x30、パック形式十進数の時
は0x00)しシフト動作を行なう。これにより、例え
ば4バイトからなる十進数の全ての桁は、十進数チェッ
ク回路22に並列に供給される。
The byte shifter 21 is for performing fill control and byte shift of memory read data, and fill control is performed so that operand data read from the memory is aligned with a word boundary (when the fill character is in unpacked decimal number, 0x30, 0x00 for packed decimal, and shift operation is performed. As a result, all the decimal digits of 4 bytes, for example, are supplied to the decimal number check circuit 22 in parallel.

【0016】十進数チェック回路22は、シフトされて
全ての桁が揃えられたリードデータの非十進数、不正ゾ
ーン、非正規化符号の検出を行なうためのものであり、
この十進数チェック回路22は、バイトシフタされたデ
ータの各桁(4bit単位)について十進数チェックし
非十進数の検出を示す信号を出力する非十進数回路と、
入力されたデータの各バイトの上位4bitについてゾ
ーンチェックを行ない、不正ゾーンの検出を示す信号を
出力する不正ゾーン検出回路と、入力されたデータの下
位(LSB側)1バイトの上位4bit/下位4bit
をそれぞれ符号チェックし非正規化符号の検出を示す信
号を出力する非正規化符号検出回路とから構成されてい
る。非十進数、不正ゾーン、および非正規化符号検出の
結果は、十進数チェック信号選択編集回路25に出力さ
れる。
The decimal number check circuit 22 is for detecting a non-decimal number, an illegal zone, and a denormalization code of the read data which has been shifted to have all the digits aligned.
The decimal number check circuit 22 performs a decimal number check on each digit (4 bit unit) of the byte-shifted data, and outputs a non-decimal number circuit,
An illegal zone detection circuit that performs a zone check on the upper 4 bits of each byte of the input data and outputs a signal indicating detection of an illegal zone, and an upper 4 bits / lower 4 bits of the lower 1 byte (LSB side) of the input data
And a denormalization code detection circuit that outputs a signal indicating the detection of the denormalization code. The result of non-decimal number, illegal zone, and denormalization code detection is output to the decimal number check signal selection editing circuit 25.

【0017】命令デコード回路23は、処理中の命令が
アンパック形式かパック形式かを調べるためのものであ
り、その検出結果は十進数チェック信号選択編集回路2
5に出力される。
The instruction decoding circuit 23 is for checking whether the instruction being processed is in the unpacked format or the packed format. The detection result is a decimal check signal selection editing circuit 2
5 is output.

【0018】1stオペランドシフトタイミング生成回
路24であり、符号フィールドを含む最初のオペランド
データがシフトされるステップを示す信号を生成するた
めのものであり、その信号は非正規化符号の存在を示す
信号として十進数チェック信号選択編集回路25に出力
される。
The 1st operand shift timing generation circuit 24 is for generating a signal indicating the step in which the first operand data including the code field is shifted, and the signal is a signal indicating the presence of the denormalized code. Is output to the decimal check signal selection / editing circuit 25.

【0019】十進数チェック信号選択編集回路25はデ
ータ異常を検出するものであり、命令デコード回路23
からのデコード結果信号と、1stオペランドシフトタ
イミング生成回路24からの信号とによって制御され、
十進数チェック回路22の出力(非十進数発見信号、不
正ゾーン発見信号、非正規化符号発見信号)と後述の2
つのフラグを入力としチェック形式(パック形式/アン
パック形式)にそって、読み込まれたオペランドデータ
1ワードの中に非十進数が存在したかを示す信号、不正
ゾーンが存在したかを示す信号、非正規化符号が存在し
たかを示す信号を出力する。図2には、4バイトデータ
に対する十進数チェック回路22の具体的な構成の一例
が示されている。
The decimal check signal selection / editing circuit 25 is for detecting a data abnormality, and the instruction decoding circuit 23
Is controlled by the decode result signal from the 1st operand shift timing generation circuit 24,
Output of the decimal number check circuit 22 (non-decimal number discovery signal, illegal zone discovery signal, denormalization code discovery signal) and 2 described later
One flag as input, along with the check format (packed format / unpacked format), a signal indicating whether a non-decimal number exists in one word of read operand data, a signal indicating whether an illegal zone exists, a non- It outputs a signal indicating whether the normalization code was present. FIG. 2 shows an example of a concrete configuration of the decimal number check circuit 22 for 4-byte data.

【0020】十進数チェック回路22は、非十進数検出
回路(d)31、不正ゾーン検出回路(z)32、非正
規化符号検出回路(s)33から構成される。この十進
数チェック回路22は、バイトシフタ21でワード境界
に合う様にシフトされたデータを入力とし8bitの非
十進数検出信号と4bitの不正ゾーン検出信号と2b
itの非正規化符号検出信号を出力する。
The decimal number check circuit 22 comprises a non-decimal number detection circuit (d) 31, an illegal zone detection circuit (z) 32, and a denormalized code detection circuit (s) 33. The decimal number check circuit 22 receives the data shifted by the byte shifter 21 so as to match the word boundary, and outputs a non-decimal number detection signal of 8 bits, an illegal zone detection signal of 4 bits, and 2b.
The denormalized code detection signal of it is output.

【0021】ここで、入力IN<0:3>,……,IN
<28:31>は、十進数のMSB側の4ビット,…
…,LSB側の4ビットにそれぞれ対応するものであ
り、出力D<0:7>は非十進数検出信号、Z<0:3
>は不正ゾーン検出信号、S<0:1>は非正規化符号
検出信号である。非十進数検出回路(d)31は、入力
信号(IN)に対し下記の信号(D)を出力する。 D<n>=IN<4n>*(IN<4n+1>+IN<4n+2>) n=0〜7 不正ゾーン検出回路32は、入力信号(IN)に対し下
記の信号(Z)を出力する。 Z<m> ={ (IN<8m>) ̄*(IN<8m+1>) ̄ *IN<8m+2>*IN<8m+3> } ̄ m=0〜3 ここで、 ̄は反転論理を示す。非正規化符号検出回路3
3は、8bitの入力(IN<24:31>)に対し下
記の信号(S)を出力する。 S<k> ={ (IN<4k+25>) ̄*IN<4k+26> *IN<4k+27> } ̄ k=0〜1 図3には、4バイトデータに対する十進数チェック信号
選択編集回路25の具体的構成の一例が示されている。
Here, inputs IN <0: 3>, ..., IN
<28:31> is 4 bits on the MSB side of the decimal number, ...
..., 4 bits on the LSB side, respectively, and the output D <0: 7> is a non-decimal number detection signal, Z <0: 3.
> Is an illegal zone detection signal, and S <0: 1> is a denormalization code detection signal. The non-decimal number detection circuit (d) 31 outputs the following signal (D) with respect to the input signal (IN). D <n> = IN <4n> * (IN <4n + 1> + IN <4n + 2>) n = 0 to 7 The illegal zone detection circuit 32 outputs the following signal (Z) with respect to the input signal (IN). Z <m> = {(IN <8m>) ** (IN <8m + 1>) * IN <8m + 2> * IN <8m + 3>} _m = 0 to 3 Here,  ̄ indicates the inversion logic. Denormalization code detection circuit 3
3 outputs the following signal (S) in response to an 8-bit input (IN <24:31>). S <k> = {(IN <4k + 25>)-* IN <4k + 26> * IN <4k + 27>}-k = 0 to 1 In FIG. 3, the decimal number check signal selection editing circuit 25 for 4-byte data is concrete. An example of the configuration is shown.

【0022】パック形式/アンパック形式共最初のワー
ド(オペランドのLSB側のワード)には符号のフィー
ルドがある。また、十進数チェックを行なう上でパック
形式/アンパック形式でフォーマットが異なる。このた
め、十進数チェック信号選択編集回路25はオペランド
の最初のワードか、アンパック形式の命令かを示す信号
を制御信号として用い、十進数チェック回路22の出力
と前記2種の異常検出フラグの各データからフラグへの
ライトデータを生成しチェック結果を記憶し、これを異
常検出信号として出力する。
The first word (word on the LSB side of the operand) of both the packed format / unpacked format has a code field. Also, the format differs between packed and unpacked formats when performing decimal check. Therefore, the decimal check signal selection / editing circuit 25 uses a signal indicating the first word of the operand or an unpacked instruction as a control signal, and outputs the decimal check circuit 22 and each of the two types of abnormality detection flags. Write data to the flag is generated from the data, the check result is stored, and this is output as an abnormality detection signal.

【0023】すなわち、十進数チェック信号選択編集回
路25には、パック形式非十進数検出回路41、アンパ
ック形式非十進数検出回路42、セレクタ43、フラグ
レジスタ44、不正ゾーン検出回路45、フラグレジス
タ46、セレクタ47、フラグレジスタ48が設けられ
ている。パック形式非十進数検出回路41は、ワード単
位(4バイト)でパック形式非十進数の検出を行なうも
のであり、下記のロジックを実行する。 ERRDP =D<0>+D<1>+D<2>+D<3>+D<4>+D<5> +D<6>+(D<7>*$1st ̄)+FERRD
That is, the decimal check signal selection editing circuit 25 includes a pack format non-decimal number detection circuit 41, an unpack format non-decimal number detection circuit 42, a selector 43, a flag register 44, an illegal zone detection circuit 45, and a flag register 46. , A selector 47, and a flag register 48 are provided. The pack format non-decimal number detection circuit 41 detects a pack format non-decimal number in word units (4 bytes), and executes the following logic. ERRDP = D <0> + D <1> + D <2> + D <3> + D <4> + D <5> + D <6> + (D <7> * $ 1st ̄) + FERRD

【0024】ここで、フラグレジスタ44の値(FER
RD)を論理和に加えているのは、一連の十進数のリー
ド命令についてエラーを累積し、命令単位でエラー検出
を行なうためである。また、D<7>*$1st ̄は、
D<7>の値は1stオペランドのシフトの時は符号で
あるので、その時のD<7>を無効にするためのもので
ある。アンパック形式非十進数検出回路42は、ワード
単位(4バイト)でアンパック形式非十進数の検出を行
なうものであり、下記のロジックを実行する。 ERRDU=D<1>+D<3>+D<5>+D<7>+FERRD
Here, the value of the flag register 44 (FER
The reason why RD) is added to the logical sum is that errors are accumulated for a series of decimal read instructions and error detection is performed in instruction units. Also, D <7> * $ 1st ̄ is
Since the value of D <7> is a sign when the 1st operand is shifted, it is for invalidating D <7> at that time. The unpacked non-decimal number detection circuit 42 detects an unpacked non-decimal number in word units (4 bytes), and executes the following logic. ERRDU = D <1> + D <3> + D <5> + D <7> + FERRD

【0025】ここで、フラグレジスタ44の値(FER
RD)を論理和に加えているのは、一連の十進数のリー
ド命令についてエラーを累積し、命令単位でエラー検出
を行なうためである。
Here, the value of the flag register 44 (FER
The reason why RD) is added to the logical sum is that errors are accumulated for a series of decimal read instructions and error detection is performed in instruction units.

【0026】セレクタ43は、アンパック形式の十進数
チェック命令の場合は、アンパック形式非十進数検出回
路42の出力を選択し、それ以外はパック形式非十進数
検出回路41の出力を選択する。フラグレジスタ44
は、非十進数の検出を示すものであり、シフトによって
データが揃った時にライトされる。不正ゾーン検出回路
45は、ワード単位で不正ゾーンを検出するために、下
記のロジックを実行する。 ERRZ =Z<0>+Z<1>+Z<2>+(Z<3>*$1st ̄)+FERRZ
The selector 43 selects the output of the unpacked non-decimal number detection circuit 42 in the case of the unpacked decimal number check instruction, and selects the output of the packed type non-decimal number detection circuit 41 otherwise. Flag register 44
Indicates the detection of a non-decimal number, and is written when the data is aligned by the shift. The illegal zone detection circuit 45 executes the following logic in order to detect the illegal zone in units of words. ERRZ = Z <0> + Z <1> + Z <2> + (Z <3> * $ 1st ̄) + FERRZ

【0027】ここで、フラグレジスタ46の値(FER
RZ)を論理和に加えているのは、一連の十進数のリー
ド命令についてエラーを累積し、命令単位でエラー検出
を行なうためである。また、D<3>*$1st ̄は、
D<3>の値は1stオペランドのシフトの時は符号で
あるので、その時のD<3>を無効にするためのもので
ある。
Here, the value of the flag register 46 (FER
The reason why RZ) is added to the logical sum is that errors are accumulated for a series of decimal-numbered read instructions and error detection is performed in units of instructions. In addition, D <3> * $ 1st
Since the value of D <3> is a sign when the 1st operand is shifted, it is for invalidating D <3> at that time.

【0028】フラグレジスタ46は、不正ゾーンの検出
を示すものであり、アンパック形式十進数チェック命令
実行時においてシフトによってデータが揃った時にライ
トされる。また、フラグレジスタ46のライトは、パッ
ク形式のときはディスエーブルされる。
The flag register 46 indicates the detection of an illegal zone, and is written when the data is prepared by the shift when the unpacked decimal number check instruction is executed. Further, the writing of the flag register 46 is disabled in the pack format.

【0029】セレクタ47は、十進数の形式にあった非
正規化符号チェック信号を選択する。フラグレジスタ4
8は、非正規化符号の検出を示すものであり、最初のオ
ペランドがシフトされる時にライトされる。
The selector 47 selects a denormalized code check signal in the decimal format. Flag register 4
8 indicates the detection of the denormalized code, which is written when the first operand is shifted.

【0030】次に、図4のフローチャートを参照して、
十進数チェック処理の動作を説明する。ここでは、CP
Uがメモリリードコマンドを送出した後2ステップ目で
リードデータが読み込まれシフト動作を行なうシステム
を仮定する。
Next, referring to the flow chart of FIG.
The operation of the decimal number check process will be described. Here, CP
Assume a system in which read data is read in the second step after U sends a memory read command and shift operation is performed.

【0031】命令実行の時、予め命令処理の制御がファ
ームウェア動作になる前に、非十進数検出フラグレジス
タ44、不正ゾーン検出フラグレジスタ46、非正規化
符号検出フラグレジスタ48をクリアする。
At the time of executing an instruction, the non-decimal number detection flag register 44, the illegal zone detection flag register 46, and the denormalization code detection flag register 48 are cleared before the control of the instruction processing becomes the firmware operation in advance.

【0032】命令実行の制御がファームウェア動作にな
ったとき、まず、シフト動作を行なうためにメモリデー
タの先読みが必要かどうかをしらべ、必要なら先読みを
行なう(ステップS41、ステップS42)。次にオペ
ランドリードのための最初のメモリリードコマンドを送
出する(ステップS43)。
When the instruction execution control is a firmware operation, it is first checked whether or not the memory data need to be pre-read in order to perform the shift operation, and if so, the pre-reading is performed (steps S41 and S42). Next, the first memory read command for operand read is sent (step S43).

【0033】そして、次のステップで読み込むデータが
残っているかを調べ(ステップS44)、残りがある場
合は次のオペランドデータを読み込むメモリコマンドを
送出し、同時に2ステップ前に要求したオペランドデー
タの十進数チェックを行ない、読み込むデータが残って
いるかを調べるステップに分岐する(ステップS4
5)。
Then, it is checked whether or not there is data remaining to be read in the next step (step S44), and if there is remaining data, a memory command for reading the next operand data is sent out, and at the same time, the operand data required two steps before is read. A radix check is performed, and the process branches to a step for checking whether there is data to be read (step S4).
5).

【0034】このとき、1stオペランドシフトタイミ
ング生成回路24は、十進数チェック信号選択編集回路
25に、このステップで処理しているワードが最初のオ
ペランドデータであることを通知し、十進数チェック回
路22は命令実行開始時に命令デコードを終えているた
め、命令の形式にあったフォーマットで、かつ、最初の
オペランド(符号部を持つワード)として処理される。
この結果は3つのフラグレジスタ44、46、48に格
納される。但し、パック形式十進数処理命令の場合は、
不正ゾーン検出フラグレジスタ46へのライトはディス
エーブルされる。
At this time, the 1st operand shift timing generation circuit 24 notifies the decimal number check signal selection / editing circuit 25 that the word processed in this step is the first operand data, and the decimal number check circuit 22. Has been decoded at the start of instruction execution, it is processed as the first operand (word having a sign part) in a format suitable for the instruction format.
The result is stored in the three flag registers 44, 46 and 48. However, in the case of packed format decimal number processing instructions,
The write to the illegal zone detection flag register 46 is disabled.

【0035】さらに、オペランドデータが残っている場
合は、メモリリードコマンド送出と、十進数チェック
と、分岐を行なう(ステップS45)。これ以降の十進
数チェックでは、1stオペランドシフトタイミング生
成回路24からの通知は無いため符号部のチェックは行
なわれない。すなわち、非正規化符号検出フラグレジス
タ48へのライトは起きない。オペランドデータの最後
のワードのメモリリードコマンドを送出するまで、上記
のループが繰り返される。
Further, when the operand data remains, the memory read command is sent, the decimal number is checked, and the branch is performed (step S45). In the subsequent decimal check, since there is no notification from the 1st operand shift timing generation circuit 24, the code part is not checked. That is, no write to the denormalization code detection flag register 48 occurs. The above loop is repeated until the memory read command for the last word of the operand data is sent.

【0036】オペランドデータの最後のワードに対する
メモリリードコマンドを送出すると、ステップS44で
分岐し、最後のワードの十進数チェックを行なう(ステ
ップS46)。このとき、最後のワードの中の不足部分
はフィル制御によって、パック形式十進数処理の場合は
0x00、アンパック形式十進数処理の場合は0x30
が入れられるためチェック結果に影響を与えない。
When the memory read command for the last word of the operand data is sent, the process branches at step S44 and the decimal number of the last word is checked (step S46). At this time, the lacking part in the last word is 0x00 for packed decimal processing and 0x30 for unpacked decimal processing by fill control.
Will not affect the check result.

【0037】この後、状態指示子を設定し(ステップS
47)、命令処理を終了する(ステップS48)。この
方式ではオペランドデータを読み込むステップだけで十
進数チェック処理が終了する。
After that, the status indicator is set (step S
47), the instruction processing is ended (step S48). In this method, the decimal number check process is completed only by reading the operand data.

【0038】上記の説明では1回のメモリコマンドで1
ワード読み込んでいるが、1回のメモリコマンドで複数
のワードが順番に読み出されるメモリコマンドが利用で
きるケースでも同様にして実行することができる。
In the above description, one memory command is used for 1
Although the word is read, the same operation can be performed in the case where a memory command in which a plurality of words are sequentially read by one memory command can be used.

【0039】また、十進数演算命令において、それぞれ
の命令がパック形式処理かアンパック形式処理かでフィ
ル制御を行なうことによってオペランドを読み出す前に
十進数チェックを行なうことができる。このときは、非
十進数検出フラグを用いて十進数チェックを行なう。こ
の方法を用いれば、オペランドデータを読み込んでおけ
ば十進数チェック処理が完了する。
In addition, in the decimal number operation instruction, the decimal number check can be performed before the operand is read by performing the fill control in each instruction in the packed format process or the unpacked format process. At this time, a decimal number check is performed using the non-decimal number detection flag. If this method is used, the decimal number check processing is completed by reading the operand data.

【0040】以上のようにこの実施例においては、非十
進数検出回路31、不正ゾーン検出回路32、および非
正規化符号検出回路33から構成される十進数チェック
回路22によって、十進数の各桁に対して非十進数検
出、不正ゾーン検出、および非正規化符号検出が並行し
て実行される。そして、各桁の検出結果は非十進数検
出、不正ゾーン検出、および非正規化符号検出について
それぞれ対応して十進数チェック信号選択編集回路25
によって編集され、その編集結果に従って十進数の正当
性が検査される。したがって、十進数を構成する複数の
桁について並列にチェック処理が実行でき、1桁ずつ検
査する場合に比し、十進数チェックを高速に行なうこと
が可能になる。
As described above, in this embodiment, the decimal number check circuit 22 composed of the non-decimal number detection circuit 31, the illegal zone detection circuit 32, and the denormalization code detection circuit 33 causes each digit of the decimal number to be changed. On the other hand, non-decimal number detection, illegal zone detection, and denormalization code detection are performed in parallel. The detection result of each digit corresponds to the non-decimal number detection, the illegal zone detection, and the denormalization code detection, respectively, and the decimal number check signal selection editing circuit 25
Edited by, and the decimal correctness is checked according to the edited result. Therefore, the check process can be executed in parallel for a plurality of digits forming a decimal number, and the decimal number check can be performed at a higher speed than in the case of checking the digits one by one.

【0041】[0041]

【発明の効果】以上説明したように、この発明によれ
ば、十進数を構成する複数の桁について並列にチェック
できるようになり、十進数チェックを高速に行なうこと
が可能となる。したがって、十進数チェック命令処理の
ステップ数の削減と、十進演算命令実行時のオペランド
データの十進数チェックのステップ数の削減等の効果が
得られる。
As described above, according to the present invention, a plurality of digits forming a decimal number can be checked in parallel, and the decimal number check can be performed at high speed. Therefore, it is possible to obtain effects such as a reduction in the number of steps for the decimal check command processing and a reduction in the number of steps for the decimal check of the operand data when executing the decimal operation instruction.

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

【図1】この発明の一実施例に係わる十進数チェック装
置の構成を示すブロック図。
FIG. 1 is a block diagram showing the configuration of a decimal number check device according to an embodiment of the present invention.

【図2】図1の十進数チェック装置に設けられている4
バイトデータに対する十進数チェック回路の具体的構成
の一例を示す図。
FIG. 2 is a block diagram of the decimal check device of FIG.
The figure which shows an example of the concrete structure of the decimal number check circuit with respect to byte data.

【図3】図1の十進数チェック装置に設けられている4
バイトデータに対する十進数チェック信号選択編集回路
の具体的構成の一例を示す図。
3 is a block diagram of the decimal check device of FIG.
The figure which shows an example of the concrete structure of the decimal number check signal selection edit circuit with respect to byte data.

【図4】図1の十進数チェック装置を使用した十進数チ
ェック処理の動作を説明するフローチャート。
FIG. 4 is a flowchart illustrating an operation of a decimal number check process using the decimal number check device of FIG.

【図5】従来のパック形式十進数チェック処理の動作を
説明するフローチャート。
FIG. 5 is a flowchart illustrating an operation of a conventional packed decimal check process.

【図6】従来のアンパック形式十進数チェック処理の動
作を説明するフローチャート。
FIG. 6 is a flowchart illustrating an operation of a conventional unpacked decimal number check process.

【符号の説明】[Explanation of symbols]

21…バイトシフタ、22…十進数チェック回路、23
…命令デコード回路23、24…1stオペランドシフ
トタイミング生成回路24、25…十進数チェック信号
選択編集回路、31…非十進数検出回路、32…不正ゾ
ーン検出回路、33…非正規化符号検出回路、41…パ
ック形式非十進数検出回路、42…アンパック形式非十
進数検出回路、45…不正ゾーン検出回路。
21 ... Byte shifter, 22 ... Decimal number check circuit, 23
... instruction decode circuits 23, 24 ... 1st operand shift timing generation circuits 24, 25 ... Decimal number check signal selection editing circuit, 31 ... Non-decimal number detection circuit, 32 ... Illegal zone detection circuit, 33 ... Denormalized code detection circuit, 41 ... Pack type non-decimal number detection circuit, 42 ... Unpack type non-decimal number detection circuit, 45 ... Illegal zone detection circuit.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 複数桁から構成されるパック形式または
アンパック形式の十進数の正当性を検査する十進数チェ
ック装置において、 前記十進数を構成する複数桁が並列に入力され、前記複
数桁内の対応する各桁に対して非十進数検出、不正ゾー
ン検出、および非正規化符号検出が並行して実行される
ように、複数の非十進数検出回路、不正ゾーン検出回
路、および非正規化符号検出回路から構成される十進数
チェック手段と、 この十進数チェック手段から得られる各桁の検出結果を
前記非十進数検出、不正ゾーン検出、および非正規化符
号検出にそれぞれ対応させて編集し、その編集結果に従
って十進数の正当性を検査する手段とを具備することを
特徴とする十進数チェック装置。
1. A decimal number check device for checking the legitimacy of a packed or unpacked decimal number consisting of a plurality of digits, wherein a plurality of digits constituting the decimal number are input in parallel and Multiple non-decimal digit detection circuits, illegal zone detection circuits, and denormalization codes so that non-decimal digit detection, illegal zone detection, and denormalization code detection are performed in parallel for each corresponding digit. A decimal number check means composed of a detection circuit and a detection result of each digit obtained from the decimal number check means are edited in correspondence with the non-decimal number detection, the illegal zone detection, and the denormalization code detection, respectively, A decimal number check device comprising means for checking the validity of a decimal number according to the edited result.
JP4319947A 1992-11-30 1992-11-30 Decimal number checking device Pending JPH06168098A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4319947A JPH06168098A (en) 1992-11-30 1992-11-30 Decimal number checking device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4319947A JPH06168098A (en) 1992-11-30 1992-11-30 Decimal number checking device

Publications (1)

Publication Number Publication Date
JPH06168098A true JPH06168098A (en) 1994-06-14

Family

ID=18116021

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4319947A Pending JPH06168098A (en) 1992-11-30 1992-11-30 Decimal number checking device

Country Status (1)

Country Link
JP (1) JPH06168098A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019530093A (en) * 2016-09-30 2019-10-17 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Decimal load immediate instruction

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019530093A (en) * 2016-09-30 2019-10-17 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Decimal load immediate instruction
US10990390B2 (en) 2016-09-30 2021-04-27 International Business Machines Corporation Decimal load immediate instruction

Similar Documents

Publication Publication Date Title
JP3969895B2 (en) Dividing coprocessor operation code by data type
US5907842A (en) Method of sorting numbers to obtain maxima/minima values with ordering
US4899273A (en) Circuit simulation method with clock event suppression for debugging LSI circuits
JP3828677B2 (en) Data transfer between registers and memory
JP2000029866A (en) Exceptional processing generated in processing of vector instruction
US4360891A (en) Address and data interface unit
US6036350A (en) Method of sorting signed numbers and solving absolute differences using packed instructions
JPS6220578B2 (en)
EP0383899B1 (en) Failure detection for partial write operations for memories
US6055623A (en) Specialized millicode instruction for editing functions
US6067617A (en) Specialized millicode instructions for packed decimal division
US6058470A (en) Specialized millicode instruction for translate and test
JPH034936B2 (en)
JPH06168098A (en) Decimal number checking device
US6240540B1 (en) Cyclic redundancy check in a computer system
US6055624A (en) Millicode flags with specialized update and branch instructions
EP0365186A2 (en) Apparatus for enhanced tagged data processing in a generalized computer execution unit
JPS6049937B2 (en) Microprogram controlled data processing device
JPH02278424A (en) Normalizer
JP2826927B2 (en) Arithmetic processing device and processing method
JPH1196001A (en) Device for executing program and method for converting program
JP2587407B2 (en) Micro program controller
JPH0778723B2 (en) Information processing equipment
JPS5847739B2 (en) Character appearance order analysis device
JP2615746B2 (en) Bit operation circuit