Skip to content
BetterDL

Johnson counter

Also called: twisted-ring counter, twisted ring counter, switch-tail counter, switch-tail ring counter, Möbius counter, creeping counter

A shift register whose inverted last output feeds its serial input. Starting from all 0s, an n-bit Johnson counter cycles through 2n states.

A Johnson counter is a ring counter with a twist: the serial input is fed the complement of the last output. For a shift-right register, SI = .

Starting from 0000, 1s fill in from the left, then 0s do:

0000 → 1000 → 1100 → 1110 → 1111 → 0111 → 0011 → 0001 → 0000 …

Key facts:

  • An n-bit Johnson counter has 2n states: twice as many as a ring counter with the same flip-flops.
  • Each step changes exactly one bit, like a Gray code, which avoids glitches when the outputs are decoded.
  • Each state can be recognized with a single 2-input AND gate looking at two neighboring bits.
  • It starts naturally from 0000, which a power on reset clear provides.

Tracing rule: look at the old Q0 at each edge. If it was 0, a 1 enters on the left; if it was 1, a 0 enters.

The remaining 2ⁿ − 2n patterns form one or more separate, unused cycles. If noise ever puts the counter in one, it stays there, so robust designs add logic to steer it back.

Flip-flops needed: for N states, N/2 flip-flops (N even). A binary counter needs fewer; a ring counter needs more.

startclkclkclkclkclkclk000100110111011001

Worked examples

Example

A 3-bit Johnson counter (the diagram above)

Shift right with SI = , starting at 000.

  1. 1.

    000: old Q0 = 0, so a 1 enters: 100.

  2. 2.

    100 → 110 → 111 (Q0 still 0 each time, until it becomes 1).

  3. 3.

    111: old Q0 = 1, so a 0 enters: 011.

  4. 4.

    011 → 001 → 000. Back to the start.

  5. 5.

    6 states = 2 × 3.

Example

Jumping ahead

A 4-bit Johnson counter starts at 0000. What does it hold after 6 edges, and after 50?

  1. 1.

    The sequence is 1000, 1100, 1110, 1111, 0111, 0011 for edges 1–6. After 6 edges: 0011.

  2. 2.

    The cycle length is 2 × 4 = 8.

  3. 3.

    50 mod 8 = 2, so after 50 edges it is in the same state as after 2: 1100.

Common mistakes

  • Feeding back Q0 instead of its complement. That makes a ring counter.

  • Saying it has n or 2ⁿ states. It has 2n.

  • Forgetting to use the old Q0 when deciding what enters.

Practice Johnson counter

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Johnson counter is taught in Registers and Counters.