JPH10303738A - Counter - Google Patents

Counter

Info

Publication number
JPH10303738A
JPH10303738A JP4335498A JP4335498A JPH10303738A JP H10303738 A JPH10303738 A JP H10303738A JP 4335498 A JP4335498 A JP 4335498A JP 4335498 A JP4335498 A JP 4335498A JP H10303738 A JPH10303738 A JP H10303738A
Authority
JP
Japan
Prior art keywords
clock signal
circuit
count
frequency
detection signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP4335498A
Other languages
Japanese (ja)
Other versions
JP3372858B2 (en
Inventor
Akihiro Nozaki
暁弘 野崎
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.)
NEC IC Microcomputer Systems Co Ltd
Original Assignee
NEC IC Microcomputer Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC IC Microcomputer Systems Co Ltd filed Critical NEC IC Microcomputer Systems Co Ltd
Priority to JP04335498A priority Critical patent/JP3372858B2/en
Publication of JPH10303738A publication Critical patent/JPH10303738A/en
Application granted granted Critical
Publication of JP3372858B2 publication Critical patent/JP3372858B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To realize a counter capable of counting a high-frequency clock with a circuit small in circuit scale and small in power consumption. SOLUTION: An external setting value HDB denoting a count end value is divided into higher-order bits and lower-order bits, the higher-order bits are counted by using a counter circuit 12 small in circuit scale and small in power consumption and a comparator 13 detects matching. A clock is frequency-divided to make high frequency clock supply and supplied to the counter circuit 12. Then a shift register 14 and a multiplexer 15 are used to allow the shift register 14 operated by a high-frequency clock to shift the matching detection signal of the high-order bits by a digit number equivalent to the low-order bits to provide on output of a count end signal OUT.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は所定の数のクロック
を数えるカウンタに関し、特に高速なクロックを用いる
集積回路に内蔵されるのに適したカウンタに関する。
The present invention relates to a counter for counting a predetermined number of clocks, and more particularly to a counter suitable for being incorporated in an integrated circuit using a high-speed clock.

【0002】[0002]

【従来の技術】クロックに同期する同期式計数回路を用
いて、所定の数のクロックが入力されたときにパルスを
出力するカウンタがある。このようなカウンタは、例え
ばディスプレイ装置の水平同期信号の生成などに広く用
いられている。
2. Description of the Related Art There is a counter which outputs a pulse when a predetermined number of clocks are inputted by using a synchronous counting circuit synchronized with a clock. Such a counter is widely used, for example, for generating a horizontal synchronization signal of a display device.

【0003】図6に、所定数のクロックを数える、一般
的なカウンタのブロック図を示す。カウンタ60は、計
数回路61でクロックCLKの数をカウントし、比較器
62で計数回路61の計数値(Q0〜Qn)と所定の数
を示す外部設定値HDB(HDB0〜HDBn)とを比
較して、両値が一致したときに計数終了信号OUTを出
力する。なお、計数回路61はリセット信号RSTで初
期化される。また、比較器62は例えばEX−NOR回
路で構成されており、入力される計数値(Q0〜Qn)
と外部設定値HDB(HDB0〜HDBn)は、同数の
ビットで構成されている。
FIG. 6 is a block diagram of a general counter for counting a predetermined number of clocks. The counter 60 counts the number of clocks CLK by the counting circuit 61, and compares the count value (Q0 to Qn) of the counting circuit 61 with an external set value HDB (HDB0 to HDBn) indicating a predetermined number by the comparator 62. Then, when both values match, a count end signal OUT is output. Note that the counting circuit 61 is initialized by the reset signal RST. The comparator 62 is formed of, for example, an EX-NOR circuit, and receives input count values (Q0 to Qn).
And the external setting value HDB (HDB0 to HDBn) are composed of the same number of bits.

【0004】一般的に、計数回路61には図7に示され
る回路が用いられる。計数回路70は、クロック信号C
LKが共通に入力される出力回路であるD型フリップフ
ロップ700〜70nと、計数値の桁上げを行なう帰還
部71とで構成される。計数値はBCDコードで表現さ
れ、Q0がLSB,QnがMSBである。ところで、こ
の回路の動作周波数は、主に帰還部71の動作速度によ
って左右される。すなわち、帰還部71はインバータ7
10,EX−OR回路720〜72nおよびAND回路
730〜73nといったゲート回路から構成されている
ので、計数回路70の最大動作可能周波数は、帰還部7
1を構成するゲート回路のゲート遅延に依存することに
なる。
Generally, a circuit shown in FIG. 7 is used as the counting circuit 61. The counting circuit 70 outputs the clock signal C
D-type flip-flops 700 to 70n, which are output circuits to which LK is commonly input, and a feedback unit 71 that carries the count value. The count value is represented by a BCD code, where Q0 is the LSB and Qn is the MSB. By the way, the operating frequency of this circuit mainly depends on the operating speed of the feedback unit 71. That is, the feedback unit 71 is connected to the inverter 7
10, the maximum operable frequency of the counting circuit 70 is determined by the feedback unit 7 because it is constituted by gate circuits such as EX-OR circuits 720 to 72n and AND circuits 730 to 73n.
1 depends on the gate delay of the gate circuit.

