A counter is a sequential circuit made of flip-flops whose stored bits step through a fixed list of patterns, moving one step at every active clock edge. Usually the patterns are binary numbers going up or down by one, but the sequence can be anything.
It's really the simplest kind of finite state machine: there is often no input except the clock, so each state has exactly one next state.
The main families:
- Binary up and down counters, and up/down counters.
- Ripple (asynchronous) vs synchronous: same sequence, different timing.
- Mod-N and BCD counters, which cut the sequence short.
- Ring and Johnson counters, which are shift registers fed back on themselves.
Counters are everywhere: a CPU's program counter, timers in every microcontroller, clock dividers, and delays and timeouts in FPGA designs. The safest way to reason about any counter is a table with one row per clock edge, showing what the flip-flops hold after that edge.