JP2012169891A - Counter circuit - Google Patents

Counter circuit Download PDF

Info

Publication number
JP2012169891A
JP2012169891A JP2011029486A JP2011029486A JP2012169891A JP 2012169891 A JP2012169891 A JP 2012169891A JP 2011029486 A JP2011029486 A JP 2011029486A JP 2011029486 A JP2011029486 A JP 2011029486A JP 2012169891 A JP2012169891 A JP 2012169891A
Authority
JP
Japan
Prior art keywords
count value
circuit
clock signal
flip
flop
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
JP2011029486A
Other languages
Japanese (ja)
Inventor
Nobutaka Shiozaki
伸敬 塩崎
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2011029486A priority Critical patent/JP2012169891A/en
Publication of JP2012169891A publication Critical patent/JP2012169891A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a counter circuit that performs double precision measurement while using a smaller circuit scale and/or lower power consumption than before.SOLUTION: The counter circuit includes: a first circuit for counting pulses in synchronism with rising edges of a clock signal for a measuring period to generate a first count value; a second circuit for counting pulses in synchronism with falling edges of the clock signal for the measuring period to generate a second count value; a third circuit for holding flag information indicating an order relationship between the rising edges and the falling edges of the clock signal in the measuring period; and a fourth circuit for decoding the first count value and second count value according to the flag information to output a measured count value with double precision with respect to the frequency of the clock signal.

Description

本発明は、設定された計測期間においてクロック信号のパルス数をカウントするために用いられるカウンター回路等に関する。   The present invention relates to a counter circuit used for counting the number of pulses of a clock signal in a set measurement period.

例えば、センサー素子として水晶振動子を用いる圧力計測制御回路においては、水晶振動子を用いた発振動作によって得られるセンサーパルス信号を任意の分周比で分周して分周信号を生成した後に、分周信号のパルス幅によって定まる計測期間において基準クロック信号のパルス数をカウントすることにより分周信号のパルス幅を求め、分周信号のパルス幅に基づいて圧力の計測値を求めることが行われている。   For example, in a pressure measurement control circuit using a crystal resonator as a sensor element, after generating a divided signal by dividing a sensor pulse signal obtained by an oscillation operation using a crystal resonator by an arbitrary division ratio, In the measurement period determined by the pulse width of the divided signal, the pulse width of the divided signal is obtained by counting the number of pulses of the reference clock signal, and the measured pressure value is obtained based on the pulse width of the divided signal. ing.

ここで、計測精度(解像度)を向上させるためには、基準クロック信号の周波数を高めることが考えられる。例えば、PLL(フェーズ・ロックド・ループ)回路を用いて基準クロック信号を逓倍処理することにより高い周波数のクロック信号を生成し、そのパルス数をカウントすることが考えられる。   Here, in order to improve the measurement accuracy (resolution), it is conceivable to increase the frequency of the reference clock signal. For example, it is conceivable to generate a clock signal having a high frequency by multiplying a reference clock signal using a PLL (phase locked loop) circuit and to count the number of pulses.

しかしながら、高精度の計測値を取得するために、PLL回路を用いたり、あるいは、その他の方法によって高い周波数のクロック信号を生成することは、圧力計測制御回路やシステム全体の構成の複雑化を招き、設計の負担増、コストアップ、消費電流増加等に直結する。そこで、基準クロック信号の周波数を高めることなく、計測精度を向上させることが望まれる。   However, using a PLL circuit or generating a high-frequency clock signal by other methods in order to acquire highly accurate measurement values leads to complication of the configuration of the pressure measurement control circuit and the entire system. This leads directly to increased design burden, increased costs, and increased current consumption. Therefore, it is desired to improve measurement accuracy without increasing the frequency of the reference clock signal.

関連する技術として、特許文献1には、サンプリングクロック信号(基準クロック信号)の周波数を変えずに、サンプリングクロック信号の1/2周期の精度、即ち、従来回路の倍の精度で、被測定パルスのパルス幅を計測し得るパルス幅計測用カウンター回路が開示されている。   As a related technique, Patent Document 1 discloses that a pulse to be measured has a half cycle accuracy of a sampling clock signal without changing the frequency of the sampling clock signal (reference clock signal), that is, twice the accuracy of the conventional circuit. A pulse width measuring counter circuit capable of measuring the pulse width of the above is disclosed.

特許文献1の図1及び図3に示されているように、このパルス幅計測用カウンター回路は、被測定パルス21がハイレベル又はローレベルである期間(パルス幅PWの期間)にのみ作動し、この期間の長さより十分短い所定の周期を持つサンプリングクロック信号22に同期し、且つサンプリングクロック信号の周波数を1/2に分周した信号を出力する初段分周手段と、前段の分周手段の出力信号に同期し、且つこの出力信号の周波数を1/2に分周した信号を出力する1つ又は複数の後段分周手段(Dフリップフロップ2〜4等)とを、順次、縦続に接続してなり、上記期間の終端における各分周手段の出力信号(カウンター出力C0〜C3等)から被測定パルスのパルス幅を計測するカウンター回路であって、初段分周手段を、サンプリングクロック信号の立ち上がりで作動する第1の初段分周手段(Dフリップフロップ11)と、サンプリングクロック信号の立ち下がりで作動する第2の初段分周手段(Dフリップフロップ12)との2つに分け、これら2つの初段分周手段の出力信号を合成して、サンプリングクロック信号に同期し且つサンプリングクロック信号と同一の周波数の信号を出力し、2つの初段分周手段の出力信号の一方が存在しないときは、存在する他方の出力信号に相当する信号を出力する信号合成手段を介して、後段分周手段を、順次、縦続に接続することを特徴とする。   As shown in FIGS. 1 and 3 of Patent Document 1, this pulse width measurement counter circuit operates only during a period (pulse width PW period) in which the measured pulse 21 is at a high level or a low level. A first-stage frequency divider that outputs a signal obtained by dividing the frequency of the sampling clock signal by 1/2, and a first-stage frequency divider that is synchronized with the sampling clock signal 22 having a predetermined period sufficiently shorter than the length of the period; One or a plurality of post-stage dividers (D flip-flops 2 to 4 etc.) that output a signal obtained by dividing the frequency of the output signal by 1/2, and sequentially cascade the output signal. A counter circuit for measuring the pulse width of the pulse to be measured from the output signals (counter outputs C0 to C3, etc.) of each frequency dividing means at the end of the period, wherein the first stage frequency dividing means The first first-stage frequency dividing means (D flip-flop 11) that operates at the rising edge of the sampling clock signal and the second first-stage frequency dividing means (D flip-flop 12) that operates at the falling edge of the sampling clock signal. Divide and synthesize the output signals of these two first stage frequency dividers, output a signal synchronized with the sampling clock signal and the same frequency as the sampling clock signal, and one of the output signals of the two first stage frequency dividers exists If not, the subsequent stage frequency dividing means are connected in cascade in sequence through a signal synthesizing means for outputting a signal corresponding to the other output signal.

また、特許文献2には、クロック周波数を高くすることなく、カウント精度を上げることができると共に、カウンター部の消費電流の大幅な増加を抑えることのできるカウンター装置が開示されている。   Patent Document 2 discloses a counter device that can increase the counting accuracy without increasing the clock frequency and can suppress a significant increase in the current consumption of the counter unit.

特許文献2の図1及び図2に示されているように、このカウンター装置は、信号が共通に入力され、この信号の所定レベル期間をクロック信号(基準クロック信号)を用いてカウントする複数のカウンター手段(カウンター部1及び2)と、それらのカウンター手段に互いにタイミングのずれたクロック信号を供給するクロック供給手段(インバーター5)と、それらのカウンター手段のカウント値を加算する加算手段(加算器6)とを設けたことを特徴とする。   As shown in FIG. 1 and FIG. 2 of Patent Document 2, this counter device receives a signal in common, and counts a predetermined level period of this signal using a clock signal (reference clock signal). Counter means (counter units 1 and 2), clock supply means (inverter 5) for supplying clock signals shifted in timing to the counter means, and adding means (adder) for adding the count values of these counter means And 6).

特開平10−28048号公報(第3頁、図1、図3)Japanese Patent Laid-Open No. 10-28048 (page 3, FIG. 1, FIG. 3) 特開2001−298360号公報(第2頁、図1、図2)JP 2001-298360 A (2nd page, FIG. 1, FIG. 2)

特許文献1及び特許文献2によれば、基準クロック信号の周波数を高めることなく、従来回路の倍の精度で被測定パルスのパルス幅を計測することができる。しかしながら、特許文献1においては、サンプリングクロック信号又はそれと同一の周波数の信号に同期して出力信号を変化させる3つの分周手段(図1のDフリップフロップ11、12、及び、2)が用いられるので、消費電力の増加を招いてしまう。また、特許文献2においては、同一ビット数の複数のカウンター手段(図1のカウンター部1及び2)が用いられるので、回路規模及び消費電力の増加を招いてしまう。   According to Patent Document 1 and Patent Document 2, the pulse width of the pulse to be measured can be measured with double the accuracy of the conventional circuit without increasing the frequency of the reference clock signal. However, in Patent Document 1, three frequency dividing means (D flip-flops 11, 12, and 2 in FIG. 1) that change an output signal in synchronization with a sampling clock signal or a signal having the same frequency as the sampling clock signal are used. As a result, the power consumption increases. In Patent Document 2, since a plurality of counter means (counter units 1 and 2 in FIG. 1) having the same number of bits are used, the circuit scale and power consumption are increased.

