JPH07319671A - Preprocessing method for division or residue and preprocessor for division or residue - Google Patents

Preprocessing method for division or residue and preprocessor for division or residue

Info

Publication number
JPH07319671A
JPH07319671A JP6112406A JP11240694A JPH07319671A JP H07319671 A JPH07319671 A JP H07319671A JP 6112406 A JP6112406 A JP 6112406A JP 11240694 A JP11240694 A JP 11240694A JP H07319671 A JPH07319671 A JP H07319671A
Authority
JP
Japan
Prior art keywords
data
bits
bit
complement
division
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.)
Withdrawn
Application number
JP6112406A
Other languages
Japanese (ja)
Inventor
Toshimitsu Nagata
敏光 永田
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP6112406A priority Critical patent/JPH07319671A/en
Publication of JPH07319671A publication Critical patent/JPH07319671A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To accurately perform preprocessing for division and residue as to a negative number fast. CONSTITUTION:In the processing which normalizes data on a division object or residue object consisting of a sign bit and numeric bits following it when the data is a plus number, or normalizes complement data of 2 when a minus number, the number of bits of leading '1' of each data or the number of bits of leading '0' of its complement data of 1 is found when the data is minus and whether or not there are successive bits '10' in the bit sequence or whether or not there are successive bits '10' in the bit sequence of the its complement data of 1 is detected, and, a control signal for (negative number) normalization generated on the basis of the number of bits is made different by '1' between the case wherein there are the successive bits and a case wherein there are not.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、符号ビットおよびこれ
に続く数値ビットからなる除算対象または剰余対象の各
デ−タについて、それが正数のときにはそのデ−タ自体
を正規化し、また負数のときにはその2の補数デ−タを
正規化する除算または剰余の前処理方法およびそのため
の前処理装置に関する。なお、以下の記載では、除算に
ついての前処理ということで説明していくが、これは
「除算または剰余」とその都度記載するのをもっぱら省
くためであり、以後の本発明についての説明中の「除
算」の部分を「剰余」に置換した内容も本発明の対象と
なるのは勿論である。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention normalizes each piece of data to be divided or modulo consisting of a sign bit and a numerical bit following the sign bit when the data is a positive number, and a negative number. In this case, the present invention relates to a division or remainder preprocessing method for normalizing the 2's complement data and a preprocessing apparatus therefor. In the following description, preprocessing for division will be described, but this is to omit the description “division or remainder” each time, and the description of the present invention will be given below. It goes without saying that the contents obtained by replacing the “division” part with the “remainder” are also covered by the present invention.

【0002】一般に、符号ビットとこれに続く数値ビッ
トからなる被除数および除数の除算のさい、この被除数
らが負数の場合には先ず2の補数に変換してから正規化
するといった前処理が実行されるが、従来、この前処理
の簡素化、高速化を図ることが要請されており、本発明
はこのような要請に応えるものである。
Generally, when a dividend and a divisor are divided from a sign bit and a numerical bit following the sign bit, when the dividend is a negative number, a preprocessing such as first converting to a two's complement and then normalizing is performed. However, there has been a demand for simplification and speedup of this pretreatment, and the present invention responds to such demand.

【0003】[0003]

【従来の技術】図5〜図8は一般的な除算前処理につい
ての説明図であり、図5は除算対象の被除数および除数
を示す各データ(16ビット)とそれぞれを正規化したと
きの表現形式を、図6は被除数および除数を正規化する
ときの手順を、また図7および図8は除算前処理のブロ
ック図などをそれぞれ示している。
2. Description of the Related Art FIGS. 5 to 8 are explanatory views of general pre-division processing, and FIG. 5 shows data (16 bits) indicating a dividend and a divisor to be divided and an expression when each is normalized. The format is shown in FIG. 6, the procedure for normalizing the dividend and the divisor, and FIGS. 7 and 8 are block diagrams of the pre-division processing.

【0004】図5で示されるように、除算対象データ自
体はその最上位ビット(MSB)で正負の符号を示し、
またその後の数値ビットで例えば整数値を示すかたちの
固定少数点形式となっている。
As shown in FIG. 5, the division target data itself has a positive and negative sign in its most significant bit (MSB).
In addition, it has a fixed decimal point format in which the subsequent numerical bits indicate, for example, an integer value.

【0005】そして、正数の正規化のさいには、 ・先ず、除算対象データのリーディング「0」のビット
数をカウントし ・次に、「15(数値ビット部分のビット幅)」からこの
カウント値を引いたシフト用データ(小数点移動用デー
タ)を求め、 ・次に、このシフト用データを用いて除算対象データの
小数点移動とこれにともなう指数値の設定を行う といった一連の処理が行われる。
When normalizing a positive number, firstly, the number of bits of the leading "0" of the data to be divided is counted. Then, from "15 (bit width of numerical value bit portion)", this count is performed. Obtain the shift data (decimal point movement data) from which the value has been subtracted, and then use this shift data to perform a series of processing such as moving the decimal point of the division target data and setting the exponent value accordingly. .

【0006】例えば、(a) の場合の「142」の2進数
「0000000010001110」については、 ・先ず、リーディング「0」のビット数の「8」をカウ
ントし、 ・次に、シフト用デ−タの「7(=15−8)」を求め、 ・次に、この値「7」を用いて当初の2進数「0000
000010001110」を「1.000111×2
7 」のかたちに変換している。
For example, for the binary number "0000000010001110" of "142" in the case of (a), first, the number of bits "8" of the leading "0" is counted, and then the shift data “7 (= 15−8)” is calculated, and then, using this value “7”, the initial binary number “0000” is obtained.
"0000101110" to "1.000111 x 2
7 ".

