◆ Rebuild

Part 14 · Electronics and Computing

Electronic Counters

Two tubes or transistors wired so that one is always on and the other off make a switch that flips at each pulse — the flip-flop. Chain them, and they count far faster than any wheel or relay, and divide a fast frequency down to a slow one. How to build flip-flops and multivibrators, binary and decade counters, scalers for Geiger counters, and the dividers that turn a quartz crystal into a clock.

Difficulty
●●●●●
Time
An evening for a flip-flop; weeks for a working three-decade scaler
Steps from zero
30 prerequisites →

You need first

Amplifiers and OscillatorsLogic and Binary

This unlocks

—
The full path from nothing — 30 steps before this one
  1. Fire
  2. Cordage and Rope
  3. Stone Tools
  4. Finding and Preparing Clay
  5. Finding and Identifying Ores
  6. Writing and Numbers
  7. Hunting and Trapping
  8. Basic Woodworking
  9. The Kiln
  10. Pottery
  11. Charcoal
  12. Arithmetic and Fractions
  13. Hides and Leather
  14. Lime
  15. Mercury
  16. Lye and Potash
  17. Fermentation
  18. The Wheel and Axle
  19. Logic and Binary
  20. Glass
  21. Bellows
  22. The Lathe
  23. Copper Smelting
  24. Laboratory Glassware
  25. Pumps
  26. The Battery
  27. The Vacuum Pump
  28. The Light Bulb
  29. The Vacuum Tube
  30. Amplifiers and Oscillators
  31. Electronic Counters

Do them roughly in this order. See it on the tech tree →

Why it matters

Mechanical counters (Clockwork, Music Boxes and Counting Machines) and stepping relays (The Automatic Telephone Exchange) count up to perhaps 10–50 events a second. Many things happen much faster: particles striking a Geiger tube (hundreds to thousands a second), turns of a fast shaft, cycles of an oscillator (thousands to millions a second), objects passing a light beam on a fast conveyor. An electronic counter keeps up with all of them.

Counting and dividing are the same act. A counter that gives one output pulse for every ten input pulses is a divide-by-ten. Chain five of them after a 100 kHz quartz crystal and you get one pulse a second, exact to a part in a million: a clock. Count the pulses arriving in exactly one second, and you have measured a frequency. These circuits are also the registers, counters and clocks inside every The Computer.

How it works

The flip-flop

Take two amplifier stages — two triodes (The Vacuum Tube) or two transistors (Semiconductors and the Transistor) — and connect the output (plate) of each to the input (grid) of the other.

  • Suppose tube A conducts. Its plate current flows through its load resistor, so its plate voltage is low. That low voltage, passed to B's grid, holds B cut off.
  • B is off, so B's plate is high. That high voltage, passed to A's grid, keeps A on.

Each tube holds the other in place. The circuit stays like this for ever — or until something flips it, and then it stays the other way just as firmly. It has two stable states, so it is called bistable, or a flip-flop. It is one bit of memory (Logic and Binary): A on = 0, B on = 1.

+150 to 250 V 0 V plate loads 22–47 kΩ Cross-links 100–220 kΩ, each bridged by 25–100 pF Tube A Tube B Neon lamp lit when A is on Output to next stage input grid resistors bias, −50 to −100 V steering diodes
Fig. 1 The flip-flop with two triodes. Each plate feeds the other's grid through a resistor bridged by a small "speed-up" capacitor; each grid is held down towards a negative bias supply. Whichever tube is conducting holds the other off. A negative input pulse, fed to both grids, can only switch off the tube that is on, so every pulse flips the circuit. The neon lamp lights when tube A conducts.

Dividing by two

Feed a short negative pulse to both grids at once. The tube that is already off is not affected — it is off already. The tube that is on is pushed off; its plate rises, which pulls the other tube on, and the cross-connection completes the flip. So every input pulse flips the circuit over.

Watch one plate: it goes up on one pulse and down on the next. Two input pulses make one complete output cycle. The flip-flop divides by two.

Counting in binary

Feed each flip-flop's output to the next. Stage 1 flips on every pulse, stage 2 on every second pulse, stage 3 on every fourth, stage 4 on every eighth. The lamps on the stages show the count in binary, with weights 1, 2, 4, 8 (Logic and Binary). Four stages count from 0 to 15 and then start again; n stages divide by 2ⁿ.

Input pulses Stage 1 (×1) Stage 2 (×2) Stage 3 (×4) Stage 4 (×8) Count 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 binary 1011 = 8 + 2 + 1 = 11: read the stages that are high, bottom to top
Fig. 2 Counting in binary. Each stage changes state when the stage before it switches off. Read the stages from the bottom up as a binary number — the count of pulses received so far.

