JP2761558B2 - Bit search device - Google Patents

Bit search device

Info

Publication number
JP2761558B2
JP2761558B2 JP20098389A JP20098389A JP2761558B2 JP 2761558 B2 JP2761558 B2 JP 2761558B2 JP 20098389 A JP20098389 A JP 20098389A JP 20098389 A JP20098389 A JP 20098389A JP 2761558 B2 JP2761558 B2 JP 2761558B2
Authority
JP
Japan
Prior art keywords
output
logic
data
bit
control signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP20098389A
Other languages
Japanese (ja)
Other versions
JPH0363816A (en
Inventor
久己 佐々木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ADOBANTESUTO KK
Original Assignee
ADOBANTESUTO KK
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 ADOBANTESUTO KK filed Critical ADOBANTESUTO KK
Priority to JP20098389A priority Critical patent/JP2761558B2/en
Publication of JPH0363816A publication Critical patent/JPH0363816A/en
Application granted granted Critical
Publication of JP2761558B2 publication Critical patent/JP2761558B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 「産業上の利用分野」 この発明は浮動小数点演算における正規化処理、ビッ
ト検索命令、算術シフトのオーバーフローの検出などに
利用され、最上位ビットより、それと反転するビットが
初めて出現するビット位置を検索するビット検索装置に
関する。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Application Field] The present invention is used for normalization processing in floating point arithmetic, bit search instructions, detection of overflow of arithmetic shift, and the like. The present invention relates to a bit search device that searches for a bit position that appears for the first time.

「従来の技術」 32ビットの入力データに対して1サイクルでビット検
索を実行する装置として従来より第3図に示すように32
ビット優先順位エンコーダが使用されている。これは第
4図に示すように入力データを最上位ビットMSBより順
次下位ビットを見て論理“1"のビットが初めて出現する
ビット位置Nを、最上位ビット位置を31(10)(10進数表
示)番目として2進コード5ビットで出力するものであ
る。
2. Description of the Related Art As a device for executing a bit search for input data of 32 bits in one cycle, as shown in FIG.
A bit priority encoder is used. As shown in FIG. 4, the bit position N where the bit of logic "1" first appears when the input data is sequentially looked at the lower bit from the most significant bit MSB is set to 31 (10) (decimal number ). (Display) is output with 5 bits of binary code.

ビット検索にはこのように最上位ビットから見て最初
に論理“1"が出現するビット位置nを検索する“1"ビッ
ト検索(第5図A)の他に、第5図Bに示すように最上
位ビットから見て最初に論理“0"が出現するビット位置
nを検索する“0"ビット検索と、第5図Cに示すように
最上位ビットから見て最上位ビットの論理S(Sは“0"
又は“1")と反転した論理が最初に出現するビット位
置nを検索する最上位反転ビット検索とがある。しかも
これら第5図A〜Cに示す3つの検索方式に対し、その
検索結果nを、第5図に示すように最上位ビットMSBを1
0進数で0番目として2進コード5ビットPBNで出力する
(正論理出力)場合と、第5図Eに示すように最上位ビ
ットMSBを10進数で31番目として2進コード5ビットNBN
(=▲▼)で出力する(負論理出力)場合とがあ
る。
In the bit search, in addition to the "1" bit search (FIG. 5A) for searching the bit position n where the logical "1" first appears when viewed from the most significant bit, as shown in FIG. A "0" bit search for searching for a bit position n where a logical "0" first appears when viewed from the most significant bit, and a logic S () for the most significant bit as viewed from the most significant bit as shown in FIG. 5C. S is "0"
Or "1") and the most significant inverted bit search for searching the bit position n where the inverted logic appears first. Further, for the three search methods shown in FIGS. 5A to 5C, the search result n is set to the most significant bit MSB of 1 as shown in FIG.
5 bits of binary code output as PBN as 0th in base 0 (positive logic output), and 5 bits of binary code NBN as 31st most significant bit MSB as 31st decimal as shown in FIG. 5E
(= ▲ ▼) to output (negative logic output).

