JPH04361326A - Valid bit retrieval circuit - Google Patents

Valid bit retrieval circuit

Info

Publication number
JPH04361326A
JPH04361326A JP13636391A JP13636391A JPH04361326A JP H04361326 A JPH04361326 A JP H04361326A JP 13636391 A JP13636391 A JP 13636391A JP 13636391 A JP13636391 A JP 13636391A JP H04361326 A JPH04361326 A JP H04361326A
Authority
JP
Japan
Prior art keywords
bit
search
valid
signal
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.)
Withdrawn
Application number
JP13636391A
Other languages
Japanese (ja)
Inventor
Taiko Nozue
泰功 野末
Taizo Sato
泰造 佐藤
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 JP13636391A priority Critical patent/JPH04361326A/en
Publication of JPH04361326A publication Critical patent/JPH04361326A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To retrieve the presence/absence of valid bits and the positions of those bits with a simple circuit to retrieve and output the presence/absence of the valid bits '0' or '1' in a bit train and the positions of those valid bits. CONSTITUTION:A first step retrieves the presence/absence of the valid bits for every 2 bits and outputs a bit search signal and a bit position signal to the second step. A (k)-th (0<k<=N) step of an arbitrary (i)-th step (2<=i<=n) from the second step to the final (n)-th step inputs bit search signals F1 and F2 outputted from 2k-th and 2k+1-th bits in the (i-1)-th step and bit position signals (P1 and P2) expressed by 1-1 bits to a multiplexer 1 in the (i)-th step, and the input of the multiplexer 1 is selected by the bit position signals (P1 and P2) of the 2k-th or (2k+1)-th bits. One bit of the bit search signals F1 and F2 of the 2k-th or (2k+1)-th bit is added to the output signal of i+1 bits from the multiplexer 1, and a bit position signal F of the (i)-th step expressed by (i) bits is outputted to the next (i+1)-th step.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は、ビット列の0又は1の
有効ビットの有無と有効ビットの位置を検索して出力す
る有効ビット検索回路に関する。コンピュータ等にあっ
ては例えば命令レジスタに格納された命令コードのオペ
ランドの特定位置に有効ビットが立つか否かで所定の制
御を行うか否か決めており、ビット列の中の有効ビット
の有無とビット位置の検索にはハードウェアとしての有
効ビット検索回路が使用されている。この有効ビット検
索回路は一般に多入力のプライオリティエンコーダとし
て構成されているが、ビット数の増加に伴なってゲート
回路が複雑化し、この点の改善が望まれる。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a valid bit search circuit for searching and outputting the presence or absence of a valid bit of 0 or 1 in a bit string and the position of the valid bit. In computers, for example, whether or not to perform a certain control is determined by whether or not a valid bit is set at a specific position in an operand of an instruction code stored in an instruction register, and whether or not there is a valid bit in a bit string is determined. A hardware effective bit search circuit is used to search for bit positions. This effective bit search circuit is generally configured as a multi-input priority encoder, but as the number of bits increases, the gate circuit becomes more complex, and improvements in this point are desired.

【0002】0002

【従来の技術】従来の有効ビット検索回路としては、例
えば図4に示すものが知られている。図4は2M のビ
ット列(a0 ,・・・aN−2 ,aN−1 ,aN
 )を入力し、このビット列の中の有効ビット1の有無
を示すビットサーチ信号(Found信号)Fと、有効
ビット1のビット位置を示すlog2 (N+1)ビッ
トで表わされるビット位置信号Pを出力する場合を示し
ている。
2. Description of the Related Art As a conventional effective bit search circuit, for example, one shown in FIG. 4 is known. Figure 4 shows a 2M bit string (a0,...aN-2, aN-1, aN
), and outputs a bit search signal (Found signal) F indicating the presence or absence of valid bit 1 in this bit string, and a bit position signal P expressed as log2 (N+1) bits indicating the bit position of valid bit 1. It shows the case.

【0003】即ち、エンコーダ3に最上位ビットaN 
を直接入力し、下位のビットaN−1 〜a0 につい
ては、ANDゲート4N−1 〜40 を設け、自己の
ビットをそのまま入力すると共に上位ビットを反転入力
している。このため、ビット列の中の有効ビット1のう
ち、最も上位にある有効ビット1を優先的に選択してエ
ンコーダ3に入力し、エンコーダ3は有効ビット1の入
力ビット位置を示すlog2 (N+1)ビットのビッ
ト位置信号Pを出力する多入力プライオリティエンコー
ダ回路を構成している。
That is, the most significant bit aN is sent to the encoder 3.
is input directly, and for the lower bits aN-1 to a0, AND gates 4N-1 to 40 are provided, and the own bits are input as they are, and the upper bits are inverted and input. Therefore, among the valid bits 1 in the bit string, the most significant bit 1 is selected preferentially and inputted to the encoder 3, and the encoder 3 log2 (N+1) bits indicating the input bit position of the valid bit 1. This constitutes a multi-input priority encoder circuit that outputs a bit position signal P of .

