JP4803829B2 - Bit counting method and bit counting circuit - Google Patents
Bit counting method and bit counting circuit Download PDFInfo
- Publication number
- JP4803829B2 JP4803829B2 JP2007161628A JP2007161628A JP4803829B2 JP 4803829 B2 JP4803829 B2 JP 4803829B2 JP 2007161628 A JP2007161628 A JP 2007161628A JP 2007161628 A JP2007161628 A JP 2007161628A JP 4803829 B2 JP4803829 B2 JP 4803829B2
- Authority
- JP
- Japan
- Prior art keywords
- bit
- signal
- circuit
- sum
- output
- 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
Links
Images
Description
本発明は、並列nビットの各ビットの内に1があるとき、それが0ビット目から数えて何個目の1であるかを示す値(ビットカウント結果)を出力するビットカウント方法およびビットカウント回路に関するものである。 The present invention relates to a bit count method and a bit for outputting a value (bit count result) indicating the number of 1s counted from the 0th bit when 1 is present in each of parallel n bits. The present invention relates to a count circuit.
図8に従来の間引き処理回路50の構成を示す。この間引き処理回路50は、順番付けされたn個(図8はn=4の場合)のデータ入力端子51と、順番付けされたn個のデータ出力端子52と、n個の制御入力端子53を有する。そして、制御入力端子53への通過指示がある入力データのみを、データ入力端子51の並び順を保持したまま、データ出力端子52の並びの順番の前(図8で左側)に詰めて出力する。
FIG. 8 shows a configuration of a conventional
この間引き処理回路50は、スイッチ部60とスイッチ制御部70で構成される。スイッチ部60は、データ入力端子51の各端子に接続されるn個の入力線61、データ出力端子52の各端子に接続されるn個の出力線62、およびn個の入力線61とn個の出力線62との各交叉部分で入力線61と出力線62との接続/接続断を行うn×n個のクロスポイント63で構成される。
The
また、スイッチ制御部70は、n個の制御入力端子53に入力する通過指示信号EN[i](i=0〜n−1)に応じて、出力信号OUT[i]を出力するビットカウント回路71と、その出力信号OUT[i]を0パディング(MSB側に0を詰めてビット数を調整する)する0パディング回路72からなり、この0パディング回路72からスイッチ部60の各クロスポイント63の接続/接続断を指示するスイッチ制御信号SW[i][j](i,j=0〜n−1)を出力する。
The
入力データDIN[i]は、入力データ線51のi番目から入力線61を介してスイッチ部60に入力し、通過指示信号EN[i]は、制御入力端子53のi番目からスイッチ制御部70に入力する。図8では、n=4であるので、通過指示信号EN[i]は、たとえば、次の通りである。
The input data DIN [i] is input to the
EN[0]=1
EN[1]=1
EN[2]=0
EN[3]=1
EN [0] = 1
EN [1] = 1
EN [2] = 0
EN [3] = 1
スイッチ制御部70のビットカウント回路71を構成する場合、従来では、例えば、n=4の場合は、図9に示すように、ポピュレーションカウント回路711〜713が利用される。ポピュレーションカウント回路711は、EN[0]とEN[1]の1の和を計算し、ポピュレーションカウント回路712は、EN[0]とEN[1]とEN[2]の1の和を計算し、ポピュレーションカウント回路713は、EN[0]とEN[1]とEN[2]とEN[3]の1の和を計算する。
When configuring the
そして、ポピュレーションカウント結果P[i]は、次のように2進数(例では最大3ビット)で表される。{ }内の数字は、左側がLSB、右側MSBである。
P[0]=1
P[1〕={0,1}
P[2]={0,1}
P[3]={1,1,0}
このように、P[0]は10進数の1、P[1〕は10進数の2、P[2]は10進数の2、P[3]は10進数の3を示す。
The population count result P [i] is expressed by a binary number (up to 3 bits in the example) as follows. The numbers in {} are LSB on the left side and MSB on the right side.
P [0] = 1
P [1] = {0, 1}
P [2] = {0, 1}
P [3] = {1,1,0}
Thus, P [0] is a
ポピュレーションカウント結果P[i]の2進数は、次段の2進数→ビットフラグ変換回路714〜715でビットフラグ変換され、その変換結果がセレクタ716〜718でEN[i]の値に応じて選択され、ビットカウント結果OUT[i]となる。ここで、「ビットフラグ」とは、ビット列中の最大1ビットが1で他のビットは全て0であり、1のフラグがたっているビットの位置によって数値を表現することを意味する。たとえば、{0,0,0,0}は「0」、{1,0,0,0}は「1」、{0,1,0,0}は「2」、{0,0,1,0}は「3」、{0,0,0,1}は「4」を表す。セレクタ716〜718では、EN[i]=1のときはビットフラグ変換結果が選択され、0のときは0が選択される。そして、このOUT[i]が0パディング回路72で0パディングされて、n(=4)ビットに揃えられる。0パディング回路72の出力がスイッチ制御信号SW[i][j]となる。
The binary number of the population count result P [i] is subjected to bit flag conversion by the next stage binary number → bit
たとえば、図8の例では、SW[i]は、ビットカウント結果OUT[i]のMSB側(右側)に0を付加して、
OUT[0]=1 →SW[0]={1,0,0,0}
OUT[1]={0,1} →SW[1]={0,1,0,0}
OUT[2]={0,0,0} →SW[2]={0,0,0,0}
OUT[3]={0,0,1,0} →SW[3]={0,0,1,0}
となる。図10に図9のビットカウント回路71で行われる処理のフローチャートを示した。ポピュレーションカウント回路に関しては、非特許文献1,2に記載がある。
For example, in the example of FIG. 8, SW [i] adds 0 to the MSB side (right side) of the bit count result OUT [i]
OUT [0] = 1 → SW [0] = {1, 0, 0, 0}
OUT [1] = {0, 1} → SW [1] = {0, 1, 0, 0}
OUT [2] = {0,0,0} → SW [2] = {0,0,0,0}
OUT [3] = {0,0,1,0} → SW [3] = {0,0,1,0}
It becomes. FIG. 10 shows a flowchart of processing performed by the
以上から、スイッチ信号SW[i][j]によってスイッチ部60が制御される。すなわち、EN[i]=0に対応する入力データDIN[i]は間引かれてスイッチ部60から出力せず、通過指示信号EN[i]=1に対応する入力データDIN[i]はスイッチ部60を通過して、出力データDOUT[i]となる。図8の回路では、
DOUT[0]=DIN[0]
DOUT[1]=DIN[1]
DOUT[2]=DIN[3]
DOUT[3]=無効
となる。
From the above, the
DOUT [0] = DIN [0]
DOUT [1] = DIN [1]
DOUT [2] = DIN [3]
DOUT [3] = invalid.
ところが、従来のスイッチ制御部70のビットカウント回路71は、ポピュレーションカウント回路を用いるので、次の問題点がある。まず、ポピュレーションカウント結果P[i]をスイッチ制御信号として使用するには、2進数→ビットフラグ変換回路が必要である。また、通過指示信号EN[i]=0の場合、OUT[i]={0,0,0,・・・,0}を選択するセレクタが必要である。さらに、各通過指示信号EN[i]について、先頭からの1の累算結果をビットフラグとして出力するには、ポピュレーションカウント回路、2進数→ビットフラグ変換回路、セレクタが、通過指示信号ENの個数に応じて必要となり、通過指示信号のビット数nが大きくなると、スイッチ制御部70のゲート数が急激に大きくなる。さらに、通過指示信号ENのビット数nの拡張に対して、ポピュレーションカウント回路の構成に規則性(スケーラビリテイ)が乏しく、設計が容易でない。
However, since the
本発明の目的は、ポピュレーションカウント回路や2進数→ビットフラグ変換回路を用いることなく、通常の論理素子を規則的に組み合わせて、EN[i]からビットカウント結果OUT[i]を生成できるようにし、回路のゲート規模低減、低消費電力化、容易な設計を可能にしたビットカウント回路を提供することである。 An object of the present invention is to generate a bit count result OUT [i] from EN [i] by regularly combining ordinary logic elements without using a population count circuit or a binary number → bit flag conversion circuit. And providing a bit count circuit capable of reducing the gate scale of the circuit, reducing power consumption, and designing easily.
上記目的を達成するために、請求項1にかかる発明のビットカウント方法は、並列nビットの信号ENを入力し、iビット目(i=0,・・・,n−1)の信号EN[i]について、信号EN[i]=0のときは0のみで表され、信号EN[i]=1のときは当該1のビットの位置が表わされるビットカウント結果OUT[i]を求めるとき、信号EN[0]では、信号EN[0]=0のときは0、信号EN[0]=1のときは1のビットカウント結果OUT[0]を出力するとともに、1の累算結果SUM[0]を出力し、信号EN[i](i≧1)では、信号EN[0]〜EN[i−1]の1の累算結果SUM[i−1]と前記EN[i]とを用いて、信号EN[i]=0のときは全ビット0のビットカウント結果OUT[i]を出力するとともに、累算結果SUM[i]として前記累算結果SUM[i−1]を出力し、信号EN[i]=1のときはビットカウント結果OUT[i]として前記累算結果SUM[i−1]を出力するとともに、累算結果SUM[i]として前記累算結果SUM[i−1]の値を1ビットをずらして出力することを特徴とする。
請求項2にかかるビットカウンタ方法は、並列nビットの信号ENを入力し、iビット目(i=0,・・・,n−1)の信号EN[i]について、信号EN[i]=0のときは0のみで表され、信号EN[i]=1のときは当該1のビットの位置が表わされるビットカウント結果OUT[i]を求めるとき、信号EN[0]に対応して、ビットカウント結果OUT[0]として、信号EN[0]のビット値を1ビットでそのまま出力するとともに、累算結果SUM[0]として、信号EN[0]のビット値の反転値と信号EN[0]のビット値とからなる合計2ビットを出力し、信号EN[i](i≧1)に対応して、ビットカウント結果OUT[i]として、前段の累算結果SUM[i−1]と信号EN[i]との論理積で求めた値を合計i+1ビットで出力するとともに、累算結果SUM[i]として、0ビット目を信号EN[i]の反転値と累算結果SUM[i−1]の0ビット目との論理積で求め、1〜iビット目を信号EN[i]の反転値と累算結果SUM[i−1]の1〜iビット目との論理積で求めた値と前記ビットカウント結果OUT[i]の0〜i−1ビット目の値との論理和とし、i+1ビット目をビットカウント結果OUT[i]のiビットとして、合計i+2ビットを出力する、ことを特徴とする。
請求項3にかかる発明は、請求項2に記載のビットカウント方法において、前記信号EN[i](i≧1)に対応する処理を、ビットカウント結果OUT[i]として、累算結果SUM[i−1]と信号EN[i]との否定論理積で求めた値を反転して求めた値を合計i+1ビットで出力するとともに、累算結果SUM[i]として、0ビット目を前記入力信号EN[i]の反転値と累算結果SUM[i−1]の0ビット目との否定論理積で求めた値を反転して求め、1〜iビット目を信号EN[i]の反転値と記累算結果SUM[i−1]の1〜iビット目との否定論理積で求めた値とビットカウント結果OUT[i]の0〜i−1ビット目の値との否定論理積で求め、i+1ビット目をビットカウント結果OUT[i]のiビットとして、合計i+2ビットを出力する処理、に置き換えたことを特徴とする。
請求項4にかかる発明のビットカウント回路は、並列nビットの信号ENを入力し、iビット目(i=0,・・・,n−1)の信号EN[i]について、信号EN[i]=0のときは0のみで表され、信号EN[i]=1のときは当該1のビット位置が表わされるビットカウント結果OUT[i]を求めるビットカウント回路であって、信号EN[1]を入力する第0ビット用演算部と、信号EN[i](i≧1)を入力する第iビット用演算部を備え、前記第0ビット用演算部は、信号EN[0]を入力して、信号EN[0]のビット値をそのままビットカウント結果OUT[0]として出力する経路と、信号EN[0]のビット値を第1反転回路で反転させ累算結果SUM[0][0]として出力する経路と、信号EN[0]のビット値をそのまま累算結果SUM[0][1]として出力する経路とを有し、前記第iビット用演算部は、前段の累算結果SUM[i−1]と信号EN[i]との論理積を求めビットカウント結果OUT[i]をi+1ビットで出力するi+1個の第1アンド回路と、信号EN[i]を反転する第2反転回路と、該第2反転回路の出力信号と累算結果SUM[i−1]の0ビット目との論理積を求め累算結果SUM[i]の0ビット目を出力する1個の第2アンド回路と、前記第2の反転回路31i−2の出力と累算結果SUM[i]の1〜iビット目との論理積を求めるi個の第3アンド回路と、該i個の第3アンド回路の出力とビットカウント結果OUT[i]の0〜i−1ビット目との論理和を求めて累算結果SUM[i]の1〜iビット目を出力するi個のオア回路と、ビットカウント結果OUT[i]のiビット目を累算結果SUM[i]の1+iビット目として出力する経路とを有する、ことを特徴とする。
請求項5にかかる発明は、請求項4に記載のビットカウント回路おいて、前記第iビット用演算部を、累算結果SUM[i−1]と信号EN[i]との否定論理積を求めるi+1個の第1ナンド回路と、該第1ナンド回路の各出力を反転させi+1ビットのビットカウント結果OUT[i]を出力するi+1個の第3反転回路と、信号EN[i]の反転値を求める1個の第4反転回路と、累算結果SUM[i−1]の0ビット目と前記第4反転回路の出力との否定論理積を求める1個の第2ナンド回路と、該第2ナンド回路の出力を反転させて累算結果SUM[i]の0ビット目を出力する1個の第5反転回路と、累算結果SUM[i−1]の1〜iビット目と前記第4反転回路の出力との否定論理積を求めるi個の第2ナンド回路と、該第2ナンド回路の各出力と前記第1ナンド回路の各出力との否定論理積を求めて累算結果SUM[i]の1〜iビット目を出力するi個の第4ナンド回路と、ビットカウント信号OUT[i]のiビット目を記累算結果SUM[i]のi+1ビット目として出力する経路とを有する回路、と置き換えたことを特徴とする。
In order to achieve the above object, a bit counting method according to a first aspect of the present invention receives a parallel n-bit signal EN and inputs an i-th bit (i = 0,..., N−1) signal EN [ For i], when the signal EN [i] = 0, it is represented by only 0, and when the signal EN [i] = 1, the bit count result OUT [i] representing the position of the 1 bit is obtained. The signal EN [0] outputs a bit count result OUT [0] of 0 when the signal EN [0] = 0, and 1 when the signal EN [0] = 1, and at the same time the accumulated result SUM [1 of 1 0] is output, and the signal EN [i] (i ≧ 1) outputs the accumulated result SUM [i−1] of 1 of the signals EN [0] to EN [i−1] and the EN [i]. When the signal EN [i] = 0, the bit count result OUT [i] of all
In the bit counter method according to
According to a third aspect of the present invention, in the bit counting method according to the second aspect, the processing corresponding to the signal EN [i] (i ≧ 1) is set as the bit count result OUT [i], and the accumulated result SUM [ i-1] and the signal EN [i] obtained by inverting the value obtained by the negative logical product and outputting the obtained value as a total i + 1 bits, and the 0th bit as the accumulated result SUM [i] Obtained by inverting the value obtained by the negative logical product of the inverted value of the signal EN [i] and the 0th bit of the accumulated result SUM [i-1], and inverting the signal EN [i] at the 1st to ith bits. The value obtained by the negative logical product of the value and the first to i-th bits of the accumulated result SUM [i-1] and the negative logical product of the 0-i-1th bit value of the bit count result OUT [i]. As the i bit of the bit count result OUT [i]. Wherein the replacing processing, which outputs the sum i + 2 bits.
The bit count circuit according to a fourth aspect of the present invention receives a parallel n-bit signal EN, and the signal EN [i] for the signal EN [i] of the i-th bit (i = 0,..., N−1). ] Is represented by only 0 when 0, and when the signal EN [i] = 1, it is a bit count circuit for obtaining a bit count result OUT [i] representing the bit position of the 1; ] And a 0th bit operation unit for receiving a signal EN [i] (i ≧ 1), and the 0th bit operation unit receives a signal EN [0]. Then, the bit value of the signal EN [0] is directly output as the bit count result OUT [0], and the bit value of the signal EN [0] is inverted by the first inverting circuit, and the accumulated result SUM [0] [ 0] and the bit value of the signal EN [0] And the i-th bit operation unit outputs a logical product of the previous stage accumulation result SUM [i−1] and the signal EN [i]. I + 1 first AND circuits that output bit count result OUT [i] with i + 1 bits, a second inversion circuit that inverts signal EN [i], an output signal of the second inversion circuit, and an accumulation result One second AND circuit that obtains a logical product with the 0th bit of SUM [i−1] and outputs the 0th bit of the accumulation result SUM [i], and the output of the
According to a fifth aspect of the present invention, in the bit count circuit according to the fourth aspect of the present invention, the i-th bit arithmetic unit performs a negative logical product of the accumulation result SUM [i−1] and the signal EN [i]. I + 1 first NAND circuits to be obtained, i + 1 third inversion circuits that invert the outputs of the first NAND circuits and output an i + 1 bit count result OUT [i], and inversion of the signal EN [i] One fourth inversion circuit for obtaining a value, one second NAND circuit for obtaining a negative logical product of the 0th bit of the accumulation result SUM [i−1] and the output of the fourth inversion circuit, One fifth inverting circuit that inverts the output of the second NAND circuit and outputs the 0th bit of the accumulated result SUM [i], the 1st to ith bits of the accumulated result SUM [i−1], and the above-mentioned I second NAND circuits for obtaining a negative logical product with the output of the fourth inverting circuit; I fourth NAND circuits for obtaining a negative logical product of each output of the NAND circuit and each output of the first NAND circuit and outputting the first to i-th bits of the accumulation result SUM [i], and a bit count signal A circuit having a path for outputting the i-th bit of OUT [i] as the i + 1-th bit of the accumulated result SUM [i] is replaced.
本発明のビットカウント方法およびそのビットカウント回路によれば、ビットカウント結果OUT[i]がビットフラグの形で直接出力され、かつ、信号EN[i]=0に対しては全ビット0のビットカウント結果が直接出力されるので、2進数→ビットフラグ変換やセレクタが不要となる。また、信号EN[i]のビット数が増えても、ゲート数が急激に大きくなることはない。よって、回路のゲート規模低減、低消費電力化が可能になる。さらに、ENのビット数が増えても、同様の規則で拡張する設計方法で容易にビットカウント結果を得ることができる。 According to the bit count method and the bit count circuit of the present invention, the bit count result OUT [i] is directly output in the form of a bit flag, and all bits are 0 bits for the signal EN [i] = 0. Since the count result is directly output, binary number → bit flag conversion and selector are not required. Even if the number of bits of the signal EN [i] increases, the number of gates does not increase rapidly. Therefore, the circuit scale can be reduced and the power consumption can be reduced. Furthermore, even if the number of bits of EN increases, a bit count result can be easily obtained by a design method that is extended according to the same rule.
<第1の実施例>
図1に本実施例の間引き処理回路10の構成を示す。この間引き処理回路10は、順番付けされたn個(図1はn=4の場合)のデータ入力端子11と、順番付けされたn個のデータ出力端子12と、n個の制御入力端子13を有する。そして、制御入力端子13への通過指示がある入力データのみを、データ入力端子11の並び順を保持したまま、データ出力端子12の並びの順番の前(左側)に詰めて出力する。
<First embodiment>
FIG. 1 shows the configuration of the thinning
この間引き処理回路10は、スイッチ部20とスイッチ制御部30で構成される。スイッチ部20は、データ入力端子11の各端子に接続されるn個の入力線21、データ出力端子12の各端子に接続されるn個の出力線22、およびn個の入力線21とn個の出力線22との各交叉部分で入力線21と出力線22との接続/接続断を行うn×n個のクロスポイント23で構成される。
The thinning
また、スイッチ制御部30は、n個の制御入力端子13に入力する通過指示信号EN[i](i=0〜n−1)に応じて、ビットカウント結果OUT[i]を出力するビットカウント回路31と、そのビットカウント結果OUT[i]を0バディング(MSB側に0を詰めてビット数を調整する)する0パディング回路32からなり、この0パディング回路32からスイッチ部20の各クロスポイント23の接続/接続断を指示するスイッチ制御信号SW[i][j](i,j=0〜n−1)が出力する。
Further, the
入力データDIN[i]は、入力データ線11のi番目から入力線21を介してスイッチ部20に入力し、通過指示信号EN[i]は、制御入力端子13のi番目からスイッチ制御部30のビットカウント回路31に入力する。図1は次の場合を示す。
EN[0]=1
EN[1]=1
EN[2]=0
EN[3]=1
The input data DIN [i] is input from the i-th
EN [0] = 1
EN [1] = 1
EN [2] = 0
EN [3] = 1
スイッチ制御信号SW[i][j]は、n行n列の2次元配列で、その各々の値は0又は1であり、スイッチ制御部30から出力してスイッチ部20に入力する。スイッチ制御信号SW[i][j]のi行j列は、クロスポイントスイッチ23のi行j列の接続/接続断を指示する。0のとき接続断、1のとき接続である。
The switch control signal SW [i] [j] is a two-dimensional array of n rows and n columns, and each value is 0 or 1, and is output from the
以上から、スイッチ信号SW[i][j]によってスイッチ部20が制御される。すなわち、EN[i]=0に対応する入力データDIN[i]は間引かれてスイッチ部20から出力せず、通過指示信号EN[i]=1に対応する入力データDIN[i]はスイッチ部20を通過して、出力データDOUT[i]となる。図1の回路では、
DOUT[0]=DIN[0]
DOUT[1]=DIN[1]
DOUT[2]=DIN[3]
DOUT[3]=無効
となる。
From the above, the
DOUT [0] = DIN [0]
DOUT [1] = DIN [1]
DOUT [2] = DIN [3]
DOUT [3] = invalid.
図2にスイッチ制御部30のビットカウント回路31の構成を示す。第iビット用演算部31iについて説明すると、1ビットの通過指示信号EN[i]と、前段の第i−1用演算部31i−1から出力するi+1ビットの累算結果SUM[i−1]とを入力して、i+1ビットのビットカウント結果OUT[i]と、i+2ビットの累算結果SUM[i]を出力する。
FIG. 2 shows the configuration of the
第iビット用演算部31iに入力する累算結果SUM[i−1][i:0]は、通過指示信号EN[0]〜EN[i−1]の間に存在する1の総数を表す(なお、[i:0]はビットが0〜iビット目まであることを示す)。たとえば、通過指示信号EN[0]〜EN[i−1]の間に存在する1の総数がm個(m=0,・・・,i)の場合は、EN[i−1]までの累算結果のkビット目(k=0,・・・,i)は、
SUM[i−1][k]=1 (k=m)
SUM[i−1][k]=0 (k≠m)
となる。ただし、第0ビット用演算部310にはこの前段からの累算結果SUM[i−1][i:0]は入力しない。
The accumulation result SUM [i−1] [i: 0] input to the i-th bit
SUM [i-1] [k] = 1 (k = m)
SUM [i−1] [k] = 0 (k ≠ m)
It becomes. However, the accumulated result SUM [i−1] [i: 0] from the previous stage is not input to the 0th bit
第iビット用演算部31iから出力するビットカウント結果OUT[i][i:0]は、通過指示信号EN[i]が1のときに、それは先頭の通過指示信号EN[0]から数えて何個目の1であるかをi+1ビットで表す。たとえば、通過指示信号EN[i]がp個目(p=1,・・・,i+1)の1の場合は、ビットカウント結果のkビット目(k=0,・・・,i)は、
OUT[i][k]=1 (k=p−1)
OUT[i][k]=0 (k≠p−1)
となる。通過指示信号EN[i]が0の場合は、OUT[i]は全ビットが0となる。
When the passage instruction signal EN [i] is 1, the bit count result OUT [i] [i: 0] output from the i-th bit
OUT [i] [k] = 1 (k = p−1)
OUT [i] [k] = 0 (k ≠ p−1)
It becomes. When the passage instruction signal EN [i] is 0, all bits of OUT [i] are 0.
第iビット用演算部31iから出力する累算結果SUM[i][i+1:0]は、通過指示信号EN[0]〜EN[i]の間に存在する1の総数を表す(なお、[i+1:0]はビットが第0ビットから第i+1ビットまでであることを示す)。たとえば、通過指示信号EN[0]〜EN[i]の間に存在する1の総数がm個(m=0,・・・,i+1)の場合は、EN[i]ビットまでの累算結果SUM[i]のkビット目(k=0,・・・,i+1)は、
SUM[i][k]=1 (k=m)
SUM[i][k]=0 (k≠m)
となる。
The accumulation result SUM [i] [i + 1: 0] output from the i-th bit
SUM [i] [k] = 1 (k = m)
SUM [i] [k] = 0 (k ≠ m)
It becomes.
ビットカウント結果OUT[i][i:0]の算出方法について説明する。前段の累算結果SUM[i−1][i:0]とビットカウント結果OUT[i][i:0]とは、どちらも1の個数を表すが、ビット数と個数の対応が1ずれる。OUT[i][i:0]は0ビット目が1ならば「1個目」を表す。SUM[i−1][i:0]は0ビット目が1ならば「0個」を表す。 A method of calculating the bit count result OUT [i] [i: 0] will be described. The accumulation result SUM [i−1] [i: 0] and the bit count result OUT [i] [i: 0] in the previous stage both indicate the number of 1s, but the correspondence between the number of bits and the number is shifted by 1. . OUT [i] [i: 0] represents “first” if the 0th bit is “1”. SUM [i−1] [i: 0] represents “0” if the 0th bit is 1.
よって、通過指示信号EN[i]=1の場合は、SUM[i−1][i:0]の値をそのままOUT[i][i:0]に代入すればよく、
OUT[i][k]=SUM[i−1][k]
となる。ただし、EN[i]=0の場合は、
OUT[i][k]=0
でなければならないので、EN[i]とSUM[i−1][k]の論理積をとる。また、i=0のときは、前ビットまでの累算結果が存在しないので、SUM[i−1][k]の部分はない。
Therefore, when the passage instruction signal EN [i] = 1, the value of SUM [i−1] [i: 0] may be directly substituted for OUT [i] [i: 0]
OUT [i] [k] = SUM [i−1] [k]
It becomes. However, if EN [i] = 0,
OUT [i] [k] = 0
Therefore, the logical product of EN [i] and SUM [i−1] [k] is calculated. Further, when i = 0, there is no accumulation result up to the previous bit, so there is no SUM [i−1] [k] part.
以上から、
OUT[i][k]=EN[i]・AND・SUM[i−1][k]
(i≧1、k=0,・・・,i)
OUT[0][0]=EN[0]
となる。
From the above
OUT [i] [k] = EN [i] AND AND SUM [i-1] [k]
(I ≧ 1, k = 0,..., I)
OUT [0] [0] = EN [0]
It becomes.
たとえば、
SUM[3]={0,1,0,0,0}、EN[4]=1
のとき、EN[0]〜EN[3]の1の個数は1個であるので、
OUT[4]={0,1,0,0,0}
となり、EN[4]の1は「2個目」の1である、というビットカウント結果が出る。
For example,
SUM [3] = {0, 1, 0, 0, 0}, EN [4] = 1
In this case, since the number of 1 of EN [0] to EN [3] is 1,
OUT [4] = {0, 1, 0, 0, 0}
Thus, the bit count result that 1 of EN [4] is 1 of “second” is output.
次に、累算結果SUM[i][i+1:0]の算出方法について説明する。通過指示信号EN[i]=1の場合は、累算結果は通過指示信号EN[i−1]までの累算結果より1だけ増加するので、SUM[i−1][i:0]の値をMSB側に1ビットずつずらして(ビットシフト)、SUM[i][i+1:1]に代入すればよい。SUM[i][0]は0にする。
SUM[i][k]=SUM[i−1][k−1]
(k=1,・・・,i+1)
SUM[i][k]=0 (k=0)
(1)
Next, a method for calculating the accumulation result SUM [i] [i + 1: 0] will be described. When the passage instruction signal EN [i] = 1, the accumulation result is increased by 1 from the accumulation result up to the passage instruction signal EN [i−1], so that SUM [i−1] [i: 0] The value may be shifted to the MSB side by 1 bit (bit shift) and substituted into SUM [i] [i + 1: 1]. SUM [i] [0] is set to 0.
SUM [i] [k] = SUM [i-1] [k-1]
(K = 1,..., I + 1)
SUM [i] [k] = 0 (k = 0)
(1)
一方、通過指示信号EN[i]=0の場合は、累算結果はSUM[i−1][i:0]と同じなので、SUM[i−1][i:0]の値をそのままSUM[i][i:0]に代入して、
SUM[i][k]=SUM[i−1][k]
(k=0,・・・,i)
SUM[i][k]=0 (k=i+1)
(2)
とすればよい。
On the other hand, when the passage instruction signal EN [i] = 0, since the accumulation result is the same as SUM [i−1] [i: 0], the value of SUM [i−1] [i: 0] is used as it is. Substituting for [i] [i: 0]
SUM [i] [k] = SUM [i−1] [k]
(K = 0, ..., i)
SUM [i] [k] = 0 (k = i + 1)
(2)
And it is sufficient.
以上から、(1)、(2)式の両方に対応して、EN[i]の値に応じて(1)、(2)式のどちらか一方の結果を選択するために、EN[i]と(1)式との論理積、EN[i]の反転値と(2)式との論理積を求め、その論理和を求める。ただし、i=0のときは、前ビットまでの累算結果は存在しないので、k=0のときは、(1)式の部分は存在せず、k=i+1のときは、(2)式の部分は存在しない。 From the above, in order to select either one of the expressions (1) and (2) according to the value of EN [i] corresponding to both the expressions (1) and (2), EN [i ] And (1), the inverse of EN [i], and (2) are obtained, and the logical sum is obtained. However, when i = 0, there is no accumulation result up to the previous bit. Therefore, when k = 0, there is no portion of equation (1), and when k = i + 1, equation (2). This part does not exist.
以上から、
SUM[0][0]=NOT・EN[0]
SUM[0][1]=OUT[0][0]
=EN[0]
SUM[i][0]=(NOT・EN[i])・AND・(SUM[i−1][0])
SUM[i][k]=((NOT・EN[i])・AND
・(SUM[i−1][k]))・OR
・(EN[i]・AND・(SUM[i−1][k−1]))
(i≧1、k=1,・・・,i)
SUM[i][i+1]=OUT[i][i]
=EN[i]・AND・SUM[i−1][i]
となる。
From the above
SUM [0] [0] = NOT • EN [0]
SUM [0] [1] = OUT [0] [0]
= EN [0]
SUM [i] [0] = (NOT · EN [i]) · AND · (SUM [i−1] [0])
SUM [i] [k] = ((NOT • EN [i]) • AND
(SUM [i-1] [k])) OR
(EN [i] / AND / (SUM [i-1] [k-1]))
(I ≧ 1, k = 1,..., I)
SUM [i] [i + 1] = OUT [i] [i]
= EN [i] · AND · SUM [i-1] [i]
It becomes.
たとえば、SUM[3][4:0]={0,1,0,0,0}、EN[4]=1の場合は、
SUM[4][5:0]={0,0,1,0,0,0}
となり、EN[0]〜EN[4]のうちの1の個数は「2個」である、という累算結果が得られる。
For example, if SUM [3] [4: 0] = {0, 1, 0, 0, 0} and EN [4] = 1,
SUM [4] [5: 0] = {0, 0, 1, 0, 0, 0}
Thus, an accumulation result that the number of one of EN [0] to EN [4] is “2” is obtained.
図3に以上の法則にハードウエアで構成した論理回路を示し、また、図4にその処理のフローチャートを示した。 FIG. 3 shows a logic circuit configured by hardware according to the above-mentioned rules, and FIG. 4 shows a flowchart of the processing.
図3(a)は図2の0ビット用演算部310の構成を示し、入力信号EN[0]を入力して、入力信号EN[0]のビット値をそのままビットカウント結果OUT[0]として出力する経路と、入力信号EN[0]のビット値を第1反転回路310−1で反転させ累算結果SUM[0][0]として出力する経路と、入力信号EN[0]のビット値をそのまま累算結果SUM[0][1]として出力する経路と、からなる。
FIG. 3 (a) shows the configuration of the 0-bit
図3(b)は図2の第iビット用演算部32iの構成を示し、前段の累算結果SUM[i−1]と前記入力信号EN[i]との論理積を求めビットカウント結果OUT[i]をi+1ビットで出力するi+1個の第1アンド回路31i−1と、入力信号EN[i]を反転する第2反転回路31i−2と、該第2反転回路31i−2の出力信号と前記累算結果SUM[i−1]の0ビット目との論理積を求め累算結果SUM[i]の0ビット目を出力する1個の第2アンド回路31i−3と、前記第2の反転回路31i−2の出力と前記累算結果SUM[i]の1〜iビット目との論理積を求めるi個の第3アンド回路31i−4と、該i個の第3アンド回路31i−4の出力と前記ビットカウント結果OUT[i]の0〜i−1ビット目との論理和を求めて累算結果SUM[i]の1〜iビット目を出力するi個のオア回路31i−5と、前記ビットカウント結果OUT[i]のiビット目を累算結果SUM[i]の1+iビット目として出力する経路と、を備える。
FIG. 3 (b) shows the configuration of the i-th bit arithmetic unit 32i of FIG. 2, and obtains the logical product of the previous stage accumulation result SUM [i-1] and the input signal EN [i], and the bit count result OUT. I + 1 first AND
図5に4つの通過指示信号EN[0]=1、EN[1]=1、EN[2]=0、EN[3]=1を使用する場合のビットカウント結果OUT[0][0]〜OUT[3][3:0]と、累算結果SUM[0][1:0]〜SUM[2][3:0]を示した。0パディング回路32は、OUT[0][0]の値のMSB側に0を3個付加して4ビットに揃え、OUT[1][1:0]の値のMSB側に0を2個付加して4ビットに揃え、OUT[2][2:0]の値のMSB側に0を1個付加して4ビットに揃え、OUT[3][3:0]の値をそのまま、それぞれ、SW[0][3:0]〜SW[3][3:0]として出力する。
FIG. 5 shows the bit count result OUT [0] [0] when four passage instruction signals EN [0] = 1, EN [1] = 1, EN [2] = 0, EN [3] = 1 are used. ~ OUT [3] [3: 0] and accumulated results SUM [0] [1: 0] to SUM [2] [3: 0] are shown. The 0
以上のように、本実施例では、ビットカウント回路31において、1の累算結果SUM[i]が順次次段に伝達され、ビットカウント結果OUT[i]がビットフラグの形で直接出力されるので、従来の2進数→ビットフラグ変換が不要である。また、通過指示信号EN[i]=0に対しては全ビット0のビットカウント結果OUT[i]が直接出力されるので、従来のセレクタが不要である。さらに、各演算部310〜31n−1への通過指示信号EN[i]は常に1ビットなので、入力ビット数が増えてもゲート数が急激に大きくなることはなく、同様の規則で拡張する設計方法で容易にビットカウント結果を得ることができる。さらに、図3に示したように、演算部310〜31n−1は、反転回路、アンド回路、オア回路の3種類のゲート素子で規則性をもって構成され、しかも、通過指示信号ENがnビットの場合、ゲート数は(n−1)×2段になり、従来の「ポピュレーション回路+2進数→ビットフラグ変換回路+セレクタ」で同様な結果を出力する回路を構成する場合との比較して、総ゲート数は1/4以下、ゲート段数は1/2以下に低下する。図6に、入力ビット数に対するゲート総数とゲート段数の増加程度の比較結果を示した。
As described above, in this embodiment, in the
<第2の実施例>
前記した第1の実施例では、図3に示したように、0ビット用演算部310を反転回路のみを使用して構成し、1〜n−1ビット用演算回路311〜31n−1を反転回路とアンド回路とオア回路を使用して構成した。しかし、演算部311〜31n−1については、図7に示すように、反転回路とナンド回路の2種類のゲートで構成することもできる。
<Second embodiment>
In the first embodiment, as shown in FIG. 3, the 0-bit
これは、
OUT[i][k]=NOT(EN[i]・NAND・SUM[i−1][k])
SUM[i][0]=NOT(NOT・EN[i])・NAND・
(SUM[i−1][0])
SUM[i][k]=((NOT・EN[i])・NAND
・(SUM[i−1][k]))・NAND
・(EN[i]・NAND・SUM[i−1][k−1])
SUM[i][i+1]=OUT[i][i]
(k=0,・・・,i)
の演算式に基づくものである。
this is,
OUT [i] [k] = NOT (EN [i] · NAND · SUM [i−1] [k])
SUM [i] [0] = NOT (NOT • EN [i]) • NAND •
(SUM [i-1] [0])
SUM [i] [k] = ((NOT · EN [i]) · NAND
(SUM [i-1] [k])) NAND
(EN [i] / NAND / SUM [i-1] [k-1])
SUM [i] [i + 1] = OUT [i] [i]
(K = 0, ..., i)
This is based on the arithmetic expression.
図7のiビット用演算部31iは、前段の累算結果SUM[i−1]と前記入力信号EN[i]との否定論理積を求めるi+1個の第1ナンド回路31i−11と、該第1ナンド回路31i−11の各出力を反転させi+1ビットのビットカウント結果OUT[i]を出力するi+1個の第3反転回路31i−12と、前記入力信号EN[i]の反転値を求める1個の第4反転回路31i−13と、前記累算結果SUM[i−1]の0ビット目と第4反転回路31i−13の出力との否定論理積を求める1個の第2ナンド回路31i−14と、該第2ナンド回路31i−14の出力を反転させて累算結果SUM[i]の0ビット目を出力する1個の第5反転回路31i−15と、前記累算結果SUM[i−1]の1〜iビット目と前記第4反転回路31i−13の出力との否定論理積を求めるi個の第2ナンド回路31i−16と、該第2ナンド回路31i−16の各出力と前記第1ナンド回路31i−11の各出力との否定論理積を求めて前記累算結果SUM[i]の1〜iビット目を出力するi個の第4ナンド回路31i−17と、前記ビットカウント信号OUT[i]のiビット目を前記累算結果SUM[i]のi+1ビット目として出力する経路とを備える。
The i-bit
本実施例では、各演算部310〜31n−1を構成するために、全体を反転回路とナンド回路の2種類のゲートを使用できるので、EN[i]がnビットの場合、ゲートは「n×2−1」段になる。アンド回路(=ナンド回路+反転回路)とオア回路(=ノア回路+反転回路)で構成される回路と比較して、同数のナンド回路で構成される回路の方が、最小の素子数で構成されるので一般に占有面積が小さく、低消費電力である。つまり、「(A・AND・B)OR(C・AND・D)」と「(A・NAND・B)NAND(C・NAND・D)」は、同じ結果が得られるが、ナンド回路のみのほうがICの個数が少なくて済み、基板の占有面積を小さくすることができる。例えば、「ナンド回路が4個入ったIC」、「ノア回路が4個入ったIC」、「反転回路が6個入ったIC」を使用する場合、1個のアンド回路と1個のオア回路の回路は、ナンド回路のIC、ノア回路のIC、反転回路のICの3個が必要だが、2個のナンド回路はナンド回路のICが1個で実現できる。また、実際の論理回路の設計では、アンド回路やオア回路よりもナンド回路やノア回路の方が作りやすい。さらに、遅延時間の蓄積をなるべく小さくするためには、高速性に優れるナンド回路で各段の累算結果の出力を得る構成とすることが望ましい。
In the present embodiment, in order to configure each of the
10:間引き処理回路
11:データ入力端子
12:データ出力端子
13:制御入力端子
20:スイッチ部
21:入力線
22:出力線
23:クロスポイント
30:スイッチ制御部
31:ビットフラグ回路
32:0パディング回路
310:第0ビット用演算部
310−1:第1反転回路
31i:第iビット用演算部
31i−1:i+1個の第1アンド回路
31i−2:第2反転回路
31i−3:1個の第2アンド回路
31i−4:i個の第3アンド回路
31i−5:i個のオア回路
31i−11:i+1個の第1ナンド回路
31i−12:i+1個の第3反転回路
31i−13:1個の第4反転回路
31i−14:1個の第2ナンド回路
31i−15:1個の第5反転回路
31i−16:i個の第3ナンド回路
31i−17:i個の第4ナンド回路
10: Decimation processing circuit 11: Data input terminal 12: Data output terminal 13: Control input terminal 20: Switch unit 21: Input line 22: Output line 23: Crosspoint 30: Switch control unit 31: Bit flag circuit 32: 0 Padding Circuit 310: 0th bit operation unit 310-1:
Claims (5)
信号EN[0]では、信号EN[0]=0のときは0、信号EN[0]=1のときは1のビットカウント結果OUT[0]を出力するとともに、1の累算結果SUM[0]を出力し、
信号EN[i](i≧1)では、信号EN[0]〜EN[i−1]の1の累算結果SUM[i−1]と前記EN[i]とを用いて、
信号EN[i]=0のときは全ビット0のビットカウント結果OUT[i]を出力するとともに、累算結果SUM[i]として前記累算結果SUM[i−1]を出力し、
信号EN[i]=1のときはビットカウント結果OUT[i]として前記累算結果SUM[i−1]を出力するとともに、累算結果SUM[i]として前記累算結果SUM[i−1]の値を1ビットをずらして出力することを特徴とするビットカウント方法。 A parallel n-bit signal EN is input, and the signal EN [i] of the i-th bit (i = 0,..., N−1) is represented by only 0 when the signal EN [i] = 0. When the signal EN [i] = 1, when obtaining the bit count result OUT [i] representing the position of the 1 bit,
The signal EN [0] outputs a bit count result OUT [0] of 0 when the signal EN [0] = 0, and 1 when the signal EN [0] = 1, and at the same time the accumulated result SUM [1 of 1 0],
In the signal EN [i] (i ≧ 1), the accumulated result SUM [i−1] of 1 of the signals EN [0] to EN [i−1] and the EN [i] are used.
When the signal EN [i] = 0, the bit count result OUT [i] of all 0 bits is output, and the accumulation result SUM [i−1] is output as the accumulation result SUM [i].
When the signal EN [i] = 1, the accumulated result SUM [i−1] is output as the bit count result OUT [i], and the accumulated result SUM [i−1] as the accumulated result SUM [i]. The bit count method is characterized in that the value is shifted by 1 bit and output.
信号EN[0]に対応して、ビットカウント結果OUT[0]として、信号EN[0]のビット値を1ビットでそのまま出力するとともに、累算結果SUM[0]として、信号EN[0]のビット値の反転値と信号EN[0]のビット値とからなる合計2ビットを出力し、
信号EN[i](i≧1)に対応して、ビットカウント結果OUT[i]として、前段の累算結果SUM[i−1]と信号EN[i]との論理積で求めた値を合計i+1ビットで出力するとともに、累算結果SUM[i]として、0ビット目を信号EN[i]の反転値と累算結果SUM[i−1]の0ビット目との論理積で求め、1〜iビット目を信号EN[i]の反転値と累算結果SUM[i−1]の1〜iビット目との論理積で求めた値と前記ビットカウント結果OUT[i]の0〜i−1ビット目の値との論理和とし、i+1ビット目をビットカウント結果OUT[i]のiビットとして、合計i+2ビットを出力する、
ことを特徴とするビットカウント方法。 A parallel n-bit signal EN is input, and the signal EN [i] of the i-th bit (i = 0,..., N−1) is represented by only 0 when the signal EN [i] = 0. When the signal EN [i] = 1, when obtaining the bit count result OUT [i] representing the position of the 1 bit,
Corresponding to the signal EN [0], the bit value of the signal EN [0] is output as it is as one bit as the bit count result OUT [0], and the signal EN [0] is output as the accumulation result SUM [0]. 2 bits in total consisting of the inverted value of the bit value and the bit value of the signal EN [0] are output,
Corresponding to the signal EN [i] (i ≧ 1), the bit count result OUT [i] is a value obtained by the logical product of the previous stage accumulation result SUM [i−1] and the signal EN [i]. Output with a total of i + 1 bits, and obtain the accumulation result SUM [i] as the AND of the inverted value of the signal EN [i] and the 0th bit of the accumulation result SUM [i−1] as the accumulation result SUM [i]. A value obtained by the logical product of the inverted value of the signal EN [i] and the 1st to ith bits of the accumulation result SUM [i-1] for the 1st to ith bits and 0 to 0 of the bit count result OUT [i]. a sum of i + 2 bits is output with the logical sum of the values of the (i-1) th bit and the (i + 1) th bit as the i bit of the bit count result OUT [i].
A bit count method characterized by the above.
ビットカウント結果OUT[i]として、累算結果SUM[i−1]と信号EN[i]との否定論理積で求めた値を反転して求めた値を合計i+1ビットで出力するとともに、累算結果SUM[i]として、0ビット目を前記入力信号EN[i]の反転値と累算結果SUM[i−1]の0ビット目との否定論理積で求めた値を反転して求め、1〜iビット目を信号EN[i]の反転値と記累算結果SUM[i−1]の1〜iビット目との否定論理積で求めた値とビットカウント結果OUT[i]の0〜i−1ビット目の値との否定論理積で求め、i+1ビット目をビットカウント結果OUT[i]のiビットとして、合計i+2ビットを出力する処理、
に置き換えたことを特徴とするビットカウント方法。 3. The bit count method according to claim 2, wherein processing corresponding to the signal EN [i] (i ≧ 1) is performed.
As the bit count result OUT [i], a value obtained by inverting the value obtained by the negative logical product of the accumulation result SUM [i−1] and the signal EN [i] is output with a total of i + 1 bits, As the calculation result SUM [i], the 0th bit is obtained by inverting the value obtained by the negative logical product of the inverted value of the input signal EN [i] and the 0th bit of the accumulated result SUM [i−1]. , The 1st to i-th bits of the inverted value of the signal EN [i] and the 1st to i-th bits of the accumulated result SUM [i-1] and the bit count result OUT [i] A process of obtaining a total of i + 2 bits by obtaining a negative logical product with the values of 0th to (i-1) th bits and using the i + 1th bit as i bits of the bit count result OUT [i]
A bit counting method characterized by being replaced with.
前記第0ビット用演算部は、
信号EN[0]を入力して、信号EN[0]のビット値をそのままビットカウント結果OUT[0]として出力する経路と、信号EN[0]のビット値を第1反転回路で反転させ累算結果SUM[0][0]として出力する経路と、信号EN[0]のビット値をそのまま累算結果SUM[0][1]として出力する経路とを有し、
前記第iビット用演算部は、
前段の累算結果SUM[i−1]と信号EN[i]との論理積を求めビットカウント結果OUT[i]をi+1ビットで出力するi+1個の第1アンド回路と、信号EN[i]を反転する第2反転回路と、該第2反転回路の出力信号と累算結果SUM[i−1]の0ビット目との論理積を求め累算結果SUM[i]の0ビット目を出力する1個の第2アンド回路と、前記第2の反転回路31i−2の出力と累算結果SUM[i]の1〜iビット目との論理積を求めるi個の第3アンド回路と、該i個の第3アンド回路の出力とビットカウント結果OUT[i]の0〜i−1ビット目との論理和を求めて累算結果SUM[i]の1〜iビット目を出力するi個のオア回路と、ビットカウント結果OUT[i]のiビット目を累算結果SUM[i]の1+iビット目として出力する経路とを有する、
ことを特徴とするビットカウント回路。 A parallel n-bit signal EN is input, and the signal EN [i] of the i-th bit (i = 0,..., N−1) is represented by only 0 when the signal EN [i] = 0. A bit count circuit for obtaining a bit count result OUT [i] in which the bit position of 1 is represented when the signal EN [i] = 1, a 0th bit arithmetic unit for inputting the signal EN [1]; An arithmetic unit for the i-th bit for inputting the signal EN [i] (i ≧ 1),
The arithmetic unit for the 0th bit is
The signal EN [0] is input, and the bit value of the signal EN [0] is directly output as the bit count result OUT [0], and the bit value of the signal EN [0] is inverted by the first inverting circuit. A path for outputting as the calculation result SUM [0] [0], and a path for outputting the bit value of the signal EN [0] as it is as the accumulation result SUM [0] [1].
The calculation unit for the i-th bit is
An i + 1 first AND circuit that obtains a logical product of the accumulation result SUM [i−1] and the signal EN [i] in the previous stage and outputs the bit count result OUT [i] with i + 1 bits, and the signal EN [i]. Is obtained, and a logical product of the output signal of the second inversion circuit and the 0th bit of the accumulation result SUM [i−1] is obtained, and the 0th bit of the accumulation result SUM [i] is output. A second AND circuit, and i third AND circuits for obtaining a logical product of the output of the second inverting circuit 31i-2 and the 1st to i-th bits of the accumulation result SUM [i]; The i of the outputs of the i third AND circuits and the 0th to (i-1) th bits of the bit count result OUT [i] is obtained and the 1st to ith bits of the accumulated result SUM [i] are output i And the accumulation result SUM [i] of the i-th bit of the bit count result OUT [i]. And a path for outputting a 1 + i bit of,
A bit count circuit characterized by that.
累算結果SUM[i−1]と信号EN[i]との否定論理積を求めるi+1個の第1ナンド回路と、該第1ナンド回路の各出力を反転させi+1ビットのビットカウント結果OUT[i]を出力するi+1個の第3反転回路と、信号EN[i]の反転値を求める1個の第4反転回路と、累算結果SUM[i−1]の0ビット目と前記第4反転回路の出力との否定論理積を求める1個の第2ナンド回路と、該第2ナンド回路の出力を反転させて累算結果SUM[i]の0ビット目を出力する1個の第5反転回路と、累算結果SUM[i−1]の1〜iビット目と前記第4反転回路の出力との否定論理積を求めるi個の第2ナンド回路と、該第2ナンド回路の各出力と前記第1ナンド回路の各出力との否定論理積を求めて累算結果SUM[i]の1〜iビット目を出力するi個の第4ナンド回路と、ビットカウント信号OUT[i]のiビット目を記累算結果SUM[i]のi+1ビット目として出力する経路とを有する回路、
と置き換えたことを特徴とするビットカウント回路。 5. The bit count circuit according to claim 4, wherein the i-th bit arithmetic unit is
The i + 1 first NAND circuits for obtaining a negative logical product of the accumulation result SUM [i−1] and the signal EN [i], and the outputs of the first NAND circuit are inverted, and the i + 1 bit bit count result OUT [ i] third inversion circuit for outputting i], one fourth inversion circuit for obtaining the inverted value of the signal EN [i], the 0th bit of the accumulation result SUM [i-1] and the fourth One second NAND circuit for obtaining a negative logical product with the output of the inverting circuit, and one fifth NAND circuit that inverts the output of the second NAND circuit and outputs the 0th bit of the accumulation result SUM [i]. An inverting circuit; i second NAND circuits for obtaining a negative logical product of the first to i-th bits of the accumulation result SUM [i-1] and the output of the fourth inverting circuit; and each of the second NAND circuits. The negative AND of the output and each output of the first NAND circuit is obtained, and the accumulated result SUM [i] Circuit having a i-number of fourth NAND circuit for outputting a ~i bit, and a path for outputting the i + 1 th bit of the i-th bit of the serial accumulation result SUM [i] bit count signal OUT [i],
A bit count circuit characterized by being replaced with.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007161628A JP4803829B2 (en) | 2007-06-19 | 2007-06-19 | Bit counting method and bit counting circuit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007161628A JP4803829B2 (en) | 2007-06-19 | 2007-06-19 | Bit counting method and bit counting circuit |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2009003556A JP2009003556A (en) | 2009-01-08 |
JP4803829B2 true JP4803829B2 (en) | 2011-10-26 |
Family
ID=40319902
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007161628A Expired - Fee Related JP4803829B2 (en) | 2007-06-19 | 2007-06-19 | Bit counting method and bit counting circuit |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4803829B2 (en) |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4319533B2 (en) * | 2003-12-04 | 2009-08-26 | 富士通株式会社 | Population count circuit |
-
2007
- 2007-06-19 JP JP2007161628A patent/JP4803829B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2009003556A (en) | 2009-01-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102338211B1 (en) | Quantum circuit and method for implementation a heterogeneously encoded logical bell state | |
JP4290202B2 (en) | Booth multiplication apparatus and method | |
US20080094260A1 (en) | Logic circuit | |
JP4883251B1 (en) | Semiconductor integrated circuit and index calculation method | |
Sarkar et al. | Design of hybrid (CSA-CSkA) adder for improvement of propagation delay | |
JP4803829B2 (en) | Bit counting method and bit counting circuit | |
Mohanapriya et al. | A comparative analysis of different 32-bit adder topologies with multiplexer based full adder | |
CN115102553A (en) | Device for converting binary code into thermometer code and electronic equipment | |
Wu et al. | Improving common subexpression elimination algorithm with a new gate-level delay computing method | |
JP2015026341A (en) | Arithmetic logic unit | |
Sathyabhama et al. | Area and power efficient carry select adder using 8T full adder | |
JP4595055B2 (en) | Galois field α multiplication circuit and arithmetic circuit | |
JPH03229321A (en) | Priority encoder | |
JP3727301B2 (en) | Adder circuit and semiconductor device provided with adder circuit | |
JP4290203B2 (en) | Reduction array apparatus and method | |
Soundharya et al. | GDI based area delay power efficient carry select adder | |
JP4230234B2 (en) | Parity prediction circuit for full adder | |
CN217034731U (en) | Selection controller, arithmetic circuit and chip | |
JP4408727B2 (en) | Digital circuit | |
CN217034730U (en) | Multi-bit selector, arithmetic circuit and chip | |
EP2270647A1 (en) | Multi-bit carry chain | |
Alia et al. | On the lower bound to the VLSI complexity of number conversion from weighted to residue representation | |
JP2000134103A (en) | Thermometric-binary code converting method/circuit and encoder element circuit used for the same | |
US7159004B2 (en) | Adder, multiplier and integrated circuit | |
REDDY et al. | Design and Implementation of VLSI Architectures of 16-Bit Carry Select Adder Using Brent Kung Adder |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20090715 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20110803 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110808 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4803829 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140819 Year of fee payment: 3 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |