Ring and Johnson counters
Two special shift-register counters built by feeding the output of a shift register back to its input. They trade off "wasted" states for glitch-free, self-decoding counting.
[!intuition] The core picture
A shift register is just a chain of flip-flops passing a bit along like a bucket-brigade of people passing a ball. A counter normally needs an adder or complex logic. But what if we just take a shift register and loop its last output back into its first input? The pattern of 1s and 0s circulates forever — and that circulating pattern IS the count.
- Ring counter = feed straight back to . One "hot" bit circulates.
- Johnson counter (a.k.a. twisted-ring / switch-tail) = feed the complement back. This twist doubles the number of states.
WHY care? No decoding logic is needed to know the state — you read it directly. And each transition changes only one flip-flop at a time, so there are no decoding glitches (unlike a binary counter where multiple bits flip at once).
[!definition] Definitions
- Ring counter: an -flip-flop shift register with (or ) wired to ; exactly one flip-flop is high, and the 1 rotates. Has ==== valid states.
- Johnson counter: same shift register but the inverted last output feeds the first input; produces ==== valid states.
- A valid/used state is one the counter actually visits in its normal cycle; all others are unused (lock-out) states.
[!formula] Number of states — derived, not memorised
WHY does a ring counter give states? Load a single 1 into cells. Each clock shifts it one position. After shifts the 1 has visited every cell and returned home. So the cycle length = number of cells:
WHY does Johnson give ? Trace the fill/empty process. Start all 0. Feedback is , so a 1 enters. Each clock the 1s fill from the left until the register is all 1s — that's steps. Now , so 0s enter and empty the register from the left — another steps to reach all 0s again.
Efficiency (the 80/20 fact). With flip-flops you could count to . So: Johnson is twice as efficient as ring but both are hugely wasteful vs a binary counter. You pay silicon for simplicity + no glitches.