【0005】近年、集積回路には高速動作が要求されて
おり、それに伴って集積回路で用いられるクロック信号
の周波数も高くなっている。しかしながら、計数回路7
0は、クロック信号CLKの周波数が高くなると帰還部
71のゲート遅延のために計数値の桁上げがクロック信
号CLKの入力に間にあわず、誤動作する場合がある。
したがって、最近は図7のような計数回路を用いずに、
シフトレジスタやフリップフロップのみでカウンタを構
成し、計数動作の高速化を図っている。しかしながら、
それらの計数回路では、回路規模や消費電力の点で問題
があった。
In recent years, high-speed operation has been demanded for integrated circuits, and the frequency of clock signals used in the integrated circuits has been increased accordingly. However, the counting circuit 7
When the frequency of the clock signal CLK is high, the carry of the count value does not coincide with the input of the clock signal CLK due to the gate delay of the feedback unit 71, and a malfunction may occur.
Therefore, recently, without using a counting circuit as shown in FIG.
The counter is constituted only by the shift register and the flip-flop, thereby speeding up the counting operation. However,
These counting circuits have problems in circuit scale and power consumption.

【0006】以下、図6の計数回路61として適用され
る、高速計数回路の例を説明する。
Hereinafter, an example of a high-speed counting circuit applied as the counting circuit 61 in FIG. 6 will be described.

【0007】図8は、特開平63−107317号公報
に記載された計数回路である。計数回路80は、n個の
フリップフロップ800〜80nを直列に接続してシフ
トレジスタを構成することによりn進カウンタを構成し
ている。動作状態においては、データ信号Dとして
「1」(アクティブレベルH)が入力されており、クロ
ック信号CLKの入力に応答して、AND回路811,
812…OR回路81nから順々にパルスO0〜Onが
出力される。また、フリップフロップ80nの出力Qn
が「1」となると、この反転出力/Qにより、全てのフ
リップフロップ800〜80nが初期化される。
FIG. 8 shows a counting circuit described in Japanese Patent Application Laid-Open No. 63-107317. The counting circuit 80 forms an n-ary counter by connecting n flip-flops 800 to 80n in series to form a shift register. In the operating state, “1” (active level H) is input as data signal D, and in response to the input of clock signal CLK, AND circuit 811
812... The pulses O0 to On are sequentially output from the OR circuit 81n. The output Qn of the flip-flop 80n
Becomes "1", all the flip-flops 800 to 80n are initialized by the inverted output / Q.

【0008】図9は、特開平5−136691号公報に
記載された計数回路である。計数回路90は、クロック
信号CLKが共通に入力されるD型フリップフロップ9
00〜902と、帰還部を構成するT型フリップフロッ
プ911〜914とで構成される。ただし帰還部は、図
7の帰還部71のように桁上げを行なうものではない。
すなわち、図7の計数回路70のようにBCDコードの
計数値を出力するのではなく、クロック信号CLKの入
力に応答してQ0〜Q3の4ビットで構成される16個
の異なる値を出力する。
FIG. 9 shows a counting circuit described in Japanese Patent Application Laid-Open No. Hei 5-136691. The counting circuit 90 includes a D-type flip-flop 9 to which the clock signal CLK is commonly input.
00 to 902 and T-type flip-flops 911 to 914 forming a feedback unit. However, the feedback section does not carry over as in the feedback section 71 of FIG.
That is, instead of outputting the count value of the BCD code as in the counter circuit 70 of FIG. 7, 16 different values composed of four bits Q0 to Q3 are output in response to the input of the clock signal CLK. .

【0009】[0009]

【発明が解決しようとする課題】図8および図9に示し
た計数回路を図6の計数回路61として用いると、次の
ような問題が生じる。
When the counting circuit shown in FIGS. 8 and 9 is used as the counting circuit 61 in FIG. 6, the following problem occurs.

【0010】例えば、256進の計数回路を考えた場
合、図7の計数回路70では8個のD型フリップフロッ
プとそれに対応した帰還部で構成される。これに対し
て、図8の計数回路80では、256個のフリップフロ
ップとゲート回路が必要となる。従って、比較器も含め
て、回路規模の増大が問題となる。さらに、全てのフリ
ップフロップが高速なクロック信号に同期して動作する
ため、消費電力も増大する。また図9の計数回路90で
は、D型フリップフロップの数は図7の計数回路70よ
り1つ少なくなるが、帰還部をT型フリップフロップで
構成しているため、図7の帰還部71の数倍のゲート数
が必要となり、回路規模および消費電力が増大する。
For example, when a 256-ary counting circuit is considered, the counting circuit 70 of FIG. 7 is composed of eight D-type flip-flops and a corresponding feedback unit. On the other hand, the counting circuit 80 of FIG. 8 requires 256 flip-flops and gate circuits. Therefore, an increase in the circuit scale including the comparator becomes a problem. Further, since all the flip-flops operate in synchronization with a high-speed clock signal, power consumption also increases. Also, in the counting circuit 90 of FIG. 9, the number of D-type flip-flops is one less than that of the counting circuit 70 of FIG. 7, but since the feedback unit is configured by a T-type flip-flop, the feedback unit 71 of FIG. Several times the number of gates is required, which increases the circuit scale and power consumption.

【0011】したがって、本発明は、回路規模および消
費電力の増加を低く抑えた、高速のクロック信号を計数
できるカウンタを提供することを目的とする。
Accordingly, it is an object of the present invention to provide a counter capable of counting a high-speed clock signal while suppressing an increase in circuit scale and power consumption.

【0012】[0012]