本発明の1つの観点に係るカウンター回路は、設定された計測期間においてクロック信号のパルス数をカウントするカウンター回路であって、計測期間において、クロック信号の立ち上がりエッジに同期してパルス数をカウントすることにより、第1カウント値を生成する第1の回路と、計測期間において、クロック信号の立ち下がりエッジに同期してパルス数をカウントすることにより、第2カウント値を生成する第2の回路と、計測期間におけるクロック信号の立ち上がりエッジと立ち下がりエッジとの前後関係を表すフラグ情報を保持する第3の回路と、フラグ情報に従って第1カウント値及び第2カウント値をデコードすることにより、クロック信号の周期に対して倍精度の計測カウント値を出力する第4の回路とを含む。   A counter circuit according to one aspect of the present invention is a counter circuit that counts the number of pulses of a clock signal in a set measurement period, and counts the number of pulses in synchronization with a rising edge of the clock signal in the measurement period. A first circuit for generating a first count value, and a second circuit for generating a second count value by counting the number of pulses in synchronization with the falling edge of the clock signal in the measurement period. The clock signal is obtained by decoding the first count value and the second count value according to the third circuit that holds the flag information indicating the front-rear relationship between the rising edge and the falling edge of the clock signal in the measurement period. And a fourth circuit for outputting a measurement count value of double precision with respect to the period.

本発明の1つの観点によれば、クロック信号に同期して出力信号を変化させるのは第1の回路及び第2の回路のみであり、しかも、第1の回路と第2の回路との内の一方は1ビットのカウント値を生成すればよいので、従来よりも回路規模及び/又は消費電力を低減しながら倍精度の計測を行うカウンター回路を実現することができる。従って、設計容易性の向上、消費電力の削減、及び/又は、コストの低減等において有利となる。   According to one aspect of the present invention, only the first circuit and the second circuit change the output signal in synchronization with the clock signal, and among the first circuit and the second circuit, Since one of them only needs to generate a 1-bit count value, it is possible to realize a counter circuit that performs double-precision measurement while reducing the circuit scale and / or power consumption compared to the conventional one. Therefore, it is advantageous in improving the ease of design, reducing power consumption, and / or reducing costs.