The decade counter

People read tens, not sixteens. A decade counter is four binary stages forced to go back to zero on the tenth pulse instead of the sixteenth:

  • Reset method. The count of ten is binary 1010: stages "8" and "2" both on, which happens at no lower count. Wire a simple AND gate (two diodes and a resistor, or a two-grid tube — see Logic and Binary) to watch for those two together, and let its output send a pulse to all four stages that forces them to zero. The number 10 exists for only a few millionths of a second. As stage "8" falls, it sends one carry pulse to the next decade.
  • Ring counter. Ten stages in a ring, exactly one of them on. Each pulse passes the "on" to the next, like a bucket brigade. It needs more tubes (ten stages per decade), but it reads directly in decimal with a lamp for each digit. The first great electronic computer, ENIAC (1945), counted this way.

Multivibrators and other pulse circuits

Change the cross-connections, and the same pair of tubes does other useful jobs:

  • Astable multivibrator (free-running): both cross-links are capacitors. Neither state is stable, so the circuit flips back and forth on its own, giving a square wave. For a symmetrical circuit the period is roughly 1.4 × R × C, where R is the grid resistor and C the cross-coupling capacitor: 100 kΩ and 0.1 µF give about 70 flips a second; 1 MΩ and 1 µF about one every 1.4 seconds. It is a simple clock, a tone generator and a test source.
  • One-shot (monostable): one link is a resistor, the other a capacitor. A trigger flips it, it stays flipped for about 0.7 × R × C, then returns by itself. Every input, short or long, big or small, then produces an output of the same length and height. Use it to clean up pulses from a Geiger tube and to stop a switch's contact bounce — a mechanical contact chatters for a few milliseconds and would otherwise count as many pulses.
  • Schmitt trigger: two stages sharing one cathode resistor. Its output snaps high when the input rises past one level and snaps low only when it falls past a lower level. It turns a slow, noisy signal — a photocell's output, a sine wave from the mains — into clean square pulses that a counter can trust.

What you need

Item Use See
Triodes, best in matched pairs (or twin triodes in one bulb) Two per flip-flop The Vacuum Tube
Or transistors Two per flip-flop Semiconductors and the Transistor
Resistors 10 kΩ–1 MΩ, capacitors 25 pF–1 µF Every stage Resistors, Capacitors and Coils
Small diodes Steering pulses and AND gates Semiconductors and the Transistor, The Vacuum Tube
Plate supply 150–250 V, bias supply −50 to −100 V, filament supply Tube counters Amplifiers and Oscillators
Small neon lamps, or flashlight bulbs Showing each stage's state Arc Lamps, Neon and Fluorescent Lights
Mechanical counter The last, slow stage of a scaler Clockwork, Music Boxes and Counting Machines
Stable chassis and wiring Counters have many identical stages Building Circuits: Boards, Connectors and Cables

Where to find it

Everything here is built from parts made in earlier chapters: triodes from The Vacuum Tube, transistors and diodes from Semiconductors and the Transistor, resistors and capacitors from Resistors, Capacitors and Coils. Neon for indicator lamps is separated from liquid air (Liquid Air, Nitrogen and the Noble Gases). Unless you have salvaged parts, the limit is how many good, similar tubes you can make: a three-decade counter needs at least 24 triodes.

Building a flip-flop

These are starting values for small triodes that cut off at about −8 to −15 V on the grid, on a 150–250 V plate supply. Home-made tubes vary; adjust as described.

  1. Plate loads. A 22–47 kΩ resistor from each plate to the positive supply.
  2. Cross-links. From each plate, a 100–220 kΩ resistor to the other tube's grid. Bridge each with a 25–100 pF capacitor: these "speed-up" capacitors pass the sudden edge of the flip straight across, so the circuit flips in microseconds instead of dawdling.
  3. Grid resistors. From each grid, a resistor of the same value as the cross-link (100–220 kΩ) to the negative bias supply, about −50 to −100 V.
  4. Cathodes to earth.
  5. Check the arithmetic. The cross-link and grid resistor form a voltage divider between one plate and the bias supply. When the far plate is low (its tube on), the grid must sit well below cut-off — say −20 to −30 V. When the far plate is high, the grid should come up to about zero. If the off tube is not firmly off, make the bias more negative; if the on tube is starved, make it less negative or reduce the grid resistor.
  6. Indicator. A small neon lamp in series with 100–470 kΩ across tube A's plate resistor. It glows when A conducts (the full drop across the load is then 100 V or more).
  7. Test. Switch on. One lamp state or the other should appear — never neither. Touch A's grid briefly to earth through a 10 kΩ resistor: A turns on and stays on. Touch B's grid: it flips back. Measure both plates: one should be low, one high, never both in between.
  8. Triggering. From the input, a 50–100 pF capacitor to each grid through a small diode each, connected so that only negative-going pulses get through. The input pulses should be about 10–30 V high and a few microseconds long. A plain switch is not good enough — its bounce counts many times. Feed it through a one-shot first.