【課題を解決するための手段】本発明のカウンタは、ク
ロック信号が入力され当該クロック信号を分周して分周
クロック信号を出力する分周回路と、所定のビット数の
外部設定値が入力され当該外部設定値を第1のビット数
の第1の外部設定値と第2のビット数の第2の外部設定
値とに分割する分割手段と、分周クロック信号に同期し
て動作しクロック信号が第1の外部設定値の数入力され
たときに一致検出信号を出力する第1の計数比較手段
と、クロック信号に同期して動作しクロック信号が第2
の外部設定値の数入力されたときに一致検出信号を計数
終了信号として出力する第2の計数比較手段とを有す
る。
According to the present invention, a counter receives a clock signal, divides the clock signal and outputs a divided clock signal, and receives an externally set value of a predetermined number of bits. Dividing means for dividing the external set value into a first external set value having a first number of bits and a second external set value having a second number of bits; A first counting / comparing means for outputting a coincidence detection signal when a number of first external setting values are input; a second counting / comparing means operating in synchronization with the clock signal;
And a second counting and comparing means for outputting a coincidence detection signal as a counting end signal when the number of external setting values is inputted.

【0013】好適には、第1の計数比較手段は、分周ク
ロック信号が共通に入力される第1および第2のフリッ
プフロップと第1のフリップフロップの出力を桁上げ信
号として第2のフリップフロップに供給するゲート回路
とを備える第1の計数回路を含み、第2の計数比較手段
は、クロック信号が共通に入力される第3および第4の
フリップフロップで構成されかつ一致検出信号をデータ
入力とするシフトレジスタを備える第2の計数回路を含
む。
Preferably, the first counting and comparing means includes a first and a second flip-flop to which the frequency-divided clock signal is commonly input and a second flip-flop using the outputs of the first and second flip-flops as carry signals. And a second counting / comparing means, comprising a third and a fourth flip-flop to which a clock signal is commonly input and which outputs a coincidence detecting signal to the data. A second counting circuit including a shift register as an input is included.

【0014】また、本発明では、分周回路の分周数がd
のとき第2のビット数はlog2dとする。さらに、第
2のビット数がlのときシフトレジスタの段数は2l
1とする。
Further, according to the present invention, the frequency dividing number of the frequency dividing circuit is d.
In this case, the second bit number is log 2 d. Further, when the second bit number is 1, the number of stages of the shift register is 2 l
Let it be 1.

【0015】[0015]

【発明の実施の形態】図1に、本発明のカウンタのブロ
ック図を示す。本発明では、計数回路12として、回路
規模および消費電力の小さい、図7の計数回路を用い
る。そして、計数回路12を高速なクロック信号CLK
に対応させるため、クロック入力端子16から入力され
たクロック信号CLK(以下原クロック信号)を、分周
回路11で分周して計数回路12に供給する。分周され
たクロック信号CLKD(以下分周クロック信号)を計
数回路12の最大動作可能周波数とすれば、カウンタ1
0に供給される原クロック信号CLKは分周クロック信
号CLKDの数倍の周波数とすることができる。
FIG. 1 is a block diagram of a counter according to the present invention. In the present invention, as the counting circuit 12, the counting circuit of FIG. Then, the counting circuit 12 outputs the high-speed clock signal CLK.
The clock signal CLK (hereinafter referred to as an original clock signal) input from the clock input terminal 16 is frequency-divided by the frequency dividing circuit 11 and supplied to the counting circuit 12. If the frequency-divided clock signal CLKD (hereinafter, frequency-divided clock signal) is set as the maximum operable frequency of the counter circuit 12, the counter 1
The original clock signal CLK supplied to 0 can have a frequency several times that of the divided clock signal CLKD.

【0016】本発明では、計数動作を、上位ビットと下
位ビットとに分けて行なう。すなわち、所定の数を表す
外部設定値HDBがn(=上位m+下位l)ビットで構
成されるとすると、上位mビット(0〜m−1)の計数
を計数回路12で行い、下位lビット(0〜l−1)の
計数をシフトレジスタ14で行なう。下位ビットの数l
は、分周数をdとすると、l=log2dで求められ
る。分周比は2の階乗がよく、例えば、原クロック信号
CLKを2分周した場合はl=1,4分周した場合はl
=2,8分周した場合はl=3となる。このとき、シフ
トレジスタ14の段数は2l−1で求められる。
In the present invention, the counting operation is performed separately for the upper bits and the lower bits. That is, assuming that the external setting value HDB representing a predetermined number is composed of n (= upper m + lower 1) bits, counting of upper m bits (0 to m−1) is performed by the counting circuit 12, and lower 1 bit The count of (0 to l-1) is performed by the shift register 14. Number of lower bits l
Is obtained by l = log 2 d, where d is the frequency division number. The frequency division ratio is preferably a factorial of 2. For example, when the original clock signal CLK is frequency-divided by 2, l = 1, and when frequency-divided by 4, 1
In the case where the frequency is divided by 2.8 and 2.8, l = 3. At this time, the number of stages of the shift register 14 is calculated as 2 l -1.

