A Java Simulator for the ENIAC
(Electronic Numerical Integrator and
Computer) was officially presented to the public at the Moore School of Engineering of the
University of Pennsylvania [1]. The story of the ENIAC has been told many times, but
beginning with the 50
th
Anniversary in 1996, there has been a new surge of interest about the
machine and its functionality. Jan van der Spiegel and his team of students at UPenn built a
functional replica of the main modules of the ENIAC using a single chip [2]. ENIAC-On-A-
Chip is a fitting tribute to the machine which started the era of electronic computers and is
also materialized history of technology, living proof that we still know, many decades later,
how the ENIAC worked in detail.
This contribution describes a software simulation of the ENIAC developed by the authors at
Freie Universit鋞 Berlin in Germany. The simulation can be started from any computer
connected to the Internet. With the simulation, any interested person can program the ENIAC
to solve numerical problems. Programming means here wiring the machine, that is, laying
down connectors between the functional units so that information can flow synchronously
from one module to the next.
2
The ENIAC Architecture
Fig. 1 shows a diagram by van der Spiegel of the abstract architecture of the ENIAC, with its
five functional parts: a) arithmetic, b) I/O, c) global control and programming unit, d) memory
for tables, and e) busses.
Each of the 20 accumulators can store a positive or negative decimal number (with up to 10
digits, in tens complement representation). A number arriving into an accumulator is always
added to its previous contents hence the name accumulator. Subtraction is achieved by
transmitting the tens complement of a number to an accumulator (that is, instead of
transmitting a number a we transmit a). There is a single multiplication unit, as well as a
single divider & square root unit. Constants are entered into the machine using decimal dials
mounted in the constant transmitter panels, or reading IBM punched cards. A printer can be
used as output device for numerical results. Therefore, not considering the function table
units, nor the constants which can be set up with dials, the ENIAC operated with only 20
read/write memory cells.
The cycling unit provides the timing for the whole machine by generating and distributing ten
different trains of pulses. The other units can use these pulses as reference or as input, so that
the whole machine remains synchronized. It is the equivalent of todays clocking circuits in
computers. The initiating unit, on the other hand, allows the operator to start or stop the
machine, and also to reset the circuits at the beginning. The master programmer unit can be
used to implement loops, or to start two different computations in parallel in two portions of
the machine.
There are two busses in the ENIAC: the control bus is used to send input pulses to start the
units. A unit which finishes a computation sends an output pulse, through the control bus, to
the next unit, in order to start the next computation. The data bus is used to transfer decimal
numbers from one unit to another. Each decimal digit is transmitted through a cable line using
from zero to 9 pulses, according to the digit. Ten lines in a connector cable can transmit ten
digits in parallel, that is, the contents of an accumulator. The units are not permanently
connected to the busses: it is precisely the job of the programmer to lay down the appropriate
connections from each unit to the next, using cables, thus effectively laying down the busses
through which information flows. In the ENIAC the busses were just trays for holding the
cables connecting the units together.
ACC20
ACC2
ACC1
PRINTER
CARD
READER
CONSTANT
TRANSMITTER
CYCLING
UNIT
INITIATING
UNIT
I/O
MASTER
PROGR-
AMMER
MEMORY
FUNCTION
TABLE
UNITS
DATA
BUS
CONTROL
(PROGRAM)
BUS
GLOBAL
CONTROL
ARITHMETIC/
STORAGE
S
Y
N
C
R
H
O
N
I
Z
A
T
I
O
N
B
U
S
Figure 1: Diagram of the ENIAC functional units. Reproduced from [2].
Fig. 2 shows an abstract diagram of the accumulators, which allows us to understand its
wiring. One can think of an accumulator as an addition box containing a single ten digit
number. There are five possible numerical input connections (labeled , , , , and ). There
are two possible output connections (labeled A and S). An input pulse and its corresponding
settings (in the boxes near to the input pulse) tell us how the accumulator is used. The first
example in Fig. 2 is that of an accumulator where the input connection has been selected,
and is used seven times. That is, this accumulator will receive a ten digit number through
connector seven times. At the end of the seven additions, an output control pulse is
generated to signal completion of the task. In the second example in Fig. 2, the accumulator
accepts three times a ten digit number through connector . In the third example, the
accumulator outputs its contents through connector A twice. The selection of connector,
therefore, determines if the accumulator consumes an input or generates an output number.
Figure 2: Diagram of an accumulator showing three connection examples. See main text for the explanation.
If the dials in an accumulator could be used only once (as in the examples in Fig. 2), then 20
accumulators would not be enough for complex and intricate calculations. What the ENIAC
engineers did, was to put 12 connectors for input pulses in each accumulator, with their
corresponding and repetition switches. Each unit can then be used up to twelve times in
the dataflow diagram of a computation. Theoretically this gives us 240 components we can
use in the computational dataflow. Since many computations are performed only once and do
not need to start another unit, the first four input connectors were built so that they do not
generate an output pulse and execute its operation only once.
Figure 3: An accumulator has twelve connectors for input pulses. The first four do not generate an output pulse
at completion, the last eight do. Each input pulse has a dial to select the connector through which a number will
arrive (, , , , ) or will leave the machine (A, S, or both). The first four input pulse connectors lead to a
single repetition of the operation. The last eight connectors can repeat the operation from 1 to 9 times.
Fig. 3 shows a more complete abstract diagram of an accumulator. It can only hold a single
ten digit number, but it can be started in twelve different ways, as shown in Fig. 3: reading
from the , , , and connectors, and executing once (first four input pulse connectors), or
reading from the , , , , connectors 2, 4, 5, 7 and 1 times, respectively. It can output its
7
+0000000000
A S
Start pulse
3
+0000000000
A S
Start pulse
A
2
+0000000000
A S
Start pulse
Output pulse
after 7 addition
cycles
Output pulse
after 3 addition
cycles
Output pulse
after 2 addition
cycles
2
4
5
7
1
A
2
S
1
3
+0000000000
A S
AS
contents through A or S, twice or once, or it can output both the contents and its ten
complements through A and S simultaneously, three times (last connector). Accepting a
number through the same connector in two different cases (say connector ) is not a
contradiction
the unit sending the number through the bus and can be started also in two
different ways so that it sends the number 2 or 4 times.
One example, taken from [2], will help us to see how accumulators can be used in a complex
calculation. In Fig. 4, the accumulators 4, 5 and 6 are used to compute (a b), (b+359), and
(c+2b+359) in parallel, where a, b, and c are the initial contents of the accumulators 4, 5, and
6. The cables A1, A2, I, II, and III have been laid out by the programmers. The start pulse
arrives through cable A 1 and triggers the three accumulators concurrently. Accumulator 4
receives the number sent from accumulator 5, from the S (subtraction) connector, through
cable I. Accumulator 4 thus gets ( b) through the input channel . Therefore, at the end of the
first computation cycle, accumulator 4 will contain (a b).
Accumulator 5 switches are positioned so that it outputs its contents twice. The A output
connector is directly routed to accumulator 6 using cable II. The switches in accumulator 6
are positioned so that it reads from connector twice, so that at the end of the second
computation cycle, the content of accumulator 6 is the number (c+2b). Next, accumulator 5
sends a finished pulse at the end of the second computation cycle through connector A2.
This pulse triggers accumulators 5, 6, and the constant transmitter. This last unit sends the
constant 359, set by hand by the programmers using decimal dials, into both accumulator 5
and 6 through cable III. Accumulator 5 receives this number in input connector , and
accumulator 6 in connector . At the end of the third and last computation cycle, the contents
of the accumulators are, respectively, (a-b), (b+359), (c+2b+359). For a more detailed
description of ENIAC programming see [6] and [7].
A S
ACC4
I
F
r
o
m
in
it
ia
t
in
g
u
n
it
1
4
5
12
1
4
5
6
12
A S
A S
ACC5
ACC6
Constant
Transmitter
AS
2
1
2
A S
P 0 000 000 359
II
III
A-1
A-2
Figure 4: The connections for an ENIAC program. Three results are computed in parallel in each accumulator.
Taken from [2].
As this simple example shows, the main task for the programmer is figuring out where to
store partial results, and how to continue generating new results. All accumulators