CLOCK GENERATOR

Abstract: After detecting a leading edge of a stop control signal (STBY) supplied from an external circuit, an oscillation out­ put signal (OSC) is cut off at an input side of a frequency divider (24) in synchronism with the first leading edge of a clock signal (CLK) generated from the frequency divider (24), thereby stopping the generation of clock signals (CLK). The stopping of the clock signal generating operation is released in such a manner that, immediately after a trailing edge of an external control signal (STBY) is detected, an internal state of the frequency divider (24) is initialized, and the oscillation output signal (OSC) which has been cut off is supplied to the frequency divider (24) again, thereby generating a proper clock signal (CLK).

Description: The present invention relates to a clock generator used in a microprocessor or the like and, more particularly, to a clock generator which controls the generation of clock signals in accordance with an external control signal. Fig. 1 shows the configuration of the conventional clock generator used in a microprocessor. This clock generator comprises an oscillator 1, a frequency divider 2, a synchronizing control circuit 3 and the like. The oscillator 1 oscillates at a predetermined period in correspondence with the natural frequency of a quartz vibrator 4. The frequency divider 2 divides an oscillation output signal OSC from the oscillator 1, thereby generating a clock signal CLK which controls a microprocessor. The synchronizing control circuit 3 synchronizes the clock signal CLK with an external synchronizing signal SYN which is supplied to an external synchronizing control terminal 5. When the supply of the clock signal CLK to a CMOS microprocessor is stopped so as to set the CMOS microprocessor in the standby mode to reduce its power consumption by utilizing a conventional clock generator of this type, the cycle of the clock signal CLK generated immediately beforehand cannot be properly completed depending on the timing of the external synchronizing signal SYN, as shown in the timing chart of Fig. 2. In other words, during a period T of one cycle of the clock signal CLK, a period of "0" level must be (2/3)T and a period of "1" level must be (1/3)T. However, when the external synchronizing signal SYN used as a clock stop control signal goes to "1" level with the timing shown in Fig. 2, the clock signal CLK is also at "1" level at this time, thereby stopping generation of the clock signal CLK. In this case, in a cycle immediately before stopping the clock signal CLK, a period T0 during which the clock signal is at the "0" level becomes shorter than (2/3)T, and a duty cycle of the clock signal CLK is thereby disturbed. This can cause the microprocessor which is controlled by the clock signal CLK to malfunction. The reason will be described hereinafter. A microprocessor generally forms, e.g., two phase clock signals 1 and 2 as shown in Fig. 3 by using a clock signal supplied from a clock generator. The microprocessor controls various operations by using the two phase clock signals 1 and 2. For example, as shown in Fig. 4, an internal circuit of the microprocessor comprises an input register 11, a circuit block 12 having a single function, and an output register 13. In this circuit, when one clock signal 1 is at "1" level, input data or an input signal is written in the input register 11, and when the signal 1 is at "0" level, this writing operation is stopped. When the other signal 2 is at "1" level, a calculation or determination of a control signal by the circuit block 12 is performed in accordance with the data or signal written in the input register 11. In addition, during this period, output data or a signal from the circuit block 12 is supplied to the output register 13, thereby ensuring a high-speed and precise operation. However, as shown in Fig. 2, when the clock signal CLK is stopped at an incorrect timing of the two phase clock signals 1 and 2 which are formed in the microprocessor from the clock signal CLK, the signal 2 (or 1), has a considerably shorter pulse width than normal, as shown in the timing chart of Fig. 5. Therefore, the predetermined operation of the microprocessor cannot be provided, thereby causing a malfunction of the microprocessor. Prior art document US-A-4 316 247 describes a low power consumption data processing system which contains a read-only memory circuit, an arithmetic circuit, a halt signal gate circuit and a control circuit on a single semiconductor chip including a clock generating circuit for supplying system clocks to all of the circuits on this chip. This clock generating circuit is structured such that on the input of an external halt signal, it will cease supplying system clocks during a specific period. To be more specific, in this known low power consumption data processing system a clock generating circuit receives external clocks and outputs three clocks ϑX, ϑY and ϑZ. Generation of the clocks ϑX, ϑY and ϑZ is stopped during the period of an instruction execute cycle. A counter is structured by a transfer gate and does not include an inverter and a "latch function". Upon receipt of an output signal of an oscillator OSC, data in this counter is lost if the output signal of the oscillator OSC is interrupted. If a halt signal is then set to a low level and generation of clock signals is restarted, clocks ϑX, ϑY and ϑZ are output at a predetermined timing according to the specific circuit arrangement of the counter. Further, prior art document GB-A-2 080 585 describes a semiconductor integrated circuit with reduced power consumption. This semiconductor integrated circuit comprises a clock generator in which a signal is supplied form an external terminal to an arithmetic and logic unit (ALU) via an input/output (I/O) port when the signal becomes high in level. Data is produced after execution of a predetermined arithmetic operation, and it is written in a first flip-flop 68. An output signal of this first flip-flop is stored in a second flip-flop, and the operation of an oscillator is controlled by the output of the second flip-flop and the signal from the external terminal. Since in this known circuit the operation of oscillator is not restarted using only the signal from the external terminal, the generation of the clocks cannot be stopped in a quick response to the signal from this external terminal. Furthermore a set signal for storing data in the first flip-flop is required, and only the external signal from said terminal cannot prevent the clocks from being generated. When the signal from the external terminal becomes low in level, only the operation of oscillator is restarted, and the output of the oscillator is counted by a counter. After a lapse of a predetermined time period from the restart of the operation of the oscillator, the operation of timing generator is restarted. The generation of clocks or timing signals cannot be restarted in a quick response to the signal from the external terminal. It is an object of the present invention to provide a clock generator which can generate a proper clock signal free from disturbance in a duty cycle when the generation operation of the clock signal is stopped or restarted, and can avoid a malfunction of a microprocessor before and after the standby mode when the clock generator is used in a CMOS microprocessor having a standby function. To solve this object the present invention provides a clock generator as stated in claim 1. This invention can be more fully understood from the following detailed description when taken in conjunction with the accompanying drawings, in which: Fig. 1 is a block diagram of a conventional clock generator; Fig. 2 is a timing chart showing the operation of the conventional clock generator; Fig. 3 is a timing chart showing a clock signal generally used in a microprocessor; Fig. 4 is a circuit diagram showing an internal circuit of a microprocessor; Fig. 5 is a timing chart showing a clock signal which can cause a malfunction of a general purpose microprocessor; Fig. 6 is a circuit diagram showing a configuration of a clock generator according to an embodiment of the present invention; and Figs. 7 and 8 are respectively timing charts for explaining the operation of the circuit according to the embodiment. An embodiment of the present invention will be described with reference to the accompanying drawings hereinafter. Fig. 6 is a circuit diagram showing a configuration of a clock generator according to the present invention. Reference numeral 21 denotes an oscillator to which a quartz vibrator 22 is externally connected and which oscillates at a predetermined period. An oscillation output signal OSC obtained from the oscillator 21 is supplied to one input terminal of a two-input AND gate 23. The AND gate 23 generates an oscillation output signal OSC1 in correspondence with a control signal which is supplied to the other input terminal thereof. The output signal OSC1 is supplied to a frequency divider 24. The frequency divider 24 generates a clock signal CLK frequency-dividing the output signal OSC1 by one-third. The frequency divider 24 comprises two D-type flip-flops 25 and 26, and a two-inverting input AND gate 27. The above signal OSC1 is supplied to the flip-flops 25 and 26 as a synchronizing signal CP in parallel. In addition to this, the flip-flops 25 and 26 are connected to each other in series so that the Q output signal of the former stage serves as an input signal of the latter stage. The Q output signal of the latter stage flip-flop 26 is supplied to a CMOS microprocessor (not shown) as the clock signal CLK. Furthermore, the Q output signals of the flip-flops 25 and 26 are supplied to the AND gate 27 in parallel. The AND gate 27 detects the cleared state of the flip-flops 25 and 26 wherein these flip-flops are reset, and the Q output signals thereof are at "0" level. An output signal COMP of the AND gate 27 is fed back to the former stage flip-flop 25 as an input signal. In other words, the two flip-flops 25 and 26 constitute a 1/3 frequency divider of the signal OSC1 together with the AND gate 27 for detecting a cleared state. Reference numeral 28 denotes a control terminal to which a control signal STBY for controlling the frequency-dividing operation of the frequency divider 24 is externally supplied. The control signal STBY which is supplied to the control terminal 28 is supplied to two D-type flip-flops 29 and 30 as a synchronizing signal CP. A signal having "1" level is always supplied to the flip-flop 29 as an input signal. The flip-flop 29 stores "1" level data in synchronism with a leading edge of the control signal STBY supplied as the synchronizing signal. The Q output signal Q1 of the flip-flop 29 is supplied to another D-type flip-flop 31 as an input signal. The clock signal CLK generated from the frequency divider 24 is supplied to the flip-flop 31 as the synchronizing signal CP. The flip-flop 31 stores the Q output signal Q1 from the flip-flop 29 as an input signal in synchronism with the leading edge of the signal CLK. The Q output signal Q2 from the flip-flop 31 is supplied to the other input terminal of the AND gate 23 as the control signal described above. A signal having "1" level is always supplied to the flip-flop 30 as an input signal. The flip-flop 30 stores "1" level data in synchronism with the trailing edge of the control signal STBY supplied as the synchronizing signal. The Q output signal Q3 of the flip-flop 30 is respectively supplied to the flip-flops 25, 26, 29 and 31 as a direct clear signal in parallel. The signal COMP obtained as the output signal of the AND gate 27 is supplied to the flip-flop 30 as a direct clear signal. The operation of the circuit of this embodiment will be described with reference to the timing charts of Figs. 7 and 8. The control signal STBY is kept at "0" level. In this case, all the flip-flops are in the cleared state. In the cleared state, the Q output signal Q2 from the flip-flop 31 is kept at "1" level, and the AND gate 23 is enabled by this signal Q2 . For this reason, the oscillation output signal OSC from the oscillator 21 passes through this AND gate 23 and is supplied to the frequency divider 24 as the signal OSC1. When the signal OSC1 is supplied to the frequency divider 24, the frequency divider 24 frequency divides this signal, thereby sequentially generating the clock signal CLK of, for example, 1/3 duty, as shown in Fig. 7. Then, assume that the control signal STBY rises from "0" level to "1" level at any timing. The flip-flop 29 stores "1" level data in synchronism with the leading edge of the signal STBY, and the Q output signal Q1 thereof is at "1" level. In other words, the flip-flop 29 stores the state wherein the control signal STBY is at "1" level. Thereafter, when one cycle of the clock signal CLK generated from the frequency divider 24 ends and the signal CLK goes to "1" level, the flip-flop 31 stores the Q output signal Q1 of the flip-flop 29 in synchronism with the leading edge of the signal CLK. Since the signal Q1 is preset at "1" level, the flip-flop 31 stores "1" level data in synchronism with the leading edge of the signal CLK, and the Q output signal Q2 hereof is at "0" level, as shown in Fig. 7. When the signal Q2 is at "0" level, the AND gate 23 is disabled. Therefore, the oscillation output signal OSC cannot thereafter pass through the AND gate 23, and the signal OSC1 is kept at "0" level. For this reason, the flip-flops 25 and 26 store the state before the AND gate 23 is disabled. The clock signal CLK as the output signal of the frequency divider 24 is stopped at a proper timing when one cycle ends. When the microprocessor generates two phase clock signals 1 and 2 from the clock signal CLK, the signals 1 and 2 are stopped at a proper timing. Therefore, the microprocessor can be switched into the standby mode at a proper timing. When the clock signal is stopped, a malfunction which occurs when a conventional clock generator is employed can be prevented. When generation of the clock signal CLK is restarted from the clock signal stop state, the control signal STBY is reset to "0" level at an arbitrary timing, as shown in Fig. 8. Then, since the flip-flop 30 stores "1" level data in synchronism with the trailing edge of the signal STBY, the Q output signal Q3 is set at "1" level, as shown in Fig. 8. When the signal Q3 is set at "1" level, the flip-flops 29 and 31 which use this signal Q3 as the direct clear signal are respectively cleared. Therefore, the Q output signal Q1 of the flip-flop 29 is set at "0" level and the Q output signal Q2 of the flip-flop 31 is set at "1" level. In addition, when the signal Q2 is set at "1" level, the AND gate 23 is enabled, thereby supplying the signal OSC1 to the frequency divider 24. When the flip-flops 29 and 31 are cleared, the flip-flops 25 and 26 in the frequency divider 24 are also cleared by the signal Q3. Then, both the Q output signals of the flip-flops 25 and 26 are set at "0" level, thereby setting the output signal COMP of the gate 27 at "1" level. When the signal COMP is set at "1" level, the flip-flop 30 is cleared and the Q output signal Q3 thereof is set at "0" level. Then, the cleared state of the respective flip-flops 25, 26, 29 and 31 is released. The frequency divider 24 can sequentially frequency divide the output signal OSC1 at the proper timing. Since the clock signal CLK obtained from this frequency-dividing operation has the proper timing, the microprocessor can be switched from the standby mode to the normal mode at the proper timing. Even when the standby mode is released, a malfunction of the microprocessor due to a timing shift of the clock signal CLK can be prevented. In this manner, according to the above embodiment, when the clock signal generating operation is stopped and restarted, the clock signal CLK having the proper timing can be obtained. For this reason, when the standby function of a CMOS microprocessor is realized using the clock signal CLK obtained from the circuit of this embodiment, the proper operation of the microprocessor can be ensured without causing a malfunction thereof. In the above embodiment, a frequency divider 24 of one-third the frequency-division type is used. However, any frequency division ratio can be adopted as needed.

