TMC #0009: ENIAC: Decimal Accumulator & Ballistic Trajectory Simulator
A faithful simulation of ENIAC's decade-counter arithmetic and the ballistic trajectory calculations the machine was actually built to compute.
ENIAC computed in decimal, not binary. Each of its twenty accumulators stored a ten-digit number as a ring of decade counters: ten flip-flop circuits per digit: and added by transmitting electrical pulses into those rings at 100 kHz. This project models that architecture faithfully and uses it to simulate the class of problem ENIAC was built for: computing artillery firing tables.
What It Includes
DecimalAccumulator: A 10-digit decimal accumulator with ENIAC's exact carry-ripple scheme. Tracks simulated clock cycles, so you can measure the 5,000-addition-per-second throughput the original machine achieved at 100 kHz.
compute_trajectory: Euler-step ballistic trajectory with linear drag. The same ODE that ENIAC solved for hundreds of (angle, muzzle velocity) combinations when computing firing tables. ENIAC took ~20 seconds per trajectory; a human team needed ~12 hours.
Speed comparison: Side-by-side table: human calculator (~1 mul/min), Harvard Mark I relay (~3 add/s), ENIAC (~5,000 add/s), IBM 7090 transistor machine (~229,000 add/s). Shows why ENIAC's February 1946 public debut changed what people thought was possible.
Running It
python eniac_sim.py # all three demos
python eniac_sim.py --demo accumulator # decimal arithmetic only
python eniac_sim.py --demo ballistic --trace # trajectory with per-step output
python eniac_sim.py --demo speed # speed comparison table
No external dependencies: pure Python 3.10+.