Quantcast

Clock generating circuit and method thereof

Imported: 24 Feb '17 | Published: 16 Mar '04

Yun-Kuo Lee

USPTO - Utility Patents

Abstract

A clock generating circuit and method thereof is provided. The frequency ratio between the output clock and the system clock is calculated as that the first preset value divides by the second preset value. A data value is stored into a register. The sum of the data value and the first preset value is calculated as a first result by the first adder. The sum of the first result and the second preset value is calculated as a second result by the second adder. A multiplexer (MUX) is used to select the data value that should be stored into the register at next system clock from the first result and the second result according to the level of the output clock. The first result is compared with a reference value by the first comparator to generate the output clock, so that the frequency of the output clock can be changed arbitrarily and it is not required to redesign the circuit.

Description

BRIEF DESCRIPTION OF DRAWINGS

The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention, and together with the description, serve to explain the principles of the invention. In the drawings,

FIG. 1 schematically shows a diagram of a clock generating circuit of the first embodiment according to the present invention;

FIG. 2 schematically shows a diagram of a clock waveform sequence of the first embodiment according to the present invention;

FIG. 3 schematically shows a diagram of a clock generating circuit of the second embodiment according to the present invention; and

FIG. 4 schematically shows a diagram of a clock waveform sequence of the second embodiment according to the present invention.

Claims

1. A clock generating circuit, suitable for generating a first output clock from a system clock, wherein a frequency ratio between the first output clock and the system clock is a value of a first preset value divided by a second preset value, and the clock generating circuit comprises:

2. The clock generating circuit of claim 1, wherein the magnitude of the first preset value and the second preset value is a value of the frequency of the first output clock and the frequency of the system clock divided by a GCF (Greatest Common Factor) of the frequency of the first output clock and the frequency of the system clock, respectively.

3. The clock generating circuit of claim 1, wherein a positive first preset value is input into the first adder, and a negative second preset value is input into the second adder.

4. The clock generating circuit of claim 3, wherein when the system is reset, the initial data value is set to 0.

5. The clock generating circuit of claim 3, wherein the reference value equals the second preset value, and each time when the first result is not smaller than the reference value, the first comparator generates a pulse of the first output clock.

6. The clock generating circuit of claim 5, wherein each time when the pulse is generated, the multiplexer selects the second result as the data value that should be stored into the register at the next system clock.

7. The clock generating circuit of claim 1, wherein a negative first preset value is input into the first adder, and a positive second preset value is input into the second adder.

8. The clock generating circuit of claim 7, wherein when the system is reset, the initial data value is set to equal the second preset value.

9. The clock generating circuit of claim 7, wherein the reference value equals 0, and each time when the first result is not greater than 0, the first comparator generates a pulse of the first output clock.

10. The clock generating circuit of claim 9, wherein each time when the pulse is generated, the multiplexer selects the second result as the data value that should be stored into the register at the next system clock.

11. The clock generating circuit of claim 1, further comprising a second comparator, wherein the second comparator is coupled to the register and is used to compare the data value with a third preset value that is smaller than the second preset value, so as to generate a second output clock.

12. The clock generating circuit of claim 11, wherein the third value is a rounded integer value of a half of the second preset value.

13. A clock generating method, suitable for generating a first output clock from a system clock, wherein the frequency ratio between the first output clock and the system clock is a value of the first preset value divided by the second preset value, and the clock generating method comprises the steps of:

14. The clock generating method of claim 13, wherein the magnitude of the first preset value and the second preset value is a value of the frequency of the first output clock and the frequency of the system clock divided by a GCF (Greatest Common Factor) of the frequency of the first output clock and the frequency of the system clock, respectively.

15. The clock generating method of claim 13, wherein when obtaining the first result and the second result, a positive first preset value and a negative second preset value are used to obtain its summation.

16. The clock generating method of claim 15, wherein the initial data value is 0.

17. The clock generating method of claim 15, wherein the reference value equals the second preset value, and each time when the first result is not smaller than the reference value, a pulse of the first output clock is generated.

18. The clock generating method of claim 17, wherein each time when the pulse is generated, the second result is selected as the data value that should be stored into the register at the next system clock.

19. The clock generating method of claim 13, wherein when obtaining the first result and the second result, a negative first preset value and a positive second preset value are used to obtain its summation.

20. The clock generating method of claim 19, wherein the initial data value is set to equal the second preset value.

21. The clock generating method of claim 19, wherein the reference value equals 0, and each time when the first result is not greater than 0, a pulse of the first output clock is generated.

22. The clock generating method of claim 21, wherein each time when the pulse is generated, the second result is selected as the data value that should be stored into the register at the next system clock.

23. The clock generating method of claim 13, further comprises a step of comparing the data value with a third preset value that is smaller than the second preset value, so as to generate a second output clock.

24. The clock generating method of claim 23, wherein the third value is a rounded integer value of a half of the second preset value.