【0007】また、負数の正規化のさいには、除算対象
データの2の補数に対して正数の場合と同じ処理が行わ
れる。例えば、(c) の場合の「−142」の2進数「1
111111101110010」については、 ・先ず、その1の補数である「00000000100
01101」を求め、 ・次に、この2進数に「1」を加算した「000000
0010001110」を求め、 ・次に、この補数デ−タに対して正数の場合と同様の前
記処理を実行して当初の2進数「1111111101
110010」を「−1.000111×27 」のかた
ちに変換している。
Further, when normalizing a negative number, the same processing as in the case of a positive number is performed on the 2's complement of the data to be divided. For example, in the case of (c), the binary number of "-142" is "1".
111111101110010 ": First, the complement of 1 is" 00000000100 ".
"01101" is calculated, and then "1" is added to this binary number to obtain "000000."
0010001110 ", and then performs the same processing as in the case of a positive number on this complement data to obtain the initial binary number" 1111111101 ".
110010 "is converted into the form of" -1.000111 × 2 7 ".

【0008】図6は除算前処理の手順を示す説明図であ
り、その内容は次のようになっている。 除算対象デ−タ(被除数および除数)の最上位ビット
が「1」であるかどうかを判断し、「YES 」の場合は次
のステップに進み、「NO」の場合はステップに進む。
なお、「YES 」の場合は除算対象デ−タが負数のとき、
また「NO」の場合は除算対象デ−タが正数のときであ
る。 この除算対象デ−タの1の補数を求めて、次のステッ
プに進む。 この補数デ−タに「+1」だけのインクリメントを実
行することにより除算対象デ−タの2の補数を求めて、
次のステップに進む。 除算対象デ−タ自体(正数のとき)またはステップ
で求めた補数デ−タ(負数のとき)をレジスタに保持し
て、次のステップに進む。 この保持デ−タのリーディング「0」のビット数をカ
ウントして、次のステップに進む。 このカウント値に基づいて前記の正規化処理を実行す
る。
FIG. 6 is an explanatory view showing the procedure of the pre-division processing, and its contents are as follows. It is determined whether the most significant bit of the division target data (dividend and divisor) is "1". If "YES", the process proceeds to the next step, and if "NO", the process proceeds to step.
In the case of "YES", when the division target data is a negative number,
In the case of "NO", the division target data is a positive number. The one's complement of this division target data is obtained, and the process proceeds to the next step. The complemented data is incremented by "+1" to obtain the 2's complement of the division target data,
Go to the next step. The division target data itself (when it is a positive number) or the complement data obtained at the step (when it is a negative number) is held in the register, and the process proceeds to the next step. The number of bits of the leading "0" of the held data is counted, and the process proceeds to the next step. The normalization process is executed based on this count value.

【0009】図7は以上の除算前処理についてのブロッ
ク図であり、31は除算対象デ−タの2の補数化回路、32
は除算対象デ−タ、2の補数デ−タおよび正規化デ−タ
の中の一つを選択するゲート回路、33はこのゲート回路
32の出力を保持するレジスタ、34はリーディング「0」
検出回路、35は正規化用制御信号(指数値や小数点移動
桁数などを示す信号)の設定回路、36はこの算出値を保
持するレジスタ、37は正規化回路をそれぞれ示してい
る。
FIG. 7 is a block diagram of the pre-division processing described above. Reference numeral 31 is a 2's complement circuit for the data to be divided.
Is a gate circuit for selecting one of division target data, 2's complement data and normalization data, and 33 is this gate circuit.
Register holding the output of 32, 34 is a reading "0"
A detection circuit, a normalization control signal (a signal indicating an exponent value, a decimal point moving digit number, etc.) 35, a register 36 for holding the calculated value, and a normalization circuit 37.

【0010】この回路ブロックは被除数および除数のそ
れぞれごとに設けられており、例えば(a) の場合には、 ・先ず、除算対象デ−タ、または2の補数デ−タのいず
れかをゲート回路32で選択し、 ・次に、これをレジスタ33に保持し、 ・次に、この保持デ−タのリーディング「0」を検出回
路34で検出し、 ・次に、このリーディング「0」のビット数に基づく指
数値などの正規化用制御信号を設定回路35で求め、 ・次に、これをレジスタ36に保持し、 ・次に、この保持内容に基づく正規化処理、すなわち被
除数または除数の少数点位置の移動と指数の設定を行
い、 ・次に、この正規化デ−タをゲート回路32で選択してレ
ジスタ33に保持し、 ・次に、この正規化デ−タをレジスタ33から取り出して
除算部に送る といった処理を実行している。
This circuit block is provided for each of the dividend and the divisor. For example, in the case of (a): First, either the division target data or the two's complement data is gated. 32. Then, this is held in the register 33. Then, the reading "0" of this holding data is detected by the detection circuit 34. Then, the bit of this reading "0" is detected. A normalization control signal such as an exponent value based on a number is obtained by the setting circuit 35. Then, this is held in the register 36. Then, a normalization process based on the held content, that is, the number of the dividend or divisor is small. The point position is moved and the exponent is set. Then, this normalized data is selected by the gate circuit 32 and held in the register 33. Next, this normalized data is taken out from the register 33. And send it to the division unit.

【0011】なお、(b) の場合には、ゲート回路32によ
って選択される除算対象デ−タ、または2の補数デ−タ
のいずれかをレジスタ33に保持することなしにそのリー
ディング「0」を検出するようにしているため、(a) の
場合にくらべてこの保持のタイミング分だけ処理時間の
短縮を図ることができる。
In the case of (b), either the division target data selected by the gate circuit 32 or the two's complement data is not held in the register 33 and its leading "0" is stored. Is detected, it is possible to reduce the processing time by the timing of this holding as compared with the case of (a).

【0012】図8は、ゲート回路32の具体例であり、除
算対象デ−タを選択するためのアンドゲート41、2の補
数デ−タを選択するためのアンドゲート42および正規化
デ−タを選択するためのアンドゲート43からなってい
る。
FIG. 8 shows a specific example of the gate circuit 32. An AND gate 41 for selecting data to be divided and an AND gate 42 for selecting 2's complement data and normalization data. It consists of an AND gate 43 for selecting.

