
In the realm of digital electronics, counters are fundamental building blocks, orchestrating the timing and sequencing of complex operations. While many counter designs exist, the Johnson counter stands out for its remarkable efficiency and elegance, born from a simple yet profound design choice. It addresses the challenge of creating predictable, electrically "quiet," and power-efficient state machines without complex logic. This article delves into the ingenious design of the Johnson counter, exploring how a single twist in a feedback loop unlocks a wealth of beneficial properties.
This article first explores the "Principles and Mechanisms" of the counter's operation. By starting with a basic ring counter, it will uncover how the introduction of an inverted feedback loop doubles its states and gives rise to its most valued characteristic: single-bit transitions. This section will also explore the potential pitfalls of this design, namely the "lockout loops" of unused states. Following this, the "Applications and Interdisciplinary Connections" section will reveal how this theoretical elegance translates into practical solutions, from generating precise rhythms and waveforms to choreographing the motion of electric motors.
To truly understand the Johnson counter, it is helpful to start with its simpler cousin and appreciate the profound effect of a single, elegant twist. The beauty of the Johnson counter lies not in its complexity, but in the surprising and powerful consequences of a very simple idea.
Imagine a line of people, each holding a bucket. This is our shift register, a fundamental component in digital logic. Each person represents a flip-flop, a memory cell that can hold a single bit of information: a '1' (a full bucket) or a '0' (an empty one). On the beat of a drum—our clock signal—everyone passes their bucket to the person on their right. The person at the head of the line gets a new bucket, and the person at the end is left holding theirs.
What to do with the last person's bucket? The simplest idea is to have them run back to the front and pour their bucket's contents into the first person's empty one. This closes the loop. In digital terms, for a 4-bit right-shifting register with bits indexed , we connect the output of the last flip-flop () back to the input of the first flip-flop (). This creates a ring counter.
If we start with a single '1' in the register, say the state 1000, the '1' simply marches down the line with each clock pulse: 1000 → 0100 → 0010 → 0001, and then, as the '1' from the end comes back to the front, 1000 again. For a register with flip-flops, this gives us exactly unique states. It's a perfectly logical carousel, but it's not very efficient. With 4 bits, we have possible patterns, yet we're only using 4 of them. Can we do better?
Nature often reveals its deepest secrets through subtle asymmetries. Let's introduce a "twist" to our simple loop. Instead of connecting the output of the last flip-flop directly to the input of the first, what if we connect its inverse? That is, if the last bucket is full (1), we start the line with an empty one (0). If it's empty (0), we start with a full one (1).
This single wiring change—disconnecting the input from the output and reconnecting it to the inverted output for our 4-bit example—is all it takes to transform a ring counter into a Johnson counter, also known as a twisted-ring counter. This isn't some exotic, custom-built device; it's a clever configuration that can be implemented on standard components like a universal shift register by simply setting it to "shift" mode and making this one special feedback connection.
This small act of inversion, this twist in the tale, completely changes the character of the machine.
Let's watch this new machine run. We'll start our 4-bit counter in the all-zeros state: 0000.
0000: The last bit () is 0. Its inverse is 1. On the next clock pulse, this '1' is fed into the front of the register as everything else shifts right. The new state is 1000.1000: The last bit is still 0. Its inverse is 1. The state becomes 1100.1100: The last bit is 0. Inverse is 1. The state becomes 1110.1110: The last bit is 0. Inverse is 1. The state becomes 1111.Look at this beautiful progression! A stream of '1's has elegantly filled the register from left to right. Now the register is full. What happens next?
1111: Now the last bit is 1. Its inverse is 0. On the next tick, a '0' enters the front. The state becomes 0111.0111: The last bit is 1. Inverse is 0. The state becomes 0011.0011: The last bit is 1. Inverse is 0. The state becomes 0001.0001: The last bit is 1. Inverse is 0. The state becomes 0000.And we're back where we started. We have cycled through 8 unique states: 0000, 1000, 1100, 1110, 1111, 0111, 0011, 0001. This rule holds for any size: an -bit Johnson counter will always have a cycle of states, exactly double that of its simpler cousin, the ring counter.
We can describe this dance with a wonderfully concise rule using Register Transfer Level (RTL) notation. If Q is our 4-bit register Q[3:0], the next state is simply {~Q[0], Q[3:1]}. This means "concatenate the inverse of the last bit with the first three bits of the current register". This same principle works whether the register shifts left or right; for a 3-bit left-shifting counter (with state ), the next state is formed by shifting left and feeding back the inverted MSB: . The core idea—the inverted feedback—remains the same.
The doubled state count is impressive, but it hides an even more elegant property. Look closely at the sequence again: 0000 → 1000 → 1100... In each and every step, exactly one bit changes its state. This is a stunning feature. Compare this to a standard binary counter. When it counts from 7 (0111 in 4-bit binary) to 8 (1000), all four bits must flip simultaneously!
In the world of electronics, every bit-flip consumes a tiny burst of power and generates a small amount of electromagnetic noise. When many bits flip at once, it's like a digital shout—it can cause a spike in power consumption and create enough noise to interfere with sensitive analog components nearby. The Johnson counter, by contrast, is a quiet virtuoso. With only one bit changing per clock cycle, its power consumption is smooth and its operation is electrically quiet. In fact, its average toggling activity is exactly half that of a corresponding ring counter. This makes it an ideal choice for low-power and mixed-signal (digital and analog) applications.
This "one-at-a-time" property also means the output codes are "adjacent" to each other. When the digital states of a 4-bit Johnson counter are fed into a Digital-to-Analog Converter (DAC), the resulting output is not a chaotic jump, but a smooth, stepwise waveform that approximates a sine wave. This makes it a simple and effective core for waveform synthesizers.
Our 4-bit Johnson counter uses 8 of the 16 possible bit patterns. What about the other 8 "unused" states? They are not lost in a void; they are lurking in the shadows, forming their own, separate cycles.
Suppose our counter is running perfectly in the state 0001 when a random noise spike flips the most significant bit. The state instantly becomes 1001, a pattern that is not in our main sequence. The counter doesn't know it's in a "wrong" state; it just continues to obey its fundamental rule: shift right and feed back the inverse of the last bit.
From 1001, it will proceed to 0100, then to 1010, and so on. It has been knocked into a parallel universe, a "lockout loop" from which it can never escape on its own. In this case, it turns out that the 8 unused states form their very own 8-state cycle, completely disjoint from the primary one. For an 8-bit counter, a fault could knock it into an abnormal state like 10101010, which initiates its own unique 16-state cycle, separate from the primary 16-state cycle.
This teaches us a critical lesson in engineering and in systems thinking: it is not enough to understand how a system is supposed to work. We must also understand how it can fail. The existence of these "dark loops" shows that a robust design must always include a way to recover from errors—a master reset switch, for instance—to force the system back into its desired cycle. The elegant simplicity of the Johnson counter's rule creates a rich and structured state space, complete with both its intended beautiful dance and its hidden, trapping whirlpools.
We have seen how a simple shift register, with one tiny twist in its feedback loop—the inversion of a single bit—transforms into a Johnson counter. This seemingly minor change unlocks a new realm of possibilities in digital electronics. The Johnson counter is not merely a device that counts; it is a generator of rhythm, a creator of patterns, and a choreographer of electronic events. Its applications stretch far beyond the textbook, weaving into the fabric of the technologies that power our modern world. Let's embark on a journey to see where this simple, elegant circuit takes us.
At its heart, the Johnson counter is a masterful frequency divider. Imagine you have a very fast master clock, like the frantic ticking of a tiny watch, but you need a slower, more deliberate beat to run other parts of your system. An -bit Johnson counter provides a beautifully simple solution: it produces an output signal with a frequency that is precisely times that of the main clock. A 4-bit counter, for instance, effortlessly divides a 100 kHz clock down to a steady 12.5 kHz. This ability to derive slower, synchronous clocks from a single high-speed source is a cornerstone of digital system design, ensuring all components march to a coordinated, albeit different, drumbeat.
But simple division is just the beginning. The real magic happens when we look at the outputs of all the flip-flops simultaneously. The sequence of states is so regular and predictable that we can combine them with simple logic gates to synthesize a wide variety of waveforms. Need a perfect square wave with a 50% duty cycle for a Pulse Width Modulation (PWM) signal to control the speed of a motor or the brightness of an LED? Any single output from the Johnson counter provides this directly. For a 4-bit counter, each output pin produces a square wave that is high for 4 clock cycles and low for 4 clock cycles, creating a perfect 50% duty cycle. We can also use the counter's state to drive the select lines of a multiplexer, effectively "playing" a pre-programmed sequence of high and low values to create custom digital signals. The counter's state becomes a pointer, stepping through a sequence of instructions, turning simple logic into a versatile signal generator.
Some of the most profound applications arise when we need not just one clock signal, but several, all running at the same frequency but shifted in phase from one another—like singers in a round, starting the same melody at different times to create harmony. In modern digital communications, particularly in schemes like Quadrature Phase-Shift Keying (QPSK), two such signals are essential: an 'In-phase' () signal and a 'Quadrature' () signal, which is phase-shifted by exactly 90 degrees relative to the first.
How does one generate such a precise phase relationship digitally? One might imagine complex timing circuits. Yet, a humble 2-bit Johnson counter does it with breathtaking elegance. As it cycles through its four states—00, 10, 11, 01—the output of the first flip-flop () and the second flip-flop () naturally form two square waves. Because the period is four clock cycles long, and one output lags the other by exactly one clock cycle, the phase difference is precisely of a full period, or 90 degrees. By simply labeling one output '' and the other '', we have created a perfect quadrature signal generator, a critical component for high-speed data transmission, born from one of the simplest sequential circuits imaginable.
From generating abstract signals, we move to controlling the physical world. Consider the brushless DC (BLDC) motor, the workhorse of everything from computer fans and drones to electric vehicles. Unlike a simple DC motor, a BLDC motor requires a precise, repeating sequence of electrical pulses sent to its coils to create a rotating magnetic field that pulls the rotor along. It needs a digital choreographer.
A three-phase BLDC motor requires a sequence of six distinct states to ensure smooth commutation. One could build a custom state machine, but why bother when a 3-bit Johnson counter provides the exact sequence needed? Its natural cycle of six states—000, 100, 110, 111, 011, 001—can be directly mapped to the six steps of the motor's commutation sequence. The counter doesn't just "count"; it steps through the precise choreography needed to make the motor spin. Each tick of the clock advances the counter, which in turn energizes the next set of coils in the motor. The speed of the clock controls the speed of the motor. It's a beautiful marriage of abstract digital logic and tangible mechanical motion.
So far, we've focused on the sequence of states. But the way the states transition is just as important, and it reveals a deeper, more subtle beauty. If you observe the output of a Johnson counter as it steps from one state to the next, you'll notice something remarkable: only a single bit changes at each step. For example, the 3-bit counter transitions from 100 to 110 (only flips), then to 111 (only flips), and so on. The Hamming distance between any two consecutive states is always one.
This property is tremendously significant. In digital logic, every time a bit flips from 0 to 1 or 1 to 0, it consumes a tiny amount of power. In a standard binary counter, transitioning from, say, 7 (0111) to 8 (1000) involves four bit flips. A system with millions of transistors flipping simultaneously can generate significant power draw and electrical noise. Because only one bit changes at a time in a Johnson counter, its state transitions are incredibly power-efficient and "clean." This makes its outputs inherently "glitch-free"—there are no intermediate, spurious states that can occur when multiple bits are trying to change at once.
We can see this property in action by connecting the counter's outputs to a parity checker. A 5-bit Johnson counter, for instance, has ten states in its cycle. The number of '1's in its state vector changes by exactly one at each step. As a result, the parity of the state (whether the number of '1's is even or odd) flips at every single clock tick, producing a perfectly alternating output of 0, 1, 0, 1, ... . This demonstrates the single-bit-flip property in a wonderfully clear way.
This low-switching-activity characteristic is highly prized in modern VLSI (Very-Large-Scale Integration) design, especially for low-power applications and for building test circuits. In a Built-In Self-Test (BIST) system, a circuit must generate a long sequence of test patterns to check for faults. Using a Johnson counter as the core of the test pattern generator minimizes the power consumed during the test, preventing the chip from overheating while it diagnoses itself.
Finally, like Lego bricks, Johnson counters are rarely used in isolation. They serve as fundamental modules within larger, more complex digital tapestries. Imagine you need to create a system that counts through 40 unique states. You could design a complex custom counter, or you could simply take a 4-bit Johnson counter (which has an 8-state cycle) and use its completion signal to clock a simple MOD-5 counter. The combined system will now have unique states before it repeats. This principle of cascading counters allows designers to create arbitrarily long and complex timing sequences by composing simple, well-understood building blocks. The Johnson counter, with its predictable cycle length of , is an ideal component for such modular designs.
The Johnson counter is a testament to the profound elegance that can emerge from simplicity. A single inverted feedback transforms a mundane shift register into a versatile tool for digital design. It is a frequency divider, a waveform synthesizer, a generator of harmonic phases for communication, and a precise sequencer for controlling machines. Its inherent low-power, glitch-free nature makes it a sophisticated choice for modern, high-density circuits. From the rhythmic pulse of a clock to the smooth rotation of a motor, the Johnson counter demonstrates a beautiful unity between abstract mathematical sequences and the tangible, functioning world of technology.