JP3338294B2 - Counter circuit - Google Patents

Counter circuit

Info

Publication number
JP3338294B2
JP3338294B2 JP18071796A JP18071796A JP3338294B2 JP 3338294 B2 JP3338294 B2 JP 3338294B2 JP 18071796 A JP18071796 A JP 18071796A JP 18071796 A JP18071796 A JP 18071796A JP 3338294 B2 JP3338294 B2 JP 3338294B2
Authority
JP
Japan
Prior art keywords
signal
counter
frequency
count
divided
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP18071796A
Other languages
Japanese (ja)
Other versions
JPH1028047A (en
Inventor
成一 冨田
一彦 大橋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP18071796A priority Critical patent/JP3338294B2/en
Publication of JPH1028047A publication Critical patent/JPH1028047A/en
Application granted granted Critical
Publication of JP3338294B2 publication Critical patent/JP3338294B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、カウンタ回路に係
わり、例えばマイクロコンピュータ集積回路等で制御す
るシステムで用いられ、あるいはマイクロコンピュータ
集積回路装置に内蔵されて用いられる低消費電力を要求
されるカウンタ回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a counter circuit, for example, used in a system controlled by a microcomputer integrated circuit or the like, or used in a microcomputer integrated circuit device and requiring low power consumption. Circuit.

【0002】[0002]

【従来の技術】一般に分周器を有するMCU(マイクロ
コントロールユニット)において、カウンタには一つの
クロック信号しか供給されていない。図21は、従来の
コンペア式アップカウンタの回路図を示す。図22は、
図21のカウンタ回路により2進数で1101(10進
数で13)をカウントする場合のタイミングチャートを
示す。
2. Description of the Related Art Generally, in an MCU (micro control unit) having a frequency divider, only one clock signal is supplied to a counter. FIG. 21 is a circuit diagram of a conventional compare up counter. FIG.
FIG. 22 is a timing chart when counting 1101 in binary (13 in decimal) by the counter circuit in FIG. 21.

【0003】図21に示す回路は、一般的な4ビットの
アップカウンタ回路70と、カウントすべき数を保持す
るレジスタ20と、それぞれフリップフロップ71ない
し74のQ出力であるQA,QB,QC,QDとレジス
タ20の保持しているデータとを比較し、両者が一致す
る場合にカウント終了信号を出力する、エクスクルシブ
ノアゲートとアンドゲートにより構成される比較回路7
5とにより構成される。アップカウンタ回路70は、4
段のフリップフロップ71ないし74で構成されてい
る。各フリップフロップ71ないし74のチップイネー
ブル端子CEにはカウントイネーブル信号が供給され、
リセット端子Rにはリセット信号が供給され、クロック
端子Cにはクロック信号fが供給されている。
The circuit shown in FIG. 21 is a general 4-bit up-counter circuit 70, a register 20 for holding the number to be counted, and Q outputs QA, QB, QC, Q of flip-flops 71 to 74, respectively. A comparison circuit 7 composed of an exclusive NOR gate and an AND gate for comparing the QD with the data held in the register 20 and outputting a count end signal when they match.
And 5. The up counter circuit 70
It comprises flip-flops 71 to 74 of stages. A count enable signal is supplied to a chip enable terminal CE of each of the flip-flops 71 to 74.
The reset signal is supplied to the reset terminal R, and the clock signal f is supplied to the clock terminal C.

【0004】次にこのカウンタ回路の動作を説明する。
はじめに、レジスタ20にカウントするデータ1101
がセットされる。続いて、リセット信号によりすべての
フリップフロップのQ出力は0にリセットされ、カウン
トイネーブル信号がフリップフロップのカウントイネー
ブル端子CEに供給されてカウントが開始される。クロ
ック信号fは反転されて、フリップフロップ71のクロ
ック入力端子に供給される。クロック信号fの1つ目の
立ち下がりでフリップフロップ71のQ出力QAは0か
ら1になる。クロック信号fの次の立ち下がりでQAは
1から0に立ち下がり、QBが反転し0から1になる。
クロック信号fの3回目の立ち下がりでQAは再び0か
ら1に立ち上がる。このとき、QBは反転せずそのまま
1を保持する。このように、一つ下位のフリップフロッ
プのデータが1から0へ立ち下がったときに、そのフリ
ップフロップの保持するデータが反転し、カウントアッ
プしていく。フリップフロップのデータが1101にな
ると、レジスタ20の保持データとフリップフロップの
各ビットが一致するので、比較回路75はカウント終了
信号を出力する。
Next, the operation of this counter circuit will be described.
First, data 1101 to be counted in the register 20
Is set. Subsequently, the reset signals reset the Q outputs of all the flip-flops to 0, supply the count enable signal to the count enable terminal CE of the flip-flop, and start counting. The clock signal f is inverted and supplied to the clock input terminal of the flip-flop 71. At the first falling of the clock signal f, the Q output QA of the flip-flop 71 changes from 0 to 1. At the next falling of the clock signal f, QA falls from 1 to 0, and QB inverts from 0 to 1.
QA rises again from 0 to 1 at the third falling of the clock signal f. At this time, QB holds 1 without being inverted. In this way, when the data of the next lower flip-flop falls from 1 to 0, the data held by that flip-flop is inverted and counts up. When the data of the flip-flop becomes 1101, the data held in the register 20 matches each bit of the flip-flop, so that the comparison circuit 75 outputs a count end signal.

【0005】また、図23は、複数段のTフリップフロ
ップを用いた従来の同期式カウンタを示す。この回路の
構成を以下に説明する。クロック信号fの反転信号は、
すべてのフリップフロップのクロック端子Cに供給され
る。また、カウントイネーブル信号は、1段目のフリッ
プフロップ90のカウントイネーブル端子CEとアンド
ゲート91の一方の入力端子に供給され、フリップフロ
ップ90のQ出力端子はアンドゲート91の他方の入力
端子に接続される。アンドゲート91の出力端子は、次
段のフリップフロップのカウントイネーブル端子とアン
ドゲートの入力端子に接続される。こうした構成構成が
繰り返されてカウンタが形成される。この回路におい
て、クロック信号の立ち下がり時に前段までのデータの
積が1であれば、そのフリップフロップは反転動作す
る。よって、この回路も段数をnとすると2のn乗進の
カウンタとして機能する。
FIG. 23 shows a conventional synchronous counter using a plurality of stages of T flip-flops. The configuration of this circuit will be described below. The inverted signal of the clock signal f is
It is supplied to clock terminals C of all flip-flops. The count enable signal is supplied to the count enable terminal CE of the first-stage flip-flop 90 and one input terminal of the AND gate 91, and the Q output terminal of the flip-flop 90 is connected to the other input terminal of the AND gate 91. Is done. The output terminal of the AND gate 91 is connected to the count enable terminal of the next-stage flip-flop and the input terminal of the AND gate. Such a configuration is repeated to form a counter. In this circuit, if the product of the data up to the preceding stage is 1 at the time of falling of the clock signal, the flip-flop performs an inversion operation. Therefore, this circuit also functions as a counter of 2 raised to the power of n, where n is the number of stages.

【0006】[0006]

【発明が解決しようとする課題】従来のカウンタ回路で
は、図22に示すように下位ビットのフリップフロップ
は、何度も反転を繰り返すため、電力を多く消費する。
また、図23に示した複数段の同期式カウンタにおいて
は、すべてのフリップフロップにクロック信号fを供給
するため、クロック配線92の容量は大きく、しかもク
ロックが反転を繰り返すので消費電力が大きくなってし
まう。
In the conventional counter circuit, as shown in FIG. 22, the flip-flop of the lower bit repeatedly inverts many times, so that a large amount of power is consumed.
In the multi-stage synchronous counter shown in FIG. 23, since the clock signal f is supplied to all flip-flops, the capacity of the clock wiring 92 is large, and the power consumption is large because the clock is repeatedly inverted. I will.

【0007】以上の問題は、オーバーフロー式カウン
タ、ダウンカウンタ等のすべてのカウンタについてもあ
てはまる。本発明は、上記課題に鑑み、原振クロック信
号およびこのクロック信号を分周した信号をカウンタの
クロック信号として用いることで、フリップフロップに
入力されるクロック信号及びフリップフロップが反転す
る回数を減らし、カウンタ回路の低消費電力化を図るこ
とを目的とする。
[0007] The above problems also apply to all counters such as overflow counters and down counters. In view of the above problems, the present invention reduces the number of inversions of a clock signal input to a flip-flop and a flip-flop by using a source clock signal and a signal obtained by dividing the clock signal as a clock signal of a counter, It is an object to reduce power consumption of a counter circuit.

【0008】[0008]

【課題を解決するための手段】図21に示す従来の回路
において、QAはクロック信号fの2分周のクロック信
号であり、QBはクロック信号fの4分周のクロック信
号と同一である。すなわち、フリップフロップ72は2
分周信号でカウントされ、フリップフロップ73は4分
周信号でカウントされ、フリップフロップ74は8分周
クロックでカウントされていることと同じである。よっ
て、10進数で12を数える場合、4分周信号でフリッ
プフロップ73、74を用いて3カウントさせれば済
む。
In the conventional circuit shown in FIG. 21, QA is a clock signal obtained by dividing the frequency of the clock signal f by two, and QB is the same as a clock signal obtained by dividing the frequency of the clock signal f by four. That is, the flip-flop 72 has 2
This is the same as counting by the frequency-divided signal, flip-flop 73 is counted by the frequency-divided signal, and flip-flop 74 is counted by the frequency-divided clock. Therefore, when counting 12 in decimal, it is only necessary to perform 3 counts using the flip-flops 73 and 74 with the divide-by-4 signal.

【0009】すなわち、本発明は、上記課題を解決する
ため、原振クロック信号を入力し、相異なる1個以上の
自然数について原振クロック信号の2の自然数乗分の1
の周波数の分周信号をそれぞれ出力する分周器と、分周
器が出力する原振クロック信号、1個以上の分周信号の
いずれかをカウントし、カウントすべき数をカウントし
た場合にカウント終了信号を出力する複数のカウンタ
と、複数のカウンタの各々がカウントすべき数を保持す
るレジスタと、複数のカウンタにカウントイネーブル信
号を供給するカウントイネーブル回路と、原振クロック
信号、分周信号、および複数のカウンタのカウント終了
信号を入力し、最小周波数の分周信号をカウントするカ
ウンタのカウント終了信号が未終了を表す場合は、まず
最小周波数の分周信号をカウントするカウンタに最小周
波数の分周信号を供給し、それ以外のカウンタには何等
クロック信号を供給せず、最小周波数の分周信号をカウ
ントするカウンタのカウント終了信号が終了を表し、2
番目に小さい周波数の分周信号をカウントするカウンタ
のカウント終了信号が未終了を表す場合は、2番目に小
さい周波数の分周信号をカウントするカウンタに2番目
に小さい周波数の分周信号を供給し、それ以外のカウン
タには何等クロック信号を供給せず、以下同様に繰り返
して、複数のカウンタのカウント終了信号がいずれも終
了を表すようになった場合は、複数のカウンタのいずれ
にも何等クロック信号を供給せず、カウント終了信号を
出力する制御回路とを具備する。
That is, in order to solve the above-mentioned problem, the present invention receives an original clock signal, and outputs one or more different natural numbers by dividing the original clock signal by a natural number raised to the power of two.
A frequency divider that outputs a frequency-divided signal of each frequency, an original clock signal output by the frequency divider, and one or more frequency-divided signals are counted. A plurality of counters for outputting an end signal, a register for holding a number to be counted by each of the plurality of counters, a count enable circuit for supplying a count enable signal to the plurality of counters, a source clock signal, a frequency-divided signal, If the count end signal of the counter that counts the frequency-divided signal of the minimum frequency indicates incomplete, the counter that counts the frequency-divided signal of the minimum frequency is first input to the counter that counts the frequency-divided signal of the minimum frequency. Of the counter that counts the frequency-divided signal of the minimum frequency without supplying any clock signal to the other counters. Count end signal represents the end, 2
If the count end signal of the counter that counts the frequency-divided signal of the second lowest frequency indicates incomplete, the frequency-divided signal of the second lowest frequency is supplied to the counter that counts the frequency-divided signal of the second lowest frequency. If no clock signal is supplied to the other counters, the same operation is repeated in the same manner, and if any of the count end signals of the plurality of counters indicates the end, any clock signal is supplied to any of the plurality of counters. A control circuit that supplies a signal and outputs a count end signal.

【0010】[0010]

【発明の実施の形態】以下、図面を参照して本発明の実
施例を詳細に説明する。図2は、本発明のカウンタ回路
を用いたMCUチップの構成例を示す。MCUチップ1
4は、CPU10と、CPU10により制御される周辺
回路ユニット12と、CPU10にカウント数を出力す
るカウンタ11と、原振クロック信号fを分周し、原振
クロック信号及び分周信号を周辺回路ユニット12とカ
ウンタ11に供給する分周器13とにより構成される。
従来は、分周信号はカウンタ11には供給されていなか
ったのに対して、本実施例では新たにカウンタ11に供
給されていることに特徴がある。
Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 2 shows a configuration example of an MCU chip using the counter circuit of the present invention. MCU chip 1
Reference numeral 4 denotes a CPU, a peripheral circuit unit 12 controlled by the CPU 10, a counter 11 for outputting a count to the CPU 10, a frequency divider for the original clock signal f, and a peripheral circuit unit for dividing the original clock signal and the frequency-divided signal. It comprises a frequency divider 13 and a frequency divider 13 which supplies the frequency to the counter 11.
Conventionally, the frequency-divided signal has not been supplied to the counter 11, but the present embodiment is characterized in that it is newly supplied to the counter 11.

【0011】図1は、本発明の第1の実施例を図式的に
示す。n,m,kは、0<k<m<nを満たす自然数と
する。分周器101は、原振クロック信号fを入力し、
原振クロック周波数の2k 分の1の周波数の分周信号f
/2k と、原振クロック周波数の2m 分の1の周波数の
分周信号f/2m を出力する一般的な分周器である。
FIG. 1 schematically shows a first embodiment of the present invention. n, m, and k are natural numbers satisfying 0 <k <m <n. The frequency divider 101 receives the original clock signal f,
A frequency-divided signal f having a frequency of 1/2 k of the original clock frequency
/ 2 k and a general frequency divider that outputs a frequency-divided signal f / 2 m having a frequency of 1/2 m of the original clock frequency.

【0012】下位ビットカウンタ群104は、制御回路
101が出力するf出力をカウントする。カウンタ10
4は、レジスタ107が保持するnビットデータの0ビ
ット目からk−1ビット目までの下位ビットデータより
なるカウントすべき数のカウントを終了すると、下位ビ
ット群カウント終了信号を出力する。
The lower bit counter group 104 counts the f output output from the control circuit 101. Counter 10
4 outputs a lower bit group count end signal when it finishes counting the number of lower bit data from the 0th bit to the (k-1) th bit of the n-bit data held by the register 107.

【0013】中位ビットカウンタ群105は、制御回路
101が出力するf/2k 出力をカウントする。カウン
タ105は、レジスタ107が保持するnビットデータ
のkビット目からm−1ビット目までの中位ビットデー
タよりなるカウントすべき数のカウントを終了すると、
中位ビット群カウント終了信号を出力する。
The middle bit counter group 105 counts the f / 2 k output output from the control circuit 101. When the counter 105 finishes counting the number to be counted consisting of middle-order bit data from the k-th bit to the (m-1) -th bit of the n-bit data held in the register 107,
Outputs the middle bit group count end signal.

【0014】上位ビットカウンタ群106は、制御回路
101が出力するf/2m 出力をカウントする。カウン
タ106は、レジスタ107が保持するnビットデータ
のmビット目からn−1ビット目までの上位ビットデー
タよりなるカウントすべき数のカウントを終了すると、
上位ビット群カウント終了信号を出力する。
The upper bit counter group 106 counts the output of f / 2 m output from the control circuit 101. When the counter 106 finishes counting the number to be counted, which includes upper bit data from the m-th bit to the (n-1) th bit of the n-bit data held in the register 107,
Outputs the upper bit group count end signal.

【0015】レジスタ107は、カウントしたいnビッ
トデータを保持し、そのビットデータの0ビット目から
k−1ビット目までのデータと、kビット目からm−1
ビット目までのデータと、mビット目からn−1ビット
目までのデータをそれぞれカウンタ104、105、1
06がカウントすべき数として、カウンタ104、10
5、106に供給する。
The register 107 holds n-bit data to be counted, and stores data from the 0th bit to the (k-1) th bit of the bit data and m-1 from the kth bit.
The data up to the bit and the data from the m-th bit to the (n-1) th bit are respectively counted by counters 104, 105, 1
06 are the numbers to be counted,
5, 106.

【0016】カウントイネーブル回路103は、外部か
ら供給されるカウントイネーブル信号を入力し、カウン
タ104、105、106に同一のカウントイネーブル
信号を供給する。
The count enable circuit 103 receives an externally supplied count enable signal and supplies the same count enable signal to the counters 104, 105, and 106.

【0017】制御回路102は、原振クロック信号f
と、分周器101から供給される分周信号f/2k 及び
分周信号f/2m と、上位ビット群カウント終了信号、
中位ビット群カウント終了信号、下位ビット群カウント
終了信号を入力し、上位、中位および下位ビット群カウ
ント終了信号の状態に応じて、カウンタ104、10
5、106にそれぞれ供給するf出力、f/2k 出力、
f/2m 出力を制御し、あるいはカウント終了信号を出
力する。
The control circuit 102 controls the original clock signal f
A frequency-divided signal f / 2 k and a frequency-divided signal f / 2 m supplied from the frequency divider 101, an upper bit group count end signal,
The middle bit group count end signal and the lower bit group count end signal are input, and the counters 104, 10 and 10 are set according to the state of the upper, middle and lower bit group count end signals.
F output, f / 2 k output respectively supplied to 5, 106
It controls the f / 2 m output or outputs a count end signal.

【0018】本実施例の動作を以下説明する。制御回路
102は、上位ビットカウンタ群106のカウント終了
信号が未終了を表す場合、上位ビットカウンタ群106
に分周信号f/2m を供給し、それ以外のカウンタ10
4、105には何等クロック信号を供給しない。よっ
て、カウンタ106のみカウント動作を行う。
The operation of this embodiment will be described below. When the count end signal of the higher-order bit counter group 106 indicates that the count has not been completed, the control circuit 102
Supplies the frequency-divided signal f / 2 m to the other counter 10
No clock signal is supplied to 4, 105. Therefore, only the counter 106 performs the counting operation.

【0019】上位ビットカウンタ群106は、レジスタ
107が保持する上位ビットカウンタがカウントすべき
数のカウントを終了すると、上位ビット群カウント終了
信号を終了を表すようにして制御回路102に供給す
る。
When the upper bit counter held by the register 107 has finished counting the number to be counted, the upper bit counter group 106 supplies an upper bit group count end signal to the control circuit 102 to indicate the end.

【0020】次に、上位ビットカウント終了信号が終了
を表し、中位ビットカウンタ群105のカウント終了信
号が未終了を表す場合、中位ビットカウンタ群105に
分周信号f/2k を供給し、それ以外のカウンタ10
4、106には何等クロック信号を供給しない。その結
果、カウンタ105のみカウント動作を行う。
Next, when the higher-order bit count end signal indicates the end and the count end signal of the middle-order bit counter group 105 indicates the end, the frequency-divided signal f / 2 k is supplied to the middle-order bit counter group 105. , Other counter 10
No clock signal is supplied to 4 and 106. As a result, only the counter 105 performs the counting operation.

【0021】以下同様に繰り返して、カウンタ104、
105、106のカウント終了信号がいずれも終了を表
すようになった場合は、カウンタ104、105、10
6のいずれにも何等クロック信号を供給せず、カウント
終了信号を出力する。
Hereinafter, the counter 104 is repeated similarly.
When the count end signals of 105 and 106 indicate the end, the counters 104, 105, 10
6 does not supply any clock signal, and outputs a count end signal.

【0022】このように、本実施例では、先に上位ビッ
トカウンタ群から順次カウント動作させ、あるカウンタ
が動作しているときは他のカウンタのカウント動作を停
止させるので、カウンタを構成する例えばフリップフロ
ップの反転回数が減少し、消費電力を低くすることが可
能になる。
As described above, in this embodiment, the counting operation is sequentially performed from the upper bit counter group first, and when a certain counter is operating, the counting operation of the other counter is stopped. It is possible to reduce the number of inversions of the loop and reduce power consumption.

【0023】図3は、本発明のコンペア式アップカウン
タの実施例を示す。この実施例は、図1に示した実施例
の変形例である。図4は、図3におけるフリップフロッ
プ22ないし25のQ出力であるQA、QB、QC、Q
Dと、原振クロック信号fと、その4分周信号f/4
と、上位ビット一致信号と、下位ビット一致信号と、カ
ウント終了信号のタイミングチャートを示す。図4のf
出力及びf/4出力において、破線は制御回路に入力さ
れる信号を表し、実線は制御回路が出力する信号を表
す。以下のタイミングチャートにおいても破線は同様の
意味の信号を表す。
FIG. 3 shows an embodiment of the compare type up counter of the present invention. This embodiment is a modification of the embodiment shown in FIG. FIG. 4 shows the Q outputs QA, QB, QC and Q of the flip-flops 22 to 25 in FIG.
D, the original clock signal f, and its divide-by-4 signal f / 4
5 shows a timing chart of an upper bit match signal, a lower bit match signal, and a count end signal. F of FIG.
In the output and f / 4 output, a broken line indicates a signal input to the control circuit, and a solid line indicates a signal output from the control circuit. In the following timing charts, broken lines indicate signals having the same meaning.

【0024】まず、このカウンタの構成を説明する。分
周器13は、原振クロック信号fを入力し、原振クロッ
ク周波数の4分の1の周波数の4分周信号f/4を出力
する一般的な分周器である。
First, the configuration of this counter will be described. The frequency divider 13 is a general frequency divider that receives the original clock signal f and outputs a quarter frequency signal f / 4 having a quarter of the original clock frequency.

【0025】カウンタ21は、2段のTフリップフロッ
プ22、23からなる下位カウンタ21aと、2段のT
フリップフロップ24、25からなる上位カウンタ21
bからなる。フリップフロップ22のクロック入力端子
には制御回路29から出力された原振クロック信号fの
反転信号が供給される。フリップフロップ23のクロッ
ク入力端子Cにはフリップフロップ22のQ出力信号の
反転信号が供給される。フリップフロップ24のクロッ
ク入力端子Cには制御回路29から出力された4分周信
号f/4の反転信号が供給される。フリップフロップ2
5のクロック入力端子Cにはフリップフロップ24のQ
出力信号の反転信号が供給される。
The counter 21 has a lower counter 21a comprising two-stage T flip-flops 22 and 23, and a two-stage T flip-flop 22 and 23.
Upper counter 21 composed of flip-flops 24 and 25
b. The inverted signal of the original clock signal f output from the control circuit 29 is supplied to the clock input terminal of the flip-flop 22. The inverted signal of the Q output signal of the flip-flop 22 is supplied to the clock input terminal C of the flip-flop 23. The inverted signal of the frequency-divided signal f / 4 output from the control circuit 29 is supplied to the clock input terminal C of the flip-flop 24. Flip-flop 2
5, the clock input terminal C of the flip-flop 24
An inverted signal of the output signal is supplied.

【0026】レジスタ20は、カウントすべき数を指定
するデータを保持する一般的なレジスタである。カウン
トイネーブル回路28は、外部から供給されるカウント
イネーブル信号と4分周信号を入力し、フリップフロッ
プ22ないし25のチップイネーブル端子CEにカウン
トイネーブル信号を供給する。この回路は、例えば、外
部からのカウントイネーブル信号がカウントイネーブル
を示し、かつ4分周信号が立ち下がるときに、カウンタ
21にカウントイネーブル信号を供給し保持する。
The register 20 is a general register for holding data designating the number to be counted. The count enable circuit 28 receives a count enable signal and a divide-by-4 signal supplied from the outside and supplies the count enable signal to the chip enable terminals CE of the flip-flops 22 to 25. This circuit supplies and holds the count enable signal to the counter 21 when, for example, an external count enable signal indicates the count enable and the divide-by-4 signal falls.

【0027】上位ビット比較回路26は、フリップフロ
ップ25のQ出力信号QDとレジスタ20の最上位ビッ
トのデータを入力しるエクスクルシブノアゲート17と
フリップフロップ24のQ出力信号QCとレジスタ20
の上から2ビット目のデータが入力されるエクスクルシ
ブノアゲート18と両ゲートの出力が入力されるアンド
ゲート19より構成される。この回路26は、フリップ
フロップ24、25のQ出力信号QC,QDとそれに対
応するレジスタ20の上位2ビットのデータを比較し、
2ビットともに一致する場合に上位ビット一致信号を1
にし、それ以外の場合は0にして制御回路29に出力す
る。
The upper bit comparing circuit 26 is provided with an exclusive NOR gate 17 for inputting the Q output signal QD of the flip-flop 25 and the data of the most significant bit of the register 20, the Q output signal QC of the flip-flop 24 and the register 20.
An exclusive NOR gate 18 to which data of the second bit from the top is inputted and an AND gate 19 to which outputs of both gates are inputted. This circuit 26 compares the Q output signals QC and QD of the flip-flops 24 and 25 with the corresponding upper two bits of the register 20,
When both bits match, the upper bit match signal is set to 1
Otherwise, it is set to 0 and output to the control circuit 29.

【0028】下位ビット比較回路27は、上位ビット比
較回路26と同様の構成であり、フリップフロップ2
2、23のQ出力QA,QBとそれに対応するレジスタ
20の下位2ビットのデータが入力され、両者を比較し
て2ビットともに一致する場合に下位ビット一致信号を
1にし、それ以外の場合は0にして制御回路29に出力
する。
The lower bit comparison circuit 27 has the same configuration as the upper bit comparison circuit 26,
The Q outputs QA and QB of 2 and 23 and the corresponding lower 2 bits of data in the register 20 are input, and the two are compared. If both 2 bits match, the lower bit match signal is set to 1; It is set to 0 and output to the control circuit 29.

【0029】制御回路29は、原振クロック信号fと、
分周器13から供給される分周信号f/4と、上位ビッ
ト一致信号と、下位ビット一致信号が入力され、上位お
よび下位ビット一致信号の状態に応じて、カウンタ21
に供給するクロックを切り替え、あるいはカウント終了
信号を出力する。
The control circuit 29 outputs the original clock signal f,
A frequency-divided signal f / 4, an upper bit match signal, and a lower bit match signal supplied from the frequency divider 13 are input, and a counter 21 is provided according to the state of the upper and lower bit match signals.
, Or outputs a count end signal.

【0030】図5は、制御回路29の回路例を示す。以
下、この回路構成を説明する。上位ビット一致信号は、
アンドゲート31とアンドゲート35の一方入力端子に
供給され、インバータ32を介してアンドゲート34の
一方の入力端子に供給される。下位ビット一致信号は、
アンドゲート31の他方の入力端子に供給され、インバ
ータ33を介してアンドゲート35の他方の入力端子に
供給される。原振クロック信号fは、アンドゲート35
の他方の入力端子に供給される。また、4分周信号f/
4は、アンドゲート34の他方の入力端子に供給され
る。アンドゲート31の出力は、カウント終了信号とな
る。アンドゲート34の出力端子は、フリップフロップ
24のクロック入力端子に接続される。アンドゲート3
5の出力端子は、フリップフロップ22のクロック入力
端子に接続される。以下、アンドゲート34、35の出
力信号をそれぞれf/4出力信号、f出力信号と呼ぶ。
FIG. 5 shows a circuit example of the control circuit 29. Hereinafter, this circuit configuration will be described. The upper bit match signal is
It is supplied to one input terminal of an AND gate 31 and an AND gate 35 and supplied to one input terminal of an AND gate 34 via an inverter 32. The lower bit match signal is
The signal is supplied to the other input terminal of the AND gate 31 and supplied to the other input terminal of the AND gate 35 via the inverter 33. The original clock signal f is supplied to the AND gate 35.
Is supplied to the other input terminal. Also, the divide-by-4 signal f /
4 is supplied to the other input terminal of the AND gate 34. The output of the AND gate 31 becomes a count end signal. The output terminal of the AND gate 34 is connected to the clock input terminal of the flip-flop 24. And Gate 3
5 is connected to the clock input terminal of the flip-flop 22. Hereinafter, the output signals of the AND gates 34 and 35 will be referred to as f / 4 output signal and f output signal, respectively.

【0031】次に、この回路の動作を説明する。図6
は、図5の回路の真理値表を示す。図6に示すように、
上位ビット一致信号が0である場合は、f/4出力信号
は4分周信号であり、f出力信号とカウント終了信号は
0である。上位ビット一致信号が1であり、下位ビット
一致信号が0である場合は、f/4出力信号とカウント
終了信号は0であり、f出力信号は原振クロック信号で
ある。上位ビット一致信号と下位ビット一致信号がとも
に1である場合は、f/4出力信号とf出力信号はとも
に0であり、カウント終了信号が1となる。
Next, the operation of this circuit will be described. FIG.
Shows a truth table of the circuit of FIG. As shown in FIG.
When the upper bit match signal is 0, the f / 4 output signal is a divide-by-4 signal, and the f output signal and the count end signal are 0. When the upper bit match signal is 1 and the lower bit match signal is 0, the f / 4 output signal and the count end signal are 0, and the f output signal is the original clock signal. When both the upper bit match signal and the lower bit match signal are 1, the f / 4 output signal and the f output signal are both 0, and the count end signal is 1.

【0032】以下、図3のカウンタ回路の動作を説明す
る。はじめに、レジスタ20にカウントするデータ、例
えば2進数で1101が書き込まれる。このときカウン
タ21はリセットされ、その出力は0000になる。4
分周信号が立ち下がると、カウントイネーブル回路22
はカウントイネーブル信号を出力し、カウンタ21にカ
ウントを開始させる。カウンタ21の上位2ビットがレ
ジスタ20の上位2ビットのデータと不一致の場合、図
6の真理値表から分かるように、制御回路29はフリッ
プフロップ22にクロックfを供給せず、フリップフロ
ップ24に4分周信号を供給する。その結果、上位カウ
ンタ21bがカウントを開始し、下位カウンタ21aは
カウントを停止する。
The operation of the counter circuit shown in FIG. 3 will be described below. First, data to be counted, for example, 1101 in a binary number is written to the register 20. At this time, the counter 21 is reset and its output becomes 0000. 4
When the frequency-divided signal falls, the count enable circuit 22
Outputs a count enable signal and causes the counter 21 to start counting. When the upper two bits of the counter 21 do not match the data of the upper two bits of the register 20, the control circuit 29 does not supply the clock f to the flip-flop 22, but supplies the clock f to the flip-flop 24, as can be seen from the truth table of FIG. Provides a divide-by-4 signal. As a result, the upper counter 21b starts counting, and the lower counter 21a stops counting.

【0033】上位カウンタ21bの2ビットの出力がレ
ジスタ20の上位2ビットと一致すると、上位ビット比
較回路26は、上位ビット一致信号を1にして出力す
る。上位2ビットが一致し、下位2ビットが不一致であ
る場合、制御回路29は、フリップフロップ24への4
分周信号の供給を止め、カウンタ21の上位2ビットの
カウント動作を停止させるとともに、原振クロック信号
fをフリップフロップ22に供給し、下位カウンタ21
aのカウント動作を開始させる。
When the two-bit output of the high-order counter 21b matches the high-order two bits of the register 20, the high-order bit comparison circuit 26 sets the high-order bit match signal to 1 and outputs it. If the upper 2 bits match and the lower 2 bits do not match, the control circuit 29 sends the 4
The supply of the frequency-divided signal is stopped, the counting operation of the upper two bits of the counter 21 is stopped, and the original clock signal f is supplied to the flip-flop 22 so that the lower counter 21
The count operation of a is started.

【0034】下位カウンタ21aの2ビットの出力とレ
ジスタ20の下位2ビットが一致すると、上位ビット一
致信号と下位ビット一致信号がいずれも1となるため、
カウント終了信号が1となり、カウントが終了される。
When the two-bit output of the lower counter 21a and the lower two bits of the register 20 match, both the upper bit match signal and the lower bit match signal become 1, so that
The count end signal becomes 1, and the count ends.

【0035】このように、本発明では、先にカウンタ2
1の上位2ビットを4分周信号によりカウントさせ、そ
の間下位2ビットのカウント動作を停止させるので、フ
リップフロップの反転回数は減少し、消費電力を低くす
ることが可能になる。
As described above, in the present invention, the counter 2
Since the upper two bits of 1 are counted by the divide-by-4 signal, and the counting operation of the lower two bits is stopped during this period, the number of inversions of the flip-flop is reduced, and the power consumption can be reduced.

【0036】図7は、本発明のオーバーフロー式アップ
カウンタの実施例を示す。この回路の構成を以下に説明
する。以下の図面において、すでに説明した要素と同一
の要素には同一の符号を付し、説明を省略する。
FIG. 7 shows an embodiment of the overflow type up counter of the present invention. The configuration of this circuit will be described below. In the following drawings, the same elements as those already described are denoted by the same reference numerals, and description thereof will be omitted.

【0037】レジスタ40は、カウント数を指示するデ
ータを保持する4ビットの第1のレジスタ40aと桁上
げデータを保持する2ビットの第2のレジスタ40bと
により構成され、レジスタ40a,40bは、それぞれ
保持しているデータをカウンタ21のフリップフロップ
22ないし25のデータ入力端子Dおよびオーバーフロ
ーフリップフロップ46、47のデータ入力端子Dに出
力し、これらのデータはそれぞれのフリップフロップの
Q端子に出力される。
The register 40 includes a 4-bit first register 40a for holding data indicating a count number and a 2-bit second register 40b for holding carry data. The registers 40a and 40b The held data is output to the data input terminals D of the flip-flops 22 to 25 of the counter 21 and the data input terminals D of the overflow flip-flops 46 and 47, and these data are output to the Q terminal of each flip-flop. You.

【0038】フリップフロップ22ないし25よりなる
カウンタ21、およびカウントイネーブル回路28は、
図3で説明したものと同一のものである。上位ビットオ
ーバーフローフリップフロップ46は、Tフリップフロ
ップであり、フリップフロップ25のQ出力の反転信号
がクロック入力端子に入力され、チップイネーブル端子
CEにカウントイネーブル回路28の出力が入力され、
フリップフロップ25の桁上げがあるとき1であり、な
いとき0である上位ビットオーバーフロー信号を制御回
路29に出力する。
The counter 21 composed of flip-flops 22 to 25 and the count enable circuit 28
This is the same as that described in FIG. The upper bit overflow flip-flop 46 is a T flip-flop. The inverted signal of the Q output of the flip-flop 25 is input to the clock input terminal, and the output of the count enable circuit 28 is input to the chip enable terminal CE.
An upper bit overflow signal which is 1 when there is a carry of the flip-flop 25 and is 0 when there is no carry is outputted to the control circuit 29.

【0039】下位ビットオーバーフローフリップフロッ
プ47は、Tフリップフロップであり、フリップフロッ
プ23のQ出力の反転信号がクロック入力端子に入力さ
れ、チップイネーブル端子CEにカウントイネーブル回
路28の出力が入力され、フリップフロップ23の桁上
げがあるとき1であり、ないとき0である下位ビットオ
ーバーフロー信号を制御回路29に出力する。
The lower bit overflow flip-flop 47 is a T flip-flop. The inverted signal of the Q output of the flip-flop 23 is input to the clock input terminal, the output of the count enable circuit 28 is input to the chip enable terminal CE, A lower bit overflow signal which is 1 when there is a carry of the loop 23 and 0 when there is no carry is outputted to the control circuit 29.

【0040】制御回路29は、オーバーフローフリップ
フロップ46、47の出力信号に応じてカウンタ21に
供給するクロックを切り替え、あるいはカウント終了信
号を出力してカウントを終了させる。
The control circuit 29 switches the clock supplied to the counter 21 in accordance with the output signals of the overflow flip-flops 46 and 47, or outputs a count end signal to end the count.

【0041】図8は、各フリップフロップの出力QA,
QB,QC,QDと、原振クロック信号fと、4分周信
号f/4と、上位ビットオーバーフロー信号と、下位ビ
ットオーバーフロー信号と、カウント終了信号のタイミ
ングチャートを示す。
FIG. 8 shows the outputs QA,
A timing chart of QB, QC, QD, the original clock signal f, the divide-by-4 signal f / 4, the upper bit overflow signal, the lower bit overflow signal, and the count end signal is shown.

【0042】以下、本発明のカウンタ回路の動作を説明
する。一般に、オーバーフロー方式アップカウンタで
は、2進数で1101をカウントする場合、1101の
2の補数0011からカウントアップしていき、オーバ
ーフローした時点でカウントを終了させる。本実施例で
は、カウンタ21を上位カウンタ21bと下位カウンタ
21aに分割して、カウント動作させる。したがって、
カウントする数を上位2ビットと下位2ビットに分け
る。上位2ビット11の補数は01であり、その補数に
よる桁上げは0である。また、下位2ビット01の補数
は11であり、その補数による桁上げは0となる。よっ
て、レジスタ40aには補数0111が、レジスタ40
bには桁上げデータ00が保持される。カウント開始前
に、01が上位カウンタ21bに、11が下位カウンタ
21aに書き込まれ、上位の桁上げ0と下位の桁上げ0
がそれぞれオーバーフローフリップフロップ46、47
に書き込まれる。
Hereinafter, the operation of the counter circuit according to the present invention will be described. Generally, when counting 1101 in a binary number, the overflow type up counter counts up from the two's complement 0011 of 1101, and ends counting when the overflow occurs. In the present embodiment, the counter 21 is divided into an upper counter 21b and a lower counter 21a to perform a counting operation. Therefore,
The number to be counted is divided into upper 2 bits and lower 2 bits. The complement of the upper two bits 11 is 01, and the carry by the complement is 0. The complement of the lower two bits 01 is 11, and the carry by the complement is 0. Therefore, the complement 0111 is stored in the register 40a,
b carries carry data 00. Before the start of counting, 01 is written to the upper counter 21b, 11 is written to the lower counter 21a, and upper carry 0 and lower carry 0 are written.
Are overflow flip-flops 46 and 47, respectively.
Is written to.

【0043】外部からのカウントイネーブル信号がカウ
ントイネーブルを表し、4分周信号が立ち下がると、カ
ウントイネーブル回路28はカウントイネーブル信号を
フリップフロップ22ないし25、46、47に出力
し、カウンタ21によるカウントが開始される。上位ビ
ットオーバーフローフリップフロップ46の出力信号が
0であると、制御回路29は、フリップフロップ24に
4分周信号を供給し、上位カウンタ21bの2ビットの
出力はカウントアップされる。この間、フリップフロッ
プ22にクロックは供給されず、下位カウンタ21aの
出力は11を保持する。
The count enable signal from the outside indicates the count enable, and when the divide-by-4 signal falls, the count enable circuit 28 outputs the count enable signal to the flip-flops 22 to 25, 46, and 47, and the counter 21 counts. Is started. When the output signal of the upper bit overflow flip-flop 46 is 0, the control circuit 29 supplies a 4-divided signal to the flip-flop 24, and the 2-bit output of the upper counter 21b is counted up. During this time, no clock is supplied to the flip-flop 22, and the output of the lower counter 21a holds 11.

【0044】上位カウンタ21bが2進数で11をカウ
ントすると、フリップフロップ25のQ出力QDが1か
ら0に立ち下がり、上位ビットオーバーフローフリップ
フロップ46のQ出力である上位ビットオーバーフロー
信号は0から1に立ち上がる。下位ビットオーバーフロ
ー信号は0であるから、制御回路29は、上位カウンタ
21bへのクロック信号の供給を停止し、フリップフロ
ップ22に原振クロック信号fを供給し下位カウンタ2
1aのカウント動作を開始させる。
When the upper counter 21b counts 11 in binary, the Q output QD of the flip-flop 25 falls from 1 to 0, and the upper bit overflow signal, which is the Q output of the upper bit overflow flip-flop 46, changes from 0 to 1. stand up. Since the lower bit overflow signal is 0, the control circuit 29 stops supplying the clock signal to the upper counter 21b, supplies the original clock signal f to the flip-flop 22, and
The count operation of 1a is started.

【0045】下位カウンタ21aが2進数で01をカウ
ントすると、下位ビットオーバーフロー信号は0から1
になる。オーバーフロー信号はいずれも1となるので、
制御回路29は、カウント終了信号を1にして、カウン
ト動作を終了する。
When the lower counter 21a counts 01 in binary, the lower bit overflow signal changes from 0 to 1
become. Since both overflow signals are 1,
The control circuit 29 sets the count end signal to 1 and ends the count operation.

【0046】本実施例でも、先に上位2ビットを4分周
信号でカウントさせ、その間下位2ビットのカウントを
停止させるので、カウンタのフリップフロップの反転回
数は減少し、低消費電力を実現できる。
In this embodiment as well, the upper 2 bits are first counted by the divide-by-4 signal, and the counting of the lower 2 bits is stopped during that time. Therefore, the number of inversions of the flip-flop of the counter is reduced, and low power consumption can be realized. .

【0047】図9は、本発明のダウンカウンタの実施例
を示す。まず、本発明のダウンカウンタの構成を説明す
る。レジスタ40aは、カウントすべき数を保持し、そ
れをカウンタ51にセットする一般的なレジスタであ
る。
FIG. 9 shows an embodiment of the down counter of the present invention. First, the configuration of the down counter of the present invention will be described. The register 40a is a general register that holds the number to be counted and sets it in the counter 51.

【0048】ダウンカウンタ51は、クロック入力端子
Cに制御回路29が出力する原振クロック信号fの反転
信号が供給されるTフリップフロップ52とクロック入
力端子Cにフリップフロップ52のQ出力端子が接続さ
れるTフリップフロップ53よりなる下位カウンタ51
aと、クロック入力端子Cに制御回路29が出力する4
分周信号f/4の反転信号が供給されるTフリップフロ
ップ54と、クロック入力端子Cにフリップフロップ5
4のQ出力端子が接続されるTフリップフロップ55よ
りなる上位カウンタ51bとにより構成される。フリッ
プフロップ52ないし55のチップイネーブル端子CE
にはカウントイネーブル回路28からカウントイネーブ
ル信号が供給される。
The down-counter 51 has a clock input terminal C connected to a T flip-flop 52 to which an inverted signal of the original clock signal f output from the control circuit 29 is supplied, and a clock input terminal C connected to the Q output terminal of the flip-flop 52. Counter 51 comprising a T flip-flop 53
a, and 4 output from the control circuit 29 to the clock input terminal C.
A T flip-flop 54 to which an inverted signal of the divided signal f / 4 is supplied, and a flip-flop 5 connected to the clock input terminal C.
4 and a higher-order counter 51b composed of a T flip-flop 55 connected to the Q output terminal of the fourth. Chip enable terminals CE of flip-flops 52 to 55
Is supplied with a count enable signal from the count enable circuit 28.

【0049】上位ビットカウント終了判別回路56は、
フリップフロップ54、55のQ端子QC,QDがそれ
ぞれ入力端子に接続され、その出力を上位ビットカウン
ト終了信号として制御回路29に供給するノアゲートよ
りなる。上位カウンタがダウンカウントして上位カウン
タの出力が00になると、ノアゲートの出力は1とな
り、それ以外の場合は0を出力する。
The upper bit count end determination circuit 56
The Q terminals QC and QD of the flip-flops 54 and 55 are connected to input terminals, respectively, and are formed by NOR gates that supply the output to the control circuit 29 as an upper bit count end signal. When the upper counter counts down and the output of the upper counter becomes 00, the output of the NOR gate becomes 1; otherwise, 0 is output.

【0050】下位ビットカウント終了判別回路57は、
フリップフロップ52、53のQ端子QA,QBがそれ
ぞれ入力端子に接続され、その出力を下位ビットカウン
ト終了信号として制御回路29に供給するノアゲートよ
りなる。下位カウントがダウンカウントして下位カウン
タの出力が00になると、ノアゲートの出力は1とな
り、それ以外の場合は0である。
The lower bit count end determination circuit 57
The Q terminals QA and QB of the flip-flops 52 and 53 are connected to input terminals, respectively, and are formed by NOR gates that supply the output to the control circuit 29 as a lower bit count end signal. When the lower count is down counted and the output of the lower counter becomes 00, the output of the NOR gate becomes 1, otherwise it is 0.

【0051】制御回路29は、上位ビットカウント終了
信号および下位ビットカウント終了信号に応じてカウン
タ51に供給するクロックを切り替え、あるいはカウン
ト終了信号を出力してカウントを終了させる。
The control circuit 29 switches the clock supplied to the counter 51 in response to the upper bit count end signal and the lower bit count end signal, or outputs a count end signal to end the count.

【0052】図10は、フリップフロップ52ないし5
5のQ出力であるQAないしQDと、原振クロック信号
fと、その4分周信号f/4と、上位ビットカウント終
了信号と、下位ビットカウント終了信号と、カウント終
了信号のタイミングチャートを示す。
FIG. 10 shows flip-flops 52 to 5
5 shows a timing chart of Q outputs QA to QD, an original clock signal f, a divide-by-4 signal f / 4, an upper bit count end signal, a lower bit count end signal, and a count end signal. .

【0053】以下、この回路の動作を説明する。はじめ
に、レジスタ40aにカウントしたいデータ、例えば2
進数で1101が入力され、それぞれ対応するフリップ
フロップ52ないし55に書き込まれる。外部からカウ
ントイネーブル信号が供給され、かつ4分周信号が立ち
下がるとカウントイネーブル回路28はカウントイネー
ブル信号をフリップフロップ52ないし55のカウント
イネーブル端子CEに出力する。
Hereinafter, the operation of this circuit will be described. First, the data to be counted in the register 40a, for example, 2
1101 is input as a base number and written into the corresponding flip-flops 52 to 55. When a count enable signal is supplied from outside and the frequency-divided signal falls, the count enable circuit 28 outputs the count enable signal to the count enable terminals CE of the flip-flops 52 to 55.

【0054】上位ビットカウント終了信号がカウント未
終了を意味する0であると、制御回路29は、フリップ
フロップ54に4分周信号を供給し、上位カウンタ51
bはダウンカウント動作を行う。この間、カウンタ51
の下位2ビットにはクロックが供給されず、それらの出
力は01を保持する。
When the upper bit count end signal is 0 indicating that the count is not completed, the control circuit 29 supplies a 4-divided signal to the flip-flop 54, and the upper counter 51
b performs a down-count operation. During this time, the counter 51
The clock is not supplied to the lower two bits of, and their outputs hold 01.

【0055】QC,QDが00になると、上位ビットカ
ウント終了信号は、0から1になる。下位ビットカウン
ト終了信号は0であるので、制御回路29は、フリップ
フロップ54に何等クロックを供給せず、フリップフロ
ップ52に原振クロック信号fを供給する。
When QC and QD become 00, the upper bit count end signal changes from 0 to 1. Since the lower bit count end signal is 0, the control circuit 29 supplies the original clock signal f to the flip-flop 52 without supplying any clock to the flip-flop 54.

【0056】QA,QBが00になると、上位ビットカ
ウント終了信号と下位ビットカウント終了信号がともに
1になるので、制御回路29はカウント終了信号を1に
して、カウントを終了させる。
When QA and QB become 00, both the high-order bit count end signal and the low-order bit count end signal become 1, so that the control circuit 29 sets the count end signal to 1 and ends the count.

【0057】このように、先に上位2ビットを4分周信
号でカウントし、その間下位2ビットを停止させるの
で、フリップフロップの反転回数は減少し、低消費電力
を実現できる。
As described above, the upper two bits are first counted by the divide-by-4 signal, and the lower two bits are stopped during that period, so that the number of flip-flop inversions is reduced and low power consumption can be realized.

【0058】以上、4ビットのカウンタで、MCU内に
分周器が存在し、原振クロック信号とその4分周信号が
使われている場合についての実施例を説明したが、この
他のカウンタについても本発明を適用できる。ビット数
が大きいほど、また高分周の分周信号を用いるほど、消
費電力を減らすことができる。
In the above, the embodiment in which the frequency divider is present in the MCU and the original clock signal and the four-frequency-divided signal are used in the 4-bit counter has been described. The present invention can also be applied to The power consumption can be reduced as the number of bits is increased and the frequency-divided signal having a high frequency division is used.

【0059】例えば、10進数で2515カウントする
とき、従来は最下位ビットは2515回反転を繰り返す
ことになるが、4分周信号を用いると本発明では最下位
ビットの反転回数は2515−4×628=3回で済
む。
For example, when counting 2515 in decimal, the least significant bit conventionally repeats inversion 2515 times. However, when a divide-by-4 signal is used, the number of inversions of the least significant bit is 2515-4 × in the present invention. 628 = 3 times.

【0060】図3に示した実施例では、4分周信号の立
ち下がりでカウントを開始させた。この場合は前のカウ
ントが終了した後、次のカウントを開始するまで最大で
原振クロック信号で3クロック分待つことになるが、消
費電力が低下する利点の方が大きい。
In the embodiment shown in FIG. 3, counting is started at the falling edge of the divide-by-4 signal. In this case, after the previous count is completed, a maximum of three clocks of the original clock signal must be waited until the next count is started, but the advantage of lower power consumption is greater.

【0061】以上説明した実施例では、4分周クロック
の立ち下がりをカウント開始のタイミングとしたが、4
分周クロックの位相と関係なくカウントを開始すること
も可能である。その場合、カウント開始時に4分周以下
のクロック信号の状態を調べ、それらのクロック信号の
状態から4分周信号の直近の立ち下がり時点からカウン
ト開始時までの原振クロックのカウント数を求める。そ
の後、レジスタが保持するカウントすべき数にそのカウ
ント数を加え、あるいは、そのカウント数の補数をさら
にカウンタにセットして、カウント動作を開始させる。
In the embodiment described above, the falling edge of the divide-by-4 clock is used as the count start timing.
It is also possible to start counting regardless of the phase of the divided clock. In this case, at the start of counting, the states of the clock signals whose frequency is divided by four or less are checked, and the count number of the original clock from the latest falling point of the divided-by-4 signal to the start of counting is determined from the state of those clock signals. Thereafter, the count is added to the count to be counted held in the register, or the complement of the count is set in the counter, and the counting operation is started.

【0062】以下、図3に示したような原振クロック信
号と4分周信号が入力される4ビットのコンペア式アッ
プカウンタにおいて、2進数で1101、すなわち10
進数で13を数えたい場合について説明する。
Hereinafter, in the 4-bit compare type up-counter to which the original clock signal and the divide-by-4 signal as shown in FIG.
A case where it is desired to count 13 in base will be described.

【0063】まず、上述したカウント数をレジスタが保
持するデータに加える方法を述べる。この場合のカウン
タの構成は、図3に示した構成に、さらに分周器の2分
周信号f/2と4分周信号f/4が入力され、直近の4
分周信号の立ち下がり時点から現時点までの原振クロッ
ク信号数を求め、その値とレジスタ20が保持するデー
タを加えた値をレジスタ20にセットする手段が加えら
れたものである。またレジスタが保持するデータに加算
を行うと桁上げが生じることがあるので、レジスタとカ
ウンタのビット数はそれぞれ1ビット増やされる。図1
1は、この方法を用いた場合のタイミングチャートを示
す。ここで、QA,QB,QC,QD,QEは低ビット
側から並べたカウンタの出力であり、QA,QBを下位
ビット群と呼び、QC,QD,QEを上位ビット群と呼
ぶ。また、QA’、QB’、QC’、QD’、QE’は
低ビット側から並べたレジスタの保持データを表す。
First, a method of adding the above-described count number to the data held in the register will be described. In this case, the configuration of the counter is the same as the configuration shown in FIG. 3 except that the frequency-divided signal f / 2 and the frequency-divided signal f / 4 of the frequency divider are further input.
A means for obtaining the number of original clock signals from the falling point of the frequency-divided signal to the present time, and setting the value obtained by adding the value to the data held by the register 20 to the register 20 is added. If addition is performed on the data held in the register, a carry may occur. Therefore, the number of bits of each of the register and the counter is increased by one bit. FIG.
FIG. 1 shows a timing chart when this method is used. Here, QA, QB, QC, QD, and QE are outputs of counters arranged from the lower bit side, and QA and QB are called lower bit groups, and QC, QD, and QE are called upper bit groups. QA ', QB', QC ', QD', and QE 'represent data held in the registers arranged from the low bit side.

【0064】次に、この回路の動作を説明する。図11
に示すようにカウント開始直後の4分周クロックf/4
は1であり、2分周クロックf/2は1である。よっ
て、4分周信号の直近の立ち下がり時点からクロック開
始時までの原振クロックfのカウント数は2進数11、
すなわち10進数で3であることが分かる。2進数11
をレジスタに保持されているデータに加えると、レジス
タのデータは2進数で10000となる。その後の動作
は図3の実施例と同じである。
Next, the operation of this circuit will be described. FIG.
As shown in the figure, the frequency-divided clock f / 4 immediately after the start of counting.
Is 1 and the frequency-divided clock f / 2 is 1. Therefore, the count number of the original clock f from the latest falling point of the divide-by-4 signal to the start of the clock is binary 11,
That is, it is understood that the decimal number is 3. Binary 11
Is added to the data held in the register, the data in the register becomes 10000 in binary. Subsequent operations are the same as in the embodiment of FIG.

【0065】次に、上述した原クロック数の補数をと
り、カウンタにセットする方法を説明する。この場合の
カウンタの構成は、図3に示した構成に、さらに、分周
器の2分周信号f/2と4分周信号f/4を入力し、直
近の4分周信号の立ち下がり時点から現時点までの原振
クロック信号数を求め、その値の補数を下位カウンタに
出力するセット回路を付加したものである。さらに、下
位カウンタは、3ビットであり、セット回路が出力した
データをその出力にセットする。下位ビット比較回路
は、下位カウンタの下位2ビットの出力とレジスタの下
位2ビットとが一致し、かつ下位カウンタの最上位ビッ
トが0である場合に、下位ビット一致信号を1にする回
路構成となっている。
Next, a method of taking the complement of the above-mentioned original clock number and setting it in the counter will be described. The configuration of the counter in this case is the same as the configuration shown in FIG. 3 except that a frequency-divided signal f / 2 and a frequency-divided signal f / 4 of the frequency divider are input, and the falling edge of the latest frequency-divided signal of four. A set circuit for obtaining the number of original clock signals from the time point to the present time and outputting the complement of the value to the lower counter is added. Further, the lower counter is 3 bits, and sets the data output by the set circuit to its output. A lower bit comparison circuit configured to set a lower bit match signal to 1 when the output of the lower 2 bits of the lower counter matches the lower 2 bits of the register and the most significant bit of the lower counter is 0; Has become.

【0066】以下、このカウンタ回路の動作を説明す
る。図12は、カウンタに補数をセットする方法におけ
るタイミングチャートを示す。下位カウンタの出力を低
ビット側からQA,QB,QB’とし、上位カウンタの
出力を低ビット側からQC,QDとする。カウント開始
直後、4分周信号f/4は1であり、2分周信号f/2
も1であるから、セット回路は、直近の4分周信号の立
ち下がりからカウント開始時まで原振クロック信号で2
進数11クロック分であることを認識し、その補数01
と符号1を合わせた101を下位カウンタにセットす
る。これは、上位カウンタのカウント動作中に行われ、
その後の動作は図3に説明した実施例と同じである。
Hereinafter, the operation of this counter circuit will be described. FIG. 12 shows a timing chart in a method of setting a complement to the counter. The output of the lower counter is QA, QB, QB 'from the lower bit side, and the output of the upper counter is QC, QD from the lower bit side. Immediately after the count is started, the frequency-divided signal f / 4 is 1, and the frequency-divided signal f / 2 is 1.
Is also 1, the set circuit calculates the original clock signal from the falling edge of the latest divided-by-4 signal to the start of counting.
It recognizes that it is 11 clocks in base, and its complement 01
Is set to the lower counter. This is performed during the counting operation of the upper counter,
Subsequent operations are the same as those of the embodiment described with reference to FIG.

【0067】これらの最大分周クロックの立ち下がりを
待たずにカウントを開始させる方法は、オーバーフロー
式カウンタやダウンカウンタにも適用できる。これらの
方法では、実際の回路の素子数が増えるが、大きな分周
信号を使うと、その分周クロックの立ち下がりを待たな
いで次のカウントを始めることができるという利点があ
る。
The method of starting counting without waiting for the fall of the maximum frequency-divided clock can also be applied to an overflow counter or a down counter. Although these methods increase the number of elements in an actual circuit, using a large frequency-divided signal has the advantage that the next count can be started without waiting for the fall of the frequency-divided clock.

【0068】また、上記の実施例では、カウンタへ供給
される信号は、原振クロック信号とその4分周信号であ
ったが、3種以上のクロック信号を使用することも可能
である。
In the above-described embodiment, the signals supplied to the counter are the original clock signal and its four-frequency-divided signal. However, three or more clock signals can be used.

【0069】以下、図3と同様のコンペア式アップカウ
ンタにおいて、3種のクロック信号をカウントする実施
例を説明する。このカウンタ回路は、分周器と、カウン
タと、カウントイネーブル回路と、レジスタと、下位ビ
ット比較回路と、中位ビット比較回路と、上位ビット比
較回路とにより構成される。
An embodiment in which three types of clock signals are counted in a compare-type up counter similar to that shown in FIG. 3 will be described below. This counter circuit includes a frequency divider, a counter, a count enable circuit, a register, a lower bit comparison circuit, a middle bit comparison circuit, and an upper bit comparison circuit.

【0070】分周器は、原振クロック信号fを入力し、
その4分周信号f/4と16分周信号f/16を制御回
路に出力する。カウンタは、制御回路のf出力信号をカ
ウントする2ビットの下位カウンタと、制御回路のf/
4出力信号をカウントする2ビットの中位カウンタと、
制御回路のf/16出力をカウントする4ビットの上位
カウンタより構成される。低ビット側から並べた下位カ
ウンタの出力QA,QBを下位ビット群、低ビット側か
ら並べた中位カウンタの出力QC,QDを中位ビット
群、低ビット側から並べた上位カウンタの出力QE,Q
F,QG,QHを上位ビット群と呼ぶことにする。
The frequency divider receives the original clock signal f,
The 4-divided signal f / 4 and the 16-divided signal f / 16 are output to the control circuit. The counter has a 2-bit lower counter that counts the f output signal of the control circuit, and the f /
A 2-bit middle counter for counting four output signals,
It comprises a 4-bit high-order counter that counts the f / 16 output of the control circuit. The lower counter outputs QA and QB arranged from the lower bit side are lower bit groups, the middle counter outputs QC and QD arranged from the lower bit side are middle bit groups, and the upper counter outputs QE and QE are arranged from the lower bit side. Q
F, QG, and QH will be referred to as an upper bit group.

【0071】カウントイネーブル回路は、外部からのカ
ウントイネーブル信号と16分周信号とを入力し、外部
からのカウントイネーブル信号がカウントイネーブルを
表し、かつ16分周信号が立ち下がった時にカウントイ
ネーブル信号をカウンタのカウントイネーブル端子に供
給する。
The count enable circuit receives an external count enable signal and a 16-frequency-divided signal, and outputs the count enable signal when the external count-enable signal indicates the count enable and when the 16-frequency-divided signal falls. It is supplied to the count enable terminal of the counter.

【0072】レジスタは、カウントすべき数を保持する
8ビットのレジスタである。上位ビット比較回路は、カ
ウンタの上位ビット群出力とそれに対応するレジスタの
上位4ビットとを比較し、両者が一致するときは上位ビ
ット群一致信号を1にして出力し、それ以外は0を出力
する。
The register is an 8-bit register that holds the number to be counted. The high-order bit comparison circuit compares the high-order bit output of the counter with the high-order 4 bits of the register corresponding thereto, sets the high-order bit group coincidence signal to 1 when both match, and outputs 0 otherwise. I do.

【0073】中位ビット比較回路は、カウンタの中位ビ
ット群出力とそれに対応するレジスタの中位2ビットと
を比較し、両者が一致するときは中位ビット群一致信号
を1にして出力し、それ以外は0を出力する。
The middle-order bit comparing circuit compares the middle-order bit group output of the counter with the middle-order two bits of the corresponding register, and when they match, sets the middle-order bit group match signal to 1 and outputs it. Otherwise, 0 is output.

【0074】下位ビット比較回路は、カウンタの下位ビ
ット群出力とそれに対応するレジスタの下位4ビットと
を比較し、両者が一致するときは下位ビット群一致信号
を1にして出力し、それ以外は0を出力する。
The lower bit comparison circuit compares the output of the lower bit group of the counter with the lower 4 bits of the corresponding register, and when they match, sets the lower bit group match signal to 1 and outputs the signal. Outputs 0.

【0075】制御回路は、原振クロック信号、4分周信
号、16分周信号、を入力し、上位ビット群一致信号、
中位ビット群一致信号、下位ビット群一致信号に応じ
て、上位カウンタ、中位カウンタ、下位カウンタに供給
するクロック信号を制御し、ビット群一致信号がすべて
1となったときカウント終了信号を出力して、カウント
動作を終了させる回路である。
The control circuit inputs the original clock signal, the divide-by-4 signal, and the divide-by-16 signal, and outputs
Controls the clock signal to be supplied to the upper counter, middle counter, and lower counter according to the middle bit group match signal and the low bit group match signal, and outputs a count end signal when all the bit group match signals become 1. And terminates the counting operation.

【0076】図13は、この場合の制御回路の一例を示
す。上位ビット群一致信号は、アンドゲート61、6
6、67に入力され、またインバータ62を介してアン
ドゲート65に入力される。中位ビット群一致信号は、
アンドゲート61に入力され、インバータ63を介して
アンドゲート66に入力され、アンドゲート67に入力
される。下位ビット群一致信号は、アンドゲート61に
入力され、インバータ64を介してアンドゲート67に
入力される。また、分周器から出力される原振クロック
信号fはアンドゲート67に入力され、分周器から出力
される4分周信号f/4はアンドゲート66に入力さ
れ、分周器から出力される16分周信号f/16はアン
ドゲート65に入力される。アンドゲート61の出力
は、カウント終了信号となる。アンドゲート67,6
6,65の出力は、それぞれ原振クロック信号出力、4
分周信号出力、16分周信号出力としてカウンタに供給
される。
FIG. 13 shows an example of the control circuit in this case. The upper bit group match signal is supplied to the AND gates 61 and 6
6 and 67, and to the AND gate 65 via the inverter 62. The middle bit group match signal is
The signal is input to the AND gate 61, input to the AND gate 66 via the inverter 63, and input to the AND gate 67. The lower bit group coincidence signal is input to the AND gate 61, and is input to the AND gate 67 via the inverter 64. The original clock signal f output from the frequency divider is input to an AND gate 67, and the frequency-divided signal f / 4 output from the frequency divider is input to the AND gate 66 and output from the frequency divider. The 16-divided signal f / 16 is input to the AND gate 65. The output of the AND gate 61 becomes a count end signal. AND gate 67, 6
6, 65 outputs are the original clock signal output, 4
It is supplied to the counter as a divided signal output and a 16 divided signal output.

【0077】次に、本カウンタ回路の動作を説明する。
図14は、2進数で0010001(10進数で35)
をカウントする場合のタイミングチャートを示す。ま
ず、カウントするデータがレジスタにセットされ、16
分周クロックが立ち下がるとカウントが開始される。こ
のとき上位ビット群一致信号は0であるから上位カウン
タに16分周クロックが供給され、カウントを行う。こ
のとき、中位カウンタ、下位カウンタにはクロックは供
給されず、カウントは停止したままである。上位ビット
群一致信号が1になると、中位ビット群一致信号は1で
あるから、下位ビット群にのみ原振クロック信号を供給
し、他の上位及び中位カウントには何等クロック信号を
供給しない。すべてのビット群一致信号が1になると、
本制御回路は、カウント終了信号を1にして出力する。
Next, the operation of the present counter circuit will be described.
FIG. 14 shows 0010001 in binary (35 in decimal)
4 shows a timing chart when counting is performed. First, data to be counted is set in a register, and 16
When the divided clock falls, counting is started. At this time, since the upper bit group coincidence signal is 0, the frequency-divided 16 clock is supplied to the upper counter and counting is performed. At this time, no clock is supplied to the middle counter and the lower counter, and the counting is stopped. When the upper bit group coincidence signal becomes 1, the middle bit group coincidence signal is 1, so that the original clock signal is supplied only to the lower bit group and no clock signal is supplied to the other upper and middle counts. . When all bit group match signals become 1,
This control circuit sets the count end signal to 1 and outputs it.

【0078】この方法は、上述のオーバーフロー式カウ
ンタやダウンカウンタ等についても適用できる。さら
に、図3、図7、図9に示した実施例のカウンタはフリ
ップフロップを4個使用しているのに対し、本実施例
は、2個のフリップフロップを使用し、上位2ビット分
をカウントさせた後、クロックを切り替えて、残りの下
位2ビット分をカウントさせることも可能である。図1
5は、本発明のコンペア式アップカウンタの実施例を示
す。図16は、図15におけるタイミングチャートを示
す。
This method can also be applied to the above-mentioned overflow counter, down counter and the like. Further, while the counters of the embodiments shown in FIGS. 3, 7 and 9 use four flip-flops, this embodiment uses two flip-flops and stores the upper two bits. After counting, the clock can be switched to count the remaining lower 2 bits. FIG.
5 shows an embodiment of the compare type up counter of the present invention. FIG. 16 shows a timing chart in FIG.

【0079】この回路は、原振クロック信号fを入力
し、4分周信号f/4を制御回路に供給する図示しない
分周器と、2ビットのカウンタ80と、カウントすべき
数を保持する4ビットのレジスタ20と、制御回路86
よりなる。
This circuit holds a frequency divider (not shown) which receives the original clock signal f and supplies a frequency-divided signal f / 4 to the control circuit, a 2-bit counter 80, and the number to be counted. 4-bit register 20 and control circuit 86
Consisting of

【0080】カウンタ80は、制御回路86が出力する
クロック信号の反転信号がクロック端子Cに供給され、
制御回路86が出力するリセット信号がリセット端子R
に供給されるTフリップフロップ80aと、フリップフ
ロップ80aのQ出力信号の反転信号がクロック端子C
に供給され、制御回路86が出力するリセット信号がリ
セット端子Rに供給されるTフリップフロップ80bと
により構成される。
The counter 80 supplies an inverted signal of the clock signal output from the control circuit 86 to the clock terminal C.
The reset signal output from the control circuit 86 is the reset terminal R
Is supplied to the clock terminal C and the inverted signal of the Q output signal of the flip-flop 80a
And a T flip-flop 80b supplied with a reset signal output from the control circuit 86 to a reset terminal R.

【0081】制御回路86は、下位ビット比較部81、
上位ビット比較部82、アンドゲート83、リセット信
号発生部84、クロック信号選択回路部85より構成さ
れる。
The control circuit 86 includes a lower bit comparing section 81,
It comprises an upper bit comparing section 82, an AND gate 83, a reset signal generating section 84, and a clock signal selecting circuit section 85.

【0082】下位ビット比較部81は、フリップフロッ
プ80aのQ出力QAとレジスタの最下位ビットのデー
タが入力されるエクスクルシブノアゲート81aと、フ
リップフロップ80bのQ出力QBとレジスタの下から
2ビット目のデータが入力されるエクスクルシブノアゲ
ート81bと、エクスクルシブノアゲート81a,81
bの出力が入力されるアンドゲート81cより構成され
る。アンドゲート81cの出力が、下位ビット一致信号
となる。この比較部81は、カウンタの出力とレジスタ
の下位2ビットが両者が一致するとき下位ビット一致信
号を1として出力し、それ以外は0を出力する。
The lower bit comparing section 81 includes an exclusive NOR gate 81a to which the Q output QA of the flip-flop 80a and the data of the least significant bit of the register are input, the Q output QB of the flip-flop 80b and the lower two bits of the register. Exclusive NOR gate 81b to which eye data is input, and exclusive NOR gates 81a and 81
It comprises an AND gate 81c to which the output of b is input. The output of the AND gate 81c becomes a lower bit match signal. The comparison unit 81 outputs a lower bit match signal as 1 when the output of the counter and the lower 2 bits of the register match, and outputs 0 otherwise.

【0083】上位ビット比較部82は、以下に説明する
構成となっている。レジスタ20の最上位ビットのデー
タは、オアゲート82cの入力端子に供給され、上から
2ビット目のデータは、オアゲート82aの入力端子に
供給される。また、フリップフロップ80aのQ出力端
子は、オアゲート82bの入力端子に接続され、フリッ
プフロップ80bのQ出力端子は、オアゲート82dの
入力端子に接続される。オアゲート82a,82b,8
2c,82dの別の入力端子は、アンドゲート82hの
出力端子に接続される。オアゲート82a,82bの出
力端子は、エクスクルシブノアゲート82eの入力端子
にそれぞれ接続され、オアゲート82c,82dの出力
端子は、エクスクルシブノアゲート82fの入力端子に
それぞれ接続される。エクスクルシブノアゲート82
e,82fの出力端子は、それぞれアンドゲート82g
の入力端子に接続される。アンドゲート82gの出力
が、上位ビット一致信号となる。アンドゲート82gの
出力端子は、アンドゲート82hの入力端子に接続され
る。ダイレクトリセット入力は、インバータゲート82
iを介して、アンドゲート82hの他の入力端子に接続
される。この回路は、レジスタ20の上位2ビットとカ
ウンタ80の2ビットのQ出力信号を入力とし、両者が
一致するとき下位ビット一致信号を1として出力し、一
度1が出力されるとダイレクトリセットされるまで1を
保持するものである。
The upper bit comparing section 82 has the configuration described below. The data of the most significant bit of the register 20 is supplied to the input terminal of the OR gate 82c, and the data of the second bit from the top is supplied to the input terminal of the OR gate 82a. The Q output terminal of the flip-flop 80a is connected to the input terminal of the OR gate 82b, and the Q output terminal of the flip-flop 80b is connected to the input terminal of the OR gate 82d. OR gate 82a, 82b, 8
The other input terminals of 2c and 82d are connected to the output terminal of AND gate 82h. The output terminals of the OR gates 82a and 82b are connected to the input terminals of the exclusive NOR gate 82e, respectively, and the output terminals of the OR gates 82c and 82d are connected to the input terminals of the exclusive NOR gate 82f, respectively. Exclusive Noah Gate 82
The output terminals of e and 82f are AND gates 82g, respectively.
Is connected to the input terminal. The output of the AND gate 82g becomes the upper bit match signal. The output terminal of the AND gate 82g is connected to the input terminal of the AND gate 82h. The direct reset input is connected to the inverter gate 82
Via i, it is connected to another input terminal of the AND gate 82h. This circuit receives the upper 2 bits of the register 20 and the 2-bit Q output signal of the counter 80, outputs a lower bit match signal as 1 when they match, and is directly reset once 1 is output. Is held until 1

【0084】アンドゲート83は、下位ビット一致信号
と上位ビット一致信号を入力し、カウント終了信号を出
力する。リセット信号発生部84は、例えば、クロック
端子Cに原振クロック信号が供給され、データ端子Dに
上位ビット一致信号が供給され、出力端子Qがインバー
タ84bを介してアンドゲート84cの一方の入力端子
と接続されるフリップフロップ84aと、他方の入力端
子に上位ビット一致信号が供給されるアンドゲート84
cと、一方の入力端子にダイレクトリセット信号が供給
され、他方の入力端子がアンドゲート84cの出力端子
と接続されるオアゲート84dとにより構成される。こ
の回路は、カウント開始時及びダイレクトリセット信号
入力時にリセット信号をカウンタ80に供給し、上位ビ
ットカウント終了時に原振クロック信号の半周期分のパ
ルスのリセット信号をカウンタ80に供給する回路であ
る。
The AND gate 83 receives the lower bit match signal and the upper bit match signal, and outputs a count end signal. For example, the reset signal generating section 84 is configured such that the original clock signal is supplied to the clock terminal C, the upper bit match signal is supplied to the data terminal D, and the output terminal Q is connected to one input terminal of the AND gate 84c via the inverter 84b. And an AND gate 84 to which an upper bit match signal is supplied to the other input terminal
c, and an OR gate 84d whose one input terminal is supplied with a direct reset signal and whose other input terminal is connected to the output terminal of the AND gate 84c. This circuit supplies a reset signal to the counter 80 at the start of counting and at the time of input of a direct reset signal, and supplies a reset signal of a pulse corresponding to a half cycle of the original clock signal to the counter 80 at the end of higher-order bit counting.

【0085】セレクタ回路85は、原振クロック信号f
及び図示しない分周器から供給される4分周信号f/4
が入力され、上位ビット一致信号及びカウント終了信号
に応じてクロック信号を選択し、カウンタにそのクロッ
ク信号を供給する回路である。例えば、カウント終了信
号がカウント終了を表す場合は、接地電位を供給し、カ
ウント終了信号がカウント未終了を表し、かつ上位ビッ
ト一致信号が上位ビット不一致を表す場合は、4分周信
号f/4を供給し、カウント終了信号が未終了を表し、
かつ上位ビット一致信号が一致を表す場合は、原振クロ
ック信号fを供給する。
The selector circuit 85 outputs the original clock signal f
And a frequency-divided signal f / 4 supplied from a frequency divider (not shown)
Is input, a clock signal is selected according to the upper bit match signal and the count end signal, and the clock signal is supplied to the counter. For example, when the count end signal indicates the end of the count, the ground potential is supplied. When the count end signal indicates that the count is not completed and the upper bit match signal indicates that the upper bit does not match, the divide-by-4 signal f / 4. And the end-of-count signal indicates incomplete,
If the upper bit match signal indicates a match, the original clock signal f is supplied.

【0086】このカウンタ回路の動作を以下説明する。
まず、レジスタ20にカウント数1011がセットされ
る。カウント開始時、制御回路86は、カウンタ80に
1であるリセット信号を供給し、カウンタ出力QA,Q
Bを0とする。さらに、上位ビット一致信号、下位ビッ
ト一致信号がともに0であるから、制御回路86は、カ
ウンタ80へ4分周信号を出力し、カウント動作を開始
させる。カウンタ80の出力が2進数で10となると、
上位ビット一致信号が1となる。下位ビット一致信号は
0のままであるから、制御回路86は、リセット信号を
0から1にしてカウンタ80の出力を00にし、カウン
タ80へ原振クロック信号を供給し、カウント動作を開
始させる。カウンタ80の出力が2進数で11になる
と、下位ビット一致信号が1となる。上位ビット一致信
号も下位ビット一致信号も1になると、制御回路86
は、カウント終了信号を0から1にするとともに、カウ
ンタ80に何等クロック信号を供給しない。
The operation of this counter circuit will be described below.
First, the count number 1011 is set in the register 20. At the start of counting, the control circuit 86 supplies a reset signal of 1 to the counter 80 and outputs the counter outputs QA and Q
B is set to 0. Further, since both the upper bit match signal and the lower bit match signal are 0, the control circuit 86 outputs a divide-by-4 signal to the counter 80 to start the counting operation. When the output of the counter 80 becomes 10 in binary,
The upper bit match signal becomes 1. Since the lower bit match signal remains at 0, the control circuit 86 changes the reset signal from 0 to 1 to set the output of the counter 80 to 00, supplies the original clock signal to the counter 80, and starts the counting operation. When the output of the counter 80 becomes 11 in binary, the lower bit match signal becomes 1. When both the upper bit match signal and the lower bit match signal become 1, the control circuit 86
Changes the count end signal from 0 to 1 and does not supply any clock signal to the counter 80.

【0087】上述の実施例では、先に上位カウンタをカ
ウントし、その後下位カウンタをカウントするのに対
し、先に下位カウンタをカウントし、次に上位カウンタ
をカウントすることとも可能である。この場合、上位カ
ウンタに供給する分周信号が、下位カウンタに供給する
クロック信号の最後の立ち下がりの直後から始まるよう
に、上位カウンタへの分周信号の位相を遅らせる回路を
付加する必要がある。図17は、この方法で10進数で
11をカウントする場合のコンペア式アップカウンタの
タイミングチャートを示す。まず、下位カウンタが原振
クロック信号fで3クロック分カウントし、その後上位
カウンタが位相が原振クロック信号で3クロック分遅ら
された4分周信号f/4で2クロック分カウントする。
In the above-described embodiment, it is also possible to count the upper counter first and then count the lower counter, while counting the lower counter first and then count the upper counter. In this case, it is necessary to add a circuit for delaying the phase of the frequency-divided signal to the upper counter so that the frequency-divided signal supplied to the upper counter starts immediately after the last fall of the clock signal supplied to the lower counter. . FIG. 17 is a timing chart of a compare-type up-counter when counting 11 in decimal using this method. First, the lower counter counts for three clocks with the original clock signal f, and then the upper counter counts for two clocks with the frequency-divided signal f / 4 whose phase is delayed by three clocks with the original clock signal.

【0088】この方法は、他のカウンタ回路に対しても
適用できる。また、上記の実施例においてはカウンタは
非同期式であったが、同期式のカウンタに対しても本発
明を適用できる。
This method can be applied to other counter circuits. In the above embodiment, the counter is of an asynchronous type, but the present invention can be applied to a synchronous type counter.

【0089】図18は、カウントイネーブル回路でカウ
ンタを制御する本発明の実施例を示す。上述の実施例で
は、制御回路によりカウンタの動作を制御しているが、
本実施例では、カウントイネーブル回路が出力するカウ
ントイネーブル信号によりカウンタの動作を制御する。
n,m,kは、0<k<m<nを満たす自然数とする。
FIG. 18 shows an embodiment of the present invention in which a counter is controlled by a count enable circuit. In the above embodiment, the operation of the counter is controlled by the control circuit.
In this embodiment, the operation of the counter is controlled by the count enable signal output from the count enable circuit.
n, m, and k are natural numbers satisfying 0 <k <m <n.

【0090】分周器111は、原振クロック信号fが入
力され、原振クロック周波数の2k分の1の周波数の分
周信号f/2k と、原振クロック周波数の2m 分の1の
周波数の分周信号f/2m を出力する分周器である。
[0090] The frequency divider 111 is supplied with the master clock signal f, and the frequency-divided signal f / 2 k 1 of the frequency of 2 k min of the master clock frequency 1 2 m fraction of the master clock frequency Is a frequency divider that outputs a frequency-divided signal f / 2 m having a frequency of

【0091】下位ビットカウンタ群113は、カウント
イネーブル回路112が出力する下位ビットカウントイ
ネーブル信号が入力され、原振クロック信号fをカウン
トする。カウンタ113は、レジスタ116が保持する
nビットデータの0ビット目からk−1ビット目までの
下位ビットデータよりなるカウントすべき数のカウント
を終了すると、下位ビット群カウント終了信号を出力す
る。
The lower bit counter group 113 receives the lower bit count enable signal output from the count enable circuit 112 and counts the original clock signal f. The counter 113 outputs a lower bit group count end signal when it finishes counting the number of lower bit data from the 0th bit to the (k-1) th bit of the n-bit data held by the register 116.

【0092】中位ビットカウンタ群114は、カウント
イネーブル回路112が出力する中位ビットカウントイ
ネーブル信号が入力され、分周器111が出力する分周
信号f/2k をカウントする。カウンタ114は、レジ
スタ116が保持するnビットデータのkビット目から
m−1ビット目までの中位ビットデータよりなるカウン
トすべき数のカウントを終了すると、中位ビット群カウ
ント終了信号を出力する。
The middle bit counter group 114 receives the middle bit count enable signal output from the count enable circuit 112 and counts the frequency-divided signal f / 2 k output from the frequency divider 111. The counter 114 outputs a middle bit group count end signal when it finishes counting the number of middle bits from the k-th bit to the (m-1) -th bit of the n-bit data held by the register 116. .

【0093】上位ビットカウンタ群115は、カウント
イネーブル回路112が出力する上位ビットカウントイ
ネーブル信号が入力され、分周器111が出力する分周
信号f/2m をカウントする。カウンタ115は、レジ
スタ116が保持するnビットデータのmビット目から
n−1ビット目までの上位ビットデータよりなるカウン
トすべき数のカウントを終了すると、上位ビット群カウ
ント終了信号を出力する。
The upper bit counter group 115 receives the upper bit count enable signal output from the count enable circuit 112 and counts the frequency-divided signal f / 2 m output from the frequency divider 111. The counter 115 outputs an upper bit group count end signal when it finishes counting the number of upper bits from the m-th bit to the (n-1) th bit of the n-bit data held by the register 116.

【0094】レジスタ116は、カウントしたいnビッ
トデータを保持し、そのビットデータの0ビット目から
k−1ビット目までのデータと、kビット目からm−1
ビット目までのデータと、mビット目からn−1ビット
目までのデータをそれぞれカウンタ113、114、1
15がカウントすべき数として、カウンタ113、11
4、115に供給する。
The register 116 holds n-bit data to be counted, and stores the data from the 0th bit to the (k-1) th bit of the bit data and the (m-1) th bit from the kth bit.
The data up to the bit and the data from the mth bit to the (n-1) th bit are respectively counted by counters 113, 114, 1
The counters 113, 11
4, 115.

【0095】カウントイネーブル回路112は、外部か
ら供給されるカウントイネーブル信号と、原振クロック
信号fと、分周器111から供給される分周信号f/2
k 及び分周信号f/2m と、上位ビット群カウント終了
信号、中位ビット群カウント終了信号、下位ビット群カ
ウント終了信号が入力され、上位、中位および下位ビッ
ト群カウント終了信号の状態に応じて、カウンタ11
3、114、115にそれぞれカウントイネーブル信号
を供給し、あるいはカウント終了信号を出力する。
The count enable circuit 112 includes a count enable signal supplied from the outside, an original clock signal f, and a frequency-divided signal f / 2 supplied from the frequency divider 111.
k and the frequency-divided signal f / 2 m , the higher-order bit group count end signal, the middle-order bit group count end signal, and the lower-order bit group count end signal are input. Accordingly, the counter 11
A count enable signal is supplied to 3, 114, and 115, or a count end signal is output.

【0096】図19は、図18に示した実施例に用いら
れるカウントイネーブル回路の回路例を示す。上位ビッ
トカウント終了信号は、アンドゲート121、126、
127に入力され、またインバータ122を介してアン
ドゲート125に入力される。中位ビットカウント終了
信号は、アンドゲート121に入力され、インバータ1
23を介してアンドゲート126に入力され、アンドゲ
ート127に入力される。下位ビットカウント終了信号
は、アンドゲート121に入力され、インバータ124
を介してアンドゲート127に入力される。また、カウ
ントイネーブル信号は、フリップフロップ128のデー
タ入力端子に供給され、分周器111から出力される分
周信号f/2m の反転信号は、フリップフロップ128
のクロック端子に供給される。フリップフリップ128
の出力端子Qは、アンドゲート125、126、127
の入力端子に接続される。アンドゲート121の出力
は、カウント終了信号となる。アンドゲート125,1
26,127の出力は、それぞれ上位ビットカウントイ
ネーブル信号、中位ビットカウントイネーブル信号、下
位ビットカウントイネーブル信号として、それぞれ下位
ビットカウンタ群113、中位ビットカウンタ群11
4、上位ビットカウンタ群115に供給される。
FIG. 19 shows a circuit example of the count enable circuit used in the embodiment shown in FIG. The upper bit count end signal includes AND gates 121 and 126,
127 and via an inverter 122 to an AND gate 125. The middle bit count end signal is input to the AND gate 121,
The signal is input to the AND gate 126 via the reference numeral 23, and is input to the AND gate 127. The lower bit count end signal is input to the AND gate 121,
Is input to the AND gate 127 via the. The count enable signal is supplied to the data input terminal of the flip-flop 128, and the inverted signal of the frequency-divided signal f / 2 m output from the frequency divider 111 is applied to the flip-flop 128.
Clock terminal. Flip flip 128
Output terminals Q of the AND gates 125, 126, 127
Is connected to the input terminal. The output of the AND gate 121 becomes a count end signal. AND gate 125,1
Outputs 26 and 127 are a lower bit counter group 113 and a middle bit counter group 11 as an upper bit count enable signal, a middle bit count enable signal and a lower bit count enable signal, respectively.
4. It is supplied to the upper bit counter group 115.

【0097】以下、図18に示した実施例の動作を説明
する。カウントイネーブル回路112は、上位ビットカ
ウンタ群115のカウント終了信号が”0”である場
合、上位ビットカウントイネーブル信号を”1”にし、
中位ビットカウントイネーブル信号及び下位ビットカウ
ントイネーブル信号を”0”にする。この結果、カウン
タ115のみが分周信号f/2m のカウント動作を行
い、それ以外のカウンタはカウント動作を行わない。
The operation of the embodiment shown in FIG. 18 will be described below. The count enable circuit 112 sets the upper bit count enable signal to “1” when the count end signal of the upper bit counter group 115 is “0”,
The middle bit count enable signal and the lower bit count enable signal are set to “0”. As a result, only the counter 115 performs the counting operation of the frequency-divided signal f / 2 m , and the other counters do not perform the counting operation.

【0098】上位ビットカウンタ群115は、レジスタ
116が保持する上位ビットカウンタがカウントすべき
数のカウントを終了すると、上位ビット群カウント終了
信号を”1”にして制御回路102に供給する。
When the higher-order bit counter group 115 finishes counting the number to be counted by the upper-order bit counter held by the register 116, the higher-order bit counter count signal is set to “1” and supplied to the control circuit 102.

【0099】次に、上位ビットカウント終了信号が”
1”であり、中位ビットカウント終了信号が”0”であ
る場合、カウントイネーブル回路112は、中位ビット
カウントイネーブル信号を”1”にし、上位ビットカウ
ントイネーブル信号及び下位ビットカウントイネーブル
信号を”0”にする。この結果、カウンタ114のみが
分周信号f/2k のカウント動作を行い、それ以外のカ
ウンタはカウント動作を行わない。
Next, the upper bit count end signal becomes "
When it is “1” and the middle bit count end signal is “0”, the count enable circuit 112 sets the middle bit count enable signal to “1” and sets the upper bit count enable signal and the lower bit count enable signal to “1”. 0 to ". As a result, only the counter 114 performs a counting operation of the frequency-divided signal f / 2 k, the other counter does not perform the counting operation.

【0100】以下同様に繰り返して、カウンタ113、
114、115のカウント終了信号がいずれも”1”に
なった場合、上位ビットカウント終了信号、中位ビット
カウント終了信号、下位ビットカウント終了信号をいず
れも”0”にし、カウント終了信号を”1”にする。
The same operation is repeated in the same manner, and the counter 113,
When the count end signals 114 and 115 both become "1", the upper bit count end signal, the middle bit count end signal, and the lower bit count end signal are all set to "0", and the count end signal is set to "1". "

【0101】このように、本実施例では、先に上位ビッ
トカウンタ群から順次カウント動作させ、あるカウンタ
が動作しているときは他のカウンタのカウント動作を停
止させるので、カウンタを構成する例えばフリップフロ
ップの反転回数が減少し、消費電力を低くすることが可
能になる。
As described above, in the present embodiment, the counting operation is performed sequentially from the upper bit counter group, and when a certain counter is operating, the counting operation of the other counter is stopped. It is possible to reduce the number of inversions of the loop and reduce power consumption.

【0102】また、図18に示した実施例に用いられる
カウンタは、アップカウンタでもダウンカウンタでもよ
く、コンペア式でもオーバーフロー式でもよく、ジョン
ソンカウンタでもバイナリカウンタでも良く、同期式で
も非同期式でも良い。また、各ビット群カウンタのカウ
ンタ方式及びカウンタ回路が同じでも違っても良い。
The counter used in the embodiment shown in FIG. 18 may be an up counter or a down counter, a compare type or an overflow type, a Johnson counter or a binary counter, a synchronous type or an asynchronous type. Further, the counter method and the counter circuit of each bit group counter may be the same or different.

【0103】図20は、同期式のカウンタに本発明を適
用した実施例を示す。この実施例は、図23に示した構
成のカウンタにおいて、原振クロック信号fの反転信号
をすべてのフリップフロップに供給しないで、例えば、
1段目から3段目までのフリップフロップに原振クロッ
ク信号fの反転信号を供給し、4段目から8段目までの
フリップフロップに8分周信号f/8の反転信号を供給
し、9段目以上のフリップフロップに256分周信号f
/256の反転信号を供給するものである。これらの分
周信号は、分周器から直接供給される。同期式のカウン
タでは、前段のTフリップフロップのQ出力と前段のフ
リップフロップに供給されるカウントイネーブル信号の
論理積が本段のフリップフロップのカウントイネーブル
端子に供給されるので、クロックの立ち下がり時に前段
までのデータの積が1であれば、そのフリップフロップ
は反転動作する。よって、図20に示したように上位ビ
ットに分周クロックを使っても従来と同じ動作を行うこ
とができる。このように、上位のフリップフロップに分
周クロックを供給すると、充放電の回数が減り、配線容
量による消費電力は減少する。以上説明したカウンタ
は、Tフリップフロップにより構成されているが、それ
に限られるものではない。
FIG. 20 shows an embodiment in which the present invention is applied to a synchronous counter. In this embodiment, the counter having the configuration shown in FIG. 23 does not supply an inverted signal of the original clock signal f to all flip-flops.
An inverted signal of the original clock signal f is supplied to the first to third flip-flops, and an inverted signal of the divide-by-8 signal f / 8 is supplied to the fourth to eighth flip-flops. The divide-by-256 signal f is applied to the ninth or higher flip-flop.
/ 256 is supplied. These frequency-divided signals are supplied directly from the frequency divider. In the synchronous counter, the logical product of the Q output of the preceding T flip-flop and the count enable signal supplied to the preceding flip-flop is supplied to the count enable terminal of the main flip-flop. If the product of the data up to the preceding stage is 1, the flip-flop performs an inversion operation. Therefore, the same operation as in the related art can be performed even when the frequency-divided clock is used for the upper bits as shown in FIG. As described above, when the frequency-divided clock is supplied to the upper flip-flop, the number of times of charging and discharging is reduced, and the power consumption due to the wiring capacity is reduced. The counter described above is configured by a T flip-flop, but is not limited thereto.

【0104】[0104]

【発明の効果】以上説明したように、本発明によれば、
上位ビット群のカウンタがカウントを行っているときは
下位ビット群のカウンタのカウント動作を停止させるの
で、下位ビットのカウンタを構成するフリップフロップ
の動作回数が減り、消費電力を下げることができる。
As described above, according to the present invention,
When the counter of the higher-order bit group is counting, the counting operation of the counter of the lower-order bit group is stopped, so that the number of operations of the flip-flops constituting the counter of the lower-order bit is reduced, and power consumption can be reduced.

【0105】また、本発明を同期式カウンタに適用する
と、クロック線に供給されるクロックの周波数を局所的
に下げて、クロックの反転回数を少なくすることができ
るので、クロック配線の容量による消費電力を下げるこ
とができる。さらに、本発明の制御回路は簡単な回路で
あるため、チップコストはほとんど上昇しない。
Further, when the present invention is applied to a synchronous counter, the frequency of the clock supplied to the clock line can be locally reduced to reduce the number of clock inversions. Can be lowered. Furthermore, since the control circuit of the present invention is a simple circuit, chip cost hardly increases.

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

【図1】本発明の実施例を示す図。FIG. 1 is a diagram showing an embodiment of the present invention.

【図2】本発明のカウンタ回路を内蔵したMCUチップ
を示す図。
FIG. 2 is a diagram showing an MCU chip incorporating a counter circuit of the present invention.

【図3】本発明のコンペア式アップカウンタを示す図。FIG. 3 is a diagram showing a compare-type up counter of the present invention.

【図4】図3に示したカウンタのタイミングチャートを
表す図。
FIG. 4 is a diagram showing a timing chart of the counter shown in FIG. 3;

【図5】本発明の制御回路の回路例を示す図。FIG. 5 is a diagram showing a circuit example of a control circuit of the present invention.

【図6】本発明の制御回路の動作を表す図。FIG. 6 is a diagram showing the operation of the control circuit of the present invention.

【図7】本発明のオーバーフロー式カウンタを示す図。FIG. 7 is a diagram showing an overflow counter of the present invention.

【図8】図7に示したカウンタのタイミングチャートを
表す図。
FIG. 8 is a diagram showing a timing chart of the counter shown in FIG. 7;

【図9】本発明のダウンカウンタを示す図。FIG. 9 is a diagram showing a down counter of the present invention.

【図10】図9に示したダウンカウンタのタイミングチ
ャートを表す図。
FIG. 10 is a diagram showing a timing chart of the down counter shown in FIG.

【図11】タイミングチャートを表す図。FIG. 11 is a diagram showing a timing chart.

【図12】タイミングチャートを表す図。FIG. 12 is a diagram showing a timing chart.

【図13】本発明の制御回路の回路例を示す図。FIG. 13 is a diagram showing a circuit example of a control circuit of the present invention.

【図14】タイミングチャートを表す図。FIG. 14 is a diagram showing a timing chart.

【図15】本発明のコンペア式アップカウンタを示す
図。
FIG. 15 is a diagram showing a compare-type up counter of the present invention.

【図16】図15に示したカウンタのタイミングチャー
トを表す図。
FIG. 16 is a diagram showing a timing chart of the counter shown in FIG.

【図17】タイミングチャートを表す図。FIG. 17 is a diagram showing a timing chart.

【図18】本発明の別の実施例を示す図。FIG. 18 is a diagram showing another embodiment of the present invention.

【図19】図18に示したカウントイネーブル回路を示
す図。
FIG. 19 is a diagram showing a count enable circuit shown in FIG. 18;

【図20】本発明の同期式カウンタを示す図。FIG. 20 is a diagram showing a synchronous counter of the present invention.

【図21】従来のコンペア式アップカウンタを示す図。FIG. 21 is a diagram showing a conventional compare-type up counter.

【図22】図21に示したカウンタのタイミングチャー
トを表す図。
FIG. 22 is a diagram showing a timing chart of the counter shown in FIG. 21.

【図23】従来の同期式カウンタを示す図。FIG. 23 is a diagram showing a conventional synchronous counter.

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

101…分周器、 102…制御回路、 103…カウントイネーブル回路、 104…下位ビットカウンタ、 105…中位ビットカウンタ、 106…上位ビットカウンタ、 107…レジスタ。 101: frequency divider, 102: control circuit, 103: count enable circuit, 104: lower bit counter, 105: middle bit counter, 106: upper bit counter, 107: register.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 大橋 一彦 神奈川県川崎市川崎区駅前本町25番地1 東芝マイクロエレクトロニクス株式会 社内 (56)参考文献 特開 昭59−208945(JP,A) 特開 平7−248741(JP,A) 特開 平6−204873(JP,A) 特開 昭63−166318(JP,A) (58)調査した分野(Int.Cl.7,DB名) H03K 21/00 ──────────────────────────────────────────────────続 き Continuation of front page (72) Inventor Kazuhiko Ohashi 25-1, Ekimae Honcho, Kawasaki-ku, Kawasaki-ku, Kanagawa Prefecture In-house Toshiba Microelectronics Corporation (56) References JP-A-59-208945 (JP, A) JP-A Heisei 7-248741 (JP, A) JP-A-6-204873 (JP, A) JP-A-63-166318 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) H03K 21/00