【0013】ここで、 ・2の補数デ−タのMSBに基づく符号信号の反転信号
aが「L」でかつ正規化デ−タの取出しタイミングを特
定するための制御信号の反転信号bが「L」のときには
アンドゲート41のみが開いて除算対象デ−タがレジスタ
33に保持され、 ・当該反転信号aが「H」でかつ当該反転信号bが
「L」のときにはアンドゲート42のみが開いて2の補数
デ−タがレジスタ33に保持され、 ・当該反転信号bが「H」のときにはアンドゲート43の
みが開いて正規化デ−タがレジスタ33に保持されること
になる。
Where the inversion signal a of the code signal based on the MSB of the two's complement data is "L" and the inversion signal b of the control signal for specifying the extraction timing of the normalized data is "L". When "L", only the AND gate 41 is opened and the division target data is the register.
Held in 33, when the inversion signal a is "H" and the inversion signal b is "L", only the AND gate 42 is opened and the two's complement data is held in the register 33; When b is "H", only the AND gate 43 is opened and the normalization data is held in the register 33.

【0014】[0014]

【発明が解決しようとする課題】このように、従来、負
数の除算対象データの除算前処理における正規化に必要
な指数値などの正規化用制御信号を、当該除算対象デー
タの2の補数、すなわちその1の補数を求めてからこれ
に「1」をインクリメントするといった2段階処理の実
行後に得られる補数のリーディング「0」のビット数に
基づいて生成しているため、除算前処理の実行時間が長
くなってしまうという問題点があった。
As described above, conventionally, a normalization control signal such as an exponent value required for normalization in the pre-division processing of the division target data of a negative number is set to the 2's complement number of the division target data. That is, since it is generated based on the number of bits of the leading "0" of the complement obtained after executing the two-step processing of obtaining the one's complement and incrementing it by "1", the execution time of the pre-division processing There was a problem that it became longer.

【0015】そこで、本発明では、負数の除算対象デー
タの正規化用制御信号を、この除算対象デ−タの1の補
数デ−タに「1」だけインクリメントして2の補数とす
るより前のデ−タ、すなわち除算対象データ自体または
その1の補数デ−タから生成し、また前記インクリメン
トにともないそれまでのリーディング「0」の部分の最
下位ビットが「1」に反転するときにはこれが前記生成
過程に反映されるようにすることにより、負数について
の除算前処理を正しくかつ高速に実行できるようにする
ことを目的とする。
Therefore, according to the present invention, the normalization control signal of the data to be divided by a negative number is incremented by "1" to the 1's complement data of the data to be divided to obtain the 2's complement. Of the division target data itself or its 1's complement data, and when the least significant bit of the leading "0" portion is inverted to "1" with the increment, this is It is an object of the present invention to enable correct and high-speed pre-division processing for negative numbers by reflecting it in the generation process.

【0016】[0016]

【課題を解決するための手段】図1は本発明の原理説明
図である。図において、1および2は正数を対象とした
従来と同様の処理であり、3〜9は負数を対象とした処
理であり、また10は正数および負数の両者を対象とした
処理である。
FIG. 1 is a diagram for explaining the principle of the present invention. In the figure, 1 and 2 are processes similar to the conventional process for positive numbers, 3 to 9 are processes for negative numbers, and 10 is a process for both positive numbers and negative numbers. .

【0017】すなわち、1は、被除数xまたは除数yに
ついてのリーディング「0」のビット数を検出する処理
であり、2は、このビット数に基づいて正規化用制御信
号(指数値や小数点移動桁数などを示す信号)を生成す
る処理であり(図5参照)、3は、被除数xまたは除数
yについて「1」の補数を求める処理であり、4は、こ
の補数データを「1」だけインクリメントして2の補数
データに変換する処理であり、5は、被除数xまたは除
数yについてのリーディング「1」のビット数を検出す
る処理であり、6は、被除数xまたは除数yのビット列
に「01」の連続ビットが有るかどうかをチェックする
処理であり、7は、3の処理で求めた補数データのリー
ディング「0」のビット数を検出する処理であり、8
は、3の処理で求めた補数データのビット列に「10」
の連続ビットが有るかどうかをチェックする処理であ
り、9は、5または7の処理で求めたビット数に基づい
て正規化用制御信号(指数値や小数点移動桁数などを示
す信号)を生成し(図5参照)、かつ6または8の処理
で前記反転が検出されたときにはこの生成に際して
「1」だけ調整する、例えば当該ビット数から「1」だ
け減じた値を用いるようにする処理であり、10は、2ま
たは9の処理で求めた正規化用制御信号に基づいて被除
数xおよび除数yを正規化する処理である。
That is, 1 is a process for detecting the number of bits of the leading "0" for the dividend x or the divisor y, and 2 is a normalization control signal (exponent value or decimal point moving digit) based on this bit number. (A signal indicating a number) (see FIG. 5), 3 is a process for obtaining the complement of “1” for the dividend x or the divisor y, and 4 is for incrementing this complement data by “1”. And 5 to detect the number of bits of the leading "1" for the dividend x or the divisor y, and 6 is "01" for the bit string of the dividend x or the divisor y. Is a process for checking whether there is a continuous bit of "," 7 is a process for detecting the number of bits of leading "0" of the complement data obtained in the process of 3, and 8
Is "10" in the bit string of the complement data obtained by the process of 3.
Is a process for checking whether or not there are consecutive bits, and 9 generates a normalization control signal (a signal indicating an exponent value, the number of decimal places to move, etc.) based on the number of bits obtained in the process of 5 or 7. (Refer to FIG. 5), and when the inversion is detected in the processing of 6 or 8, adjustment is performed by "1" in this generation, for example, processing in which a value obtained by subtracting "1" from the number of bits is used. Yes, 10 is a process of normalizing the dividend x and the divisor y based on the normalization control signal obtained in the process of 2 or 9.

