JPH0675746A - 1-position detecting method and computing element - Google Patents

1-position detecting method and computing element

Info

Publication number
JPH0675746A
JPH0675746A JP22823892A JP22823892A JPH0675746A JP H0675746 A JPH0675746 A JP H0675746A JP 22823892 A JP22823892 A JP 22823892A JP 22823892 A JP22823892 A JP 22823892A JP H0675746 A JPH0675746 A JP H0675746A
Authority
JP
Japan
Prior art keywords
data
bit
digit
input
bits
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
JP22823892A
Other languages
Japanese (ja)
Inventor
Maki Toyokura
真木 豊蔵
Kunitoshi Aono
邦年 青野
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP22823892A priority Critical patent/JPH0675746A/en
Publication of JPH0675746A publication Critical patent/JPH0675746A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To detect 1-position of the input data in the small processing frequency. CONSTITUTION:An AND computing element 21 is provided together with a 0 detector 22, and a multiplexer 23. The input intermediate data 24 and the mask data 25 are inputted to the element 21 for output of the AND computing result 26. The result 26 is inputted to the detector 22 which outputs 0 and 1 when the result 26 is equal to 0 and not equal to 0 respectively. The data 24 and the result 26 are inputted to the multiplexer 23. The multiplexer 23 outputs the data 24 and the result 26 when the result of the detector 22 is equal to 0 and 1 respectively. Then the multiplexer 23 outputs the result of the detector 22 as a bit of the number (N bits) of the digit where 1 is secured for the first time to the data 24 consisting of 2N bite through the check carried out toward the less significant direction from MSB and then output the result 26 as the output intermediate data consisting of 2N bits.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、マイクロプロセッサ
や、浮動小数点演算器で用いられる正規化処理を行うた
めにデータの1位置を検出する方法及び演算器である。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method and an arithmetic unit for detecting one position of data for performing a normalization process used in a microprocessor or a floating point arithmetic unit.

【0002】[0002]

【従来の技術】浮動小数点演算器では、演算結果を正規
表現とする。この方法は、仮数部のデータの内でMSB
(most significant bit)から下方へ1となる最初の桁
を探してその桁が、決まったビットまで左方へシフト
し、このシフト量分だけ、指数部のデータを減らす。こ
のときに、データの内でMSBから下方へ1となる最初
の桁をシフト量として用いる。 また、VLD(variab
le length decode)を行うときに、同様に1となる最初
の桁を利用することがある。
2. Description of the Related Art In a floating point arithmetic unit, the arithmetic result is a regular expression. This method uses the MSB in the mantissa part of the data.
Search for the first digit that becomes 1 downward from (most significant bit), and shift that digit to the left until a fixed bit, and reduce the data in the exponent by this shift amount. At this time, the first digit in the data that is 1 from the MSB downward is used as the shift amount. In addition, VLD (variab
When performing le length decode), the first digit that is also 1 may be used.

【0003】従来、1の位置を検出する処理は、図4に
示すフローチャートのように実現していた。簡単のた
め、入力データが8(23)ビットの場合について説明
する。出力データは、MSBから下位方向に調べて最初
に1となっている桁の番号Y(3ビット)を検出し、そ
の番号はLSBから、2進数表現で000,001,0
10,011,100,101,110,111とす
る。また、どのビットにも1がない場合には、000を
出力するものとする。マスクデータは2進数表現とす
る。以下、図4に基づいて処理内容を説明する。
Conventionally, the process of detecting the position 1 has been realized as shown in the flowchart of FIG. For simplicity, the case where the input data is 8 (2 3 ) bits will be described. The output data is searched in the lower direction from the MSB, and the number Y (3 bits) of the first digit of 1 is detected, and the number is LSB from 000,001,0.
Let 10,011,100,101,110,111. When there is no 1 in any bit, 000 is output. The mask data is expressed in binary. The processing contents will be described below with reference to FIG.

【0004】41aで、入力データDをマスクデータ1
0000000と論理積を行い、その結果をXに入れ
る。41bでXが0であるか否かを判定し、0の場合は
42aに進む。0でない場合は41cに進む。41cで
2進数表現の111(7)を出力Yとして終了する。
At 41a, the input data D is set to the mask data 1
Logical AND with 0000000 and put the result in X. At 41b, it is determined whether X is 0, and if it is 0, the process proceeds to 42a. If it is not 0, proceed to 41c. At step 41c, the binary expression 111 (7) is output as Y, and the process ends.