従来においてはこれらビット検索方式や出力形式に応
じて入力データや出力データをソフトウエア処理を行っ
ており、そのために数サイクルのデータ整形処理を必要
としていた。
Conventionally, input data and output data are subjected to software processing in accordance with the bit search method and output format, and therefore, several cycles of data shaping processing are required.

この発明の目的はビット検索方式や出力形式にかかわ
らず1サイクルで実行できるビット検索装置を提供する
ことにある。
An object of the present invention is to provide a bit search device that can be executed in one cycle regardless of a bit search method and an output format.

「課題を解決するための手段」 この発明によれば入力データは第1論理回路で正論理
データ及び負論理データとして出力され、これら正論理
データ及び負論理データの各最上位ビットと、第1,第2,
第3制御信号とがマルチプレクサへ供給され、第1制御
信号の状態に応じて第2,第3制御信号又は上記両最上位
ビットがマルチプレクサから出力され、その出力に応じ
て上記正論理データ又は負論理データがデータセレクタ
で選択され、その選択されたデータは優先順位エンコー
ダへ供給され、優先順位エンコーダは入力されたデータ
を最上位ビットから見て初めて論理“1"となるビット位
置2進数で出力し、その出力は第2論理回路で正論理出
力及び負論理出力として出力され、その正論理出力又は
負論理出力が出力セレクタで第4制御信号の状態に応じ
て選択出力される。
According to the present invention, input data is output by the first logic circuit as positive logic data and negative logic data, and the most significant bits of the positive logic data and the negative logic data are stored in the first logic circuit. ,No. 2,
A third control signal is supplied to the multiplexer, and the second and third control signals or both the most significant bits are output from the multiplexer according to the state of the first control signal, and the positive logic data or the negative logic data is output according to the output. Logic data is selected by the data selector, and the selected data is supplied to the priority encoder, and the priority encoder outputs the input data as a binary number at a bit position that becomes logical "1" only when viewed from the most significant bit. Then, the output is output as a positive logic output and a negative logic output by the second logic circuit, and the positive logic output or the negative logic output is selectively output by the output selector according to the state of the fourth control signal.

「実施例」 第1図にこの発明の実施例を示す。32ビットの入力デ
ータ〔DB〕は第1論理回路11で正論理データ〔DB〕と負
論理データ〔▲▼〕として出力される。その正論理
データ〔DB〕の最上位ビットDB00と負論理データ〔▲
▼〕の最上位ビット▲▼とがマルチプレクサ
12内のアンド回路13,1にそれぞれ供給される。マルチプ
レクサ12内のアンド回路15,16の両者に第1制御信号IAL
1が供給され、アンド回路15,16にそれぞれ第2,第3制御
信号IAL2,IAL3が供給され、アンド回路15,16の各出力は
それぞれオア回路17,18へ供給される。アンド回路13,14
の両者に第1制御信号の反転信号▲▼が供給さ
れ、アンド回路13,14の各出力はそれぞれオア回路17,18
へ供給される。
FIG. 1 shows an embodiment of the present invention. The 32-bit input data [DB] is output by the first logic circuit 11 as positive logic data [DB] and negative logic data [▲ ▼]. The most significant bit DB00 of the positive logic data [DB] and the negative logic data [▲
The most significant bit ▲ ▼ of ▼) is a multiplexer
The signals are supplied to AND circuits 13 and 1 in 12, respectively. The first control signal IAL is supplied to both of the AND circuits 15 and 16 in the multiplexer 12.
1 is supplied, the second and third control signals IAL2 and IAL3 are supplied to the AND circuits 15 and 16, respectively, and the respective outputs of the AND circuits 15 and 16 are supplied to the OR circuits 17 and 18, respectively. AND circuit 13,14
Are supplied with inverted signals ▲ of the first control signal, and the outputs of the AND circuits 13 and 14 are respectively connected to the OR circuits 17 and 18.
Supplied to