【0004】例えばN=7となる8ビット列(a0 〜
a7)の場合、エンコーダ3からビット列の中に存在す
る有効ビット1の最も高いビット位置を示す3ビット(
log2 (N+1)=log2 8=3)のビット位
置信号Pが出力される。更に、ビット列(a0 ,・・
・aN−2 ,aN−1 ,aN )の各ビットはOR
ゲート5に入力され、有効ビット1の有無を示すビット
サーチ信号(Found信号)Fを出力する。このビッ
トサーチ信号は、有効ビット1が存在すれば(サーチ成
功)F=1となり、有効ビット1が存在しなければ(サ
ーチ不成功)F=0となる。
For example, an 8-bit string (a0 to
In the case of a7), the encoder 3 sends 3 bits (
A bit position signal P of log2(N+1)=log28=3) is output. Furthermore, the bit string (a0,...
・Each bit of aN-2, aN-1, aN) is OR
It is input to gate 5 and outputs a bit search signal (Found signal) F indicating the presence or absence of valid bit 1. This bit search signal becomes F=1 if a valid bit 1 exists (search success), and F=0 if a valid bit 1 does not exist (search unsuccessful).

【0005】尚、図4は有効ビット1を検索する1サー
チを例にとっているが、有効ビット0を検索する0サー
チについては、ビット列(a0 ,・・・aN−2 ,
aN−1 ,aN )を反転して入力すればよい。
Note that FIG. 4 takes as an example a 1 search that searches for valid bit 1, but for a 0 search that searches for valid bit 0, the bit string (a0, . . . aN-2,
aN-1, aN) may be inverted and input.

【0006】[0006]

【発明が解決しようとする課題】しかしながら、このよ
うな従来の有効ビット検索回路にあっては、最上位ビッ
トを除く下位ビット毎にANDゲートを設けた多入力プ
ライオリティエンコーダ回路を使用していたため、優先
度の低いビット位置のANDゲートの入力数がビット列
の長さに応じて増加し、最下位ビットではN+1個の入
力がANDゲートに対して行われ、回路が相当複雑にな
ってしまう問題があった。
[Problems to be Solved by the Invention] However, such conventional effective bit search circuits use a multi-input priority encoder circuit in which an AND gate is provided for each lower bit except the most significant bit. The number of inputs to the AND gate in the bit position with low priority increases according to the length of the bit string, and N+1 inputs are made to the AND gate in the least significant bit, making the circuit considerably complicated. there were.

【0007】本発明は、このような従来の問題点に鑑み
てなされたもので、簡単な回路で有効ビットの有無とビ
ット位置を検索する有効ビット検索回路を提供すること
を目的とする。
The present invention has been made in view of these conventional problems, and an object of the present invention is to provide a valid bit search circuit that searches for the presence or absence of a valid bit and the bit position using a simple circuit.

【0008】[0008]

【課題を解決するための手段】図1は本発明の原理説明
図である。まず本発明は2M のビット列a0 ,a1
 ,a2 ,・・・aN−1 ,aN の中の有効ビッ
トの有無を検索し、有効ビットのサーチ成功の有無を示
すビットサーチ信号Fと有効ビットのサーチが成功した
際の有効ビットの位置を示すMビット(但し、M=lo
g2 (N+1))のビット位置信号Pを出力する有効
ビット検索回路を対象とする。
[Means for Solving the Problems] FIG. 1 is a diagram illustrating the principle of the present invention. First, the present invention uses 2M bit strings a0, a1
, a2 , . . . aN-1 , aN , search for the presence or absence of a valid bit in M bits (however, M=lo
The target is a valid bit search circuit that outputs a bit position signal P of g2 (N+1)).

【0009】このような有効ビット検索回路につき本発
明にあっては、図1(a)に示すように、まず1段目に
ついては2ビットごとに有効ビットの有無を検索してビ
ットサーチ信号とビット位置信号を2段目に出力する。 また2段目から最後のn段目の各々を示す任意のi段目
の(但し、2≦i≦M)のk番目(0<k≦2M−i+
1 −1)については、図1(b)の一般形に示すよう
に構成する。
In the present invention, as shown in FIG. 1(a), such a valid bit search circuit first searches for the presence or absence of a valid bit every two bits in the first stage and generates a bit search signal. The bit position signal is output to the second stage. Also, the kth (0<k≦2M−i+
1-1) is configured as shown in the general form of FIG. 1(b).

【0010】即ち、ビット位置信号Pについては、1つ
前のi−1段目の2k番目及び2k+1番目のそれぞれ
から出力されたビットサーチ信号F1、F2とi−1ビ
ットで表されたビット位置信号P1、P2をi段目のマ
ルチプレクサ1に入力する。マルチプレクサ1は2k番
目又は2k+1番目のビット位置信号P1、P2により
入力を選択して出力する。更にマルチプレクサ1からの
i+1ビットの出力信号に2k番目又は2k+1番目の
ビットサーチ信号F1、F2の1ビットを付加してiビ
ットで表現されたi段目のビット位置信号Fを次のi+
1段目に出力する。
That is, regarding the bit position signal P, the bit position represented by the bit search signals F1 and F2 outputted from the 2k-th and 2k+1-th bits of the previous i-1 stage and the i-1 bit. Signals P1 and P2 are input to the i-th stage multiplexer 1. The multiplexer 1 selects and outputs an input based on the 2kth or 2k+1st bit position signals P1 and P2. Furthermore, 1 bit of the 2k-th or 2k+1-th bit search signals F1, F2 is added to the i+1-bit output signal from multiplexer 1, and the i-th bit position signal F expressed by i bits is converted to the next i+
Output to the first stage.

