Reference
Types of counters: digital, mechanical and software
Counters fall into three families. In digital electronics they are sequential circuits classified as synchronous or asynchronous, up, down or up/down, and mod-N. As devices they are hand tallies, panel totalizers and preset counters, and the CTU, CTD and CTUD counters in a PLC. In software they are a variable incremented by one per event.
The three families
The word does a lot of work. Someone asking about counter types is usually in one of three places, and the answers do not overlap much:
- Digital electronics. A sequential logic circuit built from flip-flops that counts clock pulses. This is what an exam question means.
- Physical devices. A hand tally or clicker with a display and a button, and its industrial relatives: panel counters and the counters inside a PLC, which count machine pulses and act when a preset is reached.
- Software. A variable that goes up by one each time something happens.
Classified by clock triggering
This is the primary division in digital logic, and the one most often examined.
Asynchronous (ripple) counters
Only the first flip-flop receives the external clock. Each flip-flop's output then clocks the next one in the chain. Simple to build, but the signal has to travel through every stage in turn, so each adds its own propagation delay. That accumulated delay limits the maximum usable frequency and can produce brief invalid states while the ripple settles.
Synchronous counters
One shared clock reaches every flip-flop at the same instant, so all stages change together. Faster and free of ripple glitches, at the cost of extra combinational logic to decide which flip-flops should toggle on each pulse. That logic grows as the count width grows, which is the main design trade-off.
Classified by direction
| Type | Behaviour | Typical use |
|---|---|---|
| Up counter | Increments: 0, 1, 2, 3… | Event and pulse counting |
| Down counter | Decrements from a preset value | Timers, countdowns |
| Up/down counter | Either direction, chosen by a control input | Position and encoder tracking |
Classified by modulus, and the special cases
A mod-N counter cycles through N states then resets. A decade counter is mod-10, running 0 to 9, which is why it appears in every digital clock. Mod-16 is the natural range of four flip-flops, so anything else needs reset logic.
Two special-purpose designs come up often enough to name:
- Ring counter. A shift register with the last stage's output fed back to the first, circulating a single active bit. N flip-flops give N states, which is wasteful of hardware but needs no decoding: each state is already a distinct output line.
- Johnson (twisted ring) counter. The same loop, but the last stage's inverted output feeds back. That doubles the state count to 2N for the same number of flip-flops, which is why it is preferred where states matter more than output simplicity.
| Type | Clocking | States from N flip-flops | Speed |
|---|---|---|---|
| Asynchronous binary | Cascaded | 2N | Slower, ripple delay |
| Synchronous binary | Common clock | 2N | Fast |
| Decade (mod-10) | Either | 10 | Depends on design |
| Ring | Common clock | N | Fast, no decoding |
| Johnson | Common clock | 2N | Fast |
Industrial and PLC counters
On a production line the same circuits are packaged by what they do with the count. Instrument makers sell them by function, not by flip-flop design, and one panel unit often does several of these at once:
| Type | What it does with the count | Typical job |
|---|---|---|
| Totalizer | Keeps a running total of pulses, scaled to units; some add or subtract two channels (A+B, A−B) | Parts made, machine cycles, litres through a flow meter |
| Preset counter | Compares the count with one or two set points and switches an output when it reaches them | Stop a machine after 500 pieces, warn at 450 |
| Batch counter or controller | Counts each batch to a preset, starts the next, and totals the batches | Repetitive fills: 12 bottles a case, cases a shift |
| Rate meter | Shows how fast pulses arrive, per second, minute or hour, not how many | Line speed, flow rate, RPM |
| Quadrature position counter | Counts up or down from an encoder’s two out-of-phase signals, on one, two or four edges per cycle | Shaft or table position |
| Counter-timer | Times between a start and a stop pulse instead of counting them | Cycle time, time between events |
Built as hardware these are electromechanical (each pulse steps a geared number wheel, which holds its count with the power off) or electronic (a display, faster inputs, presets and outputs). Inside a programmable logic controller the counter is an instruction in the program instead, and the international PLC language standard, IEC 61131-3, defines three of them:
| Block | Inputs | Outputs | Output is on when |
|---|---|---|---|
| CTU, count up | CU counts, R resets CV to 0, PV is the preset | Q, CV | CV ≥ PV |
| CTD, count down | CD counts, LD loads PV into CV, PV is the start | Q, CV | CV ≤ 0 |
| CTUD, up and down | CU, CD, R, LD, PV | QU, QD, CV | QU at CV ≥ PV; QD at CV ≤ 0 |
Three details trip people up. The preset means opposite things: for CTU it is the target, for CTD the starting value, and a CTD’s output comes on at zero, not at the preset. A counter counts rising edges, the moment an input turns on, so a sensor held on counts once; OpenPLC’s blocks build the edge detection in, while some vendor variants ask for an R_TRIG in front, so check yours. And the standard block counts in a 16-bit INT, −32,768 to 32,767, with wider versions (CTU_DINT and so on) for longer runs; Schneider’s CODESYS-based documentation notes that its PV is a WORD where the standard says INT. Brand instruction sets go further still. Allen-Bradley’s Logix controllers use CTU and CTD instructions on a COUNTER tag with an accumulated value (.ACC), a preset (.PRE) and a done bit (.DN), reset by a separate RES instruction; and depending on the make a counter typically runs 0 to 9,999, −32,768 to 32,767 or 0 to 65,535. As one long-running PLC tutorial puts it, every manufacturer “seems to use them a different way”, so read your controller’s manual before trusting a done bit. Sources: OpenPLC, counter function blocks; Kollmorgen, CTUD; Laurel Electronics, counters and timers; PLC Tutor, counters; all read 2026-10-18.
Mechanical and handheld counters
The physical family is simpler. A hand tally counter or clicker has a thumb plunger that advances a geared number wheel, and a side knob that returns it to zero. Four and five digit versions are standard, the latter counting to 99,999. A finger counter is the same mechanism with a ring so it can be worn and pressed without being held.
Older counting devices belong here too: the abacus, with beads sliding on rods where each column carries a place value; the tally stick, notched to record a number physically; and the counting board, where tokens are moved across marked lines. All three solve the same problem as a clicker, which is keeping a count outside human memory.
Counters in code
In programming a counter is just a variable that increments. The pattern is the same in every language:
let count = 0;
for (const item of items) {
count = count + 1; // or count++
}
Most standard libraries also provide a counting collection that tallies how often each
distinct value appears — Python's collections.Counter, JavaScript's Map
used as a frequency table, or a dictionary keyed by value. That is a different job from a running
total: it answers "how many of each" rather than "how many altogether".
Which one do people mean?
In practice the context gives it away. A question about flip-flops, clock pulses, propagation delay or modulus is digital electronics. One about presets, batches, CTU or a done bit is a machine or a PLC. A question about counting people, reps or inventory is a hand tally or a browser tool. A question with the word variable, loop or increment in it is software.
This site is the third case wearing the second case's clothes: a browser tool that does what a hand tally does, without the hardware.
Frequently asked questions
What are the two main types of counters?
In digital electronics, asynchronous (ripple) and synchronous counters. Asynchronous counters clock each flip-flop from the previous stage's output, so delays accumulate. Synchronous counters clock every flip-flop from one shared signal, so all stages change together and the circuit runs faster.
What are the three types of counters?
Counters are usually grouped three ways at once: by clock triggering (asynchronous or synchronous), by direction (up, down or up/down), and by modulus (mod-N, such as a decade counter that counts 0 to 9). A single counter has one classification from each group.
What is a digital counter?
An electronic circuit built from flip-flops that counts clock pulses and presents the total in binary or decoded decimal. Digital clocks, frequency dividers and industrial item counters all use them. Each flip-flop stores one bit, so N flip-flops count up to 2 to the power N.
What is the difference between a ring counter and a Johnson counter?
Both circulate a bit through a shift register. A ring counter feeds the last output back to the first input and gives N states from N flip-flops. A Johnson counter feeds back the inverted output, doubling that to 2N states for the same hardware.
Which is a simple counting device?
The abacus is the classic example: beads on rods where each column represents a place value. Tally sticks, counting boards and handheld finger clickers are equally simple. All keep a count physically so it does not have to be held in memory.
What is a mod-10 counter?
A counter that cycles through ten states, 0 to 9, then resets. It is also called a decade counter and is the building block of digital clocks and any decimal display, since each digit needs exactly ten states.
What are the types of counters in a PLC?
The IEC 61131-3 standard defines three: CTU counts up and turns its output on when the count reaches the preset; CTD counts down from a preset loaded into it and turns its output on at zero; CTUD does both, with one output for each limit. Most controllers also offer a few high-speed counters for fast inputs such as encoders.
What is the difference between a totalizer and a preset counter?
A totalizer only accumulates a running total, such as parts made or litres pumped. A preset counter also compares the count with one or two set points and switches an output when they are reached, for example to stop a machine after 500 pieces. Many panel counters do both, and a batch counter adds a total of completed batches.