How the Colossus Computer Processed Binary Streams
During World War II, the Colossus computer was developed at Bletchley Park to decipher high-level German military communications encrypted by the Lorenz SZ40/42 cipher machine. Colossus achieved its unprecedented processing speed by combining high-speed optical paper tape readers with thousands of vacuum tubes to analyze binary data in real time. By reading encrypted text encoded as five-bit binary streams and comparing it against electronically generated pseudo-random key streams, the machine performed rapid Boolean logic operations and statistical counts, making it the world’s first programmable, electronic digital computer.
Binary Data Representation
German teleprinter communications relied on the Baudot-Murray code
(CCITT-2), a five-bit standard where every character was represented by
a sequence of five binary digits (bits), such as 10110 or
01001. In paper tape format:
- A punched hole represented a binary
1(a “mark”). - An unpunched space represented a binary
0(a “space”).
Lorenz encryption applied an additive cipher by combining the cleartext binary stream with a pseudo-random key stream generated by its rotating mechanical wheels. This operation used modular addition (Modulo-2), which is functionally identical to the modern Boolean Exclusive-OR (XOR) operation:
- \(0 \oplus 0 = 0\)
- \(1 \oplus 0 = 1\)
- \(0 \oplus 1 = 1\)
- \(1 \oplus 1 = 0\)
To break the cipher, British cryptanalysts needed to identify the starting positions of the Lorenz wheels by testing potential key streams against the intercepted ciphertext tape until statistical anomalies appeared.
Optical Paper Tape Reading
Traditional mechanical tape readers were too slow and fragile to handle the millions of comparisons required for cryptanalysis. Tommy Flowers and his engineering team designed a revolutionary optical tape reader, colloquially known as the “Bedstead.”
- Pulleys and Continuous Loops: The intercepted ciphertext was punched onto a paper tape joined into a continuous loop and spun around a system of pulleys at up to 30 miles per hour (5,000 characters, or 25,000 bits, per second).
- Photoelectric Sensors: A light source shone through the tape’s five data channels and a central sprocket channel onto photoelectric cells.
- Pulse Generation: As holes passed the light source,
the photocells generated electrical pulses for
1s and remained quiescent for0s, converting physical punches directly into synchronized, high-frequency electrical binary signals.
Vacuum Tubes as Logic and Memory
Colossus Mk 1 utilized approximately 1,500 vacuum tubes (thermionic valves), while the Mk 2 version expanded to roughly 2,400. In Colossus, these tubes acted as high-speed electronic switches, bistable memory elements (flip-flops), and logical processors.
- Electronic Wheel Simulation: Rather than reading a second paper tape containing the hypothesized key stream—which would have created synchronization errors—Colossus generated the Lorenz key bitstreams entirely inside the machine. Banks of vacuum tubes were wired to replicate the stepping patterns and period lengths of the German cipher wheels electronically.
- Boolean Logic Gates: Vacuum tubes were arranged into logic circuits that performed XOR (\(\Delta\)-stream comparisons), AND, OR, and NOT operations on the synchronized bitstreams coming from the tape reader and the internal electronic wheels.
- Shift Registers and Parallel Processing: Colossus Mk 2 processed five five-bit characters simultaneously in parallel using shift-register circuits made of valves, effectively operating at a calculation rate equivalent to 25,000 characters per second.
Processing the Binary Streams
As the tape spun continuously:
- The optical reader fed the five-bit ciphertext stream into the tube-based circuitry.
- The internal vacuum-tube registers generated the corresponding sequence of the simulated Lorenz key stream.
- The logical circuits calculated XOR and difference (\(\Delta\)) equations between adjacent characters at electronic speeds.
- Thyratron-driven electronic counter tubes tracked the statistical frequency of specific binary conditions.
- If a counter passed a pre-programmed statistical threshold, the result was sent to an attached electric typewriter, indicating the probable wheel setting for that segment of the ciphertext.
By shifting storage and logical comparison entirely from mechanical components to electronic vacuum tubes, Colossus replaced weeks of manual calculation with hours of automated binary processing.