【0017】外部設定値HDBは分割手段18’によっ
て分割され、上位ビットHDBL+0〜HDBM−1は
比較器13に、下位ビットHDB0〜HDBL−1はマ
ルチプレクサ15にそれぞれ入力される。したがって、
比較器13では、外部設定値HDBのうちのHDBL+
0〜HDBM−1(mビット)と計数回路12の計数値
Q0〜QM−1(mビット)とを比較し、両値が一致し
たときに一致検出信号OUT0を出力端子Yから出力す
る。なお、比較器13は、例えば2入力EX−NOR回
路で構成され、一方の入力に計数回路の出力Qを、他方
の入力に外部設定値HDBを入力する。したがって、計
数値Q0〜QM−1と外部設定値HDBL+0〜HDB
M−1が一致したとき、一致検出信号OUT0は「1」
(アクティブレベルH)となり、不一致のとき「0」
(インアクティブレベルL)となる。
The external setting value HDB is divided by the dividing means 18 ', and the upper bits HDBL + 0 to HDBM-1 are inputted to the comparator 13, and the lower bits HDB0 to HDBL-1 are inputted to the multiplexer 15. Therefore,
In the comparator 13, HDBL + of the external setting value HDB
0 to HDBM-1 (m bits) are compared with the count values Q0 to QM-1 (m bits) of the counter circuit 12, and when both values match, a match detection signal OUT0 is output from the output terminal Y. The comparator 13 is constituted by, for example, a two-input EX-NOR circuit. One input receives the output Q of the counting circuit, and the other input receives the external set value HDB. Therefore, the count values Q0 to QM-1 and the external set values HDBL + 0 to HDB
When M-1 matches, the match detection signal OUT0 becomes “1”.
(Active level H) and "0" when they do not match
(Inactive level L).

【0018】一致検出信号OUT0が出力されたら、そ
の信号OUT0を原クロック信号CLKにもとづいてシ
フトレジスタ14でシフトして、リタイミング一致検出
信号OUT1〜OUT2l−1を生成する。これらの信
号OUT1〜OUT2l−1は原クロック信号CLKの
計数値に相当する。生成された一致検出信号OUT1〜
OUT2l−1はマルチプレクサ15に入力され、外部
設定値HDBの下位ビットlによって選択されて計数終
了信号OUTとして一つだけ出力される。すなわち、シ
フトレジスタ14は実質的に下位ビットの計数回路とし
て振るまい、マルチプレクサ15は実質的に下位ビット
の比較器として振るまう。
When the coincidence detection signal OUT0 is output, the signal OUT0 is shifted by the shift register 14 based on the original clock signal CLK to generate retiming coincidence detection signals OUT1 to OUT2 l -1. These signals OUT1 to OUT2 l -1 correspond to the count value of the original clock signal CLK. The generated match detection signals OUT1 to OUT1
OUT2 l -1 is input to the multiplexer 15, selected by the lower bit l of the external setting value HDB, and output as a counting end signal OUT. That is, the shift register 14 behaves substantially as a lower-bit counting circuit, and the multiplexer 15 substantially behaves as a lower-bit comparator.

【0019】[0019]

【実施例】以下、本発明の具体的な実施例を説明する。
第1の実施例は図2のように構成される。本実施例は8
ビットまでの計数、すなわち0〜255までの原クロッ
ク信号CLKを計数できるカウンタである。このカウン
タ20では、2分周回路11aによって、原クロック信
号CLKを2分周して、分周クロック信号CLKDを生
成している。すなわち、分周クロック信号CLKDがf
[Mhz]の場合、原クロック信号CLKは2f[Mh
z]である。分周数dが2であるので、下位ビット数l
は1,シフトレジスタ段数も1となる。したがって、計
数回路12aは7ビットの計数値Q1〜Q7を出力する
ように構成され、比較器13aにおいて計数値Q1〜Q
7と外部設定値HDBの上位7ビットHDB1〜HDB
7とが比較される。また、シフトレジスタ14aは1段
でよいので1つのフリップフロップDF1で構成され
る。フリップフロップDF1は、比較器13aからの一
致検出信号OUT0を原クロック信号CLKによってリ
タイミングして、一致検出信号OUT1として出力す
る。マルチプレクサ15aには、一致検出信号OUT
0,OUT1がそれぞれデータ入力端子DIN0,DI
N1に入力される。これらの一致検出信号OUT0,O
UT1は、外部設定値HDBの下位ビットHDB0の値
によって選択される。すなわち、マルチプレクサ15a
のセレクト端子SELに外部設定値HDB0が入力され
ており、外部設定値HDB0=「0」のとき一致検出信
号OUT0が選択され、「1」のとき一致検出信号OU
T1が選択されて計数終了信号OUTとして出力され
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, specific embodiments of the present invention will be described.
The first embodiment is configured as shown in FIG. This embodiment is 8
This counter can count up to bits, that is, the original clock signal CLK from 0 to 255. In this counter 20, the original clock signal CLK is frequency-divided by 2 by the frequency-divided-by-2 circuit 11a to generate a frequency-divided clock signal CLKD. That is, the divided clock signal CLKD becomes f
In the case of [Mhz], the original clock signal CLK is 2f [Mh
z]. Since the frequency division number d is 2, the lower bit number l
Is 1, and the number of shift register stages is also 1. Therefore, the counting circuit 12a is configured to output the 7-bit count values Q1 to Q7.
7 and upper 7 bits HDB1 to HDB of external setting value HDB
7 is compared. Further, since the shift register 14a has only one stage, it is constituted by one flip-flop DF1. The flip-flop DF1 retiming the coincidence detection signal OUT0 from the comparator 13a with the original clock signal CLK and outputs the same as the coincidence detection signal OUT1. The match detection signal OUT is supplied to the multiplexer 15a.
0 and OUT1 are data input terminals DIN0 and DI
Input to N1. These match detection signals OUT0, O
UT1 is selected by the value of the lower bit HDB0 of the external setting value HDB. That is, the multiplexer 15a
Is set to the select terminal SEL, the match detection signal OUT0 is selected when the external set value HDB0 = “0”, and the match detection signal OU is set when the value is “1”.
T1 is selected and output as the count end signal OUT.