オア回路17,18の各出力がマルチプレクサ12の出力と
してデータセレクタ19へ供給され、これら出力に応じて
第1論理回路11からの正論理データ〔DB〕又は負論理デ
ータ〔▲▼〕が選択される。データセレクタ19で選
択された32ビットのデータはパス21を通じて32ビット優
先順位エンコーダ22へ供給される。優先順位エンコーダ
22は入力されたデータ最上位ビットから見て最初に論理
“1"となったビット位置を5ビットの2進数として出力
するものである。この出力は第2論理回路23へ供給さ
れ、第2論理回路23からその正論理出力PBNと負論理出
力NBNとが出力されて出力セレクタ24へ供給される。出
力セレクタ24は第4制御信号IAL4により制御され、第4
制御信号IAL4が論理Lで正論理出力PBNが選択され、IAL
4が論理Hで負論理出力NBNが選択される。
Each output of the OR circuits 17 and 18 is supplied as an output of the multiplexer 12 to the data selector 19, and according to these outputs, positive logic data [DB] or negative logic data [▲ ▼] from the first logic circuit 11 is selected. You. The 32-bit data selected by the data selector 19 is supplied to a 32-bit priority encoder 22 through a path 21. Priority encoder
Numeral 22 outputs the bit position which first becomes logical "1" when viewed from the most significant bit of the input data as a 5-bit binary number. This output is supplied to the second logic circuit 23, and the positive logic output PBN and the negative logic output NBN are output from the second logic circuit 23 and supplied to the output selector 24. The output selector 24 is controlled by the fourth control signal IAL4,
When the control signal IAL4 is at logic L and the positive logic output PBN is selected, IAL
4 is logic H and the negative logic output NBN is selected.

上述の構成において第1制御信号IAL1が論理Lの場合
は、アンド回路13,14が阻止され、アンド回路15,16が通
過になって、第2,第3制御信号IAL2,IAL3がそれぞれオ
ア回路17,18より出力され、第2制御信号IAL2が論理L
で第3制御信号IAL3が論理Hの場合はデータセレクタ19
で負論理データ〔▲▼〕が選択され、従って優先順
位エンコーダ22では入力データ〔DB〕に対して“0"ビッ
ト検索を行ったことになる。第2制御信号IAL2が論理H
で第3制御信号IAL3が論理Lの場合はデータセレクタ19
で正論理データ〔DB〕が選択され、優先順位エンコーダ
22では入力データ〔DB〕に対し“1"ビット検索を行った
ことになる。
In the above configuration, when the first control signal IAL1 is logic L, the AND circuits 13 and 14 are blocked, the AND circuits 15 and 16 are passed, and the second and third control signals IAL2 and IAL3 are OR circuits, respectively. Output from 17, 18 and the second control signal IAL2 is logic L
When the third control signal IAL3 is logic H, the data selector 19
, The negative logic data [▲ ▼] is selected, so that the priority encoder 22 has searched the input data [DB] for “0” bits. The second control signal IAL2 is logic H
When the third control signal IAL3 is logic L, the data selector 19
To select positive logic data [DB], and the priority encoder
At 22, it means that "1" bit search has been performed on the input data [DB].