【0018】ここで、前記「01」の連続ビットなどの
有無をチェックするのは、負数の場合、その「1」の補
数についてのインクリメントを実行する前の段階でその
リーディング「1」またはその「1」の補数のリーディ
ング「0」のビット数を求めているので、このビット数
がインクリメント後のデータのリーディング「0」のそ
れと合致しないことが生じるためである。
Here, the presence or absence of the consecutive bits of "01" is checked in the case of a negative number, at the stage before the increment of the complement of the "1" is executed, the leading "1" or the "1" is read. This is because the bit number of the leading "0" of the complement of "1" is obtained, and this bit number may not match that of the leading "0" of the data after the increment.

【0019】すなわち、図2(b) で示すように、負数の
リーディング「1」の後に「0」のビットのみが続くと
きや、負数のすべてのビットが「1」であるときなどに
は、その「1」の補数に「1」だけインクリメントする
と、当該補数のリーディング「0」の最下位ビットが桁
上がりのため「1」に変化し、例えば「−126(10進
数)」の場合、このインクリメントによってリーディン
グ「0」のビット数はそれまでの「9」から「8」とな
り両者は一致しない。
That is, as shown in FIG. 2 (b), when only a "0" bit follows a negative reading "1", or when all the negative bits are "1", When the complement of "1" is incremented by "1", the least significant bit of the leading "0" of the complement changes to "1" because of a carry. For example, in the case of "-126 (decimal)", By the increment, the number of bits of the leading "0" is changed from "9" to "8", and the two do not match.

【0020】このビット数の不一致は6または8での連
続ビットのチェック処理の結果に基づいて補正される
が、これは、負数のビット列に「01」の連続ビットが
あるか、またはその「1」の補数のビット列に「10」
の連続ビットがあれば、前記インクリメントにともなう
桁上がりの影響はこの連続ビット部分で止まるが、これ
らの連続ビットがないときには「1」の補数のリーディ
ング「0」の最下位ビットが桁上がりして前記不一致状
態になることに着目したものである。
This discrepancy in the number of bits is corrected based on the result of the check processing of consecutive bits at 6 or 8, which means that there is "01" consecutive bits in the negative bit string or its "1". "" In the complement bit string of
If there are consecutive bits of, the effect of the carry due to the increment stops at this consecutive bit part, but when these consecutive bits do not exist, the least significant bit of the leading "0" of the complement of "1" is carried. The focus is on the disagreement state.

【0021】すなわち、これらの連続ビットがないとき
には、9の処理で正規化用制御信号を生成するさいに
「1」だけ調整することにより、この正規化用制御信号
が本来の値に設定されるようにしている。
That is, when these consecutive bits are not present, the normalization control signal is set to the original value by adjusting "1" when the normalization control signal is generated in the process of 9. I am trying.

【0022】指数値や小数点移動桁数を正規化用制御信
号とする場合の調整法としては、 ・負数のリーディング「1」などのビット数から「1」
だけ減じた値を用いて図5と同様の減算処理を実行する
こと ・当該ビット数をそのまま用いて図5と同様の減算処理
を実行し、その実行結果に「1」を加えること などが用いられ、前記連続ビットがないときの正規化用
制御信号はこれがあるときに比べて「1」だけ大きな値
となる。
The adjustment method when the exponent value or the number of moving digits of the decimal point is used as the control signal for normalization is as follows:
The subtraction process similar to that of FIG. 5 is executed using the value obtained by subtracting the same value.-The subtraction process similar to that of FIG. 5 is executed using the bit number as it is, and "1" is added to the execution result. The normalization control signal when there is no continuous bit has a value larger by "1" than when there is this continuous bit.

【0023】また、負数の正規化処理に際し、指数値や
小数点移動桁数に代えて保持レジスタでの左シフト量を
正規化用制御信号として用いる場合には図5と同様の減
算処理は不要であり、前記連続ビットがないときの正規
化用制御信号はこれがあるときに比べて「1」だけ小さ
な値となる。
In the case of using the left shift amount in the holding register as the normalization control signal instead of the exponent value or the number of decimal places to move when the negative number is normalized, the same subtraction process as in FIG. 5 is not necessary. The normalization control signal when there is no continuous bit has a value smaller by “1” than when there is this continuous bit.

