3.4.9 · D1Sequential Circuits

Foundations — Ring and Johnson counters

1,924 words9 min readBack to topic

Before you can read the parent note, you need to earn every symbol it throws at you. Below, each idea is built from the one before it: a picture first, then the plain meaning, then why the topic needs it. Nothing is assumed.


[!definition] Symbol 0 — a "bit" and the boxes that hold it

A bit is the smallest piece of information: it is either 0 or 1. Think of it as a light that is either off (0) or on (1).

A flip-flop is a tiny box that remembers one bit. Left alone it holds its value; it only changes when told to. Picture a light-switch that stays wherever you last flicked it.

Why the topic needs it. Ring and Johnson counters are built entirely out of these one-bit memory boxes wired in a row. If you don't picture "a box that holds one on/off light," none of the diagrams make sense.

See Flip-Flops (D type) for the exact box we use.


[!definition] Symbol 1 — and : the input and the output of one box

Every flip-flop has two labelled wires that matter to us:

  • = the ==Data input==. This is "the value I will remember at the next clock tick." Picture it as a note handed to the box saying "next time, become this."
  • = the output. This is "the value I am remembering right now." Picture the box's own light showing 0 or 1.

Why the topic needs it. The entire wiring of a ring counter is written with these letters, e.g. "." That is just: "the note handed to box 0 is a copy of box 3's current light." Once you read and this way, every wiring line is plain English.


[!definition] Symbol 2 — the overbar : the opposite light

The bar on top, ====, means "the opposite of ."

  • If (on), then (off).
  • If (off), then (on).

Picture a second little lamp on the box that is always the reverse of the main one. The gadget that produces this reverse is an inverter (a NOT gate).

Why the topic needs it. This ONE bar is the entire difference between the two counters. A ring counter feeds back ; a Johnson counter feeds back — the opposite. That single overbar is what "twists" the ring and doubles its states. Miss the bar, miss the whole point.


[!definition] Symbol 3 — subscripts and the row

We line the boxes up and number them. The subscript is just the box's position number, starting at 0:

Box 0 is one end of the row; box 3 is the other. There is nothing deep here — it is a name tag so we can say which box we mean.

Why the topic needs it. Wiring like "" only means "each box copies the box to its left." The subscripts are the addresses that let us write that rule precisely.


[!definition] Symbol 4 — the clock and "one tick"

A clock is a wire that goes steadily, like a metronome. Every time it goes from 0 up to 1 (a rising edge), all the flip-flops update at the same instant. One rising edge = one clock tick = one step of the counter.

Why the topic needs it. "After 4 shifts the 1 returns home" only counts something if you know a shift happens once per tick. Because every box updates on the same edge, these are called synchronous circuits — see Synchronous Counters. The word "shift" itself means "move the pattern one box per tick."


[!definition] Symbol 5 — the shift register (the row that passes bits)

Chain the boxes so each one's is fed by its neighbour's : Now on every tick, each box copies its left neighbour. The whole pattern of lights slides one step to the right. This sliding row is a shift register — a bucket-brigade passing a value along.

Why the topic needs it. A ring or Johnson counter is exactly a shift register with one extra wire looping the far end back to the near end. Master the plain shift register first (full detail in Shift Registers) and the counters are a one-line addition.


[!definition] Symbol 6 — "state," "valid," and "unused"

A state is just the snapshot of all the lights at one instant, e.g. . With boxes there are possible snapshots (every on/off combination).

  • A valid (used) state is one the counter actually lands on during its normal loop.
  • An unused (lock-out) state is a possible snapshot the counter never visits in normal running — but might accidentally power up in.

Why the topic needs it. The parent's whole ", , but are possible" argument is a statement about how many of the possible snapshots are actually used. And unused states are exactly where the self-starting problem lives.


[!definition] Symbol 7 — powers and the fraction

means "multiply 2 by itself times" — the count of all possible on/off patterns of lights. For : .

The state utilisation is the fraction A fraction near 1 means "efficient use of the boxes"; near 0 means "wasteful."

Why the topic needs it. This is the honest cost-accounting of the whole topic: you spend extra flip-flops to buy simplicity and glitch-freedom. See Frequency Division for the flip side — those "wasted" states are exactly what lets a ring counter divide a clock by .


[!definition] Symbol 8 — the AND dot and a "decode gate"

Writing two labels next to each other, like , means logical AND: the output is 1 only when both are 1 at once. Picture two switches wired in series — the lamp lights only if both are closed.

To decode a state means "build a small gate whose output is 1 for exactly that one state and 0 for all others."

Why the topic needs it. The parent claims each Johnson state is decodable with a single 2-input AND, e.g. by . That is only readable once "putting labels side by side = AND" and "overbar = opposite" are both in your toolkit. This cheap, unique decoding — and the fact that only one bit flips per tick — is why there are no decoding glitches.


Prerequisite map

Bit off or on

Flip-flop one bit memory

D input and Q output

Overbar the opposite bit

Subscripts name the boxes

Clock one tick updates all

Shift register passes bits

Feedback loop last to first

States used and unused

Powers and utilisation

AND gate and decoding

Ring and Johnson counters


Equipment checklist

Test yourself — cover the right side and answer each before moving on.

What does a single flip-flop store?
Exactly one bit — one on/off value it remembers until the next clock tick.
In one line, what does a D flip-flop do on a tick?
It copies whatever is on into : .
What does the overbar in mean?
The opposite bit — if then , and vice-versa (made by an inverter).
What do the subscripts in label?
The position (address) of each flip-flop in the row, starting at 0.
What happens on one clock tick in a synchronous circuit?
Every flip-flop updates at the same instant on the rising edge.
What is a shift register?
A row of flip-flops where each copies its left neighbour, so the whole pattern slides one box per tick.
What one wire turns a shift register into a counter?
A feedback wire from the last output back to the first input, so the pattern circulates.
How many possible states do flip-flops have?
— every on/off combination of lights.
What does state utilisation measure?
The fraction of possible states the counter actually uses (efficiency).
What does writing (labels side by side) mean?
Logical AND — output is 1 only when AND .
What is an unused (lock-out) state?
A possible snapshot the counter never visits in normal running but might power up in.

Connections

  • 3.4.09 Ring and Johnson counters (Hinglish) — the parent topic these foundations feed.
  • Flip-Flops (D type) — the one-bit memory box, Symbols 0–2.
  • Shift Registers — the row that passes bits, Symbols 5.
  • Synchronous Counters — the "all update on one tick" idea, Symbol 4.
  • Glitches and Decoding Hazards — why one-bit-change + cheap decoding matters, Symbol 8.
  • Self-starting Sequential Circuits — where unused states, Symbol 6, become a problem.
  • Frequency Division — what the "wasted" states, Symbol 7, buy you.