← ⏱️ Counters, Registers & State Machines
Subtopic 1 of 5

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

  1. Shift register: each flip-flop copies its left neighbour on every clock.
  2. Ring counter: Q_{n−1} feeds D₀; start with a single 1 and it circulates (n states).
  3. Johnson counter: Q′_{n−1} feeds D₀; the register fills with 1s then empties (2n states).
  4. 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.
clockQ0Q1Q2Q3
00000
11000
21100
31110
41111
50111
60011
70001
80000
91000
Number of states (modulus)8
Unused states out of 2ⁿ8
Output frequencyf / 8
Decoding a stateonly 2 bits needed

Check yourself

The number of distinct states of a 5-bit Johnson counter is

Remember: Ring: n states. Johnson: 2n states (invert the fed-back bit).
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.