【0024】また、本発明は、 ・符号ビットおよびこれに続く数値ビットからなる除算
対象の各デ−タについてそれが負数のときにはその2の
補数デ−タを求める補数作成手段(3および4の各処理
が対応)と、当該各データが負数の場合、そのリーディ
ング「1」のビット数またはその1の補数デ−タのリー
ディング「0」のビット数を求めるとともに、そのビッ
ト列での「01」の連続ビットの有無またはその1の補
数デ−タのビット列での「10」の連続ビットの有無を
検出するデータ判定手段(5、6、7および8の各処理
が対応)と、これらのビット数と連続ビットの有無とに
基づいて、この連続ビットが「有」の場合と「無」の場
合とで「1」だけ異なる値の正規化用制御信号を生成す
る正規化用制御信号設定手段(9の処理が対応)と、前
記2の補数デ−タをこの正規化用制御信号に基づいて正
規化するデータ正規化手段(10の処理が対応)を備えた
除算前処理装置としても特定される。
Further, the present invention is as follows: For each data to be divided consisting of a sign bit and a numerical bit following the sign bit, if the data is a negative number, the 2's complement data is obtained. If each data corresponds to a negative number, the number of bits of the leading "1" or the number of bits of the leading "0" of the complement data of 1 is obtained, and "01" in the bit string is obtained. Data determining means (corresponding to each processing of 5, 6, 7, and 8) for detecting the presence or absence of the consecutive bits of 10 or the presence of consecutive bits of "10" in the bit string of the one's complement data, and these bits. A normalization control signal setting means for generating a normalization control signal having a value different by "1" depending on whether the continuous bit is "present" or "absent" based on the number and the presence or absence of the continuous bit. (Process 9 is (Corresponding) and the data pre-processing device for normalizing the 2's complement data on the basis of the normalization control signal (corresponding to the processing of 10).

【0025】[0025]

【作用】本発明は、このように、除算対象の負数に対す
る正規化用制御信号(指数値や小数点移動桁数など)の
算出を、当該負数自体のリーディング「1」のビット数
またはその「1」の補数のリーディング「0」のビット
数に基づいて実行するようにしたものである。
As described above, according to the present invention, the normalization control signal (exponent value, decimal point moving digit number, etc.) for a negative number to be divided is calculated by the number of bits of the leading "1" of the negative number itself or its "1". The complement of "" is executed based on the number of bits of "0".

【0026】さらには、このビット数の算出と並行し
て、これらのリーディング部分のビット数が当該補数に
「1」だけインクリメントした後の「2」の補数のそれ
と合致するかどうかを負数自体またはその「1」の補数
の各ビット列の連続ビット状態から調べ、その結果が
「合致しない」のときには正規化用制御信号の算出に際
し「1」だけの調整を行ってこれを正しい値にすること
により、負数の除算前処理の正確さを確保するとともに
その高速化を図っている。
Further, in parallel with the calculation of the number of bits, it is determined whether the number of bits of these leading parts matches that of the complement of “2” after incrementing the complement by “1” by the negative number itself or By checking from the continuous bit state of each bit string of the "1" complement, and when the result is "mismatch", by adjusting only "1" in calculating the normalization control signal and setting it to a correct value. , The accuracy of pre-division processing for negative numbers is ensured and the speed is increased.

【0027】また、ビット数検出と連続ビット状態チェ
ックとの組合せは、 ・負数自体のリーディング「1」のビット数検出と、負
数自体での「01」の連続ビットの有無についてのチェ
ック ・「1」の補数のリーディング「0」のビット数検出
と、負数自体での「01」の連続ビットの有無について
のチェック ・負数自体のリーディング「1」のビット数検出と、
「1」の補数での「10」の連続ビットの有無について
のチェック ・「1」の補数のリーディング「0」のビット数検出
と、「1」の補数での「10」の連続ビットの有無につ
いてのチェック の4通りとなり、高速化を図るうえでは最初の組合せが
時間遅れが最も少なく効率的である。
Further, the combination of the bit number detection and the continuous bit state check is as follows: Detection of the bit number of the leading "1" of the negative number itself and check of the presence or absence of consecutive bits of "01" in the negative number itself "1 Of the leading "0" in the complement of ", and checking for the presence or absence of consecutive bits of" 01 "in the negative number itself-Detection of the number of leading" 1 "bits in the negative number itself,
Check for the presence or absence of "10" consecutive bits in the "1" complement ・ Leading "1" complement detection of the number of "0" bits and the presence or absence of "10" consecutive bits in the "1" complement There are four ways to check, and the first combination is the most efficient with the least time delay for speeding up.

【0028】[0028]

【実施例】図3〜図5を参照して本発明の実施例を説明
する。図3および図4は除算前処理のブロック図を示す
説明図であり、また図5は除算前処理の手順を示す説明
図である。なお、以下の実施例では、説明の便宜上、正
規化用制御信号として指数値や小数点移動桁数を用いる
こととする。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described with reference to FIGS. 3 and 4 are explanatory diagrams showing a block diagram of pre-division processing, and FIG. 5 is an explanatory diagram showing a procedure of pre-division processing. In the following embodiments, for convenience of explanation, the exponent value and the number of moving decimal points will be used as the normalization control signal.

【0029】図3において、11は、「01」検出回路、
12は、符号信号(除算対象データのMSB)とこの「0
1」検出回路11の出力信号とが入力されるアンドゲー
ト、13は、このアンドゲート12の出力信号を保持するレ
ジスタ、14は、符号信号と後記の1の補数化回路19の出
力信号とが入力されるアンドゲート、15は、符号信号と
除算対象データとが入力されるアンドゲート、16は、ア
ンドゲート14および15の出力信号が入力されるリーディ
ング「0」検出回路、17は、このリーディング「0」検
出回路16の出力信号を保持するレジスタ、18は、レジス
タ13およびレジスタ17の内容に基づいて正規化用制御信
号(指数値や小数点移動桁数)を生成する設定回路19
は、除算対象データの1の補数化回路、20は、この補数
化回路19の出力信号に「1」を加算するインクリメント
回路をそれぞれ示している。なお、除算対象データの2
の補数化回路31、ゲート回路32、レジスタ33および正規
化回路37は図7で示したものと同様の構成となってい
る。
In FIG. 3, 11 is a "01" detection circuit,
12 is the code signal (MSB of the data to be divided) and this "0
1 "and the output signal of the detection circuit 11 is input, 13 is a register that holds the output signal of the AND gate 12, and 14 is the sign signal and the output signal of the 1's complement circuit 19 described later. An AND gate to be input, 15 is an AND gate to which the code signal and the data to be divided are input, 16 is a leading "0" detection circuit to which the output signals of the AND gates 14 and 15 are input, and 17 is this reading A register that holds the output signal of the "0" detection circuit 16, and a setting circuit 19 that generates a normalization control signal (exponent value or decimal point moving digit number) based on the contents of the registers 13 and 17.
Is a 1's complement circuit for division target data, and 20 is an increment circuit for adding "1" to the output signal of the complement circuit 19. In addition, 2 of the data to be divided
The complementing circuit 31, the gate circuit 32, the register 33, and the normalizing circuit 37 of FIG. 7 have the same configurations as those shown in FIG.

【0030】ここで、アンドゲート12および14は除算対
象データの符号ビットが「H」のとき(負数が相当)
に、アンドゲート15は除算対象データの符号ビットが
「L」のとき(正数が相当)にそれぞれ開いて、アンド
ゲート14からは「1」の補数化回路19の出力(除算対象
データの1の補数)がリーディング「0」検出回路16に
送られ、アンドゲート15からは除算対象データ自体がリ
ーディング「0」検出回路16に送られることになる。
Here, the AND gates 12 and 14 are used when the sign bit of the data to be divided is "H" (corresponding to a negative number).
Further, the AND gate 15 is opened when the sign bit of the division target data is "L" (a positive number is equivalent), and the AND gate 15 outputs "1" from the complementation circuit 19 (1 of the division target data). Will be sent to the leading "0" detection circuit 16, and the data to be divided itself will be sent from the AND gate 15 to the leading "0" detection circuit 16.

【0031】また、「01」検出回路11は「01」の連
続ビットを検出したときに「H」となる信号を調整用フ
ラグとして出力し、これがレジスタ13に保持されてその
後の所定のタイミングで設定回路18に送られる。なお、
アンドゲート12の出力は、正数や「01」の連続ビット
がある負数に対しては「L」となり、また「01」の連
続ビットがない負数に対しては「H」を示すことにな
る。
Further, the "01" detection circuit 11 outputs a signal which becomes "H" when detecting the consecutive bits of "01" as an adjustment flag, which is held in the register 13 at a predetermined timing thereafter. It is sent to the setting circuit 18. In addition,
The output of the AND gate 12 shows "L" for a positive number or a negative number having consecutive bits of "01", and "H" for a negative number having no consecutive bits of "01". .

【0032】この設定回路18では、レジスタ17の内容
(リーディング「0」のビット数)とレジスタ13の内容
(「01」の連続ビットの有無)とに基づいて例えば図
5と同様の演算を実行すること(除算対象データの数値
ビット部分のビット幅から当該ビット数などを減算する
こと)により、除算対象データの正規化のために必要な
正規化用制御信号が生成される。
In the setting circuit 18, for example, an operation similar to that shown in FIG. 5 is executed based on the contents of the register 17 (the number of bits of the leading "0") and the contents of the register 13 (whether there are consecutive bits of "01"). By doing so (subtracting the number of bits from the bit width of the numerical bit portion of the division target data), the normalization control signal necessary for normalizing the division target data is generated.

【0033】そして、この生成の際、レジスタ13に
「H」の調整用フラグが保持されているときすなわち除
算対象データが負数でそのビット列に「01」の連続ビ
ットがないときには、前記調整法により、正規化用制御
信号を当該調整用フラグが保持されていないときに比べ
て「1」だけ大きくするといった調整処理が行われる。
At the time of this generation, when the "H" adjustment flag is held in the register 13, that is, when the data to be divided is a negative number and there are no consecutive bits of "01" in the bit string, the adjustment method is used. An adjustment process is performed in which the normalization control signal is increased by “1” compared to when the adjustment flag is not held.

【0034】設定回路18の出力信号は正規化回路37に送
られ、ここで正規化されたデータはゲート回路32および
レジスタ33での従来と同様の動作(図7および図8参
照)によって除算部に送られる。
The output signal of the setting circuit 18 is sent to the normalization circuit 37, and the normalized data is divided by the operation in the gate circuit 32 and the register 33 in the same manner as in the prior art (see FIGS. 7 and 8). Sent to.

【0035】図4は、図3の補数化回路19の出力信号に
ついてのリーディング「0」の検出に代えて除算対象デ
ータ自体のリーディング「1」を検出するようにしたも
のである。
In FIG. 4, instead of detecting the leading "0" in the output signal of the complementing circuit 19 in FIG. 3, the leading "1" in the division target data itself is detected.

【0036】これに対応する構成要素としてリーディン
グ「1」検出回路23、アンドゲート24およびアンドゲー
ト26を設けるとともに、正規化用制御信号の設定回路27
の出力信号を保持するレジスタ28を設けている。
As a component corresponding to this, a leading "1" detection circuit 23, an AND gate 24 and an AND gate 26 are provided, and a normalization control signal setting circuit 27 is provided.
A register 28 for holding the output signal of is provided.

【0037】そして、この設定回路27を含め、「1」の
補数化回路19、インクリメント回路20、「01」検出回
路21、アンドゲート22、「2」の補数化回路31、ゲート
回路32、レジスタ33および正規化回路37のそれぞれでは
図3で示したものと同様の動作が行われる。
Then, including the setting circuit 27, "1" complement circuit 19, increment circuit 20, "01" detection circuit 21, AND gate 22, "2" complement circuit 31, gate circuit 32, register. Each of 33 and the normalization circuit 37 performs the same operation as that shown in FIG.

【0038】例えば、除算対象データの符号ビットが
「H」のとき(負数が相当)にはアンドゲート22および
24のみが開き、またこの符号ビットが「L」のとき(正
数が相当)にはアンドゲート26のみが開くことになって
図3と同様の正規化処理が実行されることになる。
For example, when the sign bit of the division target data is "H" (a negative number is equivalent), the AND gate 22 and
When only 24 is opened and the sign bit is "L" (a positive number is equivalent), only the AND gate 26 is opened and the normalization processing similar to that shown in FIG. 3 is executed.

【0039】なお、図3および図4において、 ・2の補数化回路31が前記補数作成手段に、 ・「01」検出回路11,21やアンドゲート12, 14, 15,
22, 24,26 やリーディング「0」検出回路16,25 やリー
ディング「1」検出回路23が前記データ判定手段に、 ・正規化用制御信号の設定回路18,27 が前記正規化用制
御信号設定手段に、 ・正規化回路37が前記データ正規化手段に、 それぞれ対応することになる。
In FIGS. 3 and 4, the 2's complementing circuit 31 serves as the complement creating means, and the "01" detecting circuits 11, 21 and AND gates 12, 14, 15,
22, 24, 26 and leading "0" detection circuit 16,25 and leading "1" detection circuit 23 are used as the data judgment means, and normalization control signal setting circuits 18, 27 are used for the normalization control signal setting. The normalizing circuit 37 corresponds to the data normalizing means.

【0040】図3のアンドゲート12の出力信号を保持す
るレジスタ13を省略したり、図4のアンドゲート22の出
力信号を保持するためのレジスタを設けるようにしても
よいことは勿論である。
Of course, the register 13 for holding the output signal of the AND gate 12 in FIG. 3 may be omitted, or a register for holding the output signal of the AND gate 22 in FIG. 4 may be provided.

【0041】さらには、発明の詳細な説明の冒頭で述べ
たように、これまで除算の場合を例にとって説明してき
た内容が剰余の前処理に対してもそのまま適用できるこ
とは勿論である。
Further, as described at the beginning of the detailed description of the invention, it goes without saying that the contents described so far by taking the case of division as an example can be directly applied to the preprocessing of the remainder.

【0042】[0042]

【発明の効果】本発明は、このように、負数の、除算や
剰余の対象データの正規化用制御信号(指数値など)
を、この対象デ−タの1の補数デ−タに「1」だけイン
クリメントして2の補数とするより前のデ−タ、すなわ
ち対象データ自体またはその1の補数デ−タから生成
し、また前記インクリメントにともないそれまでのリー
ディング「0」の部分の最下位ビットが「1」に反転す
るときにはこれが前記生成過程に反映されるようにして
いるため、対象データについての正規化処理を負数の場
合にも正確にかつ高速に実行することができる。
As described above, according to the present invention, a control signal (exponent value, etc.) for normalizing target data of a negative number for division or remainder.
Is generated from the data before the one's complement data of this target data is incremented by "1" to be the two's complement, that is, the target data itself or its one's complement data, Further, when the least significant bit of the leading "0" portion up to that time is inverted to "1" with the increment, this is reflected in the generation process, so the normalization processing for the target data is performed with a negative number. It can also be done accurately and fast.

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

【図1】本発明の、原理説明図である。FIG. 1 is a diagram illustrating the principle of the present invention.

【図2】本発明の、負数のリーディング「1」やその1
の補数のリーディング「0」の各ビット数と、その2の
補数のリーディング「0」のビット数との関係を示す説
明図である。
FIG. 2 is a negative reading "1" and its 1 according to the present invention.
FIG. 6 is an explanatory diagram showing the relationship between the number of bits of the leading “0” of the complement of and the number of bits of the leading “0” of the two's complement.

【図3】本発明の、除算前処理のブロック図を示す説明
図(その1)である。
FIG. 3 is an explanatory diagram (No. 1) showing a block diagram of pre-division processing of the present invention.

【図4】本発明の、除算前処理のブロック図を示す説明
図(その2)である。
FIG. 4 is an explanatory diagram (part 2) showing a block diagram of pre-division processing of the present invention.

【図5】一般的な、被除数および除数(2バイトデー
タ)とそれぞれを正規化したときの表現形式を示す説明
図である。
FIG. 5 is an explanatory diagram showing a general expression of a dividend and a divisor (2-byte data) and their normalized expressions.

【図6】従来の、除算前処理の手順を示す説明図であ
る。
FIG. 6 is an explanatory diagram showing a conventional procedure of pre-division processing.

【図7】従来の、除算前処理のブロック図を示す説明図
である。
FIG. 7 is an explanatory diagram showing a block diagram of conventional division preprocessing.

【図8】図7の、ゲート回路の具体例を示す説明図であ
る。
8 is an explanatory diagram showing a specific example of the gate circuit in FIG. 7. FIG.

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

図1において、 1・・・除算対象データのリーディング「0」のビット
数を検出する処理 2・・・正規化用制御信号を生成する処理 3・・・除算対象データの1の補数を求める処理 4・・・「1」だけインクリメントして2の補数データ
に変換する処理 5・・・除算対象データのリーディング「1」のビット
数を検出する処理 6・・・除算対象データでの「01」の連続ビットの有
無を調べる処理 7・・・1の補数データのリーディング「0」のビット
数を検出する処理 8・・・1の補数データでの「10」の連続ビットの有
無を調べる処理 9・・・正規化用制御信号を生成する処理 10・・・正規化用制御信号に基づいて除算対象データを
正規化する処理
In FIG. 1, 1 ... Process for detecting the number of leading "0" bits of division target data 2 ... Process for generating normalization control signal 3 ... Process for obtaining 1's complement of division target data 4 ... Process of incrementing by "1" and converting to 2's complement data 5 ... Process of detecting bit number of leading "1" of division target data 6 ... "01" in division target data Process for checking presence / absence of consecutive bits of 7 ... Process for detecting bit number of leading "0" of 1's complement data 8 ... Process for examining presence / absence of consecutive bits of "10" in 1's complement data 9 ... Process for generating normalization control signal 10 ... Process for normalizing division target data based on the normalization control signal

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 符号ビットおよびこれに続く数値ビット
からなる除算対象または剰余対象の各デ−タについて、
それが正数のときにはそのデ−タ自体を正規化し、また
それが負数のときにはその2の補数デ−タを正規化する
除算または剰余の前処理方法において、 当該各データが負数の場合、そのリーディング「1」の
ビット数またはその1の補数デ−タのリーディング
「0」のビット数を求めるとともに、そのビット列での
「01」の連続ビットの有無またはその1の補数デ−タ
のビット列での「10」の連続ビットの有無を検出し、 これらのビット数と連続ビットの有無とに基づいて、こ
の連続ビットが「有」の場合と「無」の場合とで「1」
だけ異なる値の正規化用制御信号を生成し、 この正規化用制御信号で前記2の補数デ−タの正規化を
行うことを特徴とする除算または剰余の前処理方法。
1. Data for division or remainder consisting of a sign bit and a numerical bit following the sign bit,
In the division or remainder preprocessing method for normalizing the data itself when it is a positive number and for normalizing the two's complement data when it is a negative number, if each data is negative, the The number of bits of leading "1" or the number of bits of leading "0" of its one's complement data is calculated, and whether or not there are consecutive bits of "01" in the bit string or the bit string of its one's complement data Presence / absence of consecutive bits of "10" is detected, and based on the number of bits and the presence / absence of consecutive bits, "1" is determined depending on whether the consecutive bits are "present" or "absent".
A normalization control signal having different values is generated, and the 2's complement data is normalized by the normalization control signal.
【請求項2】 前記正規化用制御信号の生成に際し、前
記検出結果が「有」の場合には前記数値ビットのビット
幅から前記ビット数を減算し、また前記検出結果が
「無」の場合には当該ビット幅から「前記ビット数−
1」を減算することを特徴とする請求項1記載の除算ま
たは剰余の前処理方法。
2. When generating the normalization control signal, when the detection result is “present”, the number of bits is subtracted from the bit width of the numerical bit, and when the detection result is “absent”. From the bit width, "the number of bits-
2. The preprocessing method for division or remainder according to claim 1, wherein "1" is subtracted.
【請求項3】 前記データが負数の場合、そのリーディ
ング「1」のビット数を求めるとともに、そのビット列
での「01」の連続ビットの有無を検出することを特徴
とする請求項1または2記載の除算または剰余の前処理
方法。
3. The method according to claim 1, wherein when the data is a negative number, the number of bits of the leading “1” is obtained and the presence or absence of consecutive bits of “01” in the bit string is detected. Preconditioning method for division or remainder.
【請求項4】 符号ビットおよびこれに続く数値ビット
からなる除算対象または剰余対象の各デ−タについてそ
れが負数のときにはその2の補数デ−タを求める補数作
成手段と、 当該各データが負数の場合、そのリーディング「1」の
ビット数またはその1の補数デ−タのリーディング
「0」のビット数を求めるとともに、そのビット列での
「01」の連続ビットの有無またはその1の補数デ−タ
のビット列での「10」の連続ビットの有無を検出する
データ判定手段と、 これらのビット数と連続ビットの有無とに基づいて、こ
の連続ビットが「有」の場合と「無」の場合とで「1」
だけ異なる値の正規化用制御信号を生成する正規化用制
御信号設定手段と、 前記2の補数デ−タをこの正規化用制御信号に基づいて
正規化するデータ正規化手段と、 を備えたことを特徴とする除算または剰余の前処理装
置。
4. Complement generating means for obtaining two's complement data of each data of division object or remainder object consisting of a sign bit and a numerical bit following the sign bit, and each data is a negative number. , The number of bits of the leading "1" or the number of bits of the leading "0" of the one's complement data is determined, and the presence or absence of consecutive bits of "01" in the bit string or its one's complement data Data determining means for detecting the presence / absence of "10" consecutive bits in the bit string of the data, and the case of "present" and "absent" based on the number of bits and the presence / absence of consecutive bits. And "1"
A normalization control signal setting means for generating a normalization control signal having a different value, and a data normalization means for normalizing the two's complement data based on the normalization control signal. A preprocessing device for division or remainder characterized by the following.
【請求項5】 正規化用制御信号設定手段は、前記検出
結果が「有」の場合には前記数値ビットのビット幅から
前記ビット数を減算し、また前記検出結果が「無」の場
合には当該ビット幅から「前記ビット数−1」を減算す
ることを特徴とする請求項4記載の除算または剰余の前
処理装置。
5. The normalization control signal setting means subtracts the bit number from the bit width of the numerical value bit when the detection result is “present”, and when the detection result is “absent”. The subtraction or remainder preprocessing device according to claim 4, wherein "the number of bits-1" is subtracted from the bit width.
【請求項6】 前記データ判定手段は、負数の前記デー
タに対しそのリーディング「1」のビット数を求めると
ともに、そのビット列での「01」の連続ビットの有無
を検出することを特徴とする請求項4または5記載の除
算または剰余の前処理装置。
6. The data determination means obtains the number of bits of leading “1” for the negative data and detects the presence or absence of consecutive bits of “01” in the bit string. Item 4. A division or remainder preprocessing device according to item 4 or 5.
JP6112406A 1994-05-26 1994-05-26 Preprocessing method for division or residue and preprocessor for division or residue Withdrawn JPH07319671A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6112406A JPH07319671A (en) 1994-05-26 1994-05-26 Preprocessing method for division or residue and preprocessor for division or residue

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6112406A JPH07319671A (en) 1994-05-26 1994-05-26 Preprocessing method for division or residue and preprocessor for division or residue

Publications (1)

Publication Number Publication Date
JPH07319671A true JPH07319671A (en) 1995-12-08

Family

ID=14585860

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6112406A Withdrawn JPH07319671A (en) 1994-05-26 1994-05-26 Preprocessing method for division or residue and preprocessor for division or residue

Country Status (1)

Country Link
JP (1) JPH07319671A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011509491A (en) * 2008-01-09 2011-03-24 クゥアルコム・インコーポレイテッド Processor and method for determining a normalized count

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011509491A (en) * 2008-01-09 2011-03-24 クゥアルコム・インコーポレイテッド Processor and method for determining a normalized count
US8631056B2 (en) 2008-01-09 2014-01-14 Qualcomm Incorporated Processor and method of determining a normalization count
JP2014132485A (en) * 2008-01-09 2014-07-17 Qualcomm Incorporated Processor and method of determining normalization count

Similar Documents

Publication Publication Date Title
EP0362580A2 (en) Leading 0/1 anticipator (LZA)
GB1516220A (en) Apparatus for verifying a signature
JP2618374B2 (en) Finding the position of the most significant digit
EP0366331A3 (en) System and method for error detection in the result of an arithmetic operation
JPH0786826B2 (en) Integer division circuit
CN1194301C (en) Partial matching partial output high speed buffer storage for computer arithmetic operation
JPH07319671A (en) Preprocessing method for division or residue and preprocessor for division or residue
JPH04350724A (en) Shift extent detecting circuit
JPH0635676A (en) Divider circuit
JPH0318986A (en) Character recognizing device
JPS60167030A (en) System and circuit for shift flag generation
GB2064837A (en) Electronic computer with aural output
JPH0683019B2 (en) Digital signal processor
KR100385233B1 (en) Exponent unit for data processing system
US3739162A (en) Serial bcd adder with radix correction
SU699519A1 (en) Device for converting binary numbers into binary-decimal numbers
SU1285464A1 (en) Dividing device
JPS63263591A (en) Character recognizing circuit
SU651371A1 (en) Digital integrator
JPH01212921A (en) A/d conversion circuit
JP2908117B2 (en) Vector arithmetic processing unit
SU1361576A1 (en) Fourier digital transform device
JPH0792738B2 (en) Normalization circuit
SU1674107A1 (en) Device to determine local extreme
KR200222599Y1 (en) Floating point type normalizer

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20010731