[!example] Worked: 4-bit Ring counter ()
Wiring: . Preset with .
| Clock | |
|---|---|
| init | 1000 |
| 1 | 0100 |
| 2 | 0010 |
| 3 | 0001 |
| 4 | 1000 (repeat) |
- Why start at 1000? The ring counter cannot generate its own starting 1 — feedback just copies. You must inject one 1 (preset/clear). Why this step? Because : if all cells were 0, forever → stuck at 0000.
- Why only 4 states? One 1 in 4 positions → 4 arrangements. Why this step? The number of hot positions equals the register length.
[!example] Worked: 4-bit Johnson counter ( states)
Wiring identical except . Start at .
| Clock | ||
|---|---|---|
| 0 | 0000 | 1 |
| 1 | 0001 | 1 |
| 2 | 0011 | 1 |
| 3 | 0111 | 1 |
| 4 | 1111 | 0 |
| 5 | 1110 | 0 |
| 6 | 1100 | 0 |
| 7 | 1000 | 0 |
| 8 | 0000 (repeat) | — |
- Why does it fill then empty? Once , feedback starts injecting 0s. Why this step? The twist (complement) is what flips the incoming bit and doubles the cycle.
- Decoding a state uniquely with a 2-input AND. Notice each state has exactly one "0→1 boundary" or "1→0 boundary". E.g. state is the only one with . So decode it with . Why this step? Adjacent-bit patterns are unique per Johnson state → each output needs just a 2-input gate, cheap and glitch-free.
[!example] Self-starting fix (mini-derivation)
Problem: what if a Johnson counter powers up in an unused state like ? Trace it: , shift → … it oscillates in a dead loop, never joining the main cycle.
- Fix: modify the feedback so style correction (a common trick: variants) forcing illegal states back into the valid cycle. Why this step? A self-correcting counter must have every unused state eventually map into a used one, guaranteeing recovery after noise/power-up.
[!mistake] Common mistakes (steel-manned)
"A ring counter with flip-flops counts to ." Why it feels right: every other counter you learned (binary ripple/sync) does . The fix: ring counters encode the count as position of a single 1, giving only states. The whole point is trading count-range for zero decode logic.
"Ring and Johnson are the same, one just has an inverter — no big deal." Why it feels right: the circuits differ by one wire. The fix: that inverter twists the ring and doubles states () and enables 2-gate self-decoding. One wire changes the fundamental state count.
"They start counting by themselves." Why it feels right: other counters just power on and go. The fix: both need initialisation (preset a 1 into a ring; clear a Johnson) or must be made self-starting, else they can lock into dead loops.
"Johnson state then — did we skip?" Why it feels right: looks like a jump. The fix: at feedback is , so a 0 shifts in giving , not . The all-0 state comes only after all 1s are shifted out.
[!recall]- Explain it to a 12-year-old
Imagine a line of 4 kids passing a single glowing ball to the right; the last kid throws it back to the first. Wherever the ball is = the "count" — that's a ring counter, 4 possible spots. Now the twist: the last kid, instead of passing the same ball, passes the opposite — if he has a lit ball he passes a dark one, and vice-versa. Now the whole line lights up one-by-one, then goes dark one-by-one. Twice as many patterns from the same kids! That's a Johnson counter. You never need a scoreboard — just look at the lights.
[!mnemonic]
- Ring = one 1 Runs in a Ring → states.
- Johnson = Just add iNverter → doubles → (J for "twisted / double").
- "Ring: n. Johnson: 2n. Binary: 2ⁿ." — increasing count, increasing decode-cost.
Flashcards
How many states does an -bit ring counter have?
How many states does an -bit Johnson counter have?
What single hardware change turns a ring counter into a Johnson counter?
Why do ring/Johnson counters need no decoding logic (no glitches)?
Why must a ring counter be preset with exactly one 1?
State utilisation of a Johnson counter vs binary counter?
What is a "lock-out"/dead loop and how is it fixed?
In a 4-bit Johnson counter, what follows state ?
Decode gate for Johnson state (4-bit)?
Connections
- Shift Registers — the base building block both counters are made from.
- Synchronous Counters — compare: full range but multi-bit transitions cause glitches.
- Flip-Flops (D type) — the storage element used here.
- Glitches and Decoding Hazards — why single-bit-change counters matter.
- Self-starting Sequential Circuits — lock-out and correction feedback.
- Frequency Division — a ring counter divides clock by , Johnson by .
Concept Map
Hinglish (regional understanding)
Intuition Hinglish mein samjho
Dekho, ek shift register basically flip-flops ki ek chain hoti hai jo bit ko ek se doosre cell tak pass karti hai — jaise line me log ball aage badha rahe ho. Ab agar hum last output ko wapas first input me joड़ de, to woh pattern circulate karta rehta hai. Yahi ghoomta hua pattern hi hamara count hai. Isko bolte hain Ring counter: ek hi "1" ghoomta rehta hai, aur flip-flops ho to sirf states milte hain.
Johnson counter me bas ek chhota sa twist hai — last output ka ulta (complement, NOT gate se) wapas bhejo. Yeh twist state count ko double kar deta hai: states. Trace karo: register pehle 1s se bharta hai (0000 → 0001 → 0011 → ... → 1111), phir 0s se khaali hota hai (1111 → 1110 → ... → 0000). Ek inverter ki wajah se hi yeh magic hota hai.
Inka faayda kya hai? Har clock pe sirf ek flip-flop badalta hai, isliye koi decoding glitch nahi aata, aur state ko decode karne ke liye bahut simple gate chahiye (Johnson me sirf 2-input AND). Nuksaan? Bahut saare states waste hote hain — binary counter tak ginta hai, ring sirf tak. To yeh silicon "waste" karke simplicity aur clean output khareedte hain.
Ek important baat exam ke liye: dono counters khud se start nahi hote. Ring me ek "1" preset karna padta hai (warna 0000 pe atak jaayega), aur Johnson agar galat state (jaise 0101) me power-on ho jaaye to dead-loop me phans sakta hai — isliye self-starting feedback banate hain jo galat states ko wapas valid cycle me le aaye.