【0020】図3にタイミングチャートを示す。本実施
例の場合、外部設定値の下位ビットHDB0は最下位ビ
ットであるので、「0」に設定されたとき外部設定値は
偶数であり、「1」のときは奇数である。計数回路12
aの出力は、分周クロック信号CLKDが原クロック信
号CLKの2分周クロック信号なので、原クロック信号
CLKの偶数クロックで変化する。したがって、外部設
定値の上位ビットHDB1〜HDB7が一致した時点で
一致検出信号OUT0が発生したとき、最下位ビットH
DB0が「0」のときはマルチプレクサ15aで一致検
出信号OUT0が計数終了信号OUTとなる。これに対
して最下位ビットHDB0が「1」のときは、フリップ
フロップDF1で一致検出信号OUT0を原クロック信
号CLKの奇数クロックに合わせる。このようにしてリ
タイミングした一致検出信号OUT1を計数終了信号O
UTとする。言い換えれば、偶数値の一致検出信号OU
T0を1クロックずらして奇数値に対応した一致検出信
号としているのである。
FIG. 3 shows a timing chart. In the case of the present embodiment, since the lower bit HDB0 of the external setting value is the least significant bit, the external setting value is an even number when set to "0" and an odd number when set to "1". Counting circuit 12
The output of “a” changes with an even clock of the original clock signal CLK because the divided clock signal CLKD is the divided clock signal of the original clock signal CLK. Therefore, when the match detection signal OUT0 is generated when the upper bits HDB1 to HDB7 of the external set value match, the least significant bit H
When DB0 is "0", the coincidence detection signal OUT0 becomes the counting end signal OUT in the multiplexer 15a. On the other hand, when the least significant bit HDB0 is "1", the coincidence detection signal OUT0 is adjusted to the odd clock of the original clock signal CLK by the flip-flop DF1. The coincidence detection signal OUT1 retimed in this way is used as the counting end signal O
UT. In other words, the even value match detection signal OU
T0 is shifted by one clock to provide a coincidence detection signal corresponding to an odd value.

【0021】図2に戻って、具体的な数値を考える。例
えば、原クロック信号CLKが「255個」のときに計
数終了信号OUTを出力すると仮定する。この場合、外
部設定値HDB0〜HDB7は、「11111111」
と設定される。したがって、比較器13aでは、計数回
路12aの出力Q1〜Q7が「1111111(12
7)」となったときに一致検出信号OUT0が発生す
る。ここで、計数回路12aは2分周クロックCLKD
で計数動作を行なっているため、出力Q1〜Q7が「1
27」を示すとき原クロック信号CLKは「254」で
ある。今、外部設定値の最下位ビットHDB0は「1」
であるので、255個目の原クロック信号CLKが発生
されたときに、フリップフロップDF1の出力する一致
検出信号OUT1がマルチプレクサ15aで選択され、
計数終了信号OUTが出力される。
Returning to FIG. 2, specific numerical values will be considered. For example, it is assumed that the count end signal OUT is output when the original clock signal CLK is “255”. In this case, the external setting values HDB0 to HDB7 are “11111111”.
Is set. Therefore, in the comparator 13a, the outputs Q1 to Q7 of the counting circuit 12a are "11111111 (12
7), the coincidence detection signal OUT0 is generated. Here, the counting circuit 12a outputs the frequency-divided clock CLKD
, The outputs Q1 to Q7 output "1".
27, the original clock signal CLK is "254". Now, the least significant bit HDB0 of the external setting value is “1”.
Therefore, when the 255th original clock signal CLK is generated, the coincidence detection signal OUT1 output from the flip-flop DF1 is selected by the multiplexer 15a,
The counting end signal OUT is output.

【0022】本発明は、上述したように、高い周波数に
対応しない計数回路12aを用いた場合でも、計数回路
の最大動作可能周波数を超えた高速な原クロック信号C
LKの数を正確に計数することができる。
As described above, according to the present invention, even when the counting circuit 12a which does not correspond to a high frequency is used, the high-speed original clock signal C exceeding the maximum operable frequency of the counting circuit is used.
The number of LK can be counted accurately.

【0023】続いて、本発明の第2の実施例を説明す
る。第2の実施例は図4のように構成される。このカウ
ンタ40は、第1の実施例と同じく8ビットまでの計数
ができるカウンタであるが、原クロック信号CLKを4
分周した分周クロック信号CLKDを計数回路12bに
供給するものである。したがって、外部設定値HDB0
〜HDB7は、2ビットの下位ビットHDB0,HDB
1と、6ビットの上位ビットHDB2〜HDB7に分割
される。また、シフトレジスタ14bは3段でよいの
で、フリップフロップDF1〜DF3で構成されてい
る。これらのフリップフロップDF1〜DF3から出力
される一致検出信号OUT1〜OUT3は、マルチプレ
クサ15bにおいて外部設定値の下位ビットHDB0,
HDB1の値にもとづいて選択され、計数終了信号OU
Tとして出力される。
Next, a second embodiment of the present invention will be described. The second embodiment is configured as shown in FIG. This counter 40 is a counter capable of counting up to 8 bits as in the first embodiment.
The divided clock signal CLKD is supplied to the counting circuit 12b. Therefore, the external setting value HDB0
To HDB7 are two lower bits HDB0, HDB
1 and 6-bit upper bits HDB2 to HDB7. Further, since the shift register 14b may have three stages, the shift register 14b includes flip-flops DF1 to DF3. The match detection signals OUT1 to OUT3 output from the flip-flops DF1 to DF3 are output from the lower bits HDB0, HDB0,
The count end signal OU is selected based on the value of HDB1.
Output as T.