【0011】一方、ビットサーチ信号Fについては、2
k番目又は2k+1番目のビットサーチ信号F1、F2
をORゲート2に入力してi段目のビットサーチ信号F
として次のi+1段目に出力する。このような図1(b
)に示す構成を、図1(a)の2段目から最後のn段目
まで繰り返すことを特徴とする。
On the other hand, regarding the bit search signal F, 2
k-th or 2k+1-th bit search signals F1, F2
is input to the OR gate 2 to generate the i-th bit search signal F.
output to the next (i+1)th stage. Figure 1 (b) like this
) is repeated from the second stage to the last nth stage in FIG. 1(a).

【0012】また本発明の有効ビット検索回路は、有効
ビットとして2M のビット列の中のビット0或いはビ
ット1の有無及び位置を検索する。更に、マルチプレク
サ1は、2M のビット列の中の最も低いビット位置に
立つビット0又は1のビット位置を示すビット位置信号
を出力する順方向サーチを行う。またマルチプレクサ1
は、2M のビット列の中の最も高いビット位置に立つ
ビット0又は1のビット位置を示すビット位置信号を出
力する逆方向サーチを行う。
The valid bit search circuit of the present invention searches for the presence and position of bit 0 or bit 1 in a 2M bit string as a valid bit. Further, the multiplexer 1 performs a forward search to output a bit position signal indicating the bit position of bit 0 or 1 standing at the lowest bit position in the 2M bit string. Also multiplexer 1
performs a backward search which outputs a bit position signal indicating the bit position of bit 0 or 1 standing at the highest bit position in the 2M bit string.

【0013】[0013]

【作用】このような構成を備えた本発明の有効ビット検
索回路によれば、2段目以降については、同一構成のマ
ルチプレクサとORゲートで構成される所謂少入力のプ
ライオリティエンコーダをピラミッド状に階層構成する
と共に同一階層に属する相互間で優先付けを行い、この
構成を段数の増加に伴って繰り返すことにより同一構成
の少入力プライオリティエンコーダを複数使用すること
により多入力プライオリティエンコーダとしての機能を
もつ有効ビット検索回路が簡単に構成できる。
[Operation] According to the effective bit search circuit of the present invention having such a configuration, from the second stage onward, the so-called low-input priority encoders, which are composed of multiplexers and OR gates having the same configuration, are hierarchically arranged in a pyramid shape. By using multiple small-input priority encoders with the same configuration and prioritizing them among the ones belonging to the same hierarchy, and repeating this configuration as the number of stages increases, it is possible to effectively function as a multi-input priority encoder. A bit search circuit can be easily configured.

【0014】[0014]

【実施例】図2は4ビット列の有効ビットの有無及び有
効ビットの位置を検索する本発明の一実施例を示した実
施例回路図である。図2において、2M =24 のビ
ット列a0 ,a1 ,a2 ,a3 のそれぞれは、
まずサーチセレクト回路10−1,10−2,10−3
,10−4のそれぞれに入力される。サーチセレクト回
路10−1〜10−4に対しては0/1サーチセレクト
信号が与えられており、0サーチのセレクトでビット列
a0 〜a3 をそのま出力し、1サーチでビット列a
0 〜a3 を反転した信号を出力する。以下の実施例
にあっては0ビットサーチをセレクトした場合を例にと
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 2 is a circuit diagram showing an embodiment of the present invention for searching for the presence or absence of a valid bit in a 4-bit string and the position of the valid bit. In FIG. 2, each of the 2M = 24 bit strings a0, a1, a2, a3 is
First, search select circuits 10-1, 10-2, 10-3
, 10-4. A 0/1 search select signal is given to the search select circuits 10-1 to 10-4, and when a 0 search is selected, the bit strings a0 to a3 are output as they are, and when one search is performed, the bit string a is output.
A signal obtained by inverting 0 to a3 is output. In the following embodiment, a case where 0 bit search is selected will be taken as an example.

【0015】サーチセレクト回路10−1〜10−4に
続いては1段目の回路部が設けられる。1段目の回路部
はビット列a0 〜a3につき2ビット毎にビットサー
チを行って有効ビット0の有無を示すビットサーチ信号
(FOUND信号)と有効ビット0のビット位置を示す
ビット位置信号を出力する。
A first stage circuit section is provided following the search select circuits 10-1 to 10-4. The first stage circuit section performs a bit search for every two bits in the bit strings a0 to a3 and outputs a bit search signal (FOUND signal) indicating the presence or absence of valid bit 0 and a bit position signal indicating the bit position of valid bit 0. .

【0016】即ち、反転入力を備えたORゲート11に
ビットa0 とa1 を入力し、インバータ12で反転
してビットa0 ,a1 の中に有効ビット0があるか
否かを示すビットサーチ信号F1を出力する。ビットa
2 ,a3 についても同様に反転入力のORゲート1
3とインバータ14で構成され、ビットa2 ,a3 
に有効ビット0が含まれるかを示すビットサーチ信号F
2を出力する。
That is, bits a0 and a1 are input to an OR gate 11 equipped with an inverting input, and inverted by an inverter 12 to generate a bit search signal F1 indicating whether or not there is a valid bit 0 among bits a0 and a1. Output. bit a
2, a3 as well, OR gate 1 with inverted input
3 and an inverter 14, bits a2 and a3
Bit search signal F indicating whether valid bit 0 is included in
Outputs 2.

【0017】今、ビット列a0 〜a3 が[1011
]であったとすると、ORゲート11の出力は1となり
、従ってインバータ12からのビットサーチ信号F1は
有効ビット0の存在を示すF1=0となる。一方、OR
ゲート13はビットa2 =a3 =1の入力を受けて
出力0を生じ、インバータ14からのビットサーチ信号
F2=1となり、ビットa2 ,a3 には有効ビット
0が存在しないことを示す。
Now, the bit strings a0 to a3 are [1011
], the output of the OR gate 11 becomes 1, and therefore the bit search signal F1 from the inverter 12 becomes F1=0, indicating the existence of a valid bit 0. On the other hand, OR
Gate 13 receives input of bits a2 = a3 = 1 and produces an output of 0, and the bit search signal F2 from inverter 14 becomes 1, indicating that there is no valid bit 0 in bits a2 and a3.

【0018】尚、1段目の有効ビットの位置を示すビッ
ト位置信号についてはビットa0 またはa1 、ビッ
トa2 またはa3 のいずれかの一方の出力がそのま
ま用いられる。2段目については、1段目で2ビットず
つまとめられて得られたビットサーチ信号F1,F2と
ビット位置信号をマルチプレクサ1−1,1−2のそれ
ぞれに入力している。ここでマルチプレクサ1−1,1
−2の2つを設けているのは、マルチプレクサ1−1で
有効ビット0の順方向サーチを行ってビット位置を求め
、またマルチプレクサ1−2で逆方向サーチを行ってビ
ット位置を求めるためである。
As for the bit position signal indicating the position of the effective bit in the first stage, the output of either bit a0 or a1 or bit a2 or a3 is used as is. In the second stage, the bit search signals F1 and F2 obtained by combining two bits each in the first stage and the bit position signal are input to multiplexers 1-1 and 1-2, respectively. Here multiplexer 1-1,1
-2 is provided because the multiplexer 1-1 performs a forward search for valid bit 0 to determine the bit position, and the multiplexer 1-2 performs a backward search to determine the bit position. be.

【0019】即ち、マルチプレクサ1−1による順方向
サーチとは、ビット列a0 〜a3 の中の最も低いビ
ット位置に立つビット0を有効ビットとして検索してビ
ット1を出力する。一方、マルチプレクサ1−2の逆方
向サーチとは、ビット列a0 〜a3 の中の最も高い
ビット位置に立つビット0を有効ビットとして検索して
ビット位置信号を出力する。
That is, the forward search by the multiplexer 1-1 searches for bit 0, which stands at the lowest bit position in the bit string a0 to a3, as a valid bit and outputs bit 1. On the other hand, the backward search of the multiplexer 1-2 searches for bit 0, which stands at the highest bit position in the bit strings a0 to a3, as a valid bit and outputs a bit position signal.

【0020】順方向サーチを行うマルチプレクサ1−1
及び逆方向サーチを行うマルチプレクサ1−2は共にN
ANDゲート20,21と反転入力のORゲート22を
備えた4入力プライオリティエンコーダとして同じ回路
構成をもつ。このため、マルチプレクサ1−1にあって
はビット列a0 〜a3 の順方向サーチを行ってOR
ゲート22からの出力信号OF0に1段目のビットサー
チ信号F1でなる信号OF1を加えた2ビットのビット
位置信号を生成する。
Multiplexer 1-1 for forward search
and the multiplexer 1-2 that performs reverse direction search are both N
It has the same circuit configuration as a 4-input priority encoder including AND gates 20 and 21 and an OR gate 22 with an inverted input. Therefore, the multiplexer 1-1 performs a forward search of the bit strings a0 to a3 and performs an OR operation.
A 2-bit bit position signal is generated by adding a signal OF1 consisting of the first stage bit search signal F1 to the output signal OF0 from the gate 22.

【0021】具体的には、ビット列a0 〜a3 =1
011のとき、 OF1,OF0=01 となり、ビットa1 に有効ビット0があることを示す
Specifically, bit string a0 to a3 =1
When the value is 011, OF1, OF0=01, indicating that bit a1 has a valid bit 0.

【0022】一方、マルチプレクサ1−2はビット列a
0 〜a3 について逆方向サーチを行い、インバータ
25で反転した信号OB0に1段目のビットサーチ信号
F2をインバータ26で反転して与えられるOB1信号
を加えた2ビットで逆方向サーチによる有効ビットのビ
ット位置を示す。具体的には、ビット列a0 〜a3 
=1011の場合、 OB1,OB0=01 となり、有効ビット0がビットa1 にあることを示す
On the other hand, multiplexer 1-2 outputs bit string a
A backward search is performed for 0 to a3, and the valid bits are determined by the backward search using 2 bits, which is the signal OB0 inverted by the inverter 25 and the OB1 signal given by inverting the first stage bit search signal F2 by the inverter 26. Indicates bit position. Specifically, bit strings a0 to a3
=1011, OB1, OB0=01, indicating that valid bit 0 is in bit a1.

【0023】更に2段目の反転入力を備えたORゲート
23には1段目のビットサーチ信号F1,F2が入力さ
れ、ORゲート23の出力をインバータ24で反転して
ビット列a0 〜a3 の中に有効ビット0の有無を示
すビットサーチ信号F3を出力す。ビット列a0 =a
3 =1011の場合、ビットサーチ信号F3はF3=
0となって有効ビット0の存在を示す。
Furthermore, the bit search signals F1 and F2 from the first stage are inputted to the OR gate 23 having an inverting input at the second stage, and the output of the OR gate 23 is inverted by an inverter 24 to select the bits in the bit string a0 to a3. A bit search signal F3 indicating the presence or absence of a valid bit 0 is output. Bit string a0 = a
3 = 1011, the bit search signal F3 is F3 =
It becomes 0, indicating the existence of a valid bit of 0.