【0005】42aで、入力データDをマスクデータ0
1000000と論理積を行い、その結果をXに入れ
る。42bでXが0であるか否かを判定し、0の場合は
43aに進む。0でない場合は42cに進む。42cで
2進数表現の110(6)を出力Yとして終了する。
At 42a, the input data D is set to the mask data 0.
Performs a logical product with 1000000 and puts the result in X. At 42b, it is determined whether X is 0, and if it is 0, the routine proceeds to 43a. If it is not 0, proceed to 42c. At 42c, the binary expression 110 (6) is output as the output Y, and the process ends.

【0006】同様にマスクデータを変えて処理を進め、
47aで、入力データDをマスクデータ0000001
0と論理積を行い、その結果をXに入れる。47bでX
が0であるか否かを判定し、0の場合は48に進む。0
でない場合は47cに進む。47cで2進数表現の00
1(1)を出力Yとして終了する。
Similarly, the mask data is changed to proceed with the processing,
47a, input data D is mask data 00000001
Logical AND with 0 and put the result in X. X at 47b
Is 0, and if 0, the process proceeds to 48. 0
If not, proceed to 47c. 47c, 00 in binary notation
1 (1) is output as Y, and the process ends.

【0007】最後に、48で、2進数表現の000
(0)を出力して終了する。入力データDが、2進数表
現で00000001と00000000のときは、4
8で、同じ値の出力000(0)を出力する。
Finally, at 48, the binary representation of 000
Output (0) and end. 4 when the input data D is 00000001 and 00000000 in binary notation
At 8, the output 000 (0) of the same value is output.

【0008】これにより、入力データDのMSBから下
方へ1となる最初の桁の番号Yが得られる。また、シフ
ト量として用いる場合は、Yの反転データとして用いれ
ばよい。
As a result, the first digit number Y which becomes 1 downward from the MSB of the input data D is obtained. When used as the shift amount, it may be used as the inverted data of Y.

【0009】[0009]

【発明が解決しようとする課題】しかしながら図4のよ
うな方法では、入力データのビット数1ビット当たり1
回のマスク処理と1回の比較を必要とし、処理に多くの
時間を必要とする。
However, in the method shown in FIG. 4, the number of bits of input data is 1 per 1 bit.
It requires a masking process once and a comparison process once, and requires a lot of time for the process.

【0010】本発明では、処理時間の少ない1の位置を
検出する方法及び演算器を提供することを目的とする。
It is an object of the present invention to provide a method and an arithmetic unit for detecting the position of 1 which requires less processing time.

【0011】[0011]

【課題を解決するための手段】本発明は、1の位置の番
号の1個の桁を決めるデータを抽出するマスクデータを
用いて順に各々の桁を求める。
According to the present invention, each digit is sequentially obtained by using mask data for extracting data for determining one digit of a position number 1.

【0012】[0012]

【作用】本発明によると、1の位置の番号の1個の桁を
決めるために、1回のマスク処理と1回の比較を行なう
だけでよいので処理時間が短くなる。
According to the present invention, the processing time is shortened because only one mask processing and one comparison are required to determine one digit of the position number 1.

【0013】[0013]

【実施例】図1に請求項1記載の1位置検出方法のフロ
ーチャートを示す。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 shows a flow chart of the one-position detecting method according to claim 1.

【0014】簡単のため、入力データが8(23)ビッ
トの場合について説明する。出力データは、MSBから
下位方向に調べて最初に1となっている桁の番号Y(3
ビット)を検出し、その番号はLSBから、2進数表現
で000,001,010,011,100,101,
110,111とする。また、どのビットにも1がない
場合には、000を出力するものとする。マスクデータ
は2進数表現とする。以下、図1に基づいて請求項1記
載の1位置検出方法の実施例の処理内容を説明する。
For simplicity, the case where the input data is 8 (2 3 ) bits will be described. The output data is the digit number Y (3
Bit) and the number is 000,001,010,011,100,101, in binary notation from the LSB.
110 and 111. When there is no 1 in any bit, 000 is output. The mask data is expressed in binary. The processing contents of the embodiment of the one-position detecting method according to claim 1 will be described below with reference to FIG.

