ArticlesProjectsWeeklyCredentialsAbout

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.

eniacdecimal-arithmeticballisticsvacuum-tubespythonsimulation

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+.

Source code
# ENIAC Decimal Accumulator & Ballistic Trajectory Simulator

Code companion to [TMC #0009 — ENIAC Unveiled](https://rishisharma.in/articles/tmc-0009-eniac-unveiled).

ENIAC (1946) computed in decimal using decade-counter rings.  
This simulator models that architecture and the ballistic trajectory calculations it was built for.

## Usage

```bash
python eniac_sim.py                          # run all three demos
python eniac_sim.py --demo accumulator       # decimal arithmetic
python eniac_sim.py --demo ballistic         # ballistic trajectory
python eniac_sim.py --demo ballistic --trace # with per-step output
python eniac_sim.py --demo speed             # speed comparison table
```

Requires Python 3.10+. No external dependencies.

## Contents

| File           | Description                                                 |
| -------------- | ----------------------------------------------------------- |
| `eniac_sim.py` | Decimal accumulator, ballistic trajectory, speed comparison |

## Key References

- Goldstine & Goldstine (1946). _Mathematical Tables and Other Aids to Computation_, 2(15), 97–110.
- Haigh, Priestley & Rope (2016). _ENIAC in Action_. MIT Press.