【0024】勿論、ビットサーチ信号F3=0となって
、有効ビット0の存在を示すときにのみビット位置信号
OF1,OF0及びOB1,OB0が意味をもち、有効
ビット0がないことを示すビットサーチ信号F3=1の
場合、ビット位置信号OF1,OF0及びOB1,OB
0は無意味となる。図3は8ビット列を処理する本発明
の他の実施例を示した実施例回路図である。図3の実施
例にあっては、ビット列a0 〜a7 に続いてサーチ
セレクト回路10−1〜10−8が設けられ、図2の実
施例と同様、0/1サーチセレクト信号により0サーチ
または1サーチが選択できる。
Of course, the bit position signals OF1, OF0 and OB1, OB0 have meaning only when bit search signal F3=0, indicating the existence of valid bit 0, and the bit position signals OF1, OF0 and OB1, OB0 have meaning, indicating that there is no valid bit 0. When signal F3=1, bit position signals OF1, OF0 and OB1, OB
0 is meaningless. FIG. 3 is a circuit diagram showing another embodiment of the present invention for processing an 8-bit string. In the embodiment of FIG. 3, search select circuits 10-1 to 10-8 are provided following the bit strings a0 to a7, and similarly to the embodiment of FIG. Search can be selected.

【0025】1段目に続いては図2の1段目の回路が2
回路、ビット列方向に設けられている。即ち、ビット列
a0 〜a3 については図2の1段目と同じであり、
残りのビット列a4 〜a7 について新たに2ビット
ずつ取りまとめてORゲート15,17とインバータ1
6,18でなる回路が設けられ、インバータ16,18
よりビットa4 ,a5 及びビットa6 ,a7 の
有効ビット0の有無を示すビットサーチ信号F3,F4
を出力している。
Following the first stage, the first stage circuit in FIG.
The circuit is provided in the direction of the bit string. That is, the bit strings a0 to a3 are the same as in the first row of FIG.
The remaining bit strings a4 to a7 are newly collected 2 bits at a time and sent to OR gates 15 and 17 and inverter 1.
A circuit consisting of inverters 16, 18 is provided.
Bit search signals F3 and F4 indicate the presence or absence of valid bit 0 in bits a4 and a5 and bits a6 and a7.
is outputting.

【0026】2段目は図2の2段目の回路を2回路、ビ
ット列方向に設けている。即ち、ビット列a0 〜a3
 の順方向サーチを行うマルチプレクサ1−1及び逆方
向サーチを行うマルチプレクサ1−2については図2の
実施例と同じであり、これに加えて残りのビット列a4
 〜a7 の順方向サーチを行うマルチプレクサ1−3
と、逆方向サーチを行うマルチプレクサ1−4を設けて
いる。
In the second stage, two circuits of the second stage shown in FIG. 2 are provided in the direction of the bit string. That is, bit string a0 to a3
The multiplexer 1-1 that performs a forward search and the multiplexer 1-2 that performs a backward search are the same as those in the embodiment shown in FIG.
Multiplexer 1-3 that performs forward search of ~a7
A multiplexer 1-4 is provided for performing a backward search.

【0027】マルチプレクサ1−3,1−4は共にNA
NDゲート20,21及びORゲート22を備える。ま
た、ビット列a0 〜a3 の有効ビット0の有無を示
すビットサーチ信号は図2の場合と同様、ORゲート2
3とインバータ24よりビットサーチ信号F5として出
力され、更にビット列a4 〜a7 についてはORゲ
ート26とインバータ27によりビットサーチ信号F6
が出力されている。
Multiplexers 1-3 and 1-4 are both NA
It includes ND gates 20 and 21 and an OR gate 22. In addition, the bit search signal indicating the presence or absence of valid bit 0 in bit strings a0 to a3 is sent to OR gate 2 as in the case of FIG.
3 and inverter 24 as bit search signal F5, and bit strings a4 to a7 are output as bit search signal F6 by OR gate 26 and inverter 27.
is being output.

【0028】3段目の回路については8ビットのビット
列a0 〜a7 のビット位置を順方向サーチによりエ
ンコードする8入力のプライオリティエンコーダとして
の機能を備えたマルチプレクサ1−5と同じくビット列
a0 〜a7 の有効ビット位置を逆方向サーチにより
エンコードする8入力プライオリティエンコーダとして
のマルチプレクサ1−6が設けられる。
The third stage circuit has the function of an 8-input priority encoder that encodes the bit positions of the 8-bit bit string a0 to a7 by forward search, and similarly to the multiplexer 1-5, the bit positions of the bit string a0 to a7 are valid. A multiplexer 1-6 is provided as an 8-input priority encoder for encoding bit positions by backward search.