【0015】11aで、入力データを第0の中間データ
とし、第0の中間データと第1のマスクデータ1111
0000との論理積を行い、その結果をXとする。11
bでXが0であるか否かを判定し、0の場合は11cに
進む。0でない場合は11dに進む。11cでYのMS
Bから1ビット目に0をセットし、第0の中間データを
第1の中間データとする。11dでYのMSBから1ビ
ット目に1をセットし、Xを第1の中間データとする。
At 11a, the input data is set to the 0th intermediate data, and the 0th intermediate data and the first mask data 1111.
The logical product with 0000 is performed, and the result is X. 11
It is determined whether or not X is 0 in b, and if it is 0, the process proceeds to 11c. If not 0, proceed to 11d. 11c Y MS
0 is set to the first bit from B, and the 0th intermediate data is used as the first intermediate data. At 11d, 1 is set to the first bit from the MSB of Y, and X is the first intermediate data.

【0016】12aで、第1の中間データと第2のマス
クデータ11001100との論理積を行い、その結果
をXとする。12bでXが0であるか否かを判定し、0
の場合は12cに進む。0でない場合は12dに進む。
12cでYのMSBから2ビット目に0をセットし、第
1の中間データを第2の中間データとする。12dでY
のMSBから2ビット目に1をセットし、Xを第2の中
間データとする。
At 12a, the logical product of the first intermediate data and the second mask data 11001100 is obtained, and the result is taken as X. In 12b, it is determined whether X is 0, and 0
In the case of, proceed to 12c. If it is not 0, proceed to 12d.
At 12c, 0 is set to the second bit from the MSB of Y, and the first intermediate data is used as the second intermediate data. 12d for Y
1 is set to the 2nd bit from the MSB of X to set X as the second intermediate data.

【0017】13aで、第2の中間データと第3のマス
クデータ10101010との論理積を行い、その結果
をXとする。13bでXが0であるか否かを判定し、0
の場合は13cに進む。0でない場合は13dに進む。
13cでYのMSBから3ビット目に0をセットし、終
了する。13dでYのMSBから3ビット目に1をセッ
トし、終了する。
At 13a, the logical product of the second intermediate data and the third mask data 10101010 is calculated, and the result is taken as X. In 13b, it is determined whether X is 0 and 0
In the case of, proceed to 13c. If not 0, proceed to 13d.
At 13c, 0 is set to the 3rd bit from the MSB of Y, and the process is ended. At 13d, 1 is set to the 3rd bit from the MSB of Y, and the process ends.

【0018】上記処理の原理を以下に述べる。入力デー
タのMSBから上位4ビット目までのいずれかのビット
に1があれば、100,101,110,111番目に
1があるから、YのMSBから1ビット目に1をセット
する。そうでない場合には、YのMSBから1ビット目
に0をセットする。11aから11dまでで、入力デー
タとマスクデータ11110000との論理積演算を行
なって、その結果が0であるかどうかによりYのMSB
から1ビット目を決めている。
The principle of the above processing will be described below. If there is 1 in any bit from the MSB to the upper 4th bit of the input data, there is 1 in the 100th, 101st, 110th, and 111th bits, so 1 is set in the 1st bit from the MSB of Y. Otherwise, 0 is set in the 1st bit from the MSB of Y. In 11a to 11d, the AND operation of the input data and the mask data 1110000 is performed, and the MSB of Y is determined depending on whether the result is 0 or not.
The first bit is decided from.

【0019】次に、YのMSBから2ビット目を決め
る。YのMSBから1ビット目の判定と同様にして、Y
のMSBから1ビット目が1であれば、入力データとマ
スクデータ11000000との論理積演算を行ない、
YのMSBから1ビット目が0であれば、入力データと
マスクデータ00001100との論理積演算を行な
う。その結果が0であるか否かによりYのMSBから2
ビット目を決める。ここで、YのMSBから1ビット目
が1であれば、入力データとマスクデータ110000
00との論理積演算は、入力データとマスクデータ11
110000との論理積演算結果と、マスクデータ11
001100との論理積演算と結果が同じになる。ま
た、YのMSBから1ビット目が0であれば、上位4ビ
ットは0000であるから、入力データとマスクデータ
00001100との論理積演算は、入力データとマス
クデータ11001100との論理積演算結果が同じに
なる。従って、YのMSBから1ビット目を決める際に
得られた入力データとマスクデータ11110000と
の論理積演算結果と、入力データとを選択して得られる
第1の中間データとマスクデータ11001100との
論理積演算を行えば、その結果に従ってYのMSBから
2ビット目を決めることができる。
Next, the second bit is determined from the MSB of Y. Similarly to the determination of the first bit from the MSB of Y, Y
If the first bit from the MSB of 1 is 1, the logical product operation of the input data and the mask data 11000000 is performed,
If the first bit from the MSB of Y is 0, the logical product operation of the input data and the mask data 00001100 is performed. 2 from the MSB of Y depending on whether the result is 0 or not
Decide on a bit. Here, if the first bit from the MSB of Y is 1, the input data and mask data 110000
AND operation with 00 is performed by input data and mask data 11
AND operation result with 110000 and mask data 11
The result is the same as the AND operation with 00100. If the first bit from the MSB of Y is 0, the upper 4 bits are 0000. Therefore, the logical product operation of the input data and the mask data 00001100 yields the logical product operation result of the input data and the mask data 11001100. Will be the same. Therefore, the AND operation result of the input data obtained when the first bit is determined from the MSB of Y and the mask data 1110000, and the first intermediate data obtained by selecting the input data and the mask data 11001100 If the logical product operation is performed, the second bit can be determined from the MSB of Y according to the result.