ここで、第1カウント値又は第2カウント値がNビット(Nは2以上の整数)のカウント値であり、Nビットの第1カウント値と第2カウント値の最下位ビットとを結合した(N+1)ビットの第1結合カウント値、又は、Nビットの第2カウント値と第1カウント値の最下位ビットとを結合した(N+1)ビットの第2結合カウント値に基づいて、第4の回路が、第1結合カウント値又は第2結合カウント値の少なくとも下位2ビットをデコードするようにしても良い。例えば、第1結合カウント値の下位2ビットがデコードされる場合には、第1カウント値の上位(N−1)ビットを、デコードせずに、計測カウント値の上位(N−1)ビットとして用いることができる。   Here, the first count value or the second count value is a count value of N bits (N is an integer of 2 or more), and the N-bit first count value and the least significant bit of the second count value are combined ( The fourth circuit based on the (N + 1) -bit first combined count value or the (N + 1) -bit second combined count value obtained by combining the N-bit second count value and the least significant bit of the first count value However, at least the lower 2 bits of the first combined count value or the second combined count value may be decoded. For example, when the lower 2 bits of the first combined count value are decoded, the upper (N-1) bit of the first count value is not decoded and is used as the upper (N-1) bit of the measurement count value. Can be used.

また、第4の回路は、計測期間におけるクロック信号の最初の立ち上がりエッジが最初の立ち下がりエッジよりも前である場合に、第1結合カウント値の下位2ビット「0、0」を「0、0」にデコードし、下位2ビット「1、0」を「0、1」にデコードし、下位2ビット「1、1」を「1、0」にデコードし、下位2ビット「0、1」を「−1、1」にデコードし、計測期間におけるクロック信号の最初の立ち上がりエッジが最初の立ち下がりエッジよりも後である場合に、第1結合カウント値の下位2ビット「0、0」を「0、0」にデコードし、下位2ビット「0、1」を「0、1」にデコードし、下位2ビット「1、1」を「1、0」にデコードし、下位2ビット「1、0」を「1、1」にデコードするようにしても良い。このように、デコード動作の内容が比較的簡単である場合には、第1結合カウント値の下位2ビットと、第3の回路に保持されているフラグ情報とを、IC設計においてDFT(Design For Testability:テスト容易化設計)によるスキャン化の対象とすることが可能となり、出荷選別の際におけるテスト容易性が向上する。   Further, the fourth circuit sets the lower 2 bits “0, 0” of the first combined count value to “0, when the first rising edge of the clock signal in the measurement period is before the first falling edge. 0 ”, lower 2 bits“ 1, 0 ”are decoded to“ 0, 1 ”, lower 2 bits“ 1, 1 ”are decoded to“ 1, 0 ”, and lower 2 bits“ 0, 1 ” When the first rising edge of the clock signal in the measurement period is later than the first falling edge, the lower 2 bits “0, 0” of the first combined count value are decoded. Decode to “0, 0”, lower 2 bits “0, 1” to “0, 1”, lower 2 bits “1, 1” to “1, 0”, lower 2 bits “1” , 0 ”may be decoded to“ 1, 1 ”. As described above, when the content of the decoding operation is relatively simple, the lower 2 bits of the first combined count value and the flag information held in the third circuit are used for DFT (Design For Testability (testability: design for testability) can be a target of scanning, and testability at the time of shipment selection is improved.

以上において、第1の回路が、クロック信号の立ち上がりエッジに同期して出力信号を変化させる第1のフリップフロップを含み、第2の回路が、クロック信号の立ち下がりエッジに同期して出力信号を変化させる第2のフリップフロップを含み、第3の回路が、第1のフリップフロップの出力信号と第2のフリップフロップの出力信号との排他的論理和を求める排他的論理和回路と、計測期間におけるクロック信号の立ち上がりエッジに同期して排他的論理和回路の出力信号をラッチする第3のフリップフロップとを含むようにしても良い。その場合には、第3の回路の構成を比較的簡単にすることができる。   In the above, the first circuit includes the first flip-flop that changes the output signal in synchronization with the rising edge of the clock signal, and the second circuit outputs the output signal in synchronization with the falling edge of the clock signal. An exclusive OR circuit for calculating an exclusive OR between the output signal of the first flip-flop and the output signal of the second flip-flop, and a measurement period. And a third flip-flop for latching the output signal of the exclusive OR circuit in synchronization with the rising edge of the clock signal. In that case, the configuration of the third circuit can be made relatively simple.

本発明の一実施形態に係るカウンター回路を用いた圧力計測制御回路の図。The figure of the pressure measurement control circuit using the counter circuit concerning one embodiment of the present invention. 図1に示す圧力計測制御回路のカウント動作を示すタイミングチャート。The timing chart which shows the count operation | movement of the pressure measurement control circuit shown in FIG. 図1に示す圧力計測制御回路のカウント動作を示すタイミングチャート。The timing chart which shows the count operation | movement of the pressure measurement control circuit shown in FIG. 図1に示すデコーダーのデコード動作を説明するための図。The figure for demonstrating the decoding operation | movement of the decoder shown in FIG. 図1に示すデコーダーのデコード動作を説明するための図。The figure for demonstrating the decoding operation | movement of the decoder shown in FIG. 図1に示すエッジ情報保持回路の第2の回路例を示す図。The figure which shows the 2nd circuit example of the edge information holding circuit shown in FIG. 図1に示すエッジ情報保持回路の第3の回路例を示す図。The figure which shows the 3rd circuit example of the edge information holding circuit shown in FIG. 図1に示すエッジ情報保持回路の第4の回路例を示す図。The figure which shows the 4th circuit example of the edge information holding circuit shown in FIG. 図1に示すエッジ情報保持回路の第5の回路例を示す図。The figure which shows the 5th circuit example of the edge information holding circuit shown in FIG.

以下、本発明の実施形態について、図面を参照しながら詳しく説明する。なお、同一の構成要素には同一の参照符号を付して、重複する説明を省略する。
図1は、本発明の一実施形態に係るカウンター回路を用いた圧力計測制御回路の一部の構成を示す図である。この圧力計測制御回路は、センサー素子として水晶振動子を用いており、水晶振動子を用いた発振動作によって得られるセンサーパルス信号(センサークロック信号)SCKを入力し、センサークロック信号SCKによって定まる計測期間において基準クロック信号RCKのパルス数をカウントし、このカウント値に基づいて圧力の計測値を求める。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In addition, the same referential mark is attached | subjected to the same component and the overlapping description is abbreviate | omitted.
FIG. 1 is a diagram showing a partial configuration of a pressure measurement control circuit using a counter circuit according to an embodiment of the present invention. This pressure measurement control circuit uses a crystal resonator as a sensor element, inputs a sensor pulse signal (sensor clock signal) SCK obtained by an oscillation operation using the crystal resonator, and is a measurement period determined by the sensor clock signal SCK. The number of pulses of the reference clock signal RCK is counted and a pressure measurement value is obtained based on this count value.

図1には、センサークロック信号SCKのパルス数をカウントするゲートカウンター10と、ゲートカウンター10から出力されるカウント値に基づいて計測期間を設定する計測期間設定回路20と、計測期間設定回路20によって設定された計測期間において基準クロック信号RCKのパルス数をカウントする計測カウンター30とが示されている。   In FIG. 1, a gate counter 10 that counts the number of pulses of the sensor clock signal SCK, a measurement period setting circuit 20 that sets a measurement period based on a count value output from the gate counter 10, and a measurement period setting circuit 20 A measurement counter 30 that counts the number of pulses of the reference clock signal RCK in the set measurement period is shown.

ゲートカウンター10は、例えば、18ビットのトグルカウンター(本実施形態においては、アップカウンター)として構成される。ゲートカウンター10のセット端子SETに入力されるゲートカウンターイネーブル信号GCEがローレベルに非活性化されている間に、ゲートカウンター10のカウント値の最下位ビットBIT0〜最上位ビットBIT17がハイレベルにセットされる。ゲートカウンターイネーブル信号GCEがハイレベルに活性化されると、ゲートカウンター10のカウント値の最下位ビットBIT0〜最上位ビットBIT17が一旦ローレベルとなって、ゲートカウンター10が、センサークロック信号SCKのパルス数のカウントを開始する。ゲートカウンター10は、第1番目のパルスをカウントすると、カウント値の最下位ビットBIT0をハイレベルに変化させ、2の17乗番目のパルスをカウントすると、カウント値の最上位ビットBIT17をハイレベルに変化させ、2の18乗番目のパルスをカウントすると、カウント値の最上位ビットBIT17をローレベルに変化させる。カウント値の最下位ビットBIT0及び最上位ビットBIT17は、計測期間設定回路20に供給される。   The gate counter 10 is configured as, for example, an 18-bit toggle counter (up counter in the present embodiment). While the gate counter enable signal GCE input to the set terminal SET of the gate counter 10 is inactivated to the low level, the least significant bit BIT0 to the most significant bit BIT17 of the count value of the gate counter 10 are set to the high level. Is done. When the gate counter enable signal GCE is activated to a high level, the least significant bit BIT0 to the most significant bit BIT17 of the count value of the gate counter 10 once become a low level, and the gate counter 10 pulses the sensor clock signal SCK. Start counting the number. The gate counter 10 changes the least significant bit BIT0 of the count value to the high level when counting the first pulse, and sets the most significant bit BIT17 of the count value to the high level when counting the 2 17th pulse. When the second 18th pulse is counted, the most significant bit BIT17 of the count value is changed to a low level. The least significant bit BIT0 and the most significant bit BIT17 of the count value are supplied to the measurement period setting circuit 20.

計測期間設定回路20は、2つのDフリップフロップDF21及びDF22を含んでいる。DフリップフロップDF21及びDF22は、ゲートカウンターイネーブル信号GCEがローレベルに非活性化されている間に、出力信号をローレベルにリセットする。ゲートカウンターイネーブル信号GCEがハイレベルに活性化された後に、ゲートカウンター10のカウント値の最下位ビットBIT0がローレベルに変化すると、DフリップフロップDF21は、データ入力端子Dに入力されるハイレベル(電源電位VDD)の信号をラッチして、出力端子Qからハイレベルのカウント開始信号CSTを出力する。その後、ゲートカウンター10のカウント値の最上位ビットBIT17がローレベルに変化すると、DフリップフロップDF22は、データ入力端子Dに入力されるハイレベルのカウント開始信号CSTをラッチして、出力端子Qからハイレベルのカウント終了信号CEDを出力する。 The measurement period setting circuit 20 includes two D flip-flops DF21 and DF22. The D flip-flops DF21 and DF22 reset the output signal to the low level while the gate counter enable signal GCE is inactivated to the low level. When the least significant bit BIT0 of the count value of the gate counter 10 is changed to a low level after the gate counter enable signal GCE is activated to a high level, the D flip-flop DF21 is input to the data input terminal D at a high level ( The signal of the power supply potential V DD ) is latched, and a high level count start signal CST is output from the output terminal Q. Thereafter, when the most significant bit BIT17 of the count value of the gate counter 10 changes to a low level, the D flip-flop DF22 latches the high-level count start signal CST input to the data input terminal D, and outputs from the output terminal Q. A high level count end signal CED is output.

ここで、カウント開始信号CSTがハイレベルに移行してからカウント終了信号CEDがハイレベルに移行するまでの期間が、計測期間として設定される。以上においては、カウント開始信号CST及びカウント終了信号CEDを生成するために、ゲートカウンター10のカウント値の最下位ビットBIT0及び最上位ビットBIT17を使用する場合について説明したが、ゲートカウンター10のカウント値の他のビットを使用するようにしても良い。そのようにすれば、センサークロック信号SCKを任意の分周比で分周して分周信号(カウント値)を生成し、分周信号のパルス幅によって計測期間を設定することができる。カウント開始信号CST及びカウント終了信号CEDは、計測カウンター30に供給される。   Here, a period from when the count start signal CST shifts to a high level until the count end signal CED shifts to a high level is set as a measurement period. In the above description, the least significant bit BIT0 and the most significant bit BIT17 of the count value of the gate counter 10 are used to generate the count start signal CST and the count end signal CED. Other bits may be used. By doing so, it is possible to divide the sensor clock signal SCK by an arbitrary division ratio to generate a divided signal (count value), and to set the measurement period according to the pulse width of the divided signal. The count start signal CST and the count end signal CED are supplied to the measurement counter 30.

計測カウンター30は、本発明の一実施形態に係るカウンター回路であり、ラッチフリップフロップLF31と、メインカウンター31と、サブカウンター32と、エッジ情報保持回路33と、デコーダー34とを含んでいる。ラッチフリップフロップLF31は、カウント終了信号CEDがローレベルに非活性化されている間に、データ入力端子Dに入力される基準クロック信号RCKをゲートクロック信号GCKとして出力し、カウント終了信号CEDがハイレベルに活性化されると、基準クロック信号RCKをラッチして、出力信号をハイレベル又はローレベルに固定する。   The measurement counter 30 is a counter circuit according to an embodiment of the present invention, and includes a latch flip-flop LF31, a main counter 31, a sub-counter 32, an edge information holding circuit 33, and a decoder 34. The latch flip-flop LF31 outputs the reference clock signal RCK input to the data input terminal D as the gate clock signal GCK while the count end signal CED is inactivated to the low level, and the count end signal CED is high. When activated to the level, the reference clock signal RCK is latched, and the output signal is fixed to the high level or the low level.

メインカウンター31は、N個のDフリップフロップDF31〜DF33を含んでいる(Nは2以上の整数)。DフリップフロップDF31〜DF33の各々において、反転出力端子Qバーから出力される反転出力信号が、データ入力端子Dに供給される。DフリップフロップDF31〜DF33の各々は、カウント開始信号CSTがローレベルに非活性化されている間にリセットされて、出力信号をローレベルとし、反転出力信号をハイレベルとする。   The main counter 31 includes N D flip-flops DF31 to DF33 (N is an integer of 2 or more). In each of the D flip-flops DF31 to DF33, an inverted output signal output from the inverted output terminal Q bar is supplied to the data input terminal D. Each of the D flip-flops DF31 to DF33 is reset while the count start signal CST is inactivated to the low level, and the output signal is set to the low level and the inverted output signal is set to the high level.

カウント開始信号CSTがハイレベルに活性化されると、DフリップフロップDF31は、ラッチフリップフロップLF31から供給されるゲートクロック信号GCKの立ち上がりエッジに同期して出力信号及び反転出力信号のレベルを変化させることにより、ゲートクロック信号GCKを2分周する。   When the count start signal CST is activated to a high level, the D flip-flop DF31 changes the levels of the output signal and the inverted output signal in synchronization with the rising edge of the gate clock signal GCK supplied from the latch flip-flop LF31. As a result, the gate clock signal GCK is divided by two.

DフリップフロップDF31の反転出力端子Qバーは次段のDフリップフロップDF32のクロック信号入力端子に接続されており、以下同様にして、第N段のDフリップフロップDF33まで、N個のDフリップフロップが直列に接続されている。これにより、ゲートクロック信号GCKが、順次2分周される。   The inverted output terminal Q bar of the D flip-flop DF31 is connected to the clock signal input terminal of the next-stage D flip-flop DF32. Are connected in series. As a result, the gate clock signal GCK is sequentially divided by two.

ラッチフリップフロップLF31は、カウント終了信号CEDがローレベルに非活性化されている間にゲートクロック信号GCKをメインカウンター31に供給し、計測期間設定回路20によって設定された計測期間が経過してカウント終了信号CEDがハイレベルに活性化されると、ゲートクロック信号GCKの供給を停止する。従って、メインカウンター31は、計測期間設定回路20によって設定された計測期間において、ゲートクロック信号GCKの立ち上がりエッジに同期してパルス数をカウントすることにより、Nビットのメインカウント値CM(最下位ビットCM0〜最上位ビットCM(N−1))を生成する。   The latch flip-flop LF31 supplies the gate clock signal GCK to the main counter 31 while the count end signal CED is inactivated to a low level, and counts after the measurement period set by the measurement period setting circuit 20 elapses. When the end signal CED is activated to a high level, the supply of the gate clock signal GCK is stopped. Accordingly, the main counter 31 counts the number of pulses in synchronization with the rising edge of the gate clock signal GCK during the measurement period set by the measurement period setting circuit 20, thereby providing an N-bit main count value CM (the least significant bit). CM0 to most significant bit CM (N-1)) are generated.

サブカウンター32は、DフリップフロップDF34を含んでいる。DフリップフロップDF34において、反転出力端子Qバーから出力される反転出力信号が、データ入力端子Dに供給される。DフリップフロップDF34は、カウント開始信号CSTがローレベルに非活性化されている間にリセットされて、出力信号をローレベルとし、反転出力信号をハイレベルとする。カウント開始信号CSTがハイレベルに活性化されると、DフリップフロップDF31は、ラッチフリップフロップLF31から供給されるゲートクロック信号GCKの立ち下がりエッジに同期して出力信号及び反転出力信号のレベルを変化させることにより、ゲートクロック信号GCKを2分周する。   The sub-counter 32 includes a D flip-flop DF34. In the D flip-flop DF34, the inverted output signal output from the inverted output terminal Q bar is supplied to the data input terminal D. The D flip-flop DF34 is reset while the count start signal CST is inactivated to the low level, and sets the output signal to the low level and the inverted output signal to the high level. When the count start signal CST is activated to a high level, the D flip-flop DF31 changes the levels of the output signal and the inverted output signal in synchronization with the falling edge of the gate clock signal GCK supplied from the latch flip-flop LF31. By doing so, the gate clock signal GCK is divided by two.

ラッチフリップフロップLF31は、カウント終了信号CEDがローレベルに非活性化されている間にゲートクロック信号GCKをサブカウンター32に供給し、計測期間設定回路20によって設定された計測期間が経過してカウント終了信号CEDがハイレベルに活性化されると、ゲートクロック信号GCKの供給を停止する。従って、サブカウンター32は、計測期間設定回路20によって設定された計測期間において、ゲートクロック信号GCKの立ち下がりエッジに同期してパルス数をカウントすることにより、1ビットのサブカウント値CSを生成する。   The latch flip-flop LF31 supplies the gate clock signal GCK to the sub-counter 32 while the count end signal CED is inactivated to the low level, and counts after the measurement period set by the measurement period setting circuit 20 elapses. When the end signal CED is activated to a high level, the supply of the gate clock signal GCK is stopped. Therefore, the sub-counter 32 generates a 1-bit sub-count value CS by counting the number of pulses in synchronization with the falling edge of the gate clock signal GCK in the measurement period set by the measurement period setting circuit 20. .

エッジ情報保持回路33は、排他的論理和回路(EOR回路)EX31と、DフリップフロップDF35とを含んでいる。EOR回路EX31は、メインカウンター31のDフリップフロップDF31の出力信号とサブカウンター32のDフリップフロップDF34の出力信号との排他的論理和を求める。   The edge information holding circuit 33 includes an exclusive OR circuit (EOR circuit) EX31 and a D flip-flop DF35. The EOR circuit EX31 obtains an exclusive OR of the output signal of the D flip-flop DF31 of the main counter 31 and the output signal of the D flip-flop DF34 of the sub-counter 32.

図1においては、EOR回路EX31がDフリップフロップDF31の反転出力信号とDフリップフロップDF34の非反転出力信号との排他的論理和を求める場合が示されているが、本回路例及び他の回路例において、EOR回路EX31は、DフリップフロップDF31の非反転出力信号とDフリップフロップDF34の反転出力信号との排他的論理和を求めても良いし、DフリップフロップDF31の非反転出力信号とDフリップフロップDF34の非反転出力信号との排他的論理和を求めても良いし、DフリップフロップDF31の反転出力信号とDフリップフロップDF34の反転出力信号との排他的論理和を求めても良い。エッジ情報フラグFLGの極性が反転しても、デコーダー34においてこれに対応することができる。   FIG. 1 shows a case where the EOR circuit EX31 obtains an exclusive OR of the inverted output signal of the D flip-flop DF31 and the non-inverted output signal of the D flip-flop DF34, but this circuit example and other circuits are shown. In the example, the EOR circuit EX31 may obtain an exclusive OR of the non-inverted output signal of the D flip-flop DF31 and the inverted output signal of the D flip-flop DF34, An exclusive OR of the non-inverted output signal of the flip-flop DF34 may be obtained, or an exclusive OR of the inverted output signal of the D flip-flop DF31 and the inverted output signal of the D flip-flop DF34 may be obtained. Even if the polarity of the edge information flag FLG is inverted, the decoder 34 can cope with this.

EOR回路EX31の出力信号は、DフリップフロップDF35のデータ入力端子Dに入力される。DフリップフロップDF35は、カウント開始信号CSTがローレベルに非活性化されている間にリセットされて、出力信号をローレベルとする。カウント開始信号CSTがハイレベルに活性化されると、DフリップフロップDF35は、計測期間設定回路20によって設定された計測期間において、ゲートクロック信号GCKの立ち上がりエッジに同期してEOR回路EX31の出力信号をラッチ(保持)することにより、エッジ情報フラグFLGを生成する。   The output signal of the EOR circuit EX31 is input to the data input terminal D of the D flip-flop DF35. The D flip-flop DF35 is reset while the count start signal CST is inactivated to the low level, and sets the output signal to the low level. When the count start signal CST is activated to the high level, the D flip-flop DF35 outputs the output signal of the EOR circuit EX31 in synchronization with the rising edge of the gate clock signal GCK in the measurement period set by the measurement period setting circuit 20. Is latched (held) to generate an edge information flag FLG.

エッジ情報フラグFLGは、計測期間設定回路20によって設定された計測期間におけるゲートクロック信号GCKの立ち上がりエッジと立ち下がりエッジとの前後関係を表す情報である。図1に示す構成によれば、計測期間においてゲートクロック信号GCKの最初の立ち上がりエッジが最初の立ち下がりエッジよりも前である場合に、エッジ情報フラグFLGがハイレベル(「1」)となり、計測期間においてゲートクロック信号GCKの最初の立ち上がりエッジが最初の立ち下がりエッジよりも後である場合に、エッジ情報フラグFLGがローレベル(「0」)となる。   The edge information flag FLG is information representing the front-rear relationship between the rising edge and the falling edge of the gate clock signal GCK in the measurement period set by the measurement period setting circuit 20. According to the configuration shown in FIG. 1, when the first rising edge of the gate clock signal GCK is before the first falling edge in the measurement period, the edge information flag FLG becomes high level (“1”), and the measurement is performed. When the first rising edge of the gate clock signal GCK is after the first falling edge in the period, the edge information flag FLG becomes low level (“0”).

デコーダー34は、メインカウンター31によって生成されたメインカウント値CMの所定ビット及びサブカウンター32によって生成されたサブカウント値CSを、エッジ情報保持回路33に保持されているエッジ情報フラグFLGの値に従ってデコードすることにより、倍精度の計測カウント値CTを求める。   The decoder 34 decodes the predetermined bit of the main count value CM generated by the main counter 31 and the subcount value CS generated by the subcounter 32 according to the value of the edge information flag FLG held in the edge information holding circuit 33. As a result, a double-precision measurement count value CT is obtained.

以下に、図1に示す圧力計測制御回路のカウント動作について詳しく説明する。
図2及び図3は、図1に示す圧力計測制御回路のカウント動作を示すタイミングチャートである。図2には、計測期間においてゲートクロック信号GCKの最初の立ち上がりエッジが最初の立ち下がりエッジよりも前である場合のカウント動作が示されており、図3には、計測期間においてゲートクロック信号GCKの最初の立ち上がりエッジが最初の立ち下がりエッジよりも後である場合のカウント動作が示されている。
Hereinafter, the counting operation of the pressure measurement control circuit shown in FIG. 1 will be described in detail.
2 and 3 are timing charts showing the counting operation of the pressure measurement control circuit shown in FIG. FIG. 2 shows a counting operation when the first rising edge of the gate clock signal GCK is before the first falling edge in the measurement period, and FIG. 3 shows the gate clock signal GCK in the measurement period. The counting operation is shown when the first rising edge is after the first falling edge.

図2及び図3に示すように、ゲートカウンターイネーブル信号GCEがローレベルに非活性化されている間に、ゲートカウンター10のカウント値の最下位ビットBIT0及び最上位ビットBIT17がハイレベルにセットされる。次に、ゲートカウンターイネーブル信号GCEがハイレベルに活性化されると、ゲートカウンター10のカウント値の最下位ビットBIT0及び最上位ビットBIT17が一旦ローレベルとなって、ゲートカウンター10がセンサークロック信号SCKのパルス数のカウントを開始する。ゲートカウンター10は、第1番目のパルスをカウントすると、カウント値の最下位ビットBIT0をハイレベルに変化させ、2の17乗番目のパルスをカウントすると、カウント値の最上位ビットBIT17をハイレベルに変化させ、2の18乗番目のパルスをカウントすると、カウント値の最上位ビットBIT17をローレベルに変化させる。   As shown in FIGS. 2 and 3, while the gate counter enable signal GCE is inactivated to the low level, the least significant bit BIT0 and the most significant bit BIT17 of the count value of the gate counter 10 are set to the high level. The Next, when the gate counter enable signal GCE is activated to a high level, the least significant bit BIT0 and the most significant bit BIT17 of the count value of the gate counter 10 are once set to a low level, and the gate counter 10 detects the sensor clock signal SCK. Start counting the number of pulses. The gate counter 10 changes the least significant bit BIT0 of the count value to the high level when counting the first pulse, and sets the most significant bit BIT17 of the count value to the high level when counting the 2 17th pulse. When the second 18th pulse is counted, the most significant bit BIT17 of the count value is changed to a low level.

ゲートカウンター10のカウント値の最下位ビットBIT0がローレベルに変化すると、計測期間設定回路20のDフリップフロップDF21は、カウント開始信号CSTをハイレベルに変化させる。また、ゲートカウンター10のカウント値の最上位ビットBIT17がローレベルに変化すると、計測期間設定回路20のDフリップフロップDF22は、カウント終了信号CEDをハイレベルに変化させる。   When the least significant bit BIT0 of the count value of the gate counter 10 changes to low level, the D flip-flop DF21 of the measurement period setting circuit 20 changes the count start signal CST to high level. When the most significant bit BIT17 of the count value of the gate counter 10 changes to low level, the D flip-flop DF22 of the measurement period setting circuit 20 changes the count end signal CED to high level.

計測カウンター30のラッチフリップフロップLF31は、カウント終了信号CEDがローレベルに非活性化されている間にゲートクロック信号GCKを出力し、カウント終了信号CEDがハイレベルに活性化されると、ゲートクロック信号GCKをハイレベル又はローレベルに固定する。   The latch flip-flop LF31 of the measurement counter 30 outputs the gate clock signal GCK while the count end signal CED is inactivated to the low level, and when the count end signal CED is activated to the high level, the gate clock The signal GCK is fixed at a high level or a low level.

計測カウンター30のメインカウンター31は、カウント開始信号CSTがハイレベルに活性化されると、ラッチフリップフロップLF31から供給されるゲートクロック信号GCKの立ち上がりエッジに同期してパルス数をカウントすることにより、Nビットのメインカウント値CMを生成する。図2及び図3には、メインカウント値の最下位ビットCM0の変化も示されている。   When the count start signal CST is activated to a high level, the main counter 31 of the measurement counter 30 counts the number of pulses in synchronization with the rising edge of the gate clock signal GCK supplied from the latch flip-flop LF31. An N-bit main count value CM is generated. 2 and 3 also show changes in the least significant bit CM0 of the main count value.

計測カウンター30のサブカウンター32は、カウント開始信号CSTがハイレベルに活性化されると、ラッチフリップフロップLF31から供給されるゲートクロック信号GCKの立ち下がりエッジに同期してパルス数をカウントすることにより、1ビットのサブカウント値CSを生成する。   When the count start signal CST is activated to a high level, the sub-counter 32 of the measurement counter 30 counts the number of pulses in synchronization with the falling edge of the gate clock signal GCK supplied from the latch flip-flop LF31. A 1-bit subcount value CS is generated.

エッジ情報保持回路33は、メインカウント値の最下位ビットCM0の反転信号とサブカウント値CSとの排他的論理和を求め、ゲートクロック信号GCKに同期して排他的論理和をラッチすることによって、エッジ情報フラグFLGを生成する。図2に示すように、計測期間(カウント開始信号CSTがハイレベルに活性化された後)においてゲートクロック信号GCKの最初の立ち上がりエッジが最初の立ち下がりエッジよりも前である場合には、エッジ情報フラグFLGがハイレベルとなる。一方、図3に示すように、計測期間においてゲートクロック信号GCKの最初の立ち上がりエッジが最初の立ち下がりエッジよりも後である場合には、エッジ情報フラグFLGがローレベルとなる。DフリップフロップDF35のラッチ動作はその後も継続されるが、エッジ情報フラグFLGの値が変更されることはない。   The edge information holding circuit 33 obtains an exclusive OR of the inverted signal of the least significant bit CM0 of the main count value and the subcount value CS, and latches the exclusive OR in synchronization with the gate clock signal GCK. An edge information flag FLG is generated. As shown in FIG. 2, when the first rising edge of the gate clock signal GCK is before the first falling edge in the measurement period (after the count start signal CST is activated to high level), the edge The information flag FLG becomes high level. On the other hand, as shown in FIG. 3, when the first rising edge of the gate clock signal GCK is later than the first falling edge in the measurement period, the edge information flag FLG becomes low level. Although the latch operation of the D flip-flop DF35 is continued thereafter, the value of the edge information flag FLG is not changed.

デコーダー34は、メインカウンター31によって生成されたNビットのメインカウント値CMとサブカウンター32によって生成された1ビットのサブカウント値CSとを結合して得られる(N+1)ビットの結合カウント値の少なくとも下位2ビットを、エッジ情報フラグFLGの値に応じてデコードすることにより、ゲートクロック信号GCKのパルス数を倍精度で表す計測カウント値CTを求める。図2及び図3においては、デコーダー34が、計測カウント値CTを随時算出しているが、1つの計測期間における一連のカウント動作が終了した後に計測カウント値CTを算出するようにしても良い。   The decoder 34 combines at least one of (N + 1) -bit combined count values obtained by combining the N-bit main count value CM generated by the main counter 31 and the 1-bit sub-count value CS generated by the sub-counter 32. By decoding the lower 2 bits according to the value of the edge information flag FLG, a measurement count value CT that represents the number of pulses of the gate clock signal GCK with double precision is obtained. In FIGS. 2 and 3, the decoder 34 calculates the measurement count value CT as needed. However, the measurement count value CT may be calculated after a series of counting operations in one measurement period is completed.

図4及び図5は、図1に示すデコーダーのデコード動作を説明するための図である。図4には、エッジ情報保持回路33に保持されているエッジ情報フラグFLGの値が「1」である場合のデコード動作が示されており、図5には、エッジ情報保持回路33に保持されているエッジ情報フラグFLGの値が「0」である場合のデコード動作が示されている。   4 and 5 are diagrams for explaining the decoding operation of the decoder shown in FIG. FIG. 4 shows a decoding operation when the value of the edge information flag FLG held in the edge information holding circuit 33 is “1”, and FIG. 5 shows the decoding operation held in the edge information holding circuit 33. The decoding operation when the value of the edge information flag FLG being “0” is “0” is shown.

メインカウンター31によって生成されたNビットのメインカウント値CMと、サブカウンター32によって生成された1ビットのサブカウント値CSとを結合することにより、(N+1)ビットの結合カウント値が得られる。図4及び図5には、結合カウント値の下位3ビットCM1、CM0、CSと、デコード結果として求められる計測カウント値CTの下位3ビットとが示されている。   By combining the N-bit main count value CM generated by the main counter 31 and the 1-bit sub-count value CS generated by the sub-counter 32, a combined count value of (N + 1) bits is obtained. 4 and 5 show the lower 3 bits CM1, CM0, CS of the combined count value and the lower 3 bits of the measurement count value CT obtained as a decoding result.

デコーダー34は、結合カウント値の下位2ビットをデコードしても良いし、それよりも多くのビットをデコードしても良いが、以下においては、下位2ビットをデコードする場合について説明する。その場合には、メインカウンター31によって生成されたメインカウント値の上位(N−1)ビットを、デコードせずに、計測カウント値の上位(N−1)ビットとして用いることができる。   The decoder 34 may decode the lower 2 bits of the combined count value, or may decode more bits than that, but a case where the lower 2 bits are decoded will be described below. In that case, the upper (N-1) bits of the main count value generated by the main counter 31 can be used as the upper (N-1) bits of the measurement count value without decoding.

エッジ情報保持回路33に保持されているエッジ情報フラグFLGの値が「1」である場合には、図4に示すように、デコーダー34が、結合カウント値の下位2ビット「0、0」を「0、0」にデコードし、結合カウント値の下位2ビット「1、0」を「0、1」にデコードし、結合カウント値の下位2ビット「1、1」を「1、0」にデコードし、結合カウント値の下位2ビット「0、1」を「−1、1」にデコードする。ここで、結合カウント値の第2下位ビットCM0が「−1」となる場合には、デコーダー34が、結合カウント値の第3下位ビットCM1の値を繰り下げる(図4における☆印)。この繰り下げは、結合カウント値の第4下位ビット以上に波及する場合がある(例えば、デコード結果が「111(7)」となる場合)。   When the value of the edge information flag FLG held in the edge information holding circuit 33 is “1”, as shown in FIG. 4, the decoder 34 sets the lower 2 bits “0, 0” of the combined count value. Decode to “0, 0”, lower 2 bits “1, 0” of combined count value to “0, 1”, lower 2 bits “1, 1” of combined count value to “1, 0” Then, the lower 2 bits “0, 1” of the combined count value are decoded to “−1, 1”. Here, when the second lower bit CM0 of the combined count value becomes “−1”, the decoder 34 decrements the value of the third lower bit CM1 of the combined count value (marked with a asterisk in FIG. 4). This carry-down may spill over to the fourth lower-order bit of the combined count value (for example, when the decoding result is “111 (7)”).

一方、エッジ情報保持回路33に保持されているエッジ情報フラグFLGの値が「0」である場合には、図5に示すように、デコーダー34が、結合カウント値の下位2ビット「0、0」を「0、0」にデコードし、結合カウント値の下位2ビット「0、1」を「0、1」にデコードし、結合カウント値の下位2ビット「1、1」を「1、0」にデコードし、結合カウント値の下位2ビット「1、0」を「1、1」にデコードする。   On the other hand, when the value of the edge information flag FLG held in the edge information holding circuit 33 is “0”, as shown in FIG. 5, the decoder 34 uses the lower two bits “0, 0” of the combined count value. ”Is decoded to“ 0, 0 ”, the lower 2 bits“ 0, 1 ”of the combined count value are decoded to“ 0, 1 ”, and the lower 2 bits“ 1, 1 ”of the combined count value are“ 1, 0 ” And the lower two bits “1, 0” of the combined count value are decoded into “1, 1”.

このように、デコード動作の内容が比較的簡単である場合には、結合カウント値の下位2ビットと、エッジ情報保持回路33に保持されているエッジ情報フラグFLGの値とを、IC設計においてDFT(Design For Testability:テスト容易化設計)によるスキャン化の対象とすることが可能となり、出荷選別の際におけるテスト容易性が向上する。   In this way, when the content of the decoding operation is relatively simple, the lower 2 bits of the combined count value and the value of the edge information flag FLG held in the edge information holding circuit 33 are used in DFT in IC design. (Design For Testability) makes it possible to be a target of scanning, and the testability at the time of shipping selection is improved.

本実施形態によれば、図1において、クロック信号に同期して出力信号を変化させるのはDフリップフロップDF31及びDF34のみであり、しかも、サブカウンター32は1ビットのカウント値を生成するだけなので、従来よりも回路規模及び/又は消費電力を低減しながら倍精度の計測を行うカウンター回路を実現することができる。従って、設計容易性の向上、消費電力の削減、及び/又は、コストの低減等において有利となる。   According to this embodiment, in FIG. 1, only the D flip-flops DF31 and DF34 change the output signal in synchronization with the clock signal, and the sub-counter 32 only generates a 1-bit count value. Thus, it is possible to realize a counter circuit that performs double-precision measurement while reducing the circuit scale and / or power consumption as compared with the prior art. Therefore, it is advantageous in improving the ease of design, reducing power consumption, and / or reducing costs.

以下に、図1に示すエッジ情報保持回路の他の回路例について説明する。
図6は、図1に示すエッジ情報保持回路の第2の回路例を示す図である。このエッジ情報保持回路33aは、排他的論理和回路(EOR回路)EX31と、DフリップフロップDF36及びDF37とを含んでいる。EOR回路EX31は、メインカウンターのDフリップフロップDF31の出力信号(反転出力信号)とサブカウンターのDフリップフロップDF34の出力信号(非反転出力信号)との排他的論理和を求める。
Hereinafter, another circuit example of the edge information holding circuit shown in FIG. 1 will be described.
FIG. 6 is a diagram showing a second circuit example of the edge information holding circuit shown in FIG. The edge information holding circuit 33a includes an exclusive OR circuit (EOR circuit) EX31 and D flip-flops DF36 and DF37. The EOR circuit EX31 obtains an exclusive OR of the output signal (inverted output signal) of the D flip-flop DF31 of the main counter and the output signal (non-inverted output signal) of the D flip-flop DF34 of the sub-counter.

DフリップフロップDF36は、カウント開始信号CSTがローレベルに非活性化されている間にリセットされて、出力信号をローレベルとする。カウント開始信号CSTがハイレベルに活性化されると、DフリップフロップDF36は、ゲートクロック信号GCKの立ち上がりエッジに同期してハイレベルの信号をラッチすることにより、出力信号をハイレベルに活性化する。   The D flip-flop DF36 is reset while the count start signal CST is inactivated to the low level, and sets the output signal to the low level. When the count start signal CST is activated to the high level, the D flip-flop DF36 activates the output signal to the high level by latching the high level signal in synchronization with the rising edge of the gate clock signal GCK. .

DフリップフロップDF37のデータ入力端子Dには、EOR回路EX31の出力信号が入力され、DフリップフロップDF37のクロック信号入力端子には、DフリップフロップDF36の出力信号が入力される。DフリップフロップDF37は、カウント開始信号CSTがローレベルに非活性化されている間にリセットされて、出力信号をローレベルとする。カウント開始信号CSTがハイレベルに活性化されると、DフリップフロップDF37は、DフリップフロップDF36の出力信号の立ち上がりエッジに同期してEOR回路EX31の出力信号をラッチすることにより、エッジ情報フラグFLGを生成する。   The output signal of the EOR circuit EX31 is input to the data input terminal D of the D flip-flop DF37, and the output signal of the D flip-flop DF36 is input to the clock signal input terminal of the D flip-flop DF37. The D flip-flop DF37 is reset while the count start signal CST is inactivated to the low level, and sets the output signal to the low level. When the count start signal CST is activated to a high level, the D flip-flop DF37 latches the output signal of the EOR circuit EX31 in synchronization with the rising edge of the output signal of the D flip-flop DF36, whereby the edge information flag FLG Is generated.

図6に示す第2の回路例によれば、DフリップフロップDF37がEOR回路EX31の出力信号をラッチするのは、1つの計測期間において1回だけとなるので、複数回のラッチによる誤動作のおそれがなくなる。   According to the second circuit example shown in FIG. 6, since the D flip-flop DF37 latches the output signal of the EOR circuit EX31 only once in one measurement period, there is a risk of malfunction due to multiple latches. Disappears.

図7は、図1に示すエッジ情報保持回路の第3の回路例を示す図である。このエッジ情報保持回路33bは、カウント開始信号CSTの立ち上がりエッジに同期してゲートクロック信号GCKをラッチするフリップフロップDF38によって構成される。フリップフロップDF38の反転出力端子Qバーから、エッジ情報フラグFLGが出力される。   FIG. 7 is a diagram showing a third circuit example of the edge information holding circuit shown in FIG. The edge information holding circuit 33b includes a flip-flop DF38 that latches the gate clock signal GCK in synchronization with the rising edge of the count start signal CST. The edge information flag FLG is output from the inverting output terminal Q bar of the flip-flop DF38.

カウント開始信号CSTがハイレベルに活性化された後の計測期間においてゲートクロック信号GCKの最初の立ち上がりエッジが最初の立ち下がりエッジよりも前である場合には、カウント開始信号CSTが立ち上がる時点においてゲートクロック信号GCKがローレベルであるので、エッジ情報フラグFLGがハイレベル(「1」)となる。一方、計測期間においてゲートクロック信号GCKの最初の立ち上がりエッジが最初の立ち下がりエッジよりも後である場合には、カウント開始信号CSTが立ち上がる時点においてゲートクロック信号GCKがハイレベルであるので、エッジ情報フラグFLGがローレベル(「0」)となる。   If the first rising edge of the gate clock signal GCK is before the first falling edge in the measurement period after the count start signal CST is activated to the high level, the gate is turned on when the count start signal CST rises. Since the clock signal GCK is at a low level, the edge information flag FLG is at a high level (“1”). On the other hand, when the first rising edge of the gate clock signal GCK is later than the first falling edge in the measurement period, the gate clock signal GCK is at the high level when the count start signal CST rises. The flag FLG becomes low level (“0”).

図7に示す第3の回路例によれば、エッジ情報保持回路の構成を非常に簡単にすることができる。また、DフリップフロップDF38がゲートクロック信号GCKをラッチするのは、1つの計測期間において1回だけであるので、複数回のラッチによる誤動作のおそれがなくなる。   According to the third circuit example shown in FIG. 7, the configuration of the edge information holding circuit can be greatly simplified. Further, since the D flip-flop DF38 latches the gate clock signal GCK only once in one measurement period, there is no possibility of malfunction due to multiple latches.

図8は、図1に示すエッジ情報保持回路の第4の回路例を示す図である。このエッジ情報保持回路33cは、論理和回路(OR回路)35と、セレクター36と、DフリップフロップDF39とを含んでいる。OR回路35は、メインカウンター31から出力されるメインカウント値の最下位ビットCM0〜最上位ビットCM(N−1)を入力して、全てのビットがローレベル(「0」)である場合に出力信号をローレベルとし、少なくとも1つのビットがハイレベル(「1」)である場合に出力信号をハイレベルとする。   FIG. 8 is a diagram showing a fourth circuit example of the edge information holding circuit shown in FIG. The edge information holding circuit 33c includes an OR circuit (OR circuit) 35, a selector 36, and a D flip-flop DF39. The OR circuit 35 inputs the least significant bit CM0 to the most significant bit CM (N−1) of the main count value output from the main counter 31, and when all the bits are at the low level (“0”). The output signal is set to a low level, and the output signal is set to a high level when at least one bit is at a high level (“1”).

セレクター36は、OR回路35の出力信号がローレベル(「0」)である場合に、サブカウンター32のDフリップフロップDF34の出力信号(サブカウント値CS)を選択し、OR回路35の出力信号がハイレベル(「1」)である場合に、DフリップフロップDF39の出力信号を選択する。DフリップフロップDF39は、カウント開始信号CSTがハイレベルに活性化されたときに、ゲートクロック信号GCKの立ち上がりエッジに同期してセレクター36の出力信号をラッチして、反転出力端子Qバーからエッジ情報フラグFLGを出力する。   The selector 36 selects the output signal (subcount value CS) of the D flip-flop DF34 of the subcounter 32 and the output signal of the OR circuit 35 when the output signal of the OR circuit 35 is at a low level (“0”). Is at the high level (“1”), the output signal of the D flip-flop DF39 is selected. The D flip-flop DF39 latches the output signal of the selector 36 in synchronization with the rising edge of the gate clock signal GCK when the count start signal CST is activated to a high level, and receives edge information from the inverted output terminal Q bar. The flag FLG is output.

カウント開始信号CSTがハイレベルに活性化された直後にゲートクロック信号GCKが立ち上がる時点においては、メインカウント値CMが「0」であるので、セレクター36はサブカウント値CSを選択している。従って、計測期間においてゲートクロック信号GCKの最初の立ち上がりエッジが最初の立ち下がりエッジよりも前である場合に、DフリップフロップDF39は、ローレベル(「0」)のサブカウント値CSをラッチして、ハイレベル(「1」)のエッジ情報フラグFLGを出力する。その後、ゲートクロック信号GCKが立ち上がると、メインカウント値が「1」以上となるので、セレクター36は、DフリップフロップDF39の出力信号を選択し、DフリップフロップDF39は、ローレベルの出力信号をラッチして、エッジ情報フラグFLGをハイレベル(「1」)に維持する。   Since the main count value CM is “0” at the time when the gate clock signal GCK rises immediately after the count start signal CST is activated to the high level, the selector 36 selects the sub-count value CS. Therefore, when the first rising edge of the gate clock signal GCK is before the first falling edge in the measurement period, the D flip-flop DF39 latches the low-level (“0”) subcount value CS. The high level (“1”) edge information flag FLG is output. After that, when the gate clock signal GCK rises, the main count value becomes “1” or more, so the selector 36 selects the output signal of the D flip-flop DF39, and the D flip-flop DF39 latches the low-level output signal. Then, the edge information flag FLG is maintained at a high level (“1”).

一方、計測期間においてゲートクロック信号GCKの最初の立ち上がりエッジが最初の立ち下がりエッジよりも後である場合には、DフリップフロップDF39は、ハイレベル(「1」)のサブカウント値CSをラッチして、ローレベル(「0」)のエッジ情報フラグFLGを出力する。その後、ゲートクロック信号GCKが立ち上がると、メインカウント値が「1」以上となるので、セレクター36は、DフリップフロップDF39の出力信号を選択し、DフリップフロップDF39は、ハイレベルの出力信号をラッチして、エッジ情報フラグFLGをローレベル(「0」)に維持する。   On the other hand, when the first rising edge of the gate clock signal GCK is later than the first falling edge in the measurement period, the D flip-flop DF39 latches the high-level (“1”) subcount value CS. Then, the low level (“0”) edge information flag FLG is output. After that, when the gate clock signal GCK rises, the main count value becomes “1” or more, so the selector 36 selects the output signal of the D flip-flop DF39, and the D flip-flop DF39 latches the high-level output signal. Then, the edge information flag FLG is maintained at the low level (“0”).

図8に示す第4の回路例によれば、メインカウント値が「1」以上になると、DフリップフロップDF39から出力されるエッジ情報フラグFLGの値が維持されるので、1つの計測期間においてエッジ情報フラグFLGの値が変化するおそれがなくなる。   According to the fourth circuit example shown in FIG. 8, when the main count value becomes “1” or more, the value of the edge information flag FLG output from the D flip-flop DF39 is maintained. There is no possibility that the value of the information flag FLG changes.

図9は、図1に示すエッジ情報保持回路の第5の回路例を示す図である。このエッジ情報保持回路33dは、インバーター37と、論理積回路(AND回路)38〜40と、DフリップフロップDF40及びDF41とを含んでいる。インバーター37は、ゲートクロック信号GCKを反転する。   FIG. 9 is a diagram showing a fifth circuit example of the edge information holding circuit shown in FIG. The edge information holding circuit 33d includes an inverter 37, AND circuits (AND circuits) 38 to 40, and D flip-flops DF40 and DF41. The inverter 37 inverts the gate clock signal GCK.

AND回路38は、入力端子にゲートクロック信号GCKを入力すると共に、反転入力端子にDフリップフロップDF41の出力信号を入力する。また、AND回路39は、入力端子にゲートクロック信号GCKの反転信号を入力すると共に、反転入力端子にDフリップフロップDF40の出力信号を入力する。さらに、AND回路40は、反転入力端子にDフリップフロップDF40の出力信号を入力すると共に、入力端子にDフリップフロップDF41の出力信号を入力し、出力端子からエッジ情報フラグFLGを出力する。   The AND circuit 38 inputs the gate clock signal GCK to the input terminal and inputs the output signal of the D flip-flop DF41 to the inverting input terminal. The AND circuit 39 inputs an inverted signal of the gate clock signal GCK to an input terminal, and inputs an output signal of the D flip-flop DF40 to an inverted input terminal. Further, the AND circuit 40 inputs the output signal of the D flip-flop DF40 to the inverting input terminal, inputs the output signal of the D flip-flop DF41 to the input terminal, and outputs the edge information flag FLG from the output terminal.

計測期間においてゲートクロック信号GCKの最初の立ち上がりエッジが最初の立ち下がりエッジよりも前である場合には、カウント開始信号CSTがハイレベルに活性化された時点においてゲートクロック信号GCKがローレベルとなっているので、DフリップフロップDF40の出力信号がローレベルに維持され、DフリップフロップDF41の出力信号がハイレベルに活性化される。その結果、エッジ情報フラグFLGがハイレベル(「1」)となる。   When the first rising edge of the gate clock signal GCK is before the first falling edge in the measurement period, the gate clock signal GCK becomes low level when the count start signal CST is activated to high level. Therefore, the output signal of the D flip-flop DF40 is maintained at a low level, and the output signal of the D flip-flop DF41 is activated to a high level. As a result, the edge information flag FLG becomes high level (“1”).

一方、計測期間においてゲートクロック信号GCKの最初の立ち上がりエッジが最初の立ち下がりエッジよりも後である場合には、カウント開始信号CSTがハイレベルに活性化された時点においてゲートクロック信号GCKがハイレベルとなっているので、DフリップフロップDF40の出力信号がハイレベルに活性化され、DフリップフロップDF41の出力信号がローレベルに維持される。その結果、エッジ情報フラグFLGがローレベル(「0」)となる。   On the other hand, when the first rising edge of the gate clock signal GCK is later than the first falling edge in the measurement period, the gate clock signal GCK is at the high level when the count start signal CST is activated to the high level. Therefore, the output signal of the D flip-flop DF40 is activated to a high level, and the output signal of the D flip-flop DF41 is maintained at a low level. As a result, the edge information flag FLG becomes low level (“0”).

図9に示す第5の回路例によれば、カウント開始信号CSTがハイレベルに活性化された後にDフリップフロップDF40及びDF41の出力信号のレベルが一旦決定されると、その後変化することがないので、AND回路40から出力されるエッジ情報フラグFLGの値も維持されて、1つの計測期間においてエッジ情報フラグFLGの値が変化するおそれがなくなる。   According to the fifth circuit example shown in FIG. 9, once the levels of the output signals of the D flip-flops DF40 and DF41 are determined after the count start signal CST is activated to a high level, there is no subsequent change. Therefore, the value of the edge information flag FLG output from the AND circuit 40 is also maintained, and there is no possibility that the value of the edge information flag FLG changes in one measurement period.

10 ゲートカウンター、 20 計測期間設定回路、 30 計測カウンター、 31 メインカウンター、 32 サブカウンター、 33、33a〜33d エッジ情報保持回路、 34 デコーダー、 35 OR回路、 36 セレクター、 37インバーター、 38〜40 AND回路、 DF21〜DF41 Dフリップフロップ、 LF31 ラッチフリップフロップ、 EX31 EOR回路   10 gate counter, 20 measurement period setting circuit, 30 measurement counter, 31 main counter, 32 sub counter, 33, 33a-33d edge information holding circuit, 34 decoder, 35 OR circuit, 36 selector, 37 inverter, 38-40 AND circuit DF21 to DF41 D flip-flop, LF31 latch flip-flop, EX31 EOR circuit

Claims (4)

設定された計測期間においてクロック信号のパルス数をカウントするカウンター回路であって、
前記計測期間において、前記クロック信号の立ち上がりエッジに同期してパルス数をカウントすることにより、第1カウント値を生成する第1の回路と、
前記計測期間において、前記クロック信号の立ち下がりエッジに同期してパルス数をカウントすることにより、第2カウント値を生成する第2の回路と、
前記計測期間における前記クロック信号の立ち上がりエッジと立ち下がりエッジとの前後関係を表すフラグ情報を保持する第3の回路と、
前記フラグ情報に従って前記第1カウント値及び前記第2カウント値をデコードすることにより、前記クロック信号の周期に対して倍精度の計測カウント値を出力する第4の回路と、
を具備するカウンター回路。
A counter circuit that counts the number of pulses of a clock signal in a set measurement period,
A first circuit that generates a first count value by counting the number of pulses in synchronization with a rising edge of the clock signal in the measurement period;
A second circuit for generating a second count value by counting the number of pulses in synchronization with a falling edge of the clock signal in the measurement period;
A third circuit that holds flag information indicating a front-rear relationship between a rising edge and a falling edge of the clock signal in the measurement period;
A fourth circuit for outputting a measurement count value of double precision with respect to a cycle of the clock signal by decoding the first count value and the second count value according to the flag information;
A counter circuit comprising:
前記第1カウント値又は前記第2カウント値は、Nビット(Nは2以上の整数)のカウント値であり、
Nビットの前記第1カウント値と前記第2カウント値の最下位ビットとを結合した(N+1)ビットの第1結合カウント値、又は、Nビットの前記第2カウント値と前記第1カウント値の最下位ビットとを結合した(N+1)ビットの第2結合カウント値に基づいて、前記第4の回路が、前記第1結合カウント値又は前記第2結合カウント値の少なくとも下位2ビットをデコードする、請求項1記載のカウンター回路。
The first count value or the second count value is a count value of N bits (N is an integer of 2 or more),
(N + 1) -bit first combined count value obtained by combining the first count value of N bits and the least significant bit of the second count value, or the second count value of N bits and the first count value Based on the second combined count value of (N + 1) bits combined with the least significant bit, the fourth circuit decodes at least the lower 2 bits of the first combined count value or the second combined count value. The counter circuit according to claim 1.
前記第4の回路が、前記計測期間における前記クロック信号の最初の立ち上がりエッジが最初の立ち下がりエッジよりも前である場合に、前記第1結合カウント値の下位2ビット「0、0」を「0、0」にデコードし、下位2ビット「1、0」を「0、1」にデコードし、下位2ビット「1、1」を「1、0」にデコードし、下位2ビット「0、1」を「−1、1」にデコードし、前記計測期間における前記クロック信号の最初の立ち上がりエッジが最初の立ち下がりエッジよりも後である場合に、前記第1結合カウント値の下位2ビット「0、0」を「0、0」にデコードし、下位2ビット「0、1」を「0、1」にデコードし、下位2ビット「1、1」を「1、0」にデコードし、下位2ビット「1、0」を「1、1」にデコードする、請求項2記載のカウンター回路。   When the first rising edge of the clock signal in the measurement period is before the first falling edge, the fourth circuit sets the lower 2 bits “0, 0” of the first combined count value to “ 0, 0 ”, lower 2 bits“ 1, 0 ”are decoded to“ 0, 1 ”, lower 2 bits“ 1, 1 ”are decoded to“ 1, 0 ”, and lower 2 bits“ 0, 0 ”are decoded. 1 ”is decoded into“ −1, 1 ”, and when the first rising edge of the clock signal in the measurement period is later than the first falling edge, the lower two bits“ 1 ”of the first combined count value “0, 0” is decoded to “0, 0”, the lower 2 bits “0, 1” are decoded to “0, 1”, the lower 2 bits “1, 1” are decoded to “1, 0”, Decode lower 2 bits “1, 0” to “1, 1”, Counter circuit of Motomeko 2 described. 前記第1の回路が、前記クロック信号の立ち上がりエッジに同期して出力信号を変化させる第1のフリップフロップを含み、
前記第2の回路が、前記クロック信号の立ち下がりエッジに同期して出力信号を変化させる第2のフリップフロップを含み、
前記第3の回路が、前記第1のフリップフロップの出力信号と前記第2のフリップフロップの出力信号との排他的論理和を求める排他的論理和回路と、前記計測期間における前記クロック信号の立ち上がりエッジに同期して前記排他的論理和回路の出力信号をラッチする第3のフリップフロップとを含む、請求項1〜3のいずれか1項記載のカウンター回路。
The first circuit includes a first flip-flop that changes an output signal in synchronization with a rising edge of the clock signal;
The second circuit includes a second flip-flop that changes an output signal in synchronization with a falling edge of the clock signal;
The third circuit includes an exclusive OR circuit that obtains an exclusive OR of the output signal of the first flip-flop and the output signal of the second flip-flop, and a rising edge of the clock signal in the measurement period. The counter circuit according to claim 1, further comprising a third flip-flop that latches an output signal of the exclusive OR circuit in synchronization with an edge.
JP2011029486A 2011-02-15 2011-02-15 Counter circuit Withdrawn JP2012169891A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011029486A JP2012169891A (en) 2011-02-15 2011-02-15 Counter circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011029486A JP2012169891A (en) 2011-02-15 2011-02-15 Counter circuit

Publications (1)

Publication Number Publication Date
JP2012169891A true JP2012169891A (en) 2012-09-06

Family

ID=46973576

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011029486A Withdrawn JP2012169891A (en) 2011-02-15 2011-02-15 Counter circuit

Country Status (1)

Country Link
JP (1) JP2012169891A (en)

Similar Documents

Publication Publication Date Title
JP4806631B2 (en) Timing generator and semiconductor test equipment
KR102224031B1 (en) A circuit delay monitoring apparatus and method
US10491201B2 (en) Delay circuit, count value generation circuit, and physical quantity sensor
JPWO2006038468A1 (en) Phase difference measurement circuit
JP2007120945A (en) Noise measuring circuit, noise measuring method used for the same, lsi provided with the measuring circuit
JP6481533B2 (en) Digitally controlled oscillator circuit
US9166843B2 (en) Digital pulse width generator and method for generating digital pulse width
US8786347B1 (en) Delay circuits for simulating delays based on a single cycle of a clock signal
CN113949378A (en) Time-to-digital converter with small area and low power consumption
JPH1073681A (en) Time measuring system and its time measuring method
JP2004125574A (en) Testing apparatus and testing process
JP2019068366A (en) A/d conversion circuit
JP2009272858A (en) A/d conversion circuit
JP2013205092A (en) Time measuring device
JP2012169891A (en) Counter circuit
US20100201409A1 (en) Frequency Divider Circuit
JP2006157849A (en) Frequency-dividing circuit, and semiconductor integrated circuit equipped with the frequency-dividing circuit
JP3803664B2 (en) Random number generation circuit, semiconductor integrated circuit, IC card and information terminal device
JP2015171151A (en) Time base including oscillator, frequency divider circuit and clocking pulse inhibition circuit
KR102655138B1 (en) time measurement circuit
JP5854003B2 (en) Digitally controlled oscillator and variable frequency oscillator
JP2013024857A (en) Speed measuring method and system therefor
JP2005233975A (en) Delay measuring device
JP5307532B2 (en) Frequency change measurement method and apparatus
JP2019124478A (en) Time measuring circuit

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20140513