一方第1制御信号IAL1が論理Hの場合は、アンド回路
15,16が阻止され、アンド回路13,14が通過となり、正論
理データ〔DB〕と負論理データ〔▲▼〕との各最上
位ビットDB00と▲▼との反転したものがオア回
路17,18より出力され、DB00が論理Lの場合はオア回路1
7,18の各出力はそれぞれ論理H,Lとなり、データセレク
タ19で正論理データ〔DB〕が選択され、最上位ビットDB
00が論理L(“0")に対し、最初に論理“1"となるビッ
ト位置を優先順位エンコーダ22で検索し、DB00が論理H
の場合はオア回路17,18の各出力はそれぞれ論理L,Hとな
り、データセレクタ19で負論理データ〔▲▼〕が選
択され、入力データ〔DB〕について最上位ビットDB00が
論理H(“1")に対し、最初に論理“0"となるビット位
置を優先順位エンコーダ22で検索したことになる。つま
り第1制御信号IAL1が論理Hの場合は入力データ〔DB〕
に対し最上位反転ビット検索が行われる。
On the other hand, if the first control signal IAL1 is logic H,
15 and 16 are blocked, the AND circuits 13 and 14 pass, and the inverted one of the most significant bits DB00 and ▲ ▼ of the positive logic data [DB] and the negative logic data [▲ ▼] is the OR circuit 17, Output from 18 and when OR00 is logic L, OR circuit 1
Outputs 7 and 18 become logic H and L, respectively.Positive logic data [DB] is selected by the data selector 19 and the most significant bit DB
00 is first searched by the priority encoder 22 for a bit position that becomes logical “1” with respect to logical L (“0”).
In the case of, the outputs of the OR circuits 17 and 18 become logic L and H, respectively, the negative logic data [▲ ▼] is selected by the data selector 19, and the most significant bit DB00 of the input data [DB] is logic H (“1”). This means that the priority encoder 22 first searches for a bit position that becomes logical “0” in response to “)”. That is, when the first control signal IAL1 is logic H, the input data [DB]
Is searched for the most significant inverted bit.

このようにして入力データ〔DB〕に対して“0"ビット
検索、“1"ビット検索、最上位反転ビット検索が、第1,
第2,第3制御信号IAL1,IAL2,IAL3の状態により行われ、
その結果が優先順位エンコーダ22から出力される。この
出力は第2論理回路23で正論理出力と負論理出力とさ
れ、第4制御信号IAL4が論理Lの場合は正論理出力PBN
が出力セレクタ24で選択され、IAL4が論理Hの場合は負
論理出力NBNが選択され、最上位ビットを0番目とした
場合の検索結果出力と最上位ビットを31番目とした場合
の検索結果出力とを選択的に得ることができる。第1〜
第4制御信号IAL1〜IAL4の各状態に対する、検索方式と
出力形式との関係を第2図に示す。
In this way, for the input data [DB], the “0” bit search, “1” bit search,
This is performed depending on the state of the second and third control signals IAL1, IAL2, IAL3,
The result is output from the priority encoder 22. This output is made into a positive logic output and a negative logic output by the second logic circuit 23. When the fourth control signal IAL4 is logic L, the positive logic output PBN
Is selected by the output selector 24, the negative logic output NBN is selected when IAL4 is logic H, and the search result output when the most significant bit is 0th and the search result output when the most significant bit is 31st And can be selectively obtained. First to first
FIG. 2 shows the relationship between the search method and the output format for each state of the fourth control signals IAL1 to IAL4.

なお、入力データ〔DB〕が全ビット“0"又は全ビット
“1"でビット検索ができない場合は優先順位エンコーダ
22の端子25からオーバーフローとして論理Hが出力され
る。
If the input data [DB] cannot be searched with all bits “0” or all bits “1”, the priority encoder
Logic H is output from terminal 25 of 22 as overflow.

「発明の効果」 以上述べたようにこの発明によれば1つの優先順位エ
ンコーダ22を使用して、第1論理回路11、マルチプレク
サ12、データセレクタ19により第1〜第3制御信号IAL1
〜IAL3の状態に応じて正論理データ又は負論理データを
優先順位エンコーダ22へ供給し、第2論理回路23と出力
セレクタ24とにより第4制御信号IAL4に応じて優先順位
エンコーダ22の正論理出力又は負論理出力を出力するこ
とにより、1サイクルで各種のビット検索、各種の出力
形式とすることができる。
[Effects of the Invention] As described above, according to the present invention, the first to third control signals IAL1 are controlled by the first logic circuit 11, the multiplexer 12, and the data selector 19 using one priority encoder 22.
IAL 3 負 IAL IAL し 正 IAL に IAL の IAL し 正 正 正 〜 〜 〜 IAL IAL IAL IAL IAL IAL IAL IAL し 正 正 正. Alternatively, by outputting a negative logic output, various bit searches and various output formats can be performed in one cycle.

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

第1図はこの発明の実施例を示すブロック図、第2図は
その制御信号の状態とビット検索方式と出力形式との関
係を示す図、第3図は従来のビット検索装置を示すブロ
ック図、第4図はその入力データと出力データとを示す
図、第5図は各種ビット検索方式と出力形式とを示す図
である。
FIG. 1 is a block diagram showing an embodiment of the present invention, FIG. 2 is a diagram showing a relationship between a control signal state, a bit search method and an output format, and FIG. 3 is a block diagram showing a conventional bit search device. FIG. 4 is a view showing the input data and output data, and FIG. 5 is a view showing various bit search methods and output formats.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】入力データを正論理データ及び負論理デー
タとして出力する第1論理回路と、 これら正論理データ及び負論理データの各最上位ビット
と、第1,第2,第3制御信号とが入力され、その第1制御
信号の状態に応じて上記第2,第3制御信号又は上記両最
上位ビットを出力するマルチプレクサと、 そのマルチプレクサの出力に応じて上記正論理データ又
は負論理データを選択するデータセレクタと、 そのデータセレクタの出力データが供給され、その最上
位ビットから見て初めて論理“1"となるビット位置を2
進数で出力する優先準位エンコーダと、 その優先順位エンコーダの出力を正論理出力及び負論理
出力として出力する第2論理回路と、 第4制御信号の状態に応じて上記第2論理回路の正論理
出力又は負論理出力を選択出力する出力セレクタと、 を具備するビット検索装置。
A first logic circuit for outputting input data as positive logic data and negative logic data; a most significant bit of each of the positive logic data and the negative logic data; a first, a second, and a third control signal; And a multiplexer that outputs the second or third control signal or both the most significant bits according to the state of the first control signal, and the positive logic data or the negative logic data according to the output of the multiplexer. The data selector to be selected and the output data of the data selector are supplied, and the bit position that becomes logical "1" only when viewed from the most significant bit is 2
A priority level encoder that outputs in radix, a second logic circuit that outputs the output of the priority encoder as a positive logic output and a negative logic output, and a positive logic of the second logic circuit according to the state of the fourth control signal. An output selector for selecting and outputting an output or a negative logic output.
JP20098389A 1989-08-02 1989-08-02 Bit search device Expired - Fee Related JP2761558B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20098389A JP2761558B2 (en) 1989-08-02 1989-08-02 Bit search device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20098389A JP2761558B2 (en) 1989-08-02 1989-08-02 Bit search device

Publications (2)

Publication Number Publication Date
JPH0363816A JPH0363816A (en) 1991-03-19
JP2761558B2 true JP2761558B2 (en) 1998-06-04

Family

ID=16433561

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20098389A Expired - Fee Related JP2761558B2 (en) 1989-08-02 1989-08-02 Bit search device

Country Status (1)

Country Link
JP (1) JP2761558B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005027403A1 (en) * 2003-09-11 2005-03-24 Renesas Technology Corp. Information processing device

Also Published As

Publication number Publication date
JPH0363816A (en) 1991-03-19

Similar Documents

Publication Publication Date Title
US4903228A (en) Single cycle merge/logic unit
JPH06236252A (en) Leading-zero two-stage and multistage detection unit for detection of number of leading zeros in mantissa part of floating-point number, floating-point left-shift mantissa normalization unit and method for detection of number of leading zeros
US3818203A (en) Matrix shifter
EP0264048A2 (en) Thirty-two bit bit-slice
JP3507517B2 (en) Position detection circuit for the end "1" bit in the binary number
US20030131029A1 (en) Barrel shifter
JPH0531769B2 (en)
JP2761558B2 (en) Bit search device
US5636156A (en) Adder with improved carry lookahead structure
US5920493A (en) Apparatus and method to determine a most significant bit
JPH034936B2 (en)
JP3012357B2 (en) Shift amount detection circuit
US5777906A (en) Left shift overflow detection
JP2565730B2 (en) Overflow detection circuit
JPH0661871A (en) Parallel serial data conversion circuit
KR100252766B1 (en) Sticky signal generator operating at high-speed
US6172623B1 (en) Efficient bit scan mechanism
KR100248976B1 (en) A circuit for 2'complement operation
JPS63115229A (en) Element shift system
JP2553175B2 (en) Overflow detection circuit
JP2558939B2 (en) Rounding circuit
JP2615746B2 (en) Bit operation circuit
JP3189552B2 (en) Arithmetic unit
JPH05143326A (en) Bank processor
JPH0318925A (en) Arithmetic circuit

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees