Background of the Invention
1. Field of the Invention
The present invention relates to computer systems and more particularly to a method and apparatus for changing the operating clock speed of the system during doze modes to minimize power consumption.
2. Description of the Related Art
In recent years, the popularity of portable and laptop computers has steadily grown. As a result, computer manufacturers have worked diligently to improve the design and the performance of these computers. Portable and laptop technology has now advanced to a stage where the performance of the portable computers is approximately equal to that of the larger desk top computers. Some portables are capable of operating at a clock speed of 25 MHz or even higher.
Although they perform like desk top computers, portable computers suffer from one inherent disadvantage. Because they are portable, they must be operated under battery power, which means that power conservation is a major concern. One method for saving power is to simply reduce the operating clock speed of the system, but most users demand full performance from their systems so reducing the operating clock speed does not seem to be a desirable method for saving power.
It is not necessary for a computer to always operate at its highest clock speed, however. There are periods, called "doze modes," during which the central processing unit is not executing any instructions. During these periods, the clock speed of the processor may be altered without adversely affecting the operation of the computer. Prior attempts have been made to alter the operating clock speed of a processor but these methods involved changing the clock speed dynamically, that is, on-the-fly without interrupting the processor. However, the prior art methods cannot be implemented in applications where timing paths are critical, such as computer systems using INTEL 80486 series CPUs. Therefore, there exists a need for a method and apparatus for changing the operating clock speed of a computer system which is more generally applicable.
Summary of the Invention
The present invention provides an improved method and apparatus for changing the operating clock speed of a central processing unit. In a preferred embodiment, the apparatus of the present invention comprises an input port, a plurality of output ports, an instructing means, a latching means having a data input, a clock input, and a data output, and a gating means having a select input, a plurality of data inputs connected to a plurality of clock sources, and an output. The input port receives a change frequency signal and relays this signal to the CPU. In response, the CPU, under the direction of the instructing means, stores the contents of its registers into the memory. The CPU also generates a frequency select signal and a reset signal which resets the CPU. These signals are sent to the output ports and then relayed to the latching means. The latching means receives the reset signal at its clock input and the frequency select signal at its data input. At each occurrence of the reset signal, the latching means outputs the frequency select signal to the select input of the gating means. This causes the gating means to gate one of the clock sources at its data inputs to the CPU. With the CPU reset and the new clock frequency gated to the CPU, the instructing means directs the CPU to reload into its registers the information stored in the memory.
Brief Description of the Drawings
FIG. 1 is a functional block diagram of a computer system including the apparatus of the present invention; and
FIG. 2 is a circuit diagram of a computer system including the preferred embodiment of the invention.
Detailed Description of the Invention
FIG. 1 shows a functional block diagram of a computer system 10 comprising a central processing unit (CPU) 12, a signal bus 14, memory 16, and the apparatus of the present invention. The CPU 12 has a clock input 28 for receiving an operating clock signal 30, a reset input 32 for receiving a reset signal 34, and a plurality of internal registers 36 for storing data and information while the CPU 12 is executing instructions. The CPU 12 is coupled to bus 14, and serves as the central processing unit for an entire computer system 10 which includes the apparatus of the present invention. The apparatus of the present invention further comprises instructing means 18, latching means 20, gating means 22, input port 24, and output ports 26. The input 24 and output ports 26, the memory 16, and the instructing means 18 are also coupled to the bus 14.
The latching means 20 has a clock input 38 for receiving an activating clock signal and a data input 40 for receiving a data signal 58. With each active clock signal it receives, the latching means 20 latches the data signal 58 received at the data input 40 and outputs this signal 58 through the data output 42.
The gating means 22 of the invention receives at its data inputs 44 a plurality of clock signals 46 with each clock signal having a different frequency. The clock signals 46 are generated by a means (not shown) for generating a plurality of clock signals of different frequency such as a plurality of crystal oscillators. Depending upon the status of a signal 60 received at a select input 48, the gating means 22 gates to output 50 one of the clock signals 46. Output 50 is coupled to the clock input 28 of the CPU 12.
During normal operation, the CPU 12 operates at its highest clock frequency to execute the instructions of a computer program and the present invention is inactive. However, during periods where the CPU 12 is not executing any instructions, (i.e., during "doze modes") a change frequency interrupt signal appears on interrupt line 52 to signal to the present invention that a clock frequency change is desired. The interrupt signal 52 may originate from a number of sources including manual switch 54 and power management unit 56. The input port 24 of the present invention receives the interrupt signal 52 and sends the signal via bus 14 to the CPU 12. The CPU 12 responds to the interrupt signal 52 by executing instructions from the instructing means 18.
A set of instructions is sent by instructing means 18 on bus 14 to the CPU 12 to cause the CPU 12 to perform several operations. First, the instructing means 18 causes the CPU 12 to store the contents of the internal registers 36 into the memory 16. The information stored in memory 16 preferably includes data, status and any other information necessary to completely define the state of the CPU 12. Thereafter, instructing means 18 causes the CPU 12 to generate control signals which are sent to output ports 26 via bus 14. These signals are transmitted as a reset 34 and a frequency select 58 signal to other components of computer system 10 by the output ports 26. In the preferred operation, the reset signal 34 is output just after the frequency select signal 58 exits from the output ports 26. The frequency select signal 58 is sent to the latching means 20 just before the reset signal 34 so that the frequency select signal 58 will be on the data input 40 when the latch means 20 is clocked by the reset signal 34. The reset signal 34 is also sent to the reset input 32 of the CPU 12 to reset the CPU 12. Thus, while the CPU 12 is being reset, the active reset signal 34 at clock input 38 causes the latching means 20 to latch onto the frequency select signal 58 at its data input 40. An output signal 60 having the same logic level as the frequency select signal 58 is then output by the latching means 20 through output 42.
The output signal 60 from the latching means 20 is received by the gating means 50 at its select input 48. Depending upon the logic level of the output signal 60, the gating means 22 gates one of the clock signals 46 through output 50 to the clock input 28 of the CPU 12. The CPU 12 thereafter operates in response to a new clock signal. Next, the instructing means 18 causes the CPU 12 to reload into its internal registers 36 the information that was earlier stored into the memory 16. With its vital information restored, the CPU 12 will function as if no interruption took place except that it now operates at a lower clock frequency. At this point, the changing of the operating clock frequency is complete.
A preferred embodiment of the apparatus of the present invention is shown in FIG. 2, wherein the gating means 22 is a 2 to 1 multiplexer 62 having select input S.sub.1, data inputs A, B, and output 0. Latching means 20 takes the form of a D-type flip flop 64 with a clock input CK, a data input D, and output Q. In the preferred embodiment, memory 16 is a random access memory (RAM) 66 and instructing means 18 is a Read Only Memory (ROM) 68 containing binary instructions to be executed by the CPU 12. Binary instructions for causing the CPU 12 to perform the functions described above vary from CPU to CPU. The instructions may also be derived by those of ordinary skill in the art without undue experimentation. Thus, the specific instructions need not be described in detail herein. The multiplexer 62, the flip flop 64, and the RAM 66 shown in FIG. 2 are also known in the art so their construction need not be described.
The present invention provides a superior method and apparatus for changing the operating clock speed of a computer system. Because the CPU 12 is actually reset, no timing path problems are encountered. Also, because the CPU's register information is stored before reset and then restored after reset, the CPU 12 operates after reset as if no reset ever occurred. Thus, no information or continuity is lost. Consequently, unlike the prior art, the present invention may be implemented in substantially all systems and applications.
It should be noted that although the invention has been described with reference to certain preferred embodiments, it should not be construed to be so limited. Many modifications can be made by those of ordinary skill in the art with the benefit of this disclosure without departing from the spirit of the invention. For example, the invention has been described with only one latching means 20 and only two clock signals 46, but it is possible to have many more. For instance, the present invention can accommodate four different clock signals 46 by simply having the CPU 12 generate two frequency select signals 58 instead of one. Two flip-flops 64 would be necessary, one for latching each of the frequency select signals 58. The gating means 22 would also need to have four data inputs instead of two and two select inputs instead of one. These and other changes may be made without departing from the spirit and the scope of the invention. Therefore, the invention should not be limited by the specific examples used to illustrate it but only by the scope of the appended claims.