Transistor version. The same circuit, scaled down: 6–12 V supply, 1–4.7 kΩ collector resistors, 10–47 kΩ cross-links with 100 pF–1 nF speed-up capacitors, base resistors to earth or to a small negative supply. It uses a hundredth of the power, needs no filament and can be much faster.

Building counters and dividers

Binary chain

Connect stage 1's output (tube B's plate) through a 50–100 pF capacitor to stage 2's trigger input, and so on. When B's plate falls, it sends a negative pulse that flips the next stage; when it rises, the diodes block the positive pulse. Test with a slow one-shot or a hand pulse source: after each pulse the lamps should show the next binary number. Then test faster.

Decade

  1. Build four binary stages, weights 1, 2, 4, 8.
  2. Add the reset gate: two diodes from the "2" and "8" stages' "on" plates, so that the gate's output only swings when both are on. Its output, through a small capacitor, drives a reset line connected to one grid of every stage, pushing all four back to zero.
  3. Take the carry from the "8" stage: it falls once every ten input pulses.
  4. Read the count by adding the lit weights (lamp 8 and lamp 1 lit = 9). For a lamp per digit, use a small network of diodes that decodes the four stages into ten lines (Displays, Printers and Data Storage shows glowing-numeral tubes that read directly).

Test it with exactly a known number of pulses. The mains is a good source: a 50 Hz supply gives exactly 500 pulses in 10 seconds (or 600 on a 60 Hz supply), shaped by a Schmitt trigger.

The stepping switch: a mechanical decade

A stepping switch moves its wiper one contact per pulse and has ten or more contacts on each bank: it is a decade counter already, good to about 20–50 pulses a second. Put one or two electronic decades in front of it, and it counts thousands of pulses a second.

Frequency dividers

Any counter that gives one output for n inputs is a divide-by-n. A divide-by-5 is three binary stages reset at 5 (binary 101). Divide-by-ten stages in a row turn a quartz crystal's 100,000 cycles a second into:

After Frequency Use
1 decade 10 kHz Standard tone, check on radio dials
2 decades 1 kHz Drives a synchronous clock motor (Synchronous Motors and Converters)
3 decades 100 Hz
4 decades 10 Hz
5 decades 1 Hz Seconds pulse for a slave clock

A cheaper divider used in early quartz clocks is a locked multivibrator: an astable set to run freely at a little less than one tenth of the input frequency. Each input pulse nudges it, and it locks on to exactly one tenth. It needs no more than two tubes per stage, but must be checked — a drift in the supply voltage can make it jump to divide by nine or eleven. A true counter cannot make that mistake.

GEIGER SCALER QUARTZ CLOCK DIVIDER 100,000 ÷ 10 ÷ 10 ÷ 10 ÷ 10 ÷ 10 = 1 Geiger tube random clicks One-shot shapes pulses 200–500 µs each Decade ÷ 10 lamps 0–9 Decade ÷ 10 lamps 0–9 Mechanical register counts hundreds Crystal oscillator 100 kHz ÷ 10 10 kHz ÷ 10 1 kHz ÷ 10 100 Hz ÷ 10 10 Hz ÷ 10 1 Hz Seconds clock one pulse a second
Fig. 3 Two jobs for counters. Top: a Geiger scaler — the tube's pulses are shaped by a one-shot, divided by 100 in two decades, and the rest counted on a slow mechanical register. Bottom: a quartz clock — a 100 kHz crystal divided by ten five times gives one exact pulse a second.

The scaler for a Geiger counter

A Geiger tube (or a scintillation counter) gives a short pulse for each particle, at random, sometimes two within a fraction of a millisecond. A scaler counts them.

  1. Pulse shaper. Feed the tube's pulse through a small capacitor to a one-shot that gives an output of fixed height and about 200–500 µs length for each count. This also sets a fixed dead time — the counter ignores anything during that interval — so it can be corrected for.
  2. Decades. Two or three decade counters, with lamps.
  3. Register. A mechanical counter driven by a relay or a power tube from the last decade's carry. With two decades in front (÷100), a register good for 10 counts a second keeps up with 1,000 counts a second.
  4. Timer. A switch that starts and stops the count, worked by hand with a watch, or automatically by a mains-driven or crystal-driven divider so the count lasts exactly 1 or 10 minutes.
  5. Reading. Total = register reading × 100 + the lamps of the decades. Divide by the counting time.

