A Johnson counter, also known as a twisted-ring counter or switch-tail ring counter, is a type of digital counter circuit used in electronics and digital logic. It is a modification of the standard ring counter, which is a circular shift register that has only one flip-flop set to 1 while the others are set to 0. In contrast, the Johnson counter has alternating 1s and 0s in its shifting pattern.
The shifting pattern of a Johnson counter is achieved through a process called "twisting" or "inverting." Let's consider a 4-bit Johnson counter as an example to understand how the shifting pattern works.
A 4-bit Johnson counter has four flip-flops (FFs) connected in a circular arrangement. Let's represent the state of each flip-flop at any given time as Q3, Q2, Q1, and Q0 from the most significant bit (MSB) to the least significant bit (LSB). The initial state of the counter is typically set to 0001 (Q3 Q2 Q1 Q0), with Q3 = 0, Q2 = 0, Q1 = 0, and Q0 = 1.
The shifting pattern of the Johnson counter is as follows:
Right Shift: In this operation, the bits are shifted to the right (from LSB to MSB). The right shift operation is achieved by toggling the values of the flip-flops. The state transitions are as follows:
0001 (initial state)
1000 (right shift)
1100 (right shift)
1110 (right shift)
1111 (right shift)
0111 (right shift)
0011 (right shift)
0001 (right shift, back to the initial state)
Left Shift: Similarly, you can perform a left shift operation by toggling the values of the flip-flops in the opposite direction (from MSB to LSB). The state transitions for the left shift operation are as follows:
0001 (initial state)
0010 (left shift)
0110 (left shift)
1110 (left shift)
1101 (left shift)
1011 (left shift)
0011 (left shift)
0001 (left shift, back to the initial state)
As you can see, the Johnson counter has a unique shifting pattern that continuously cycles through a sequence of 1s and 0s. This counter is often used in applications where a continuous and non-repeating sequence is required, such as in frequency division and LED chaser circuits.