【0024】本実施例の場合、一致検出信号OUT0〜
OUT3と、外部設定値の下位ビットHDB0,HDB
1との対応は、次のようになる。 HDB1,HDB0が「00」のとき、一致検出信号O
UT0を選択。 HDB1,HDB0が「01」のとき、一致検出信号O
UT1を選択。 HDB1,HDB0が「10」のとき、一致検出信号O
UT2を選択。 HDB1,HDB0が「11」のとき、一致検出信号O
UT3を選択。
In the case of this embodiment, the coincidence detection signals OUT0 to OUT0
OUT3 and lower bits HDB0 and HDB of the external setting value
The correspondence with 1 is as follows. When HDB1 and HDB0 are “00”, the match detection signal O
Select UT0. When HDB1 and HDB0 are “01”, the match detection signal O
Select UT1. When HDB1 and HDB0 are "10", the match detection signal O
Select UT2. When HDB1 and HDB0 are "11", the match detection signal O
Select UT3.

【0025】図5にタイミングチャートを示す。本実施
例の計数回路12bは原クロック信号CLKの4回に1
回、カウントアップする。したがって、この4つの原ク
ロックをシフトレジスタ14bで計数して一致検出信号
OUT1〜OUT3を生成し、マルチプレクサ15bで
外部設定値の下位2ビットHDB0,HDB1と比較し
て計数終了信号OUTを出力する。
FIG. 5 shows a timing chart. The counting circuit 12b according to the present embodiment operates once every four times of the original clock signal CLK.
Count up. Therefore, the four original clocks are counted by the shift register 14b to generate coincidence detection signals OUT1 to OUT3, and the multiplexer 15b compares them with the lower two bits HDB0 and HDB1 of the external set value to output the count end signal OUT.

【0026】以上の構成によれば、実施例1よりも高速
なクロック信号に対応できる。なお、本実施例は実施例
1に比較して、分周回路,シフトレジスタおよびマルチ
プレクサの回路規模および消費電力は多少大きくなる
が、計数回路および比較回路の規模および消費電力は小
さくなる。このように、本発明では供給クロック信号を
高周波にしても、回路規模および消費電力がそれほど増
大しない。
According to the above configuration, it is possible to cope with a clock signal faster than the first embodiment. In this embodiment, the circuit scale and the power consumption of the frequency divider, the shift register and the multiplexer are slightly larger than those of the first embodiment, but the scale and the power consumption of the counting circuit and the comparison circuit are smaller. As described above, in the present invention, even if the supply clock signal is set to a high frequency, the circuit scale and power consumption do not increase so much.

【0027】[0027]

【発明の効果】以上の説明から明らかなように、本発明
のカウンタでは従来の図6のカウンタに対して分周回
路,シフトレジスタ,およびマルチプレクサを付加する
が、原クロック信号を高周波にするほど、計数回路およ
び比較回路の規模が小さくなる。したがって回路規模の
増大は少なく済む。また、原クロック信号を分周して低
周波で計数回路を動作させることができるため、消費電
力の点においても優れている。すなわち、本発明によれ
ば、図6のカウンタに図8または図9に示した計数回路
を適用した回路に対して、回路規模および消費電力の点
で優れたカウンタを実現できる。
As is apparent from the above description, the counter of the present invention has a frequency divider, a shift register, and a multiplexer added to the conventional counter of FIG. , The scale of the counting circuit and the comparing circuit is reduced. Therefore, the increase in the circuit scale is small. Further, since the counting circuit can be operated at a low frequency by dividing the frequency of the original clock signal, power consumption is excellent. That is, according to the present invention, it is possible to realize a counter superior in circuit scale and power consumption to a circuit in which the counter circuit shown in FIG. 8 or 9 is applied to the counter in FIG.

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

【図1】本発明の一実施形態の回路構成を示すブロック
図。
FIG. 1 is a block diagram showing a circuit configuration according to an embodiment of the present invention.

【図2】本発明の第1の実施例を示す回路図。FIG. 2 is a circuit diagram showing a first embodiment of the present invention.

【図3】本発明の第1の実施例の動作を示すタイミング
図。
FIG. 3 is a timing chart showing the operation of the first embodiment of the present invention.

【図4】本発明の第2の実施例を示す回路図。FIG. 4 is a circuit diagram showing a second embodiment of the present invention.

【図5】本発明の第2の実施例の動作を示すタイミング
図。
FIG. 5 is a timing chart showing the operation of the second embodiment of the present invention.

【図6】従来のカウンタの回路構成を示すブロック図。FIG. 6 is a block diagram showing a circuit configuration of a conventional counter.

【図7】本発明で用いられる計数回路を示す回路図。FIG. 7 is a circuit diagram showing a counting circuit used in the present invention.

