A ring counter is a type of counter composed of flip-flops connected into a shift register, with the output of the last flip-flop fed to the input of the first, making a "circular" or "ring" structure. There are two types of ring counters:
A straight ring counter, also known as a one-hot counter, connects the output of the last shift register to the first shift register input and circulates a single one (or zero) bit around the ring. A Johnson counter, also called twisted ring counter, switch-tail ring, walking ring counter, or Möbius counter, connects the last shift register's complemented output to the input of the first register and circulates a stream of ones followed by zeros around the ring.
Four-bit ring-counter sequences
Properties Ring counters are often used as state sequencers in larger finite-state machines. Unlike binary counters, whose propagation delays grow as the number of bits increase, the propagation delays within a ring counter are constant regardless of the number of bits, thus allowing them to operate at higher clock frequencies. Ring counters have a smaller modulus than binary counters. A binary counter has 2N states, where N is the number of flip-flops. In contrast, a straight ring counter has N states and a Johnson counter has 2N states. This may be an important consideration in hardware implementations where registers are more expensive than combinational logic or vice versa. A Johnson counter is able to self-initialize from the all-zeros state. It generates a Gray code in which adjacent states differ by only one bit (i.e., have a Hamming distance of 1), which can be useful if the bit pattern will be asynchronously sampled. A straight ring counter is typically used when a one-hot representation of the counter state is needed, as in some sequence controllers. A bidirectional counter may be implemented by adding a multiplexer at the input of each flip-flop, to select the output of its left or right neighbor, at the expense of increased propagation delay.
Logic diagrams A straight ring counter is a circular shift register, as shown in the example below. The initial one-hot pattern is established by setting one flip-flop and clearing all others upon reset. Alternatively, the counter can be made self-initializing by ANDing the complements all of flip-flop outputs except the last, so that a 1 is applied to the first flip-flop input when there is no 1 in any stage but the last.
A Johnson counter, named for Robert Royce Johnson, is a circular shift register in which the final output is inverted, as shown in this 4-bit Johnson counter:
History Before the days of digital computing, ring counters were used in Geiger counters as frequency prescalers to reduce the event rate (of radioactive decay to alpha and beta particles) to more manageable frequencies. Five-state ring counters were used with divide-by-two scalers to make decade (power-of-ten) scalers before 1940, such as those developed by C. E. Wynn-Williams. Other early applications of ring counters include pattern occurrence counters in cryptanalysis (e.g. in the Heath Robinson codebreaking machine and Colossus computer), and as count accumulators for decimal arithmetic in computers and calculators, using either bi-quinary (as in the Colossus) or ten-state one-hot (as in the ENIAC) representations. Early ring counters used only one active element (vacuum tube, valve, or transistor) per stage, relying on global feedback to suppress states other than one-hot states. For example, in the 1941 patent filing of Robert E. Mumma of the National Cash Register Company. Wilcox P. Overbeck invented a version using multiple anodes in a single vacuum tube. In recognition of his work, ring counters are sometimes called Overbeck rings. The ENIAC used decimal arithmetic based on ten-state, one-hot ring counters. The works of Mumma at NCR and Overbeck at MIT were among the prior art works examined by the patent office that invalidated the patents of J. Presper Eckert and John Mauchly for the ENIAC technology. By the 1950s, ring counters with a two-tube or twin-triode flip-flop per stage were appearing. Robert Royce Johnson developed a number of different shift-register-based counters with the aim of making different numbers of states with the simplest possible feedback logic, and filed for a patent in 1953. The Johnson counter is the simplest of these.
Applications Straight ring counters are often used to generate one-hot signals that enable a specific action in each state of a cyclic control cycle. One-hot codes can also be decoded from a Johnson counter, using one gate for each state.
Johnson counters are commonly used to generate a cycle with an even number of states, which are naturally encoded as a Gray code and thus can be asynchronously sampled without causing glitches. A two-bit Johnson code and two-bit reflected binary code (RBC) are identical, whereas for three or more bits, RBC and Johnson codes are different. A five-bit Johnson counter produces a code identical to that of the Libaw–Craig code for decimal digits, from "a non-counting decimal-coded shaft digitizer". A Johnson counter and a few resistors can produce a glitch-free approximation of a sine wave having an output frequency determined solely by the counter's clock frequency.
See also Counter (digital) Ring oscillator Linear-feedback shift register
References


