*** Welcome to piglix ***

Ring counter


A ring counter is a type of counter composed of a type of circular shift register. The output of the last shift register is fed to the input of the first register. The Hamming distance of an Overbeck counter is 2, the Hamming distance of a Johnson counter is 1

There are two types of ring counters:

Johnson counters are often favoured, not just because they offer twice as many count states from the same number of shift registers, but because they are able to self-initialise from the all-zeros state, without requiring the first count bit to be injected externally at start-up. The Johnson counter generates a Gray code, a code in which adjacent states differ by only one bit.

A Johnson counter is a ring with an inversion; here is a 4-bit Johnson counter:

A 4-bit ring counter using D-type flip flops with asynchronous clear. (Line-negations drawn as circle.)

Note the inversion of the Q signal from the last shift register before feeding back to the first D input, making this a Johnson counter.

The circuit of an Overbeck counter is shown here: 4-bit Overbeck ring counter

Ring counters are used in hardware logic design (e.g. ASIC and FPGA design) to create complicated finite state machines. A binary counter will require an adder circuit which is substantially more complex than a ring counter. Additionally, the worst case propagation delay on an adder circuit will be proportional to the number of bits in the code (due to the carry propagation). The propagation delay of a ring counter will be a constant regardless of the number of bits in the code. The complex combinational logic of an adder can create timing errors which may result in erratic hardware performance. Last, ring counters with Hamming distance 2(or more) allow the detection of single bit upsets that can occur in hazardous environments.


...
Wikipedia

...