【0020】YのMSBから3ビット目を決めるために
は、同様に、YのMSBから2ビット目を決める際に得
られた入力データとマスクデータ11001100との
論理積演算結果と、入力データとを選択して得られる第
2の中間データとマスクデータ10101010との論
理積演算を行えば、その結果に従ってYのMSBから2
ビット目を決めることができる。
In order to determine the third bit from the MSB of Y, similarly, the logical product operation result of the input data obtained when determining the second bit from the MSB of Y and the mask data 11001100 and the input data are obtained. When the logical product operation of the second intermediate data obtained by selecting and the mask data 10101010 is performed, 2 is obtained from the MSB of Y according to the result.
You can decide the bit.

【0021】請求項1記載の1位置検出方法を従来例と
処理量を比較する。入力データが2 Nビットの場合、論
理積演算と0検知の回数を合計すると、請求項1記載の
1位置検出方法では、2N回であり、従来例では、最大
2(2N−1)回である。このN=3の例では、従来例
が14回に対して、本発明では6回であり、処理回数が
削減される。
The one-position detecting method according to claim 1 is different from the conventional example.
Compare throughput. Input data is 2 NBit, argument
The sum of the number of times of the arithmetic operation and the zero detection gives the value according to claim 1.
In the 1-position detection method, the number of times is 2N, and in the conventional example, the maximum
2 (2N-1) times. In this example of N = 3, the conventional example
In contrast to 14 times in the present invention, it is 6 times, and the number of processing times is
Be reduced.

【0022】図2に請求項2記載の1位置検出演算器の
ブロック図を示す。図2において、21は論理積演算
器、22は0判定演算器、23はマルチプレクサ、24
は入力中間データ、25はマスクデータ、26は論理積
演算器21の出力結果、27はYの1ビット分のデー
タ、28は出力中間データである。この演算器は、2N
ビットからなる入力データに対してMSBから下位方向
に調べて最初に1となっている桁の番号(Nビット)Y
の1ビット分を入力中間データを用いて計算して出力
し、2Nビットからなる出力中間データを出力する演算
器である。
FIG. 2 shows a block diagram of the one-position detecting arithmetic unit according to the second aspect. In FIG. 2, 21 is a logical product operator, 22 is a 0 decision operator, 23 is a multiplexer, 24
Is input intermediate data, 25 is mask data, 26 is an output result of the AND operator 21, 27 is data for 1 bit of Y, and 28 is output intermediate data. This calculator is 2 N
The input data consisting of bits is searched from MSB in the lower direction, and the first digit number is 1 (N bit) Y
Is an arithmetic unit that calculates and outputs 1-bit portion of the input intermediate data using the input intermediate data, and outputs 2 N- bit output intermediate data.

【0023】以下図2に基づいて、請求項2記載の1位
置検出演算器の実施例の動作を説明する。
The operation of the embodiment of the one-position detecting arithmetic unit according to claim 2 will be described below with reference to FIG.

