Abstract:
A ring counter includes a plurality of latches forming a shift register. A single bit is sequentially clocked through the shift register, so that only one output is active at any time. A logic circuit is connected to the outputs, and monitors the number of outputs which are active. If more than one output should somehow become active at one time, such as during power up, a reset signal is immediately generated to reset a single bit of the counter active. An external reset signal can also be applied to the logic circuit to force a reset of the counter.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to the field of microelectronics, and in particular to digital circuits. Still more particularly, the present invention relates to digital counters. 
     2. Description of the Prior Art 
     In digital circuit designs, digital counter circuits are often used to control the timing and/or sequencing of operations which occur in other portions of an overall circuit design. In many circuit designs, it is desirable to use a digital counter circuit having N-number of outputs, wherein only one of the N outputs is active at any instance. Since the outputs of the counter may be used to control operations in other portions of the circuit, and such operations may not be able to occur at the same time, it may be critical that no more than one output of the counter is active at any time, and that no false states occur during transitions, including the period during power-up. 
     One such counter circuit is implemented by clocking a single bit through a series of sequentially connected latches connected in a shift register configuration. This type of counter may be referred to as a &#34;ring counter&#34;, and is sometimes referred to as a shift register counter. One advantage of the ring counter is that decoding logic is not required to determine which one of the N outputs should be active during a particular clock cycle. If decoding logic is used to activate one of the N outputs, as in a &#34;Johnson counter,&#34; glitches may be generated as the decode logic settles and reaches a final state, thereby causing glitches on the output, where more than one output is active at a particular instance. 
     Although ring counters have the advantages mentioned above, ring counters also have disadvantages. One disadvantage is the possibility that the shift register chain may enter into an improper state. An improper state occurs in a ring counter when more than one active bit enters the shift register chain, which causes more than one output to be active. If, for example, during power-up, the counter does not reset properly, such an improper state may occur. In other cases, such as transitory conditions caused by power supply transients, an improper state can occur. Moreover, once a ring counter has entered into an improper state, such an improper state will continue until a reset signal is received, which will clear all but one active output. 
     Therefore, it would be desirable to have an apparatus to prevent a ring counter from outputting an improper state in the form of having more than one output in the active state at a particular instance. 
     SUMMARY OF THE INVENTION 
     A ring counter according to the present invention includes a plurality of latches forming a shift register. A single bit is sequentially clocked through the shift register, so that only one output is active at any time. A logic circuit is connected to the outputs, and monitors the number of outputs which are active. If more than one output should somehow become active at one time, such as during power up, a reset signal is immediately generated to reset a single bit of the counter active. An external reset signal can also be applied to the logic circuit to force a reset of the counter. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, and further objects and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawing, wherein: 
     FIG. 1 is a schematic diagram of a digital counter in accordance with a preferred embodiment of the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Referring now to FIG. 1, a schematic diagram of a digital counter 10 is depicted in accordance with a preferred embodiment of the present invention. Digital counter 10 includes a shift register portion 12 and a reset signal portion 14. 
     Shift register portion 12 includes a series of N latch circuits 16, each having an input 18, an output 20, a clock input 22, a &#34;reset&#34; input 24, and a &#34;set&#34; input 26. Each latch circuit 16 is preferably a D flip-flop. As illustrated, the series of N latch circuits 16 are connected in a configuration that one skilled in the art may recognize as a &#34;ring counter,&#34; wherein each output 20 is connected to an input 18 of a subsequent latch circuit 16 in the series of latch circuits, except for the last, or Nth, latch circuit 16. The output 20 of the last latch circuit is connected to the input 18 of the first latch circuit 16. Each output 20 of each of latch circuit 16 is also connected to a counter output 20 O  through 20 N . As mentioned previously, counter outputs 20 O  through 20 N  may be used to control the sequencing or timing of other operations in other portions of an overall digital circuit design. 
     Each reset input 24 of each latch circuit 16 is connected to a reset signal line 28, except for the first latch circuit 16, which has reset signal line 28 connected to the set input 26. When a reset signal is received by shift register portion 12 on signal line 28, each latch circuit 16 is set to a first state (i.e., set to a &#34;zero&#34; state), except for the first latch circuit 16, which is set to a second state or active state (i.e., set to a &#34;one&#34; state). In this example, an output of a &#34;one&#34; is considered &#34;active.&#34; However, those persons skilled in the art will recognize that either a &#34;one&#34; or a &#34;zero&#34; may be considered an active output or signal, depending upon the specific circuit design. The reset input 24 for the first latch 16, and the set inputs 26 for the remaining latches, are preferably connected to a zero or one value, whichever will force them to be permanently inactive. 
     Each clock input 22 of each latch circuit 16 is connected to a clock signal line 30. When a clock signal is received by shift register portion 12 on signal line 30, data bits stored in one latch circuit 16 are clocked to a subsequent latch circuit 16. After receiving a successful reset signal 28, and upon periodically receiving clock signal 30, shift register portion 12 will, during normal operation, cycle a single data bit, which is in the second state (i.e., a &#34;one&#34;), through all N latch circuits, thereby causing a single active signal to appear on one of the outputs, 20 O  through 20 N . 
     Turning now to reset signal portion 14 of digital counter 10, there is depicted a circuit which generates reset signal 28. Reset signal 28 is generated upon the occurrence of an improper state within shift register portion 12, or upon receiving a signal from external reset signal line 38. 
     Reset signal portion 14 includes a series of N-2 logic cells 40, one of which is associated with each of the last N-2 latch circuits 16 in the series of N latch circuits 16. Each logic cell 40 has three inputs, and two outputs. The three inputs to each logic cell 40 include: input 42, input 44, and input 46. The two outputs from each logic cell 40 include: output 48 and output 50. 
     In the implementation shown in FIG. 1, logic cell 40 comprises a two-input OR-gate 52 and a two-input AND-gate 54. One input to OR-gate 52 is connected to logic cell input 42 and the other input to OR-gate 52 is connected to logic cell input 44. The output of OR-gate 52 is connected to one input of AND-gate 54 and logic cell output 48. The other input of AND-gate 54 is connected to logic cell input 46. The output of AND-gate 54 is connected to logic cell output 50. 
     While the implementation of logic cell 40 is illustrated here using AND- and OR-gates, those persons skilled in the art will recognize that the circuits used to implement logic cell 40 may be different, yet perform the same logical function. For example, a De Morgan equivalent circuit may be used to implement the function of logic cell 40. Since logic cell 40 will be replicated N-2 times, integrated circuit designers may want to consider the area required to fabricate the circuit of logic cell 40. 
     Input 42 of a particular logic cell 40 receives a signal that indicates at least one of the outputs 20 of a previous latch circuit 16 is active (high). This applies only to latches at least two prior to the associated latch, and does not include the immediately preceeding latch. For example, an active signal received at input 42 of the logic cell 40 associated with latch circuit (3) 16 indicates that output 20 of either or both latch circuit (1) 16 or latch circuit (0) 16 is active. The input 42 of the logic cell 40 associated with latch circuit (7) would similarly indicate whether any of the outputs from latches (0) through (5) were active. Input 42 is connected to output 48 from the immediately preceeding logic cell 40, except for the first logic cell 40, which is discussed below. 
     Input 44 of a particular logic cell 40 is used to indicate whether or not output 20 of the latch circuit 16 immediately prior to a latch circuit 16 associated with the particular logic cell 40 is active. For example, an active signal received at input 44 of the logic cell 40 associated with latch circuit (3) 16 indicates that output 20 of latch circuit (2) 16, which is the prior latch circuit 16, is active. 
     Input 46 of a particular logic cell 40 is used to indicate whether or not output 20 of the latch circuit 16 associated with the particular logic cell 40 is active. For example, an active signal received at input 46 of the logic cell 40 associated with latch circuit (3) 16 indicates that output 20 of latch circuit (3) 16 is active. 
     Output 48 of a particular logic cell 40 is used to indicate whether or not output 20 of any latch circuit 16 prior to the latch circuit 16 associated with the particular logic cell 40 is active. Output 50 produces an active signal if one of the outputs 20 of any previous latch circuit 16 is active, and the output 20 of an associated latch circuit 16 is active. Output 50 active thus indicates that at least two outputs are simultaneously active, by definition an error condition. 
     AND-gate 56 is used to monitor the outputs 20 of the first two latch circuits 16. AND-gate 56 produces an active signal if the outputs 20 of the first two latch circuits 16 are both active. 
     Finally, the N inputs to OR-gate 58 are connected to N-2 logic cells 40, the output of AND-gate 56, and external reset 38. If any one of such inputs is active, OR-gate 58 activates reset signal 28, which resets each latch circuit 16 to a first state (i.e., a &#34;zero&#34; state), except for the first latch circuit 16, which is set to a second state (i.e., a &#34;one&#34; state). Thus, if any one of the inputs to AND-gate 56, except external reset 38, is active, an improper state exists within digital counter 10, which is then immediately cleared by the generation of reset signal 28. 
     While the invention has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.