Sunteți pe pagina 1din 6

University of Technology

Electrical and Electronic Engineering


Department

RING COUNTER
By
Hasanin Ghanem Khudair
Supervisor by
Dr. Bassam Hameed
2019/2020
Ring Counter

Abstract :
Ring counters are a type of counters composed of shift registers. They are extremely
fast and require few logic gates. This document introduces two types of ring counters, the
straight ring counter and the Johnson counter. The latter is elaborated on in detail. Some
applications are described as well as commercially available devices and designs using
Johnson counters. A generic VHDL description and a description of the commercially
available 4017 are provided.

Introduction :

Its a type of counter created using shift registers. A shift register is constructed using D-
type flip-flops where the output of one flip-flop is connected to the input of another flip-
flop . With ring counters, the output of the last flip-flop is fed to the input of the first flip-
flop. Ring counters do not count using normal binary code, but their internal state can be
used to decode to any output sequence wanted.
There are two types of ring counters:
a) Straight ring counter
b) Johnson Counter
There is a third counter type using a shift register, the Linear Feedback Shift Register
(LFSR). It has a more elaborate feedback circuit than the other two ring counters and
is therefore not discussed in this document.

Types of Ring Counter :

1)Straight ring counter:

A straight ring counter or Overbeck counter connects the output of the last flip-flop
to the first flip-flop input and circulates a single one bit around the ring. It provides
a one-hot counting sequence. For example, in a 4-register ring counter, with initial
register values of 1000, the repeating sequence is 1000, 0100, 0010, 0001. Note that one
of the flip-flops must be pre-loaded with a logic 1 in order for it to operate properly.
Also note that an n-bit ring counter cycles through exactly n states.
A schematic of a 4-bit straight ring counter is given in Figure 1. The asynchronous
reset will set the initial contents of the counter to 1000
Figure 1: A 4-bit straight ring counter.

2) Johnson Counter:
Another form of ring counter is created by feeding back the complement of the contents
of the last flip-flop to the input of the first flip-flop. This is called a twisted ring counter,
but is better known as the Johnson counter. The alternative term Möbius counter is found
in many books and articles because the Johnson counter resembles the famous Möbius
strip . For example, in a 5-flip-flop Johnson counter with an initial register contents (or
state) of 00000, the repeating sequence is 00000, 10000, 11000, 11100, 11110, 11111,
01111, 00111, 00011, 00001. When observing the pattern, it can be seen that any changes
between succeeding states, only one flip-flop changes state. As a result, any of these
states is directly, spike-free decodable with only a two-input gate Figure 2 shows a 5-bit
Johnson counter with terminal count output tc. This output becomes high in the last
counting state 00001 before returning to 00000.

Figure 2: A 5-bit Johnson Counter with Terminal Count. The reset is omitted for clarity.

Only the two most significant flop-flops have to be sampled, so tc is logic ‘1’ when Q3
is logic ‘0’ and Q4 is logic ‘1’. Using De Morgan’s theorem, the resulting function can
be realised using a NOR gate and the already available flip-flop outputs.

(1)
It can be easily shown that an n-bit Johnson counter cycles through exactly 2n states.
This becomes increasingly inefficient for n > 2 since any n-bit counter has 2n states
by itself. If the Johnson counter enters a state that does not belong to the original
counting sequence, it will exhibit a single parasitic counting sequence with 2n − 2n
states. This is why most commercial devices incorporate self-correcting logic.
Within a full counting sequence or so, the device will resume normal operation.

Properties
Ring counters are often used in hardware design (e.g. AASIC and FPGA design) to
create finite-state machines. A binary counter would require an adder circuit which is
substantially more complex than a ring counter and has higher propagation delay as the
number of bits increases, whereas the propagation delay of a ring counter will be nearly
constant regardless of the number of bits in the code.
The straight and twisted forms have different properties, and relative advantages and
disadvantages.
A general disadvantage of ring counters is that they are lower density codes than normal
binary encodings of state numbers. A binary counter can represent 2^N states, where N
is the number of bits in the code, whereas a straight ring counter can represent only N
states and a Johnson counter can represent only 2N states. This may be an important
consideration in hardware implementations where registers are more expensive than
combinational logic.
Johnson counters are sometimes favored, because they offer twice as many count states
from the same number of shift registers, and because they are able to self-initialize from
the all-zeros state, without requiring the first count bit to be injected externally at start-up.
The Johnson counter generates a code in which adjacent states differ by only one bit (that
is, have a Hammimg distance of 1), as in a Gray code, which can be useful if the bit
pattern is going to be asynchronously sampled.
When a fully decoded or one-hit representation of the counter state is needed, as in some
sequence controllers, the straight ring counter is preferred. The one-hot property means
that the set of codes are separated by a minimum Hamming distance of 2, so any single-
bit error is detectable (as is any error pattern other than turning on one bit and turning off
one bit).
Sometimes bidirectional shift registers are used (using multiplexors to take the input for
each flip-flop from its left or right neighbor), so that bidirectional or up–down ring
counters can be made.
Applications of Ring Counter :
Early applications of ring counters were as frequency prescalers (e.g. for Geiger counter
and such instruments) as counters to count pattern occurrences in cryptanalysis (e.g. in
the Heath Robinson codebreaking machine and the Colossus computer and as
accumulator counter elements 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.
Straight ring counters generate fully decoded one-hot codes to that are often used to
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.
Besides being an efficient alternative way to generate one-hot codes and frequency pre-
scalers, a Johnson counter is also a simple way to encode a cycle of an even number of
states that can be asynchronously sampled without glitching, since only one bit changes
at a time, as in a Gray code. Early computer mice used up–down (bidirectional) 2-bit
Johnson or Gray encodings to indicate motion in each of the two dimensions, though in
mice those codes were not usually generated by rings of flip-flops (but instead by electro-
mechanical or optical quadrature encoders A 2-bit Johnson code and a 2-bit Gray code
are identical, while for 3 or more bits Gray and Johnson codes are different. In the 5-bit
case, the code is the same as the Libaw–Craig code [de] for decimal digits

Advantages and Disadvantages of Ring Counter :


Advantages
• It doesn’t need a decoder (i.e. It is a self decoding circuit)
• It can be can be implemented using JK and D flip-flops.
Disadvantages
• In ring counter, only 4 of the 15 states are being utilized.

S-ar putea să vă placă și