【図8】シフトレジスタで構成された従来の高速計数回
路を示す回路図。
FIG. 8 is a circuit diagram showing a conventional high-speed counting circuit composed of a shift register.

【図9】フリップフロップで構成された従来の高速計数
回路を示す回路図。
FIG. 9 is a circuit diagram showing a conventional high-speed counting circuit constituted by flip-flops.

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

10,20,40,60 カウンタ 11,11a,11b 分周回路 12,12a,12b,61 計数回路 13,13a,13b,62 比較器 14,14a,14b シフトレジスタ 15,15a,15b マルチプレクサ 16,17,18,19 端子 18’ 外部設定値分割手段 DF1〜DF3 フリップフロップ 700〜70n,800〜80n,900〜902
D型フリップフロップ 710 インバータ 720〜72n EX−OR回路 730〜73n,811,812 AND回路 81n OR回路 911〜914 T型フリップフロップ
10, 20, 40, 60 Counter 11, 11a, 11b Frequency divider 12, 12a, 12b, 61 Counting circuit 13, 13a, 13b, 62 Comparator 14, 14a, 14b Shift register 15, 15a, 15b Multiplexer 16, 17 , 18, 19 Terminal 18 'External setting value dividing means DF1-DF3 Flip-flop 700-70n, 800-80n, 900-902
D-type flip-flop 710 Inverter 720-72n EX-OR circuit 730-73n, 811,812 AND circuit 81n OR circuit 911-914 T-type flip-flop

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 クロック信号が入力され当該クロック信
号を分周して分周クロック信号を出力する分周回路と、
所定の数を表す外部設定値が入力され当該外部設定値を
第1のビット数で表される第1の外部設定値と第2のビ
ット数で表される第2の外部設定値とに分割する分割手
段と、前記分周クロック信号に同期して前記第1のビッ
ト数で表わされる第1の計数値を出力する第1の計数回
路と、前記第1の外部設定値と前記第1の計数値とを比
較して両値が一致したときに一致検出信号を出力する第
1の比較器と、前記クロック信号が入力され前記第1の
比較器から前記一致検出信号が出力されてから前記第2
の外部設定値で指定された数の当該クロック信号が入力
されたときに前記一致検出信号を計数終了信号として出
力する出力手段とを有することを特徴とするカウンタ。
A frequency dividing circuit for receiving a clock signal and dividing the clock signal to output a divided clock signal;
An external setting value representing a predetermined number is input and the external setting value is divided into a first external setting value represented by a first bit number and a second external setting value represented by a second bit number Dividing means, a first counting circuit for outputting a first count value represented by the first bit number in synchronization with the frequency-divided clock signal, the first external setting value and the first A first comparator that compares the count value and outputs a match detection signal when both values match, and after the clock signal is input and the match detection signal is output from the first comparator, Second
And output means for outputting the coincidence detection signal as a count end signal when the number of clock signals specified by the external setting value is input.
【請求項2】 前記分周回路の分周数がdのとき、前記
第2のビット数はlog2dであることを特徴とする請
求項1記載のカウンタ。
2. The counter according to claim 1, wherein when the frequency division number of the frequency division circuit is d, the second bit number is log 2 d.
【請求項3】 前記出力手段は、前記クロック信号に同
期して第2の計数値を出力する第2の計数回路と、前記
一致検出信号が入力され前記第2の外部設定値と前記第
2の計数値とを比較して両値が一致したときに前記一致
検出信号を前記計数終了信号として出力する第2の比較
器とを備えることを特徴とする請求項1または2記載の
カウンタ。
3. The output means includes: a second counting circuit that outputs a second count value in synchronization with the clock signal; and a second external set value to which the coincidence detection signal is input and the second external set value and the second count value. 3. The counter according to claim 1, further comprising: a second comparator that compares the count value with the second count value and outputs the match detection signal as the count end signal when the two values match.
【請求項4】 前記第2の計数回路は、前記一致検出信
号を前記クロック信号に同期してシフトして当該シフト
出力を前記第2の計数値として出力するシフトレジスタ
であることを特徴とする請求項3記載のカウンタ。
4. The method according to claim 1, wherein the second counting circuit is a shift register that shifts the coincidence detection signal in synchronization with the clock signal and outputs the shift output as the second count value. The counter according to claim 3.
【請求項5】 前記第2のビット数がlのとき、前記シ
フトレジスタの段数は2l−1であることを特徴とする
請求項4記載のカウンタ。
5. The counter according to claim 4, wherein when the second bit number is 1, the number of stages of the shift register is 2 l -1.
【請求項6】 前記第2の比較器は、前記一致検出信号
および前記シフト出力を前記第2の外部設定値にもとづ
いて選択して前記計数終了信号として出力するマルチプ
レクサであることを特徴とする請求項4記載のカウン
タ。
6. The multiplexer according to claim 1, wherein the second comparator is a multiplexer that selects the coincidence detection signal and the shift output based on the second external set value and outputs the selected signal as the count end signal. The counter according to claim 4.
【請求項7】 クロック信号が入力され当該クロック信
号を2の階乗で分周して分周クロック信号を出力する分
周回路と、所定のビット数の外部設定値が入力され当該
外部設定値を第1のビット数の第1の外部設定値と第2
のビット数の第2の外部設定値とに分割する分割手段
と、前記分周クロック信号に同期して動作し前記クロッ
ク信号が前記第1の外部設定値の数入力されたときに一
致検出信号を出力する第1の計数比較手段と、前記クロ
ック信号に同期して動作し前記第1の計数比較手段から
前記一致検出信号が出力されてから前記クロック信号が
前記第2の外部設定値の数入力されたときに前記一致検
出信号を計数終了信号として出力する第2の計数比較手
段とを有することを特徴とするカウンタ。
7. A frequency divider for receiving a clock signal, dividing the clock signal by a factor of 2 and outputting a frequency-divided clock signal, and receiving an external set value of a predetermined number of bits and receiving the external set value With a first external setting of a first number of bits and a second
Division means for dividing the number of bits into a second external setting value, and a coincidence detection signal which operates in synchronization with the frequency-divided clock signal and receives the number of the first external setting values as the clock signal A first count comparing means for outputting the second external set value after the coincidence detection signal is output from the first count comparing means and operated in synchronization with the clock signal. A counter which outputs the coincidence detection signal as a count end signal when the counter is input.
【請求項8】 前記第1の計数比較手段は、前記分周ク
ロック信号が共通に入力される第1および第2のフリッ
プフロップと前記第1のフリップフロップの出力を桁上
げ信号として前記第2のフリップフロップに供給するゲ
ート回路とを備える第1の計数回路を含み、前記第2の
計数比較手段は、前記クロック信号が共通に入力される
第3および第4のフリップフロップで構成されかつ前記
一致検出信号をデータ入力とするシフトレジスタを備え
る第2の計数回路を含むことを特徴とする請求項7記載
のカウンタ。
8. The first counting / comparing means, wherein the first and second flip-flops to which the frequency-divided clock signal is commonly input and the output of the first flip-flop are used as carry signals. And a gate circuit that supplies the clock signal to the flip-flop, wherein the second count comparing means is constituted by third and fourth flip-flops to which the clock signal is commonly input, and The counter according to claim 7, further comprising a second counting circuit including a shift register that receives the coincidence detection signal as a data input.
JP04335498A 1997-02-27 1998-02-25 counter Expired - Fee Related JP3372858B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP04335498A JP3372858B2 (en) 1997-02-27 1998-02-25 counter

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP9-44139 1997-02-27
JP4413997 1997-02-27
JP04335498A JP3372858B2 (en) 1997-02-27 1998-02-25 counter

