5.1Shift registers, ring and Johnson counters
The idea
A shift register moves its bits one place per clock. Feeding the last output back to the first input gives a ring counter; feeding back the inverted last output gives a Johnson counter.
Think of it like this: People passing buckets down a line: a ring joins the last person back to the first.
Why it exists
The number of states of ring and Johnson counters is a classic quick question.
How it works
- Shift register: each flip-flop copies its left neighbour on every clock.
- Ring counter: Q_{n−1} feeds D₀; start with a single 1 and it circulates (n states).
- Johnson counter: Q′_{n−1} feeds D₀; the register fills with 1s then empties (2n states).
- All other states (2ⁿ − n or 2ⁿ − 2n) are unused and should be avoided or corrected.
Worked example: 4-bit Johnson counter
0000 → 1000 → 1100 → 1110 → 1111 → 0111 → 0011 → 0001 → 0000: 8 states out of 16.
Now play with it
- →Switch between ring and Johnson and read the period in the Kv boxes.
- →Use the serial register: a bit takes n clocks to come out.
| clock | Q0 | Q1 | Q2 | Q3 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 0 |
| 3 | 1 | 1 | 1 | 0 |
| 4 | 1 | 1 | 1 | 1 |
| 5 | 0 | 1 | 1 | 1 |
| 6 | 0 | 0 | 1 | 1 |
| 7 | 0 | 0 | 0 | 1 |
| 8 | 0 | 0 | 0 | 0 |
| 9 | 1 | 0 | 0 | 0 |
Check yourself
The number of distinct states of a 5-bit Johnson counter is
Exam notes (the dense version)
An n-bit shift register moves data one place per clock; a serial bit takes n clocks to travel through. A ring counter feeds Q₍ₙ₋₁₎ back to D₀ and, with one 1 preloaded, cycles through n states. A Johnson (twisted ring) counter feeds Q′₍ₙ₋₁₎ back and cycles through 2n states (0000, 1000, 1100, 1110, 1111, 0111, 0011, 0001). A ring counter wastes 2ⁿ − n states, a Johnson 2ⁿ − 2n. Johnson states decode with only 2-input gates.
Previous year questions: Counters, Registers & State Machines (10)
PYQs are grouped by topic, so this is the full set for Counters, Registers & State Machines; try the ones that match this subtopic. Open all 10 on the topic page.