【0029】3段目のマルチプレクサ1−5,1−6は
8入力を行っている4つのNANDゲート30,31,
33,34と、NANDゲート30,31の出力を取り
まとめる反転入力のORゲート32と、NANDゲート
33,34の出力を取りまとめる同じく反転入力のOR
ゲート35を備える。ビット列a0 〜a7 の順方向
サーチによるビット位置のエンコード出力を生ずるマル
チプレクサ1−5のORゲート32,35の出力は、下
位ビットよりOF0信号、OF1信号となり、これに2
段目のビットサーチ信号F5でなるOF2信号を加えた
3ビットのビット位置信号を出力する。
The third-stage multiplexers 1-5, 1-6 are composed of four NAND gates 30, 31, and 30, each having 8 inputs.
33, 34, an OR gate 32 with an inverted input that combines the outputs of the NAND gates 30 and 31, and an OR gate 32 with an inverted input that combines the outputs of the NAND gates 33 and 34.
A gate 35 is provided. The outputs of the OR gates 32 and 35 of the multiplexer 1-5, which generate the encoded output of the bit position by the forward search of the bit string a0 to a7, are the OF0 signal and the OF1 signal from the lower bit, and the 2
A 3-bit bit position signal to which the OF2 signal consisting of the bit search signal F5 of the stage is added is output.

【0030】ここで8ビットのビット列a0 〜a7 
=10111011であったとすると、3段目の順方向
サーチで得られるビット位置信号(OF2,OF1,O
F0)=001となり、有効ビット0がビットa1 に
あることを示す。一方、逆方向サーチによる有効ビット
のビット位置のエンコード出力を生ずるマルチプレクサ
1−6からのORゲート32,35の出力は、それぞれ
インバータ38,39で反転されてOB0信号及びOB
1信号となり、更に2段目のビットサーチ信号F6をイ
ンバータ40で反転したOB2を加えた3ビットのビッ
ト位置信号(OB2,OB1,OB0)によりビット列
a0 〜a7 の逆方向サーチによる有効ビット0のビ
ット位置を示す。
Here, the 8-bit bit string a0 to a7
= 10111011, the bit position signal (OF2, OF1, O
F0)=001, indicating that valid bit 0 is in bit a1. On the other hand, the outputs of the OR gates 32 and 35 from the multiplexer 1-6, which produce the encoded output of the bit position of the valid bit by the backward search, are inverted by inverters 38 and 39, respectively, and the OB0 signal and OB
1 signal, and 3-bit bit position signals (OB2, OB1, OB0) obtained by adding OB2, which is obtained by inverting the second-stage bit search signal F6 by an inverter 40, are used to search the bit string a0 to a7 in the reverse direction to find the valid bit 0. Indicates bit position.

【0031】具体的には、a0 〜a7 =10111
011の場合、逆方向サーチによるビット位置信号(O
B2,OB1,OB0)=101となり、101は10
進で5であることから逆方向サーチによる有効ビット0
がビットa5 にあることを示す。更に3段目に設けた
反転入力のORゲート36で2段目からのビットサーチ
信号F5,F6を取りまとめてインバータ37で反転す
ることで、ビット列a0 〜a7 の中の有効ビット0
の有無を示すビットサーチ信号F7を出力し、ビット列
a0 〜a7 =10111011の場合、ビットサー
チ信号F7=0となって有効ビット0が存在することを
示す。勿論、ビットサーチ信号F7=1となって有効ビ
ット0が存在しない場合には、マルチプレクサ1−5及
び1−6からのビット位置信号(OF2〜0)及び(O
B2〜0)は無意味となってビット位置信号としては無
視される。
Specifically, a0 to a7 = 10111
In the case of 011, the bit position signal (O
B2, OB1, OB0) = 101, and 101 is 10
Since it is 5 in decimal, the valid bit is 0 by backward search.
is in bit a5. Furthermore, the bit search signals F5 and F6 from the second stage are collected by an OR gate 36 with an inverting input provided in the third stage and inverted by an inverter 37, so that the effective bit 0 in the bit string a0 to a7 is
If the bit string a0 to a7 = 10111011, the bit search signal F7 becomes 0, indicating that a valid bit 0 exists. Of course, if bit search signal F7=1 and there is no valid bit 0, bit position signals (OF2 to 0) and (OF2 to 0) from multiplexers 1-5 and 1-6 are
B2-0) are meaningless and ignored as bit position signals.

【0032】尚、上記の実施例はサーチセレクト回路で
ビット列の中に存在するビット0を有効ビットとする0
サーチを例にとるものであったが、ビット列の中に存在
するビット1を有効ビットとする1サーチについては、
入力ビット列をビットセレクト回路で反転して出力する
ことで、0サーチの場合と全く同様にしてビット列に含
まれる有効ビット1の有無及び有効ビット1のビット位
置を検索することができる。
In the above embodiment, the search select circuit selects bit 0 existing in the bit string as a valid bit.
The search was taken as an example, but for a search in which bit 1 existing in a bit string is the valid bit,
By inverting the input bit string with a bit select circuit and outputting it, it is possible to search for the presence or absence of a valid bit 1 included in the bit string and the bit position of the valid bit 1 in exactly the same way as in the case of 0 search.