Publications (2)

Publication Number Publication Date
JPH10303738A true JPH10303738A (en) 1998-11-13
JP3372858B2 JP3372858B2 (en) 2003-02-04

Family

ID=26383111

Family Applications (1)

Application Number Title Priority Date Filing Date
JP04335498A Expired - Fee Related JP3372858B2 (en) 1997-02-27 1998-02-25 counter

Country Status (1)

Country Link
JP (1) JP3372858B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006197367A (en) * 2005-01-14 2006-07-27 Nec Electronics Corp Counter circuit and semiconductor device including it
JP2009212736A (en) * 2008-03-04 2009-09-17 Fujitsu Microelectronics Ltd Semiconductor integrated circuit
JP2017167799A (en) * 2016-03-16 2017-09-21 株式会社東芝 Random number generator circuit

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006197367A (en) * 2005-01-14 2006-07-27 Nec Electronics Corp Counter circuit and semiconductor device including it
US7359475B2 (en) 2005-01-14 2008-04-15 Nec Electronics Corporation Counter circuit and semiconductor device containing the same
JP4666462B2 (en) * 2005-01-14 2011-04-06 ルネサスエレクトロニクス株式会社 Counter circuit and semiconductor device including the same
JP2009212736A (en) * 2008-03-04 2009-09-17 Fujitsu Microelectronics Ltd Semiconductor integrated circuit
JP2017167799A (en) * 2016-03-16 2017-09-21 株式会社東芝 Random number generator circuit
US10459692B2 (en) 2016-03-16 2019-10-29 Kabushiki Kaisha Toshiba Random number generator

Also Published As

Publication number Publication date
JP3372858B2 (en) 2003-02-04

Similar Documents

Publication Publication Date Title
US5361290A (en) Clock generating circuit for use in single chip microcomputer
US4876704A (en) Logic integrated circuit for scan path system
US6108393A (en) Enhanced prescaler phase interface
JPH10303738A (en) Counter
CN108777575B (en) Frequency divider
JPH10276083A (en) Even-numbered and odd-numbered frequency division circuit
US7359475B2 (en) Counter circuit and semiconductor device containing the same
US7259634B2 (en) Arrangement and method for digital delay line
JPH10261952A (en) Clock frequency divider
US4400615A (en) Programmable counter circuit
KR20010091311A (en) Programmable frequency divider by high speed counter
JPH1198007A (en) Frequency divider
US5847667A (en) Digital-to-analog converter interface apparatus
JP3338294B2 (en) Counter circuit
JPH04142116A (en) Variable frequency divider
JPH0783257B2 (en) Variable frequency divider
JPS63227119A (en) Digital variable frequency dividing circuit
JPH06112812A (en) Binary counter
JP2794950B2 (en) Integrator circuit
JP3337088B2 (en) Counter circuit with pause input
JP2000286695A (en) Divider circuit, serial-parallel conversion circuit using the divider circuit and serial data transmitting and receiving circuit
JPH01108807A (en) Pulse generating circuit
JPS5826858B2 (en) ring counter circuit
JPH1028049A (en) Frequency divider circuit
JPH0884069A (en) Variable frequency divider

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: 20021029

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees