JPH03128529A - Clock generating circuit - Google Patents
Clock generating circuitInfo
- Publication number
- JPH03128529A JPH03128529A JP26727389A JP26727389A JPH03128529A JP H03128529 A JPH03128529 A JP H03128529A JP 26727389 A JP26727389 A JP 26727389A JP 26727389 A JP26727389 A JP 26727389A JP H03128529 A JPH03128529 A JP H03128529A
- Authority
- JP
- Japan
- Prior art keywords
- clock
- remainder
- trigger
- frequency
- register
- 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.)
- Pending
Links
- 230000001186 cumulative effect Effects 0.000 abstract description 5
- 230000003111 delayed effect Effects 0.000 description 3
- 125000004122 cyclic group Chemical group 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000000034 method Methods 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 230000005236 sound signal Effects 0.000 description 1
Landscapes
- Manipulation Of Pulses (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
この発明は、ある周波数のクロックから他の周波数のク
ロックを作成するクロック発生回路に関し、周波数比が
割り切れない値であってもずれのないクロックを作成す
ることができるものである。[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a clock generation circuit that generates a clock of another frequency from a clock of a certain frequency. can be created.
ディジタル機器においては、マスタクロックから様々な
周波数のクロックを作成して、各部の制御に用いている
。あるクロックから他の周波数のクロックを作成する場
合、通常はクロックをカウンタで分周して得ている。In digital equipment, clocks of various frequencies are created from a master clock and used to control each part. When creating a clock with a different frequency from a certain clock, the frequency of the clock is usually divided using a counter.
ところがカウンタで分周してクロックを作成する場合、
もとのクロックとの分周比が整数倍でなければならず、
元のクロック周波数を割り切れない周波数のクロックを
作成しようとすると、その小数点以下のずれが出て、徐
々にタイミングがずれてしまう。このようなずれを防止
するのにビット精度を上げることも考えられるが、1/
3゜1/7といった循環小数ではいくらビット精度を上
げてもずれは残ってしまう。However, when creating a clock by dividing the frequency with a counter,
The division ratio of the original clock must be an integer multiple,
If you try to create a clock with a frequency that is not divisible by the original clock frequency, the decimal point will be off and the timing will gradually shift. Increasing the bit precision can be considered to prevent such deviations, but 1/
With repeating decimal numbers such as 3° 1/7, no matter how much bit precision you increase, the discrepancy will remain.
したがって、結局のところは作成しようとするクロック
で割り切れる周波数のクロックを用いなければならなか
った。ところが、このような方法では、例えば44.
1 kll、 48 kHz、 32 kHz等の
サンプリング周波数を有するPCM音声信号と、32.
25kHzのM I D I (Muslcal I
nstrumentDigital Interfac
e )制御による電子音を同期させるような場合には、
マスタクロックに極めて高い周波数が必要となり、処理
も高速化が必要とされる。Therefore, in the end, it was necessary to use a clock whose frequency was divisible by the clock to be created. However, with this method, for example, 44.
a PCM audio signal having a sampling frequency of 1 kll, 48 kHz, 32 kHz, etc.; 32.
25kHz MIDI (Muslcal I)
nstrumentDigital Interface
e) When synchronizing electronic sounds by control,
An extremely high frequency is required for the master clock, and high-speed processing is also required.
この発明は、前記従来の技術における問題点を解決して
、元のクロックを割り切れない周波数や循環少数となる
周波数のクロックを作成てきるようにして、比較的遅い
クロックを使用して、ずれのない任意の周波数のクロッ
クを作成することができるクロック発生回路を提供しよ
うとするものである。The present invention solves the problems in the conventional technology and creates a clock with a frequency that is not divisible by the original clock or a frequency that is a cyclic decimal, and uses a relatively slow clock to eliminate the deviation. The present invention aims to provide a clock generation circuit that can generate a clock of any frequency.
この発明は、人力されるクロックの周波数を所望のクロ
ックの周波数で除算した場合の帯分数の整数を保持する
比較レジスタと、同分子数を保持する余りレジスタと、
同分母数を保持する除数レジスタと、前記入力されるク
ロックをカウントするカウンタと、このカウント値が前
記整数に対応する値に達するごとにトリガを出し、かつ
このカウンタをクリアする第1コンパレータと、前記ト
リガが出されるごとに前記分子数を累算する累算器と、
この累算値が前記分母数より大きくなったことを検出し
て、前記トリガを出すカウント値を1増加させる第2コ
ンパレータと、この第2コンパレータで前記累算値が前
記分母数より大きくなったことが検出されるごとに、前
記累算値から前記分母数を引算して新たな累算値とする
引算器とを具え、前記トリガを前記所望のクロ・ツクと
して出力してなるものである。This invention includes a comparison register that holds an integer of a mixed number when the frequency of a manually inputted clock is divided by a desired clock frequency, and a remainder register that holds the same number of molecules.
a divisor register that holds the same denominator, a counter that counts the input clock, and a first comparator that issues a trigger and clears the counter every time this count value reaches a value corresponding to the integer; an accumulator that accumulates the number of molecules each time the trigger is issued;
a second comparator that detects that the cumulative value has become larger than the denominator number and increases the count value for issuing the trigger by 1; and a second comparator that detects that the cumulative value has become larger than the denominator number. and a subtractor that subtracts the denominator number from the accumulated value to obtain a new accumulated value each time the accumulated value is detected, and outputs the trigger as the desired clock. It is.
この発明によれば、クロックのカウント値が帯分数の整
数に達するごとにトリガが出されこれが出力クロックと
なる。そして、トリガが出されるごとに余り数の分子数
が累算されて、その累算値が分母数より大きくなったら
、クロックのカウント値が前記整数+1になったときに
(すなわちトリガを出すタイミングを1クロック遅らせ
て)トリガが出されるようにして、余り数を時々抽圧し
ている。According to this invention, a trigger is issued every time the count value of the clock reaches an integer of the mixed number, and this becomes the output clock. Then, each time a trigger is issued, the remainder number of numerators is accumulated, and when the accumulated value becomes larger than the denominator number, when the clock count value becomes the integer + 1 (i.e., the timing to issue a trigger) (delayed by one clock) so that the trigger is issued, and the remaining number is extracted from time to time.
これにより、元のクロックを割り切れない周波数や循環
小数となる周波数のクロックを作成する場合にもトータ
ル的にはずれを生じることがなくなり、比較的遅いクロ
ックを使用することができ、処理速度も遅くてすむよう
になる。As a result, even when creating a clock with a frequency that is not divisible by the original clock or a frequency that is a repeating decimal number, there will be no deviation in total, and a relatively slow clock can be used, and the processing speed is also slow. I will come to live.
この発明の一実施例を第1図に示す。ここでは分周比M
/N (M、Nは整数でM>N)のクロ・ツクを作成す
るものとする。An embodiment of this invention is shown in FIG. Here, the division ratio M
/N (M, N are integers, M>N) shall be created.
M/NをM1+ (M2/N)
なる帯分数に置き換える。ここで、Mlは整数、M2/
Nは余り数、M2、Nは整数でM2<Nである。Replace M/N with a mixed number M1+ (M2/N). Here, Ml is an integer, M2/
N is a remainder number, M2 and N are integers, and M2<N.
第1図の回路には、整数M1、余り数の分子数M2、余
り数の分母数Nのデータが入力され、それぞれ比較レジ
スタ10、余りレジスタ12、除数レジスタ14に取り
込む。/Xイノくイトセ、ソト回路16は上位、下位8
ビツトずつに分けて入力される各データMl、M2.N
を元の16ビ・ントのデータになおして各レジスタ10
,12.14に取り込むものである。Data of an integer M1, a numerator number M2 of the remainder number, and a denominator number N of the remainder number are input to the circuit shown in FIG. 1, and are taken into a comparison register 10, a remainder register 12, and a divisor register 14, respectively. /X Inoku Itose, Soto circuit 16 is upper and lower 8
Each data M1, M2 . N
is converted to the original 16-bit data and each register 10 is
, 12.14.
元のクロック信号は、クロック発生器16から発生され
て、1クロック遅延回路17から出力されるカウンタス
タート信号が立ち上がっている時にアンド回路18を介
してカウンタ20のカウント人力に加わり、これをカウ
ントアツプする。The original clock signal is generated by the clock generator 16, and when the counter start signal output from the 1-clock delay circuit 17 is rising, it is added to the counting power of the counter 20 via the AND circuit 18, and is counted up. do.
比較セレクタ22は、Ml−1(余り数分を補正しない
とき)またはMl(余り数を補正するとき)を選択し、
選択した値を比較レジスタラッチ回路24にラッチする
。コンパレータ26(第1コンパレータ)はカウンタ2
0の値を比較レジスタ回路24にラッチした値と比較し
、カウンタ値がラッチした値に達すると、比較出力C1
を出力し、これを1クロツク遅延回路28で1クロツク
遅延し、ノア回路30を介して出力する。このノア回路
30の出力が周波数を変換したクロック出力CL’ と
なる。The comparison selector 22 selects Ml-1 (when not correcting the remainder) or Ml (when correcting the remainder),
The selected value is latched into the comparison register latch circuit 24. Comparator 26 (first comparator) is counter 2
The value of 0 is compared with the value latched in the comparison register circuit 24, and when the counter value reaches the latched value, the comparison output C1
is output, delayed by one clock in the one-clock delay circuit 28, and outputted via the NOR circuit 30. The output of this NOR circuit 30 becomes the frequency-converted clock output CL'.
また、ノア回路30の出力はノア回路32を介してカウ
ンタ20のクリア人力に加わり、これをクリアする。ま
た、ノア回路30の出力ばオア回路34を介して比較レ
ジスタ回路24に加わり、比較セレクタ22の新たな出
力をラッチする。Further, the output of the NOR circuit 30 is added to the manual clearing power of the counter 20 via the NOR circuit 32 to clear it. Further, the output of the NOR circuit 30 is applied to the comparison register circuit 24 via the OR circuit 34, and a new output of the comparison selector 22 is latched.
余りレジスタ12に保持された余り数の分子数は、加算
器36で引算器38からの出力が加算されて、その加算
値はオア回路42から出力される前記オア回路30から
の信号により除算補正アキュームレータ40に取り込ま
れる。このアキュームレータ40の出力は引算器38を
介して加算器36に戻されて累算されていく。The output from the subtracter 38 is added to the numerator number of the remainder held in the remainder register 12 by an adder 36, and the added value is divided by the signal from the OR circuit 30 that is output from the OR circuit 42. It is taken into the correction accumulator 40. The output of this accumulator 40 is returned to the adder 36 via the subtracter 38 and is accumulated.
コンパレータ44(第2コンパレータ)は除数レジスタ
14に保持された余り数の分母数とアキュームレータ4
0出力とを比較し、アキュームレータ40の出力のほう
が大きくなったとき比較出力C2を出力する。この比較
出力C2はアンド回路46を介して比較セレクタ22に
加わり、Mlを選択する(これ以外はM−1を選択する
)。これにより余り数分の補正が行なわれる。A comparator 44 (second comparator) uses the denominator of the remainder held in the divisor register 14 and the accumulator 4.
0 output, and when the output of the accumulator 40 is larger, a comparison output C2 is output. This comparison output C2 is applied to the comparison selector 22 via the AND circuit 46, and selects Ml (other than this selects M-1). As a result, correction for the remaining number is performed.
また、比較出力C2はアンド回路48に加わり、除数レ
ジスタ14で保持している分母数Nを引算機38に送り
(それ以外ではアンド回路48の出力はO)、累算値か
らNすなわち補正した分を引いて新たな累算値とする。In addition, the comparison output C2 is applied to the AND circuit 48, which sends the denominator number N held in the divisor register 14 to the subtracter 38 (otherwise, the output of the AND circuit 48 is O), and corrects N from the accumulated value. Subtract that amount to get the new cumulative value.
なお、カウンタ1ラップ回路50は、カウンタ20がど
こまで進んだか見たい時に、その見たいタイミングでカ
ウント1ラップ信号を送ると、その時のカウンタ20の
カウント値を16ビット−度にラッチして、次にカウン
タ1ラップ信号が与えられるまで保持するものである。Note that when you want to see how far the counter 20 has progressed, the counter 1 wrap circuit 50 sends a count 1 lap signal at the desired timing, latches the count value of the counter 20 at that time to 16 bits, and then outputs the next count value. It is held until the counter 1 wrap signal is given to the counter.
これにより、実際のラッチのタイミングと値を読む時間
にずれがあっても、正確な値を読むことができる。特に
、第1図の回路を8ビツトのCPUに付けて動かす時等
は、2回に分けて読まなければならないので有効である
第1図の回路の動作例について説明する。ここでは元の
クロックCLを100 Hzとして、7出のクロック出
力CL’を得るものとする。このとき分周比は100/
7となり帯分数を求めると14+ (2/7)となる。This allows accurate values to be read even if there is a lag between the actual latch timing and the time to read the value. In particular, when the circuit of FIG. 1 is attached to an 8-bit CPU and operated, an example of the operation of the circuit of FIG. 1 will be explained, which is effective because it has to be read twice. Here, it is assumed that the original clock CL is 100 Hz and seven clock outputs CL' are obtained. At this time, the frequency division ratio is 100/
7, and the mixed number is 14+ (2/7).
従って、
1−14
2−2
N謹7
となる。これら各データMl、M2.Nは外部から入力
されて、各レジスタ10,12.14に保持される。は
じめはカウンタ20、アキュームレータ40はクリアさ
れている。動作を開始させると、比較セレクタ22はM
l−1−13を選択して比較レジスタラッチ回路24に
ラッチする。カウンタスタート信号を立ち上げると、カ
ウンタ20はクロックCLをカウントする。Therefore, it becomes 1-14 2-2 N 7. Each of these data Ml, M2. N is input from the outside and held in each register 10, 12.14. Initially, the counter 20 and accumulator 40 are cleared. When the operation is started, the comparison selector 22
1-1-13 is selected and latched into the comparison register latch circuit 24. When the counter start signal is raised, the counter 20 counts the clock CL.
カウント値が13に達するとコンパレータ26は比較出
力C1を出力し、1クロツク遅延回路28で1クロツク
遅延して14カウント目にトリガを出す。これが変換後
のクロックCL’ となる。When the count value reaches 13, the comparator 26 outputs a comparison output C1, which is delayed by one clock in the one-clock delay circuit 28, and a trigger is issued at the 14th count. This becomes the converted clock CL'.
アキュームレータ40ははじめは0なので、トリガ信号
が与えられたとき余りレジスタ12の出力値2を取り込
む。トリガによりカウンタ20はリセットされ、再びカ
ウントを繰り返す。Since the accumulator 40 is initially 0, it takes in the output value 2 of the remainder register 12 when the trigger signal is applied. The counter 20 is reset by the trigger and repeats counting again.
同様に次は14カウント後にトリガとなり、〔アキュー
ムレータ40の出力値2〕+〔余りレジスタ12の出力
値2〕−4がアキュームレータ40に新たに取り込まれ
る。その次も14カウント後にトリがとなりアキューム
レータ40には4+2−6が取り込まれる。さらにその
次も14カウント後にトリがとなりアキュームレータ4
0には6+2−8が取り込まれる。Similarly, a trigger is generated after 14 counts, and [output value 2 of accumulator 40]+[output value 2 of remainder register 12]-4 is newly taken into accumulator 40. After the next count of 14, there is a bird, and 4+2-6 is taken into the accumulator 40. Furthermore, after 14 counts, the bird becomes accumulator 4.
6+2-8 is taken into 0.
すると、次にはコンパレータ44はA>Bとなるので、
比較出力C2がアンド回路46を介して比較セレクタ2
2に加わりMl−14を選択する。Then, since the comparator 44 becomes A>B,
Comparison output C2 is sent to comparison selector 2 via AND circuit 46.
2 and selects Ml-14.
これにまりカウンタ20の15カウント目にトリガが出
されて余り分か補正される。また、この補正が行なわれ
たときはアンド回路48がオンされてN−7が引算器3
8に加わり、8−7−1が引算器38から出力される。When this occurs, a trigger is issued at the 15th count of the counter 20, and the remainder is corrected. Also, when this correction is performed, the AND circuit 48 is turned on and N-7 is output from the subtracter 3.
8 and 8-7-1 is output from the subtracter 38.
従って、次にはアキニームレータ40には1+2が取込
まれて、コンパレータ44の比較出力C2は立下がり、
比較セレクタ22は再びMl−1−13を出力する。Therefore, next time, 1+2 is taken into the Akinimulator 40, and the comparison output C2 of the comparator 44 falls.
Comparison selector 22 again outputs Ml-1-13.
以上の動作をまとめると次のようになる。The above operations can be summarized as follows.
このようにして、入力クロックCLの100クロツクの
間に7回トリガがかかる。つまり、カウントの誤差はど
んな数をカウントしても入力クロック精度分しかずれな
いことになる。In this way, the trigger is applied seven times during 100 clocks of the input clock CL. In other words, no matter how many numbers are counted, the error in the count is only the amount of the input clock precision.
なお、アキュームレータ40のビット数を増やすことに
より、より複雑な分数にも対応することができる。Note that by increasing the number of bits of the accumulator 40, more complex fractions can be handled.
以上説明したように、この発明によれば、クロックのカ
ウント値が舟分数の整数に達するごとにトリガを出して
余り数の分子数を累算し、その累算値が分母数より大き
くなったら、クロックのカウント値が前記整数+1にな
ったときにトリガを出すようにして、余り数を時々補正
したので、元のクロックを割り切れない周波数や循環小
数となる周波数のクロックを作成する場合にもトータル
的にはずれを生じることがなくなり、比較的遅いクロッ
クを使用することができ、処理速度も遅くてすむように
なる。As explained above, according to the present invention, each time the count value of the clock reaches an integer of the fraction, a trigger is issued to accumulate the numerator of the remainder, and when the accumulated value becomes larger than the denominator, , the trigger is issued when the clock count value reaches the above integer + 1, and the remainder is sometimes corrected, so it can also be used when creating a clock with a frequency that is not divisible by the original clock or a frequency that is a repeating decimal. There is no total deviation, a relatively slow clock can be used, and the processing speed can be slow.
第1図は、この発明の一実施例を示す回路図である。
10・・・比較レジスタ、12・・・余りレジスタ、1
4・・・除数レジスタ、20・・・カウンタ、26・・
・第1コンパレータ、40・・・除算補正アキュームレ
ータ(累算器)、44・・・第2コンパレータ、38・
・・引算器、CL・・・人力クロック、CL’ ・・・
出力クロック。FIG. 1 is a circuit diagram showing an embodiment of the present invention. 10...Comparison register, 12...Remainder register, 1
4...Divisor register, 20...Counter, 26...
- First comparator, 40... Division correction accumulator (accumulator), 44... Second comparator, 38.
...Subtractor, CL...Manual clock, CL'...
Output clock.
Claims (1)
で除算した場合の帯分数の整数を保持する比較レジスタ
と、同分子数を保持する余りレジスタと、同分母数を保
持する除数レジスタと、前記入力されるクロックをカウ
ントするカウンタと、 このカウント値が前記整数に対応する値に達するごとに
トリガを出し、かつこのカウンタをクリアする第1コン
パレータと、 前記トリガが出されるごとに前記分子数を累算する累算
器と、 この累算値が前記分母数より大きくなったことを検出し
て、前記トリガを出すカウント値を1増加させる第2コ
ンパレータと、 この第2コンパレータで前記累算値が前記分母数より大
きくなったことが検出されるごとに、前記累算値から前
記分母数を引算して新たな累算値とする引算器とを具え
、 前記トリガを前記所望のクロックとして出力してなるク
ロック発生回路。[Claims] A comparison register that holds an integer of a mixed number when the input clock frequency is divided by a desired clock frequency, a remainder register that holds the same number of numerators, and a same denominator number. a divisor register; a counter that counts the input clock; a first comparator that issues a trigger and clears the counter each time the count value reaches a value corresponding to the integer; and a first comparator that clears the counter each time the trigger is issued. an accumulator that accumulates the number of numerators, a second comparator that detects that the accumulated value is larger than the denominator number and increases by 1 a count value that issues the trigger; a subtracter that subtracts the denominator number from the accumulated value to obtain a new accumulated value each time it is detected that the accumulated value is larger than the denominator number, and the trigger A clock generation circuit which outputs the desired clock as the desired clock.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP26727389A JPH03128529A (en) | 1989-10-13 | 1989-10-13 | Clock generating circuit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP26727389A JPH03128529A (en) | 1989-10-13 | 1989-10-13 | Clock generating circuit |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH03128529A true JPH03128529A (en) | 1991-05-31 |
Family
ID=17442548
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP26727389A Pending JPH03128529A (en) | 1989-10-13 | 1989-10-13 | Clock generating circuit |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH03128529A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011199363A (en) * | 2010-03-17 | 2011-10-06 | Konica Minolta Business Technologies Inc | Control apparatus and image forming apparatus |
US8194186B2 (en) | 2008-04-23 | 2012-06-05 | Silicon Library, Inc. | Receiver capable of generating audio reference clock |
US8682632B1 (en) * | 2011-02-16 | 2014-03-25 | Qlogic, Corporation | Simulation system and method thereof |
-
1989
- 1989-10-13 JP JP26727389A patent/JPH03128529A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8194186B2 (en) | 2008-04-23 | 2012-06-05 | Silicon Library, Inc. | Receiver capable of generating audio reference clock |
JP2011199363A (en) * | 2010-03-17 | 2011-10-06 | Konica Minolta Business Technologies Inc | Control apparatus and image forming apparatus |
US8639366B2 (en) | 2010-03-17 | 2014-01-28 | Konica Minolta Business Technologies, Inc. | Control apparatus and image forming apparatus |
US8682632B1 (en) * | 2011-02-16 | 2014-03-25 | Qlogic, Corporation | Simulation system and method thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100237539B1 (en) | Frequency synthesizer | |
JP2005198296A (en) | Multi-stage numeric counter oscillator | |
US7205800B2 (en) | Clock frequency divider circuit | |
JP6481533B2 (en) | Digitally controlled oscillator circuit | |
CN118677452B (en) | Method for Correcting TDC Step Size in ADPLL Based on Random Jitter | |
JPH03128529A (en) | Clock generating circuit | |
JPH0199322A (en) | Frequency divider | |
JPS63151217A (en) | Frequency divider circuit whose output frequency is partly missing | |
JP3536426B2 (en) | Waveform generator | |
JPS62233932A (en) | Decoding circuit for bch code | |
JPS5862928A (en) | Deglitch circuit | |
JP5493591B2 (en) | Clock divider circuit and method | |
JP3523369B2 (en) | Direct digital synthesizer | |
JPH08125494A (en) | Moving average filter | |
JPS59190724A (en) | Frequency variable pulse generator | |
CN1797955B (en) | Multi-Stage Digital Counting Oscillator | |
JPH02101824A (en) | Cyclic redundancy check code generation device | |
KR960014531B1 (en) | Sampling Frequency Multiplier in Digital Waveform Generators | |
EP0922332B1 (en) | Frequency dividing circuit | |
JPH04160822A (en) | D/a converter | |
JP3513802B2 (en) | Direct digital frequency synthesizer device | |
JPH0870219A (en) | Signal generator | |
JP2651300B2 (en) | Timer circuit | |
JPS62260229A (en) | Multiplying circuit | |
JPS601983B2 (en) | Frequency divider circuit |