【0033】また上記の実施例は4ビット及び8ビット
のビット列の検索を例にとるものであったが、全く同様
にして16ビット,32ビット,64ビットとビット列
の数を増やすことができ、このビット列の増加に伴って
ビット列を2M とするとM段の構成をもつ有効ビット
検索回路が構成され、2段目以降については1段増加す
る毎にマルチプレクサを4入力プライオリティエンコー
ダ、8入力プライオリティエンコーダ、16入力プライ
オリティエンコーダ、32入力プライオリティエンコー
ダとしていけば良く、各段におけるプライオリティエン
コーダは4入力のプライオリティエンコーダ回路を必要
出力入力数を満たすように増設すれば良く、2段目の4
入力プライオリティエンコーダを基本単位とした回路増
設で簡単に有効ビット検索を行う多入力プライオリティ
エンコーダ回路を実現することができる。
Furthermore, although the above embodiment takes as an example the search for 4-bit and 8-bit bit strings, the number of bit strings can be increased to 16 bits, 32 bits, and 64 bits in exactly the same way. If the bit string is increased to 2M as the bit string increases, an effective bit search circuit with M stages is constructed, and for the second and subsequent stages, each stage increases by converting the multiplexer into a 4-input priority encoder, an 8-input priority encoder, It is sufficient to use a 16-input priority encoder or a 32-input priority encoder, and the priority encoder in each stage can be expanded by adding a 4-input priority encoder circuit to satisfy the required number of output inputs, and the 4-input priority encoder circuit in the second stage is sufficient.
By adding a circuit using the input priority encoder as a basic unit, it is possible to realize a multi-input priority encoder circuit that easily searches for valid bits.

【0034】[0034]

【発明の効果】以上説明してきたように本発明によれば
、同じ構成をもつ少入力プライオリティエンコーダでな
るマルチプレクサ、例えば4入力プライオリティエンコ
ーダを回路段数の増加に応じて複数個使用するという簡
単な回路構成で、ビット列の有効ビットの有無及びビッ
ト位置を検索する所謂多入力プライオリティエンコーダ
を実現することができる。
As described above, according to the present invention, a simple circuit can be realized in which a plurality of multiplexers each having a small number of input priority encoders having the same configuration, for example, a 4-input priority encoder, is used as the number of circuit stages increases. With this configuration, it is possible to realize a so-called multi-input priority encoder that searches for the presence or absence of valid bits in a bit string and the bit position.

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

【図1】本発明の原理説明図[Fig. 1] Diagram explaining the principle of the present invention

【図2】4ビット列を処理する本発明の一実施例を示し
た実施例回路図
FIG. 2 is an embodiment circuit diagram showing an embodiment of the present invention that processes a 4-bit string.

【図3】8ビット列を処理する本発明の他の実施例を示
した実施例回路図
FIG. 3 is an embodiment circuit diagram showing another embodiment of the present invention that processes an 8-bit string.

【図4】多入力プライオリティエンコーダ回路を用いた
従来回路の説明図
[Figure 4] Explanatory diagram of a conventional circuit using a multi-input priority encoder circuit

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

1:マルチプレクサ 1−1,1−3:マルチプレクサ(順方向サーチ4入力
プライオリティエンコーダ) 1−2,1−4:マルチプレクサ(逆方向サーチ4入力
プライオリティエンコーダ) 1−5:マルチプレクサ(順方向サーチ8入力プライオ
リティエンコーダ) 1−6:マルチプレクサ(逆方向サーチ8入力プライオ
リティエンコーダ) 2:ORゲート 10−1〜10−8:サーチセレクト回路11,13,
15,17,22,23,26,32,35,36:O
Rゲート 12,14,16,18,24,27,37,38〜4
0:インバータ
1: Multiplexer 1-1, 1-3: Multiplexer (forward search 4-input priority encoder) 1-2, 1-4: Multiplexer (reverse search 4-input priority encoder) 1-5: Multiplexer (forward search 8-input Priority encoder) 1-6: Multiplexer (reverse search 8-input priority encoder) 2: OR gates 10-1 to 10-8: Search select circuits 11, 13,
15, 17, 22, 23, 26, 32, 35, 36:O
R gates 12, 14, 16, 18, 24, 27, 37, 38-4
0: Inverter

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】2M のビット列(a0 ,a1 ,a2
 ,・・・aN−1 ,aN )の中の有効ビットの有
