Ring Counters
In the previous
Shift Register tutorial we saw that if
we apply a serial data signal to the input of a Serial-in to Serial-out Shift Register, the same sequence of data will
exit from the last flip-flip in the register chain after a preset number of clock cycles thereby acting as a
time delay to the original signal. But what if we were to connect the output of the Shift Register back to its input,
we then have a closed loop circuit that "Recirculates" the DATA around a loop, and this is
the principal operation of Ring Counters or Walking Ring Counter. Consider the circuit below.
4-bit Ring Counter
The synchronous Ring Counter example above, will re-circulate the same
DATA pattern between the 4 Flip-flops over and over again every 4th clock cycle, as long as
the clock pulses are applied to it. But in order to cycle the DATA we must first "Load" the
counter with a suitable DATA pattern for it to work correctly as all logic "0"'s or all logic
"1"'s outputted at each clock cycle would make the ring counter invalid.
For Ring Counters to operate correctly they must start with the first flip-flop
(FFA) in the logic "1" state and all the others at logic "0". To achieve this, a "CLEAR" signal
is firstly applied to all the Flip-flops in order to "RESET" their outputs to a logic "0" level and then a "PRESET" pulse
is applied to the input of the first Flip-flop (FFA) before the clock pulses are applied. This
then places a single logic "1" value into the circuit of the Ring Counters.
The ring counter example shown above is also known as a "MODULO-4" or "MOD-4" counter since it
has 4 distinct stages and each Flip-flop output has a frequency equal to one-fourth or a quarter (1/4) that of the main
clock frequency. The "MODULO" or "MODULUS" of a counter is the number of states the counter counts or sequences through
before repeating itself and a ring counter can be made to output any MODULO number and a "MOD-N" Ring Counter will require
"N" number of Flip-flops connected together. For example, a MOD-8 Ring Counter requires 8 Flip-flops and a MOD-16 Ring
Counter would require 16 Flip-flops.
Johnson Ring Counters
Johnson Ring Counters or "Twisted Ring Counters", are exactly the same idea as the
Walking Ring Counter above, except that the inverted output Q of the last Flip-flop
is connected back to the input D of the first Flip-flop as shown below. The main advantage of
this type of ring counter is that it only needs half the number of Flip-flops compared to the standard walking ring counter
then its Modulo number is halved.
4-bit Johnson Ring Counter
This inversion of Q before it is fed back to input D
causes the counter to "count" in a different way. Instead of counting through a fixed set of patterns like the walking ring
counter such as for a 4-bit counter, "1000"(1), "0100"(2), "0010"(4), "0001"(8) etc, the Johnson counter counts up and
then down as the initial logic "1" passes through it to the right replacing the preceding logic "0". A 4-bit Johnson
ring counter passes blocks of four logic "0" and then four logic "1" thereby producing an 8-bit pattern. As the inverted
output Q is connected to the input D this 8-bit pattern continually
repeats. For example, "1000", "1100", "1110", "1111", "0111", "0011", "0001", "0000" and this
is demonstrated in the table below.
| FFA | FFB | FFC | FFD |
| 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 0 |
| 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 |
| 0 | 0 | 1 | 1 |
| 0 | 0 | 0 | 1 |
| Johnson Ring Counter, Count Sequence |
As well as counting, Ring Counters can be used to detect or recognise various patterns or number values.
By connecting simple logic gates such as AND or
OR gates to the outputs of the Flip-flops
the circuit can be made to detect a set number or value. Standard 2, 3 or 4-stage Johnson Ring Counters can also be
used to divide the frequency of the clock signal by varying their feedback connections and divide-by-3 or divide-by-5
outputs are also available.
A 3-stage Johnson Ring Counter can also be used as a 3-phase, 120 degree phase shift square wave generator by
connecting to the outputs from A, B and NOT-B.
The standard 5-stage Johnson counter such as the commonly available CD4017 is generally used as a Synchronous Decade
Counter/Divider circuit. The smaller 2-stage circuit is also called a "Quadrature" (sine/cosine) Oscillator/Generator and
is used to produce 4 outputs that are each "phase shifted" by 90 degrees with respect to each other, and this is shown below.
2-bit Quadrature Generator
| | A | B | C | D |
| QA+QB | 1 | 0 | 0 | 0 |
| QA+QB | 0 | 1 | 0 | 0 |
| QA+QB | 0 | 0 | 1 | 0 |
| QA+QB | 0 | 0 | 0 | 1 |
| 2-bit Quadrature Oscillator, Count Sequence |
As the 4 outputs, A to D are phase shifted by 90
degrees with regards to each other, they can be used with additional circuitry, to drive a 2-phase Full-Step Stepper Motor
as shown below.
Stepper Motor Control
2-phase (unipolar) Full-Step Stepper Motor Circuit
The speed of rotation of the
Stepper Motor will depend mainly
upon the Clock Frequency and additional circuitry would be require to drive the "power" requirements of the motor. As
this section is only intended to give the reader a basic understanding of Johnson Ring Counters other good websites
explain in detail the types and drive requirements of stepper motors.
Johnson Ring Counters are available in standard TTL or CMOS IC form, such as the CD4017
5-Stage, Decade Johnson Ring Counters with 10 active HIGH decoded outputs or the CD4022 4-stage, Divide-by-8 Johnson counter
with 8 active HIGH decoded outputs.
|