Claims (9)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 原振クロック信号を入力し、相異なる1
個以上の自然数について前記原振クロック信号の2の前
記自然数乗分の1の周波数の分周信号をそれぞれ出力す
る分周器と、 前記原振クロック信号、前記1個以上の分周信号のいず
れかをカウントし、カウントすべき数をカウントした場
合にカウント終了信号を出力する複数のカウンタと、 前記複数のカウンタの各々がカウントすべき数を保持す
るレジスタと、 前記複数のカウンタにカウントイネーブル信号を供給す
るカウントイネーブル回路と、 前記カウンタの消費電力を低減するため、前記原振クロ
ック信号、前記分周信号、および前記複数のカウンタの
カウント終了信号を入力し、最小周波数の分周信号をカ
ウントするカウンタのカウント終了信号が未終了を表す
場合は、まず前記最小周波数の分周信号をカウントする
カウンタに前記最小周波数の分周信号を供給し、それ以
外のカウンタには何等クロック信号を供給せず、前記最
小周波数の分周信号をカウントするカウンタのカウント
終了信号が終了を表し、2番目に小さい周波数の分周信
号をカウントするカウンタのカウント終了信号が未終了
を表す場合は、前記2番目に小さい周波数の分周信号を
カウントするカウンタに前記2番目に小さい周波数の分
周信号を供給し、それ以外のカウンタには何等クロック
信号を供給せず、以下同様に繰り返して、前記複数のカ
ウンタのカウント終了信号がいずれも終了を表すように
なった場合は、前記複数のカウンタのいずれにも何等ク
ロック信号を供給せず、カウント終了信号を出力する制
御回路とを具備することを特徴とするカウンタ回路。
1. An original clock signal is inputted, and different
A frequency divider that outputs a frequency-divided signal having a frequency of 1 / the natural number of 2 of the original clock signal for at least one natural number; and any one of the original clock signal and the one or more frequency-divided signals. A plurality of counters that output a count end signal when the number to be counted is counted; a register that holds the number to be counted by each of the plurality of counters; and a count enable signal to the plurality of counters. And a count enable circuit that supplies the original clock signal, the frequency-divided signal, and the count end signal of the plurality of counters to reduce the power consumption of the counter, and counts the frequency-divided signal of the minimum frequency. In the case where the count end signal of the counter which performs the counting is not completed, first, the counter which counts the frequency-divided signal of the minimum frequency is provided before the counter. The frequency division signal of the minimum frequency is supplied, no clock signal is supplied to the other counters, and the count end signal of the counter that counts the frequency division signal of the minimum frequency indicates the end, and the second lowest frequency If the count end signal of the counter that counts the frequency-divided signal indicates that the count has not been completed, the frequency-divided signal of the second lowest frequency is supplied to the counter that counts the frequency-divided signal of the second lowest frequency. No clock signal is supplied to the counters other than the above, and the same is repeated in the following. When all the count end signals of the plurality of counters indicate the end, any clock signal is supplied to any of the plurality of counters. A control circuit that does not supply a signal and outputs a count end signal.
【請求項2】 原振クロック信号を入力し、相異なる1
個以上の自然数について前記原振クロック信号の2の前
記自然数乗分の1の周波数の分周信号をそれぞれ出力す
る分周器と、 前記分周器が出力する前記原振クロック信号、前記1個
以上の分周信号のいずれかをカウントし、カウントすべ
き数をカウントした場合にカウント終了信号を出力する
複数のカウンタと、 前記複数のカウンタの各々がカウントすべき数を保持す
るレジスタと、 前記カウンタの消費電力を低減するため、前記原振クロ
ック信号、前記分周信号、および前記複数のカウンタの
カウント終了信号を入力し、最小周波数の分周信号をカ
ウントするカウンタのカウント終了信号が未終了を表す
場合は、まず前記最小周波数の分周信号をカウントする
カウンタにカウントイネーブル信号を供給してカウント
を開始させ、それ以外のカウンタにはカウントイネーブ
ル信号を供給せず、前記最小周波数の分周信号をカウン
トするカウンタのカウント終了信号が終了を表し、2番
目に小さい周波数の分周信号をカウントするカウンタの
カウント終了信号が未終了を表す場合は、前記2番目に
小さい周波数の分周信号をカウントするカウンタにカウ
ントイネーブル信号を供給してカウントを開始させ、そ
れ以外のカウンタにはカウントイネーブル信号を供給せ
ず、順次同様に繰り返して、前記複数のカウンタのカウ
ント終了信号がいずれも終了を表すようになった場合
は、前記複数のカウンタのいずれにも何等クロック信号
を供給せず、カウント終了信号を出力するカウントイネ
ーブル回路とを具備することを特徴とするカウンタ回
路。
2. An original clock signal is input, and different
Frequency dividers each outputting a frequency-divided signal having a frequency of 1 / the natural number power of 2 of the original clock signal for at least natural numbers; the original clock signal output by the frequency divider; A plurality of counters that count any of the frequency-divided signals and output a count end signal when the number to be counted is counted; a register that holds a number to be counted by each of the plurality of counters; In order to reduce the power consumption of the counter, the original clock signal, the frequency-divided signal, and the count end signal of the plurality of counters are input, and the count end signal of the counter that counts the frequency-divided signal of the minimum frequency is not ended. In the case of, first, a count enable signal is supplied to a counter that counts the frequency-divided signal of the minimum frequency to start counting. No count enable signal is supplied to the counter, and the count end signal of the counter that counts the frequency-divided signal of the minimum frequency indicates the end, and the count end signal of the counter that counts the frequency-divided signal of the second lowest frequency is not yet received. In the case of indicating the end, a count enable signal is supplied to the counter for counting the frequency-divided signal of the second lowest frequency to start counting, and the other counters are not supplied with the count enable signal. Repeatedly, when the count end signals of the plurality of counters indicate the end, a count enable circuit that does not supply any clock signal to any of the plurality of counters and outputs a count end signal. A counter circuit comprising:
【請求項3】 前記カウンタは、 アップカウンタと、 前記アップカウンタのカウント数と前記レジスタが保持
するカウンタがカウントすべき数とを入力し、両者が一
致する場合にカウント終了信号を出力する比較回路とを
具備することを特徴とする請求項1、2記載のカウンタ
回路。
3. A counter circuit for inputting an up-counter, a count number of the up-counter and a number to be counted by a counter held by the register, and outputting a count end signal when the two match. 3. The counter circuit according to claim 1, further comprising:
【請求項4】 前記カウンタは、 2進カウンタと、 前記2進カウンタの最上位ビットの出力信号を入力し、
桁上げの有無を表す信号を出力する桁上げフリップフロ
ップとを具備し、 前記レジスタは、 前記カウンタの各々がカウントすべき数の補数とその補
数の桁上げを保持し、カウント開始前にそれらを前記2
進カウンタ及び前記桁上げフリップフロップにセットす
ることを特徴とする請求項1、2記載のカウンタ回路。
4. The counter receives a binary counter and an output signal of the most significant bit of the binary counter,
A carry flip-flop that outputs a signal indicating the presence or absence of a carry. 2 above
3. The counter circuit according to claim 1, wherein the counter is set in a binary counter and the carry flip-flop.
【請求項5】 前記カウンタは、 ダウンカウンタと、 前記ダウンカウンタが前記レジスタが 保持するカウン
タがカウントすべき数をカウントした場合にカウント終
了信号を出力する判定回路とを具備することを特徴とす
る請求項1、2記載のカウンタ回路。
5. The counter according to claim 1, further comprising a down counter, and a determination circuit that outputs a count end signal when the down counter has counted the number to be counted by the counter held by the register. 3. The counter circuit according to claim 1, wherein:
【請求項6】 カウント開始時に、1から前記相異なる
自然数のうちカウントに用いられる最大の自然数nまで
のすべての自然数kに関して、原振クロック信号の2の
k乗分の1の周波数の分周信号の位相から、原振クロッ
ク信号の2のn乗分の1の周波数の分周信号をカウント
するカウンタがカウントするべき前記原振クロック信号
の2のn乗分の1の周波数の分周信号の直近の信号変化
点からカウント開始時までの原振クロック信号数を求
め、その数に応じて前記レジスタが保持するカウンタが
カウントすべき数を変化させる手段をさらに具備するこ
とを特徴とする請求項1、2記載のカウンタ回路。
6. At the start of counting, for all natural numbers k from 1 to the largest natural number n used for counting among the different natural numbers, the frequency is divided by a frequency of 1/2 k times of the original clock signal. From the phase of the signal, a counter that counts a frequency-divided signal having a frequency of 1 / n 2 of the original clock signal to be counted is a frequency-divided signal having a frequency of 1/2 n of the original clock signal. Means for calculating the number of original clock signals from the most recent signal change point to the start of counting, and changing the number to be counted by the counter held by the register according to the number. Item 3. The counter circuit according to item 1 or 2.
【請求項7】 前記カウントすべき数を変化させる手段
は、前記分周信号の直近の信号変化点からカウント開始
時までの原振クロック信号数を前記レジスタが保持する
カウントすべき数に加えることを特徴とする請求項6記
載のカウンタ回路。
7. The means for changing the number to be counted includes adding the number of original clock signals from the most recent signal change point of the frequency-divided signal to the start of counting to the number to be counted held in the register. 7. The counter circuit according to claim 6, wherein:
【請求項8】 原振クロック信号を入力し、少なくとも
1つの互いに相異なる周波数の分周信号を出力する分周
器と、 前記クロック信号をカウントするカウンタと、 前記原振クロック信号でカウントすべきカウント数と前
記分周信号の各々でカウントすべきカウント数を保持す
るレジスタと、 前記原振クロック信号、前記分周信号、前記カウンタの
カウント数、および前記レジスタの保持データを入力
し、まず、リセット信号を前記カウンタに供給した後、
最も低い周波数のクロック信号を前記カウンタに供給し
て、前記クロック信号でカウントすべき数までカウント
動作をさせ、順次、リセット信号を前記カウンタに供給
し、次に低い周波数のクロック信号を前記カウンタに供
給し同様のカウント動作をさせ、すべてのクロック信号
に関してカウントすべき数をカウントすると、カウント
終了信号を出力する制御回路とを具備することを特徴と
するカウンタ回路。
8. A frequency divider that receives an original clock signal and outputs at least one frequency-divided signal having different frequencies, a counter that counts the clock signal, and counts with the original clock signal. A register that holds a count number and a count number to be counted by each of the frequency-divided signals, and the original clock signal, the frequency-divided signal, the count number of the counter, and data held in the register are input. After supplying a reset signal to the counter,
A clock signal of the lowest frequency is supplied to the counter, a counting operation is performed up to the number to be counted by the clock signal, a reset signal is sequentially supplied to the counter, and a clock signal of the next lowest frequency is supplied to the counter. And a control circuit for outputting a count end signal when the number of signals to be supplied is counted and the number to be counted for all clock signals is counted.
【請求項9】 原振クロック信号を入力し、相異なる1
個以上の自然数について前記原振クロック信号の2の前
記自然数乗分の1の周波数の分周信号をそれぞれ出力す
る分周器と、 各々が前記原振クロック信号、前記分周信号のいずれか
をクロック入力とする同期式カウンタ群とを具備するこ
とを特徴とするカウンタ回路。
9. An original clock signal is input, and different
Frequency dividers each outputting a frequency-divided signal having a frequency of 1 / the natural number power of 2 of the original clock signal for at least natural numbers, and each of the frequency dividers outputs one of the original clock signal and the frequency-divided signal. A counter circuit comprising: a group of synchronous counters that receive a clock.
JP18071796A 1996-07-10 1996-07-10 Counter circuit Expired - Fee Related JP3338294B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18071796A JP3338294B2 (en) 1996-07-10 1996-07-10 Counter circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18071796A JP3338294B2 (en) 1996-07-10 1996-07-10 Counter circuit

Publications (2)

Publication Number Publication Date
JPH1028047A JPH1028047A (en) 1998-01-27
JP3338294B2 true JP3338294B2 (en) 2002-10-28

Family

ID=16088093

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18071796A Expired - Fee Related JP3338294B2 (en) 1996-07-10 1996-07-10 Counter circuit

Country Status (1)

Country Link
JP (1) JP3338294B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7629913B2 (en) 2007-05-11 2009-12-08 Sony Corporation Data processing method, data processing apparatus, solid-state image pickup apparatus, image pickup apparatus and electronic apparatus

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5455860B2 (en) 2010-10-15 2014-03-26 株式会社東芝 Counter circuit and solid-state imaging device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7629913B2 (en) 2007-05-11 2009-12-08 Sony Corporation Data processing method, data processing apparatus, solid-state image pickup apparatus, image pickup apparatus and electronic apparatus

Also Published As

Publication number Publication date
JPH1028047A (en) 1998-01-27

Similar Documents

Publication Publication Date Title
US3992635A (en) N scale counter
JP3338294B2 (en) Counter circuit
JPH1117531A (en) Digital delay circuit and digital pll circuit
US6504407B2 (en) Programmable high speed frequency divider
JPH10261952A (en) Clock frequency divider
US7259634B2 (en) Arrangement and method for digital delay line
JP2766133B2 (en) Parallel-serial data conversion circuit
JP2002279792A (en) Semiconductor integrated circuit device
JPH083514B2 (en) Counter test equipment
US5945657A (en) Constant divider
JP2659186B2 (en) Digital variable frequency divider
JPH09198193A (en) Interface device for digital-analog converter
JPH0783257B2 (en) Variable frequency divider
JP2998704B2 (en) counter
JPH10303738A (en) Counter
JPH0514186A (en) Pulse width modulation circuit
JP3789448B2 (en) Microcontroller with system resource prescaler
JP2876698B2 (en) Display dynamic drive device
JP3666078B2 (en) Frequency divider circuit
JP3003328B2 (en) Clock signal circuit
JPH10290156A (en) Test circuit for multi-stage counter
JPH0779247B2 (en) Decode circuit
CN117394848A (en) Arbitrary integer frequency dividing circuit, high-speed clock chip and communication chip
JPH1028049A (en) Frequency divider circuit
JPH02113619A (en) Pulse generating circuit

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20020723

LAPS Cancellation because of no payment of annual fees