無を検索し、有効ビットのサーチ成功の有無を示すビッ
トサーチ信号(F)と有効ビットのサーチが成功した際
の有効ビットの位置を示すMビット(但し、M=log
2 (N+1))のビット位置信号Pを出力する有効ビ
ット検索回路に於いて、1段目については2ビットごと
に有効ビットの有無を検索して前記ビットサーチ信号と
ビット位置信号を2段目に出力し、2段目から最後のM
段目の間の任意のi段目の(但し、2≦i≦M)のk番
目(但し、0<k≦2n−i+1 −1)については、
1つ前のi−1段目の2k番目及び2k+1番目のそれ
ぞれから出力されたビットサーチ信号F1、F2とi−
1ビットで表されたビット位置信号P1、P2をi段目
のマルチプレクサ1に入力して該マルチプレクサ1の入
力を2k番目又は2k+1番目のビット位置信号P1、
P2により選択し、更に該マルチプレクサ1からのi+
1ビットの出力信号に前記2k番目又は2k+1番目の
ビットサーチ信号F1、F2の1ビットを付加してiビ
ットで表現されたi段目のビット位置信号Fを次のi+
1段目に出力し、更に前記2k番目又は2k+1番目の
ビットサーチ信号F1、F2をORゲート(2)に入力
してi段目のビットサーチ信号Fを次のi+1段目に出
力する構成を繰り返すことを特徴とする有効ビット検索
回路。
Claim 1: 2M bit string (a0, a1, a2
, ...aN-1, aN), and a bit search signal (F) indicating whether or not the search for the valid bit is successful and the position of the valid bit when the search for the valid bit is successful. M bits indicating (however, M=log
In a valid bit search circuit that outputs a bit position signal P of 2 (N+1)), the first stage searches for the presence or absence of a valid bit every two bits, and the bit search signal and bit position signal are transmitted to the second stage. from the second stage to the last M
For the k-th (however, 0<k≦2n-i+1-1) of any i-th stage (however, 2≦i≦M) between the stages,
The bit search signals F1 and F2 output from the 2kth and 2k+1th stages of the previous i-1 stage and i-
The bit position signals P1 and P2 represented by 1 bit are input to the i-th stage multiplexer 1, and the input of the multiplexer 1 is input to the 2k-th or 2k+1-th bit position signal P1,
P2 and further select i+ from multiplexer 1.
Adding 1 bit of the 2k-th or 2k+1-th bit search signals F1 and F2 to the 1-bit output signal and converting the i-th bit position signal F expressed by i bits to the next i+
The configuration is such that the bit search signal F of the i-th stage is outputted to the first stage, the 2k-th or 2k+1-th bit search signals F1 and F2 are input to the OR gate (2), and the bit search signal F of the i-th stage is output to the next i+1-stage. A valid bit search circuit characterized by repetition.
【請求項2】請求項1記載の有効ビット検索回路に於い
て、有効ビットとして2M のビット列の中のビット0
の有無及び位置を検索することを特徴とする有効ビット
検索回路。
2. In the effective bit search circuit according to claim 1, bit 0 in a 2M bit string is used as the effective bit.
1. A valid bit search circuit, characterized in that it searches for the presence/absence and position of a valid bit.
【請求項3】請求項1記載の有効ビット検索回路に於い
て、有効ビットとして2M のビット列の中のビット1
の有無及び位置を検索することを特徴とする有効ビット
検索回路。
3. In the effective bit search circuit according to claim 1, bit 1 in a 2M bit string is used as an effective bit.
1. A valid bit search circuit, characterized in that it searches for the presence/absence and position of a valid bit.
【請求項4】請求項1記載の有効ビット検索回路に於い
て、前記マルチプレクサ1は、2M のビット列の中の
最も低いビット位置に立つビット0又は1のビット位置
を示すビット位置信号を出力する順方向サーチを行うこ
とを特徴とする有効ビット検索回路。
4. In the effective bit search circuit according to claim 1, said multiplexer 1 outputs a bit position signal indicating the bit position of bit 0 or 1 located at the lowest bit position in the 2M bit string. An effective bit search circuit characterized by performing forward search.
【請求項5】請求項1記載の有効ビット検索回路に於い
て、前記マルチプレクサ1は、2M のビット列の中の
最も高いビット位置に立つビット0又は1のビット位置
を示すビット位置信号を出力する逆方向サーチを行うこ
とを特徴とする有効ビット検索回路。
5. In the effective bit search circuit according to claim 1, the multiplexer 1 outputs a bit position signal indicating the bit position of bit 0 or 1 located at the highest bit position in the 2M bit string. An effective bit search circuit characterized by performing a backward search.
JP13636391A 1991-06-07 1991-06-07 Valid bit retrieval circuit Withdrawn JPH04361326A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13636391A JPH04361326A (en) 1991-06-07 1991-06-07 Valid bit retrieval circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13636391A JPH04361326A (en) 1991-06-07 1991-06-07 Valid bit retrieval circuit

Publications (1)

Publication Number Publication Date
JPH04361326A true JPH04361326A (en) 1992-12-14

Family

ID=15173423

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13636391A Withdrawn JPH04361326A (en) 1991-06-07 1991-06-07 Valid bit retrieval circuit

Country Status (1)

Country Link
JP (1) JPH04361326A (en)

Similar Documents

Publication Publication Date Title
EP0380294B1 (en) String matching
US4623982A (en) Conditional carry techniques for digital processors
JPH0215088B2 (en)
JPH08242176A (en) Retrieving device for data compression
US4890251A (en) Arithmetic shifter with sign extend facility
JP3507517B2 (en) Position detection circuit for the end &#34;1&#34; bit in the binary number
US5036483A (en) Binary adding apparatus
JPH04361326A (en) Valid bit retrieval circuit
EP0661820B1 (en) Parallel-to-serial data conversion circuit
US4860241A (en) Method and apparatus for cellular division
JP2766133B2 (en) Parallel-serial data conversion circuit
US5920496A (en) High speed correlator using up/down counter
RU2638724C1 (en) Device for order correction when normalizing numbers
US5889693A (en) CMOS sum select incrementor
JP2761558B2 (en) Bit search device
GB2094525A (en) Programmable read-only memory adder
JP3346204B2 (en) Variable length code decoding device
US6172623B1 (en) Efficient bit scan mechanism
RU2022337C1 (en) Parallel sign-digit code/additional binary code converter
SU1753599A1 (en) Sign-digit code/additional binary code converter
JPS5962950A (en) Shift device
SU1005317A1 (en) Threshold logic element
RU2262130C1 (en) DEVICE FOR SELECTING MINIMAL OR MAXIMAL NUMERIC VALUE OF TWO n-DIGIT NUMBERS
SU1056180A1 (en) Device for comparing parallel codes of numbers
SU696450A1 (en) Device for adding in redundancy notation

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19980903