【0024】まず、入力中間データ24とマスクデータ
25を論理積演算器21に入力する。論理積演算器は、
2入力の各ビット毎に論理積演算を行う。次に、論理積
演算器21の出力結果26を0判定演算器22に入力す
る。0判定演算器22は、入力された論理演算器21の
出力結果が0であれば0を、0以外の値であれば1を、
Yの1ビット分データ27として出力する。0判定演算
器22は、全てのビットの論理和を演算すれば、実現で
きる。次に、論理積演算器21の出力結果と入力中間デ
ータ24をマルチプレクサ23に入力する。マルチプレ
クサ23は、0判定演算器22の結果が0の場合は、入
力中間データを選択し、1の場合は、論理積演算器21
の出力結果を選択して出力中間データ28として出力す
る。この1位置検出演算器により、図1の11aから1
1dに相当する演算を行うことができる。
First, the input intermediate data 24 and the mask data 25 are input to the logical product calculator 21. The logical product operator is
An AND operation is performed for each bit of 2 inputs. Next, the output result 26 of the logical product operator 21 is input to the 0 determination operator 22. The 0-decision arithmetic unit 22 outputs 0 if the input output result of the logical arithmetic unit 21 is 0, and outputs 1 if it is a value other than 0.
It is output as 1-bit data 27 of Y. The 0 determination calculator 22 can be realized by calculating the logical sum of all bits. Next, the output result of the AND operator 21 and the input intermediate data 24 are input to the multiplexer 23. The multiplexer 23 selects the input intermediate data when the result of the 0 determination operator 22 is 0, and when it is 1, the AND operator 21
And outputs the output result as the output intermediate data 28. With this one-position detection calculator, 1a to 1a in FIG.
A calculation equivalent to 1d can be performed.

【0025】図3に請求項3記載の1位置検出方法のフ
ローチャートを示す。簡単のため、入力データが8(2
3)ビットの場合について説明する。入力データのMS
Bから下位方向に調べて最初に1となっている桁の番号
Y(3ビット)を検出し、その番号はLSBから、2進
数表現で000,001,010,011,100,1
01,110,111とする。また、どのビットにも1
がない場合には、000を出力するものとする。マスク
データは2進数表現とする。以下、図2,図3に基づい
て請求項1記載の1位置検出方法の実施例の処理内容を
説明する。
FIG. 3 shows a flowchart of the one-position detecting method according to the third aspect. For simplicity, the input data is 8 (2
3 ) Explain the case of bits. MS of input data
The number Y (3 bits) of the first digit of 1 is detected by searching in the lower direction from B, and the number is 000,001,010,011,100,1 in binary notation from LSB.
01, 110, 111. Also, 1 for every bit
If there is not, 000 shall be output. The mask data is expressed in binary. The processing contents of the embodiment of the one-position detecting method according to claim 1 will be described below with reference to FIGS.

【0026】31で、入力データを第0の中間データと
し、第0の中間データを入力中間データとして、第1の
マスクデータ11110000をマスクデータとして図
2に示す1位置検出演算回路に入力した結果、Yの1ビ
ット分と2Nビットからなる出力中間データが得られ
る。
At 31, the input data is the 0th intermediate data, the 0th intermediate data is the input intermediate data, the first mask data 1110000 is the mask data, and the result is input to the 1 position detection arithmetic circuit shown in FIG. , Y of 1 bit and 2 N bits of output intermediate data are obtained.

【0027】32で、31の結果得られた1ビット分の
データをYのMSBから1ビット目にセットし、出力中
間データを第1の中間データとする。
At 32, the 1-bit data obtained as a result of 31 is set to the first bit from the MSB of Y, and the output intermediate data is set as the first intermediate data.

【0028】33で、第1の中間データを入力中間デー
タとして、第2のマスクデータ11001100をマス
クデータとして図2に示す1位置検出演算回路に入力し
た結果、Yの1ビット分と2Nビットからなる出力中間
データが得られる。
[0028] In 33, the first intermediate data as input intermediate data, a result of entering the second mask data 11001100 to 1 position detection calculation circuit shown in FIG. 2 as the mask data, one bit and 2 N bits of Y Output intermediate data consisting of

【0029】34で、33の結果得られた1ビット分の
データをYのMSBから2ビット目にセットし、出力中
間データを第2の中間データとする。
At 34, the 1-bit data obtained as a result of 33 is set to the second bit from the MSB of Y, and the output intermediate data is used as the second intermediate data.

【0030】35で、第2の中間データを入力中間デー
タとして、第3のマスクデータ10101010をマス
クデータとして図2に示す1位置検出演算回路に入力し
た結果、Yの1ビット分と2Nビットからなる出力中間
データが得られる。
[0030] In 35, as the input intermediate data of the second intermediate data, the results entered into a position detection calculation circuit shown in FIG. 2 the third mask data 10101010 as the mask data, one bit and 2 N bits of Y Output intermediate data consisting of

【0031】36で、35の結果得られた1ビット分の
データをYのMSBから3ビット目にセットし、終了す
る。
At 36, the 1-bit data obtained as a result of 35 is set to the 3rd bit from the MSB of Y, and the processing is terminated.

