Variable-ratio frequency divider
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to a variable-ratio frequency divider having a wide range of frequency-dividing ratio and suitable for high-speed operation, or more in particular to a variable-ratio frequency divider adaptable for use with a timing generator of a test apparatus for conducting a high-precision timing test of an IC or LSI and the like. 
     2. Description of the Prior Art 
     One of the important component elements of an IC test apparatus is a timing generator. The timing generator has dual functions; one is to determine the timing (test period) of the test pattern applied to the IC to be tested, and the other is to specify the timing (the phase against the test period) at which an output signal of the IC impressed with the test pattern is compared with an expectation-value pattern. The timing signal generator for IC test roughly comprises a rate generator for determining a test period and a plurality of phase generators for generating a signal in a given phase against the test period. First, the prior art will be explained with reference to the drawings. 
     FIG. 1 is a block diagram showing an example of a conventional timing signal generator. For simplification, a single rate generator RG and a single phase generator PG are provided. In order to change the timing in real time, a test period signal 102 and a phase signal 103 are produced in response to a timing selection signal 101. The operation of this device will be explained briefly below. 
     In FIG. 1, upon application of the timing selection signal 101 to the circuit, it is introduced to a latch 7 in synchronism with a test period signal 102 that has thus far been produced. The latch 7 makes access to a rate memory 6 containing test period data and a phase memory 9 having phase signal data stored therein to read the test period data and the phase signal data, respectively. 
     In the rate generator RG, the test period signal 102 is generated by a rate counter for determining the test period which is an integral multiple of the basic clock period produced from an oscillator 1 and a variable delay circuit 3 for delaying the output of the rate counter 2 for improving the resolution of the test period more than the period of the basic clock. 
     The frequency-dividing ratio of the rate counter 2 and the delay time of the variable delay circuit 3 are controlled according to the data stored in the latch 4. In order to improve the resolution by the variable delay circuit 3, the data in the latch 4 is determined by an adder 5 for adding the delay time set in the preceding test period (the data stored in the latch 4) to a set value less than the period of the basic clock. 
     Further, in order to supply the basic clock in phase with the test period signal 102 to the phase generator PG for generating the phase signal 103, a phase clock 100 is generated by a variable delay circuit 8 for delaying the output of the oscillator 1. 
     The phase generator PG, on the other hand, produces a coincidence output at a time point when the phase data read out of the phase memory 9 and set in the latch 10 coincides with the count made by the phase counter 11, and further applies this coincidence output to a variable delay circuit 12 for producing the phase signal 103 in order to improve the phase resolution. 
     In the case where a preset counter is used as the rate counter for the variable-ratio frequency dividing operation, it is difficult to attain a high resolution of the clock after the frequency dividing process since the frequency of the basic clock is limited by the operating speed of the counter. For this reason, the basic clock is converted into a high frequency by inserting a prescaler before and after the preset counter thereby to attain a high resolution of the clock after frequency division. Since the minimum frequency divided is limited by the variable frequency dividing ratio of the prescalers, however, the range of the variable frequency ratio is small. 
     FIG. 2 is a circuit diagram showing an example of a conventional 2-modulus prescaler, and FIG. 3 is a block diagram showing an example of a variable-ratio frequency divider using the 2-modulus prescaler. 
     The prior art will be specifically explained with reference to FIGS. 2 and 3. 
     A prescaler 27 includes an OR gate 21, an AND gate 22, a NOR gate 23 and D flip-flops 24, 25, 26 for dividing the frequency of a basic clock f in  and producing a frequency f out . 
     The number of frequency divisions is controlled by a selection signal SEL. For example, it is 5 when the selection signal SEL is &#34;high&#34;, and 6 when the selection signal SEL is &#34;low&#34;. 
     Counters 28, 29 are inserted as shown in FIG. 3 since it is impossible to make continuously variable frequency divisions only with the prescaler. In the case where the data value &#34;A&#34; and data value &#34;B&#34; are present in the counters 28 and 29 respectively, the number of frequency divisions is given by the equation (1) below. 
     
         N=f.sub.in /f.sub.out =6A+5(B-A)=A+5B                      (1) 
    
     This number of frequency divisions N can be changed in units of one by changing the value of data A, and in units of five by changing the value of data B. The minimum number of frequency divisions N which is continuously variable is 20 taking the condition B≧A into consideration. 
     Generally, when the number of frequency divisions of the prescalers is U and L respectively, the relation U=L+1 is held, and therefore the minimum number of frequency divisions N min  which is continuously variable is expressed by the equation (2) below. 
     
         N.sub.min =L(L-1)                                          (2) 
    
     Specifically, if the number of frequency divisions U, L of the prescalers is increased in order to reduce the operating speed of the counter, the minimum number of frequency divisions N min  is increased thereby to narrow the variable range of the number of frequency divisions N. 
     If an IC test is to be conducted at high operating speed on the one hand and various ICs are to be tested on the other hand, therefore, a variable-ratio frequency divider having a wide variable range of the number of frequency divisions is desired. 
     SUMMARY OF THE INVENTION 
     The object of the present invention is to obviate the above-mentioned disadvantages of the prior art and to provide a variable-ratio frequency divider which can be operated at high speed and which has a wide variable range of the number of frequency divisions. 
     According to the present invention, there is provided a variable-ratio frequency divider comprising a D flip-flop for realizing a high-speed operation and a delay element in a feedback loop from an output Q of the D flip-flop to a predetermined terminal, wherein the number of frequency divisions is rendered variable by changing the transmission delay time of the delay element. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a diagram showing a circuit of a conventional timing signal generator used with an IC test apparatus. 
     FIG. 2 is a diagram showing a circuit of an example of a conventional 2-modulus prescaler. 
     FIG. 3 is a block diagram showing an example of a variable-ratio frequency divider using the 2-modulus prescaler. 
     FIG. 4 is a block diagram showing a first embodiment of a variable-ratio frequency divider according to the present invention. 
     FIG. 5 is an operation timing chart of the first embodiment. 
     FIG. 6 is a block diagram showing a variable-ratio frequency divider according to a second embodiment of the present invention. 
     FIGS. 7 and 8 are operation timing charts of the second embodiment. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     An embodiment of the present invention will be explained below with reference to the accompanying drawings. 
     FIG. 4 is a block diagram showing a variable-ratio frequency divider according to an embodiment of the present invention, and FIG. 5 is a timing chart of the operation of the same embodiment. 
     Reference numeral 30 designates a latch for delay means, numeral 31 a variable delay element, numeral 32 a fixed delay element, and numerals 33 and 34 first and second D flip-flops (hereinafter referred to merely as the D flip-flops). 
     The waveforms a to e in FIG. 5 correspond to the points designated by the same characters in FIG. 4. 
     First, the delay time of the delay element 31 can be controlled by the value e held in the latch 30, and it is assumed that the desired value of the value e is not selected fixedly. 
     Also, assume that the basic clock f in  (waveform a) is supplied to the D flip-flop 34. When the positive edge (the beginning of the section TO) of the clock (waveform b) is applied to the clock terminal CLK of the D flip-flop 33, the output Q (waveform c) thereof becomes &#34;low&#34;. 
     On the other hand, the output Q of the D flip-flop 33 becomes &#34;high&#34;, and after the lapse of the time set by the delay element 31, sets the D flip-flop 33. As a result, the output Q becomes &#34;high&#34; at the section T2. 
     The output Q of flip-flop 33 (waveform C) is applied to the input terminal D of the D flip-flop 34, so that a frequency-divided clock f out  (waveform d) of which the timing has been taken again by the basic clock f in , is produced from the output Q. The output Q of the D flip-flop 34 is applied through the delay element 32 to the clock terminal CLK of the D flip-flop 33, thus producing the frequency-divided f out  synchronous with the basic clock f in . 
     Let the period of the basic clock be T, and the transmission delay time of each element determined as below, then the number of frequency divisions N is expressed by equation (3) below. 
     
         (N-1)T&lt;T.sub.CQ33 +T.sub.31 +T.sub.SQ33 +T.sub.SET34 +T.sub.CQ34 +T.sub.32 &lt;N·T                                             (3) 
    
     where T CQ33  is the transmission delay time from the clock terminal CLK to the output Q of the D flip-flop 33, T 31  the transmission delay time of the delay element 31, T SQ33  the transmission delay time from the set terminal SD to the output Q of the D flip-flip 33, T SET34  the set up time of the clock from the input D of the D flip-flop 34, T CQ34  the transmission delay time from the clock terminal CLK to the output Q of the D flip-flop 34, and T 32  the transmission delay time of the delay element 32. 
     It is thus possible to render the number of frequency divisions N continuously variable by properly setting the delay time of the delay element 31. 
     In FIG. 4, the data e corresponding to the dividing ratio 1/N is held by the latch 30 thereby to keep constant the transmission delay time of the delay element 31 for the period equal to a period of the frequency divided clock f out . Specifically, the data e on the dividing ratio 1/N is held by the latch 30 by the negative edge of the waveform d during the section T3 in FIG. 5, thus controlling the width of the negative pulse in the sections T5 to T7 of the waveform d. It is thus possible to continuously control the number of frequency divisions N for each period of the frequency-divided clock f out . 
     The same effect as the apparatus mentioned above is obtained from a modification of the above-mentioned embodiment in which, as shown in FIG. 4, a reset terminal CD is used instead of the set terminals SD of the D flip-flop 33, and the connection of the outputs Q and Q is reversed. In short, they are identical to each other with the only difference of positive and negative logics. 
     As obvious from the embodiments explained above, a counter is not used in the prescaler. Instead, the D flip-flop is used to realize a high-speed operation. At the same time, the number of frequency divisions can be easily changed as desired by changing the transmission delay time of the delay elements in the feedback loop from the output Q to the set terminal SD of the D flip-flop 33. 
     A second embodiment of the present invention will be explained with reference to FIGS. 6 to 8. The embodiment under consideration contains an improvement of the disadvantage of the first embodiment shown in FIG. 4 that the delay element 31 is unable to produce a long delay time and has a wider frequency dividing range. 
     FIG. 6 is a block diagram showing a variable-ratio frequency divider circuit according to an embodiment of the present invention, and FIGS. 7 and 8 are timing charts of the operation thereof. 
     Numeral 51 designates a register for delay means, numeral 50 a variable delay element, numerals 40, 45, 49, 52 a fixed delay element, 42, 43 a D flip-flop, and numeral 54 a preset counter. 
     The waveforms a to g in FIG. 7 correspond to the points carrying the same characters in FIG. 6. 
     First, assume that the preset counter 54 is always supplied with an input 0 at the input terminal h thereof, and produces a &#34;high&#34; signal. 
     The delay time of the delay element 50 can be controlled by the value g held in the register 51, and assume that the desired value of g is selected and established. 
     Also, assume that the basic clock f in  (waveform a) is supplied to the D flip-flop 42. When the set terminal SD of the D flip-flop 42 is supplied with a &#34;high&#34; (sections T 0  to T 1 ) pulse (waveform e), the output Q of the D flip-flop 42 becomes &#34;low&#34;, and the waveform f becomes &#34;low&#34;. At the same time, the output Q is applied through an AND gate 44, and after the lapse of the time set by the delay element 50, is applied through an OR gate 48 to the clock terminal of the D flip-flop 42, so that the set value &#34;L&#34; of the input terminal D is produced at the Q output thereof. This Q output is applied to the input terminal D of the flip-flop 43, thereby producing the Q output waveform b of which the timing has been taken again by the basic clock f in  and the waveform c of the Q output delayed by the delay element 45, so that a &#34;high&#34; signal (sections T 5  to T 6 ) is applied to the set terminal of the D flip-flop 42 through the delay element 40. 
     As a result, a frequency-divided clock (waveform f) is obtained in synchronism with the basic clock f in . 
     Let the period of the basic clock be T and the transmission delay time of each element be determined as below. Then, the number of frequency divisions N is expressed by equation (4) below. 
     
         N·T&lt;T.sub.CQ43 +T.sub.41 +T.sub.40 +T.sub.SQ42 +T.sub.44 +T.sub.50 +T.sub.48 +T.sub.CQ42 +T.sub.SET43 &lt;(N+1)·T      (4) 
    
     where T CQ43  designates the transmission delay time from the clock terminal CLK to the output Q of the D flip-flop 43, T 41  the transmission delay time of the AND gate 41, T 40  the transmission delay time of the delay element 40, T SQ42  the transmission delay time from the set terminal SD to the output Q of the D flip-flop 42, T 44  the transmission delay time of the AND gate 44, T 50  the transmission delay time of the delay time 50, T 48  the transmission delay time of the OR gate 48, T CQ42  the transmission delay time from the clock terminal CLK to the output Q of the D flip-flop 42, and T SET43  the set-up time of the clock terminal CLK of the D flip-flop 43. 
     It is thus possible to render the number of frequency divisions N continuously variable by properly setting the delay time of the delay element 50. 
     In FIG. 6, the data g corresponding to the dividing ratio 1/N is held by the register 51, so that the transmission delay time is maintained constant for one period of the frequency-divided clock f o . Specifically, the data g on the frequency dividing ratio 1/N is held at the register 51 by the positive edge of the waveform f during the section T2 in FIG. 7, thereby controlling the width of the negative pulse of the waveform f during the sections T 5  to T 8 . The number of frequency divisions N is thus controlled so as to be continuously variable. 
     The operation of the preset counter 54 (h≠0) will be explained below with reference to FIGS. 6 and 8. The number of frequency divisions determined by the value g which is an input to the register 51 is assumed to be 5 to 9 by way of explanation, and description will be made below with reference to the case in which h is 3 and g is 7. 
     In FIG. 8, the negative pulse of the frequency-divided clock f o  (waveform f) is produced during the section T 20 , and the value 7 is stored in the register 51 at the positive edge of this pulse. A clock (waveform i) which is delayed from the frequency-divided clock is applied to the terminal PE of the preset counter 54, and the value 3 is stored in the counter 54 at the positive edge during the section T 20  of the output Q (waveform i) of the D flip-flop 42. As a result, the terminal count TC of the preset counter 54 becomes &#34;low&#34;, and the OR gate 47 is selected through the OR gate 46. In the process, the clock (waveform j) providing applied to the preset counter 54 is obtained by dividing the basic clock f in  (waveform a) by N C . Let the period of the basic clock f in  be T, and the number of frequency divisions N C  is given by the equation (5) below. 
     
         N.sub.C ·T&lt;T.sub.CQ43 +T.sub.41 +T.sub.40 +T.sub.SQ42 +T.sub.47 +T.sub.49 +T.sub.48 +T.sub.CQ42 +T.sub.SET43 &lt;(N.sub.C +1)·T(5) 
    
     ps where T 47  is the transmission delay time of the AND gate 47, and T 40  the transmission delay time of the delay element 49. In this case, the number of frequency divisions N C  is assumed to be 5. 
     The preset counter 54 counts the clock (waveform i) and raises the terminal count TC to &#34;high&#34; level at the time point (section T 24 ) that the set value 3 has been counted. The AND gate 47 is thereby closed through the OR gate 46, and the AND gate 44 is selected. During the section T 24 , therefore, the basic clock f in  (waveform a) is frequency-divided by 7 as mentioned above by the value &#34;7&#34; stored in the register 51 and is supplied to the preset counter 54 while at the same time producing the frequency-divided clock f 0  (waveform f) from the AND gate 44. Specifically, the period of the frequency-divided clock is provided by the range from the positive edge of the waveform f of the section T 20  to the positive edge of the section T 24 . 
     The number of frequency divisions N 0  for determining the frequency-divided clock f 0  by dividing the frequency of the basic clock f in  is given by equation (6) below. 
     
         N.sub.0 =f.sub.out /f.sub.in =g+5h                         (6) 
    
     In order to generally determine the number of frequency divisions N 0 , assume that the range of the set value g applied to the register 51 is from m to 2m-1, the number of frequency division with the AND gate 47 selected is m, and the value set in the preset counter 54 is h. Then the number of frequency divisions N 0  is expressed by equation (7) below. 
     
         N.sub.0 =f.sub.out /f.sub.in =g+m·h               (7) 
    
     As obvious from above, the minimum number of frequency divisions is m, and since a D flip-flop instead of a counter is used in the prescaler, high-speed operation becomes possible. Further, the number of frequency divisions can be easily changed by changing the set value of the preset counter and the transmission delay time of the delay element in the feedback loop from the terminal Q to the clock terminal CLK of the D flip-flop. 
     It will be understood from the foregoing detailed explanation that according to the present invention, there is provided a variable-ratio frequency divider circuit having a high speed and a wide range of the number of frequency divisions, which has a great advantage satisfying the demand of various electronic circuits.