Abstract:
A frequency detection device and associated method are disclosed. The frequency detection device divides a time base into a plurality of discrete time bases. Clock pulses are added during the discrete time bases in order to determine the frequency of the clock signal. A method and associated apparatus for reducing round-off error partial in displays are also disclosed. Round-off error is reduced by assigning a value of &#34;5&#34; to a more significant digit which is not to be displayed.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to the field of signal frequency measurement. More particularly, the present invention provides a method and apparatus for measurement of the frequency of clock pulses which are utilized in a central processing unit (CPU) of a microcomputer or the like. 
     2. Description of Related Art 
     FIG. 1 generally indicates the prior art method and associated apparatus which have been used in conjunction with clock pulse frequency measurement systems in a microcomputer system. A monostable switch 2 is used to control a variable logic device 4. The output from variable logic device 4 is used to select one of a plurality of clock pulses with frequencies f1, f2, f3, . . . fn which are input into multiplexer 6. Alternatively, the variable logic from variable logic device 4 can be set with a software instruction 8 via an interfacing circuit 10. Output fx from multiplexer 6 is sent to both a CPU 12 and a frequency detecting device 14. Frequency detecting device 14 may be provided with a display 16. 
     In prior art systems the frequency fx and, therefore, the indicated frequency from frequency measurement device 14 often drifts over a period of time due to variations of temperature, material properties, noise interference, and the like. Additionally, in many systems only the two most significant digits of frequency are displayed and the rest of the digits are ignored by the device. As a consequence, the indicated frequency may contain significant, non-trivial error, especially when the third, undisplayed digit is equal to or greater than 5. 
     A timing diagram for prior art systems is provided in FIG. 2 and compared to the invention described herein. The frequency of a series of clock pulses, shown on coordinate C, is to be measured. In the prior art, a time base shown on coordinate A would be utilized. The frequency counter counts the number of clock pulses occurring in the time base and the result is displayed as the frequency of the clock pulses. For example, if the time base is 1 πs and 10 pulses are counted in the time base, the frequency of the clock pulses is 10 MhZ. It is often observed, however, that the frequency of signal C drifts. Therefore, the indicated frequency tends to be unstable. This instability may result from temperature variations, noise, and the like. 
     Patents related to the field of frequency measurement include Carlton, U.S. Pat. No. 4,580,281; Cook et al., U.S. Pat. No. 4,616,173; Yool, U.S. Pat. No. 4,257,003; and Haymaker, U.S. Pat. No. 4,456,876. 
     SUMMARY OF THE INVENTION 
     A frequency measurement method and apparatus is disclosed. The method and apparatus are more stable than those used in the prior art and reduce round-off error. 
     The frequency counter is provided with a time base. The time base is divided into a plurality of discrete time bases, permitting clock pulses to be sampled and counted during several discrete sub-time bases over a wider range of time. The number of clock pulses counted during the sub-time bases is added, resulting in a displayed frequency value which is very stable. An accumulated counting value based on this &#34;spread&#34; time base is more stable and more accurate and avoids indicated frequency drift caused by variations in temperature, noise, and the like in the circuitry. 
     Round-off error is also reduced by the method and apparatus described herein, especially when only the most significant digits are displayed in the frequency measurement operation. This is accomplished by assigning a &#34;5&#34; to a next most significant digit and a &#34;0&#34; to all other digits, permitting automatic round-off after the first counting operation. 
    
    
     BRIEF DESCRIPTION OF THE FIGURES 
     FIG. 1 illustrates a prior art system for frequency measurement. 
     FIG. 2 illustrates a timing diagram for prior art systems and for the method and apparatus disclosed herein. 
     FIG. 3 illustrates the frequency measurement apparatus disclosed herein. 
     FIG. 4 is a flow chart showing the frequency measurement method and the round-off error correction method disclosed herein. 
     FIG. 5 illustrates the frequency counter in more detail. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 3 illustrates the apparatus disclosed herein. The apparatus is used to determine the frequency of a series of clock pulses, shown on coordinate C in FIG. 2. 
     A time base circuit 100 is used to provide a time base to time base dividing circuit 102. The output of the time base dividing circuit is a series of sub-time bases and is provided to the input of AND gate 104 in counter 106. The sub-time bases are illustrated by coordinate B in FIG. 2. As an example herein, the time base has been divided into 5 sub-time bases. As shown in FIG. 2, the divided time base covers a wider range of time as compared to the un-divided time base. 
     The output of AND gate 104 is attached to a Binary-Coded Decimal (BCD) counter comprising five registers (108, 110, 112, 114, and 116) with register 108 representing the fifth digit. In the example provided herein, the fifth digit is the most significant digit, but it is to be understood that the invention described herein could be utilized with a device utilizing any number of digits and in a device in which any digit is the most significant digit. Register 110 represents the fourth digit, register 112 the third digit, register 114 the second digit, and register 116 the first digit. In the example provided herein, the first digit is the least significant digit. 
     Clock pulses during each sub-time base are successively counted in the BCD counter until the total sum of the sub-time bases is equal to or approximately equal to the original time base. The judging and control circuit 118 (which may, for example, be an EPROM of the type known to those of skill in the art) then sends a latch signal &#34;x&#34; (indicated by coordinate E in FIG. 2) to selector 121 which determines if the fourth and fifth digits or the third and fourth digits are to be displayed, using logic discussed below. The output of selector 121 is transmitted to a latch 120 and then to decoder 122 and thereafter to display means 124 which may be, for example, two seven-segment displays and a decimal point. Thereafter, a reset pulse (illustrated by coordinate F in FIG. 2) is applied to selected registers in the counter to restart the process. The frequency counted in the counter represents an average frequency over a substantially wider range of clock pulses as compared to the prior art. 
     Operation of the invention is further illustrated with the flow chart shown in FIG. 4. After initiating the process, all data contained in the counting means are cleared. As shown in the top portion of FIG. 4, the time base is first generated, and divided. The divided time base and the clock pulses are then AND&#39;ed, counted, decoded, and displayed. 
     The remaining portion of FIG. 4 illustrates the round-off operation provided herein. Often, frequency detectors display only a few of the most significant digits (e.g., two digits). In the example illustrated herein, the fifth digit is the most significant digit and only 2 digits of a total of 5 digits are to be displayed. In order to provide proper round-off, it is first determined if the fifth digit is a &#34;0&#34;. If the fifth digit is a &#34;0&#34;, then the third and fourth digits are displayed in the seven segment display. Thereafter, the second digit is set to be &#34;5&#34; and other digits are cleared to be &#34;0&#34;. Therefore, in the second operation cycle, i.e., the second time base, and all cycles thereafter, the two displayed digits will be automatically rounded. Likewise, if the most significant digit is not a &#34;0&#34; the fourth and fifth digits are displayed and, thereafter, the third digit is set to be a &#34;5&#34; and the remaining digits are cleared to be &#34;0&#34; . In general, the most significant digit which is not displayed is set to a value of &#34;5&#34; and all other digits are set to be &#34;0&#34;. 
     It should be recognized that the invention has been illustrated with reference to an embodiment in which a value of &#34;5&#34; has been assigned to the most significant digit not to be displayed, but other values could be assigned without departing from the spirit of the invention. For example, even if a value of &#34;1&#34; was assigned to the most significant digit not to be displayed, round-off error would be reduced as compared to prior art systems. Any non-zero value of preferably about 5 could be utilized. 
     As an example, suppose the registers contain the digits &#34;1 2 3 4 5&#34; based on the first counting operation. Since the fifth digit is not a zero the fourth and fifth digits (i.e., &#34;1 2&#34;) are displayed. A &#34;5&#34; is set in the third digit and the rest of the digits are cleared. In the second loop, if the counting operation remains constant the registers will contain &#34;1 2 8 4 5&#34; and, again, &#34;1 2&#34; will be displayed. Hence appropriate round-off is maintained. 
     By comparison, if the digits resulting from the first counting operation are &#34;1 2 5 4 5&#34;, the third register will again be set to &#34;5&#34; and &#34;1 2&#34; will be displayed during the first cycle. If the counting operation again remains constant, the digits in the counter will be &#34;1 3 1 4 5&#34; due to carry-in and carry-out of the counter. The displayed digits will be &#34;1 3&#34;, which again is appropriately rounded. 
     Greater detail regarding one embodiment of the frequency counter is provided in FIG. 5. As shown therein, the selected output of counting means 106 is transmitted to latch 120 and a driver 126 and, thereafter, to display means 124. An enabling circuit 128 of the type known to those of skill in the art, is used to control the output of driver 126 to the display 124. 
     It is to be understood that the above description is intended to be illustrative and not restrictive. Many embodiments will be apparent to those of skill in the art upon reviewing the above description. The scope of the invention should, therefore, be determined not with reference to the above description, but should instead be determined with reference to the appended claims, along with the full scope of equivalents to which such claims are entitled.