Claims: A clock generator in which a clock signal (CLK) used for controlling an operation of a CMOS microprocessor is generated by frequency-dividing a pulse signal (OSC) having a predetermined period generated from an oscillating circuit (21) and a generating operation of the clock signal (CLK) is controlled in accordance with a logic level of a control signal (CTBY) which is supplied to a control terminal (28), said clock generator comprising a frequency-dividing circuit (24), first memory means (29) and control means (23), characterized in that: said frequency-dividing circuit (24) has a plurality of flip-flops (25, 26) connected in series to each other, for receiving signals according to the pulse signal (OSC) in parallel at respective input terminals of the flip-flops (25, 26) and outputting the clock signal (CLK) from the flip-flop circuit (26) at the final stage; said first memory means (29) stores the logic level of the control signal (STBY) supplied to the control terminal (28) at which a frequency-dividing operation of said frequency-dividing circuit (24) is stopped; second memory means (31) stores a storing state of said first memory means (29) in synchronism with the clock signal (CLK) generated from said frequency-dividing circuit (24); said control means (23) supplies the pulse signal (OSC) having the predetermined period from said oscillating circuit (21) to said frequency-dividing circuit (24) in accordance with the storing state of said second memory means (31) and third memory means (30) stores the logic level of the control signal (STBY) supplied to the control terminal (28) at which the frequency-dividing operation of said frequency-dividing circuit (24) is restarted, and initializes internal states of said first memory means (29), said second memory means (31), and said flip-flops (25, 26) in said frequency-dividing circuit (24) in accordance with the storing state thereof, an internal state of said third memory means (30) being initialized after the internal state of said frequency-dividing circuit (24) is initialized. A clock generator according to claim 1, characterized in that said first memory means (29) comprises a flip-flop to which a signal having a constant level is supplied as an input signal, and said control signal (STBY) is supplied as a synchronizing signal. A clock generator according to claim 1 or 2, characterized in that said second memory means (31) comprises a flip-flop to which the clock signal (CLK) is supplied as a synchronizing signal, and an output signal (Q1) from said first memory means (29) is supplied as an input signal. A clock generator according to anyone of claims 1 to 3, characterized in that said frequency-dividing circuit (24) further comprises a gate (27) for detecting internal states of said plurality of flip-flops (25, 26), and the storing state of said third memory means (30) is initialized in accordance with an output signal of said gate (27). A clock generator according to anyone of claims 1 to 4, characterized in that said third memory means (30) comprises a flip-flop to which a signal having a constant level is supplied as an input signal, and said control signal (STBY) is supplied as a synchronizing signal.

Inventors: SHIRAISHI, HAJIME C/O PATENT DIVISION
Applicants: KABUSHIKI KAISHA TOSHIBA
Application year: 1984
Main classification: G06F1
IPC codes: H03K17, H03K5, H03K3, H03K23, G06F1