【0032】このように図2に示す1位置検出演算回路
を用い、31〜36の処理の結果、請求項1記載の1位
置検出方法を少ない処理回数で実現することができる。
As described above, by using the 1-position detecting arithmetic circuit shown in FIG. 2, as a result of the processing of 31 to 36, the 1-position detecting method according to claim 1 can be realized with a small number of processing times.

【0033】尚、請求項2記載の1位置検出演算回路を
直列に並べて請求項2記載の1位置検出方法を全て回路
で実行することもできる。
It is also possible to arrange the 1-position detection arithmetic circuits described in claim 2 in series and execute the 1-position detection method according to claim 2 in all the circuits.

【0034】[0034]

【発明の効果】以上述べたように、本発明によれば、1
位置検出を少ない処理回数で実現することができ、特に
入力ビット数が大きい場合にその効果は顕著となり、本
発明の実用的効果は大きい。
As described above, according to the present invention, 1
Position detection can be realized with a small number of processing times, and particularly when the number of input bits is large, the effect becomes remarkable, and the practical effect of the present invention is great.

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

【図1】本発明請求項1記載の1位置検出方法のフロー
チャート
FIG. 1 is a flowchart of a one-position detecting method according to claim 1 of the present invention.

【図2】本発明請求項2記載の1位置検出演算器のブロ
ック図
FIG. 2 is a block diagram of a one-position detecting arithmetic unit according to claim 2 of the present invention.

【図3】本発明請求項3記載の1位置検出方法のフロー
チャート
FIG. 3 is a flowchart of the one-position detecting method according to claim 3 of the present invention.

【図4】従来の1位置検出方法を示すフローチャートFIG. 4 is a flowchart showing a conventional one-position detecting method.

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

21 論理積演算器 22 0検知回路 23 マルチプレクサ 24 入力中間データ 25 マスクデータ 26 論理積演算器の出力結果 27 Yの1ビット分のデータ 28 出力中間データ 21 AND operation unit 22 0 Detection circuit 23 Multiplexer 24 Input intermediate data 25 Mask data 26 Output result of AND operation unit 27 1-bit data of Y 28 Output intermediate data

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】2Nビットからなる入力データに対してM
SBから下位方向に調べて最初に1となっている桁の番
号(Nビット)を検出する方法であって、 論理積演算手段と、0検知手段と、2Nビットの桁を2
分の1に分け、上位側から第1の桁のグループの値を全
て1、第2の桁のグループの値を全て0の第1のマスク
データと、2Nビットの桁を4分の1に分け、上位側か
ら第1の桁のグループの値を全て1、第2の桁のグルー
プの値を全て0、第3の桁のグループの値を全て1、第
4の桁のグループの値を全て0の第2のマスクデータ
と、…、2 Nビットの桁を2n分の1に分け、上位側から
桁のグループ毎に全て1、全て0を繰り返した第nのマ
スクデータと、…、2Nビットの桁を2N分の1に分け、
上位側から桁毎に1、0を繰り返した第Nのマスクデー
タを持ち、2Nビットからなる入力データを第0の中間
データとして、 第n−1の中間データと第nのマスクデータを前記論理
積演算手段により、第nの論理積演算結果を出力し、第
nの論理積演算結果を前記0検知手段により判別し、第
nの論理積演算結果が0の場合に、NビットのMSBか
らn番目の桁に0を出力し、第n−1の中間データを第
nの中間データとして出力し、第nの論理積演算結果が
0でない場合に、NビットのMSBからn番目の桁に1
を出力し、第nの論理積演算結果を第nの中間データと
して出力する操作を、n=1,2,…,Nまで繰り返す
ことにより、2Nビットからなる入力2進データに対し
てMSBから下位方向に調べて最初に1となっている桁
の番号(Nビット)を検出する1位置検出方法。
1.NM for input data consisting of bits
The number of the first digit that is 1 in the lower direction from SB
No. (N-bit) detection method, which comprises: logical product operation means, 0 detection means, 2NBit digit 2
Divide it into 1 and divide the value of the first digit group from the upper side.
The first mask with all 1s and the values of the second digit group being all 0s
Data and 2NDivide the bit digit into quarters, and
From the group of the first digit to 1 and the group of the second digit to 1
0 for all group values, 1 for all group values in the third digit,
The second mask data in which the value of the group of 4 digits is all 0s
And ... 2 NBit digit 2nDivide into 1 and divide from the upper side
Repeats all 1s and all 0s for each group of digits
With data, ... 2NBit digit 2NDivide into
Nth mask data that repeats 1 and 0 for each digit from the higher order side
Have 2NInput data consisting of bits is 0th intermediate
As the data, the n-1th intermediate data and the nth mask data are the logical values.
The product operation means outputs the n-th logical product operation result,
The AND operation result of n is discriminated by the 0 detection means,
If the logical product of n is 0, is it an N-bit MSB?
0 is output to the n-th digit from the
Output as n intermediate data, and the nth AND operation result is
If not 0, 1 in the nth digit from the N-bit MSB
Is output, and the n-th AND operation result is set as the n-th intermediate data.
, And output it repeatedly until n = 1, 2, ..., N
By 2NFor input binary data consisting of bits
The first digit that is 1 in the lower direction from the MSB
1 position detection method for detecting the number (N bits) of.
【請求項2】2Nビットからなる入力データに対してM
SBから下位方向に調べて最初に1となっている桁の番
号(Nビット)の1ビット分を入力中間データを用いて
計算して出力し、2Nビットからなる出力中間データを
出力する演算器であって、 2Nビット論理積演算器と、2Nビットデータ0検知器
と、マルチプレクサを備え、2Nビットの入力中間デー
タと2Nビットのマスクデータを前記2Nビット論理積演
算器に入力して論理積演算結果を出力し、前記論理積演
算結果を前記2Nビットデータ0検知器に入力し、前記
Nビットデータ0検知器は、前記論理積演算結果が0
の場合に0を出力し、0でない場合に1を出力し、前記
Nビットの入力中間データと前記論理積演算結果を前
記マルチプレクサに入力し、前記マルチプレクサは、前
記2Nビットデータ0検知器の結果が0の場合に前記2N
ビットの入力中間データを出力し、1の場合に前記論理
積演算結果を出力し、 前記2Nビットデータ0検知器の結果を、2Nビットから
なる入力中間データに対してMSBから下位方向に調べ
て最初に1となっている桁の番号(Nビット)の1ビッ
ト分として出力し、前記論理積演算結果を、2Nビット
からなる出力中間データとして出力する演算器。
2. M for input data consisting of 2 N bits
An operation for calculating one bit of the digit number (N bit) which is 1 at the beginning from SB by calculating in the lower direction using the input intermediate data and outputting the output intermediate data consisting of 2 N bits A 2 N- bit logical product operator, a 2 N- bit data 0 detector, a multiplexer, and a 2 N- bit logical product operator for inputting 2 N- bit input intermediate data and 2 N- bit mask data. enter output a logic aND operation result, and inputs the logical aND operation result to the 2 N bit data 0 detector, said 2 N bit data 0 detector, said logical operation result is 0
0 is output in the case of, and 1 is output in the case of not being 0, the 2 N- bit input intermediate data and the logical product operation result are input to the multiplexer, and the multiplexer outputs the 2 N- bit data 0 detector. If the result is 0, then 2 N
The input intermediate data of bits is output, and the logical product operation result is output when it is 1, and the result of the 2 N- bit data 0 detector is output from the MSB to the lower direction with respect to the input intermediate data of 2 N bits. An arithmetic unit that outputs one bit of the digit number (N bits) that is first checked and outputs the AND operation result as output intermediate data of 2 N bits.
【請求項3】2Nビットからなる入力データに対してM
SBから下位方向に調べて最初に1となっている桁の番
号(Nビット)を検出する方法であって、 請求項2記載の演算器と、2Nビットの桁を2分の1に
分け、上位側から第1の桁のグループの値を全て1、第
2の桁のグループの値を全て0の第1のマスクデータ
と、2Nビットの桁を4分の1に分け、上位側から第1
の桁のグループの値を全て1、第2の桁のグループの値
を全て0、第3の桁のグループの値を全て1、第4の桁
のグループの値を全て0の第2のマスクデータと、…、
Nビットの桁を2n分の1に分け、上位側から桁のグル
ープ毎に全て1、全て0を繰り返した第nのマスクデー
タと、…、2Nビットの桁を2N分の1に分け、上位側か
ら桁毎に1、0を繰り返した第Nのマスクデータを備
え、2Nビットからなる入力データを第0の中間データ
として、 第n−1の2Nビットからなる中間データを入力中間デ
ータとして前記演算器に入力し、第nのマスクデータを
マスクデータとして前記演算器に入力し、前記2Nビッ
トデータ0検知器の結果を、2Nビットからなる入力デ
ータに対してMSBから下位方向に調べて最初に1とな
っている桁の番号(Nビット)のnビット目として出力
し、出力中間データを、n番目の2Nビットからなる中
間データとして出力する操作を、n=1,2,…,Nま
で繰り返すことにより、2Nビットからなる入力2進デ
ータに対してMSBから下位方向に調べて最初に1とな
っている桁の番号(Nビット)を検出する1位置検出方
法。
3. M for input data consisting of 2 N bits
A method for detecting the number (N bit) of the first digit of 1 by searching in the lower direction from SB, wherein the arithmetic unit according to claim 2 and the digit of 2 N bit are divided into halves. , The first mask data in which the values of the first digit group are all 1s and the values of the second digit group are all 0s from the higher order side, and the 2 N- bit digits are divided into 1/4 From first
The second mask in which the values in the group of digits are all 1, the values in the second digit group are all 0, the values in the third digit group are all 1, and the values in the fourth digit group are all 0. With data ...
Divided 2 N bit digit to 1 of 2 n min, everything every from the upper side of beam groups 1, and the mask data of the n repeating all 0, ..., 1 of the 2 N bit digit of 2 N min And the Nth mask data in which 1s and 0s are repeated for each digit from the upper side, and the input data consisting of 2N bits is the 0th intermediate data, and the n-1th intermediate data consisting of 2N bits. the input to the arithmetic unit as input intermediate data, the mask data of the n input to the arithmetic unit as the mask data, the results of the 2 n bit data 0 detector, for input data composed of 2 n bits The operation of searching in the lower direction from the MSB and outputting it as the nth bit of the digit number (N bit) which is 1 first, and outputting the output intermediate data as the intermediate data consisting of the nth 2N bits, Repeat until n = 1, 2, ..., N The one position detecting method for detecting a 2 N consists bit input binary from MSB to data digits that is the first one checks the lower direction number (N bits).
JP22823892A 1992-08-27 1992-08-27 1-position detecting method and computing element Pending JPH0675746A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP22823892A JPH0675746A (en) 1992-08-27 1992-08-27 1-position detecting method and computing element

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22823892A JPH0675746A (en) 1992-08-27 1992-08-27 1-position detecting method and computing element