Correcting for dead time. At high rates some particles arrive while the counter is dead. If the counter records n counts a second and the dead time is τ seconds, the true rate is about n ÷ (1 − n × τ). With τ = 0.0002 s (200 µs) and n = 1,000 a second, the true rate is 1,000 ÷ 0.8 = 1,250 a second. Below about 100 a second the correction is negligible.

Statistics. Random counts scatter. The uncertainty of a count of N is about the square root of N: 100 counts ± 10 (10%), 10,000 ± 100 (1%). Count long enough to get the accuracy you need (Statistics and Probability).

The frequency counter

Gate the input of a counter open for exactly one second, using the 1 Hz output of a crystal divider, and the count is the frequency in cycles per second. Gate it for 0.1 s and add a decimal point. This is the most exact way to set a Radio transmitter on its frequency, check a crystal, or measure a shaft's speed with a photocell and a slotted disc.

How to tell it worked

  • A flip-flop stays in whichever state you set it, for hours, and flips cleanly at each pulse — never sits half-way, never flips twice.
  • A binary chain shows the right number after 1, 2, 3… 15 slow pulses, and is back to 0 after 16.
  • A decade goes 0–9 and back to 0, sending exactly one carry per ten pulses.
  • The mains test: 10 seconds of 50 Hz mains gives 500 counts, every time.
  • Speed: feed a multivibrator of known frequency and raise it until counts go missing. Home-made tube stages may manage 10,000–100,000 counts a second; the first stage limits the whole counter.
  • A clock divider keeps time with the crystal: compare the seconds pulse with radio time signals over a day (Standard Time and Timetables).

Note Troubleshooting. Both tubes half-on, flip-flop won't hold → bias not negative enough, or tubes too unlike; increase the bias, or swap tubes for a better-matched pair. Flips but won't respond to pulses → trigger pulse too small or too slow; use a Schmitt trigger or one-shot to sharpen it, or larger trigger capacitors. Counts two or more for each event → switch bounce, or the input rings; add a one-shot. Counts at random with no input → interference from the mains or a nearby motor; decouple each stage's supply with a 0.1 µF capacitor, shield the input, keep wires short. Decade counts to 9 then sticks or skips → reset pulse too short or too weak; enlarge its capacitor. Locked divider jumps ratio → free-running frequency set too close to the edge; retune it to the middle of its locking range.

Dangers

Danger Many tubes, many hundreds of volts. A tube counter has a plate supply of 150–250 V, a negative bias supply, and many capacitors that hold charge after switch-off. Fuse it, bleed every supply with a resistor, discharge it before touching anything, and keep one hand away from the chassis. See Wiring and Electrical Safety.

  • Heat. Two dozen tubes give off as much heat as a small stove. Ventilate the box and keep wax and paper parts away from the tubes.
  • Radioactive sources used to test Geiger scalers: see Detecting Radiation.

What this unlocks

Counters measure radioactivity (Detecting Radiation), frequency (Radio) and speed; they keep time with a crystal (Quartz Crystals and Frequency Control, Standard Time and Timetables); they count products on a line (Photocells and Sensors) and scan lines in Cathode Rays and Television. A row of flip-flops is a register, and a counter that steps through a program's instructions is the program counter of a The Computer. Built on a chip (Integrated Circuits), counters became the digital watch, the frequency meter and the clock of every processor.

How it was first done

In Paris, Henri Abraham and Eugène Bloch built the free-running multivibrator during the First World War, describing it in 1919. In London in 1918 William Eccles and F. W. Jordan patented the "trigger relay" — the two-tube flip-flop. In 1932 Charles Eryl Wynn-Williams at the Cavendish Laboratory in Cambridge built a "scale-of-two" counter from gas-filled tubes to count alpha particles, the first electronic counter of its kind, and scalers soon became standard in every nuclear laboratory. Otto Schmitt described his trigger in 1938. ENIAC (1945) counted with rings of ten flip-flops. In 1949 John Bacon and John Pollard at Ericsson Telephones in Britain introduced the dekatron, a single glow-tube that counted a whole decade, and from the 1960s decade counters were made on integrated circuits, in the millions.

Source: content/entries/electronics/counters-and-dividers.md