Publications (1)

Publication Number Publication Date
JPH0675746A true JPH0675746A (en) 1994-03-18

Family

ID=16873329

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22823892A Pending JPH0675746A (en) 1992-08-27 1992-08-27 1-position detecting method and computing element

Country Status (1)

Country Link
JP (1) JPH0675746A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101964635A (en) * 2010-10-27 2011-02-02 中国科学院上海应用物理研究所 Automatic gain control method for digital signal
WO2011161859A1 (en) 2010-06-22 2011-12-29 日本電気株式会社 Semiconductor integrated circuit and index calculation method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011161859A1 (en) 2010-06-22 2011-12-29 日本電気株式会社 Semiconductor integrated circuit and index calculation method
US8862647B2 (en) 2010-06-22 2014-10-14 Nec Corporation Semiconductor integrated circuit and exponent calculation method
CN101964635A (en) * 2010-10-27 2011-02-02 中国科学院上海应用物理研究所 Automatic gain control method for digital signal

Similar Documents

Publication Publication Date Title
US5889690A (en) Multiply-add unit and data processing apparatus using it
JP3244506B2 (en) Small multiplier
JP3492638B2 (en) Floating point multiplier
US9256577B2 (en) Apparatuses and related methods for overflow detection and clamping with parallel operand processing
US6728739B1 (en) Data calculating device and method for processing data in data block form
JP3345894B2 (en) Floating point multiplier
JPH0675746A (en) 1-position detecting method and computing element
EP0539010B1 (en) Method and device for generating sum information/rounding control signal
US4118786A (en) Integrated binary-BCD look-ahead adder
US5142490A (en) Multiplication circuit with storing means
JPH04350724A (en) Shift extent detecting circuit
KR940008611B1 (en) Binary floating point arithmetic rounding in conformance with ieee 754-1985 standard
JP3950920B2 (en) Multiply-accumulator and data processing device
JP2734438B2 (en) Multiplier
JPS63231525A (en) Sort processor
JP2007073061A (en) Data processing apparatus
JPH01276237A (en) Selector for candidate term to be unified
US7111034B2 (en) Carry foreknowledge adder
KR200222599Y1 (en) Floating point type normalizer
JPH06243194A (en) Method and device for automatic logic circuit design
JPH0286334A (en) Multiplication circuit in 2m galois field
JPH113210A (en) 3-input comparator, saturation arithmetic unit using the same and arithmetic method therefor
JPH086762A (en) Multiplying circuit
JP2002304288A (en) Data processing device and program
JPS63197218A (en) Priority encoder