
                                 ENIAC
             Electronic Numerical Integrator And Computer

  The ENIAC is widely considered to be the first general purpose 
fully electronic computer.  Although there were a number of other
computers that predate the ENIAC, these were either non-general purpose
or else mechanical or electro-mechanical in nature.  ENIAC is not the
first stored-program computer in that the programming of the ENIAC is
carried out by setting switches on its various units and then cabling
the units together to perform complex calculations.

  ENIAC was completed in February of 1946.  Originally commissioned
during World War II, it was not actually completed until after the war
was over.  Originally ENIAC was designed for computing artillery firing
tables, but was used for much more.  It should be noted that the ENIAC
is considered to be Turing Complete, meaning that it qualifies as a 
general purpose computer.

  Construction of ENIAC used 17,468 vacuum tubes, 7,200 diodes, 1,500
relays, 70,000 resistors, 10,000 capicitors and roughly 5 million 
soldered joints.  The completed machine weight roughly 27 tonnes and
took up around 1800 square feet.  The ENIAC required about 150kw of
power to run.

  ENIAC conists of some 32 different units spread across 40 panels.
These units consisted of the Initiating Unit, Cycling Unit, 
20 Accumulators, High-speed Multiplier, Divide/Square Rooting Unit, 
Master Programmer, 3 Function Tables, Constant Transmitter, Card
Reader and Card Punch.  Signals were carried between units in two
different type of trays, digit trays carried numerical data from one
unit to another and program trays carried program pulses from one
unit to another.  These trays would be analogous to what we now call
busses.  Each tray consisted of 11 parallel wires.  there were multiple
digit and program trays that ran the entire length of the ENIAC.

  A rather unique feature of the ENIAC is that it operated purely on
decimal numbers, a feature that is highly unusual as most all other
computers (even at the time) worked in binary.


1. The ENIAC simulator
----------------------

  This ENIAC simulation attempts to simulate the entire ENIAC machine.
Nearly all of the ENIAC units and panels have been recreated in this
simulation and pretty much any problem the original ENIAC could solve
could be setup in this simulation.

  Before we dive into the simulator and how to program it, we need to 
sure to define certain terms that will be used throughout the rest of
this document.  Many of the terms we will use will be those used with
the real ENIAC and may be counter-intuitive to what we know some of
these terms to mean today.

Setup - A setup consists of all the settings on the machine to perform
        a given task.  This would be analogous to what we call a 
        program today.

Program - A single set of operational parameters to perform a given
        step on a given unit.  Most all of ENIAC's units consist of
        multiple programs that can be used to solve problems.

Digit Tray - Digit trays carry numerical data from one unit to another.
        The simulator contains 8 sections of digit trays with each
        section containing 5 trays.

Program Tray - Program trays carry program pulses from one unit to
        another.  There are 9 sections of program trays with 9 trays
        each.  Each tray has the capacity for 11 program pulses.

Program Pulse - A program pulse is used to stimulate a unit to perfrom
        an action.  Program pulses can be connected to program inputs
        on the various units in order to stiumulate that program to
        perform its function.  Most programs can then send another
        program pulse when completed to signal the next unit/program
        to function.


2. Our first setup
------------------

  Lets now create our first ENIAC setup.  We will simply load the number
1 into an accumulator.  Startup the simulation and select the "Init"
tab.

  The "Init" tab contains the controls for the Initiating Unit.  For now
we will only concern ourselves with the "Go" button and the box labeled
"Init. Pulse". 

  Start by setting the drop down in the "Init. Pulse" to P1-A:1.  A 
quick description of what this value means.  the initial "P" indicates
that this a program tray.  The "1" following the "P" indicates section 
1.  The "-A" indicates Tray A and the ":1" indicates position 1 in the
tray.  By setting this value, when you hit the "Go" button a program 
pulse will be sent out on this particular program tray and position.

  Now we need to connect this pulse to another unit in order to have
the machine do something.  Select the "Acc" tab to bring up the
Accumulator controls.  This screen looks more complicated than it 
really is.  I will describe the various pieces of this screen shortly,
but for now the only important things are the number display along the
top middle of the accumulator.  This shows the number that is currently
stored in this accumulator.  The box labeled with "1", this is called
a "program" and is used to cause the accumulator to perform an action
when stimulated.  

  A program consists of two items, the clear/correct switch, which
can be set at either "C" or "0".  For now set this to "C" in program 1.
Below the Clear/Correct switch is the mode switch.  This switch 
specifies what action to take when this program is stimulated.  We
leave it set at "alpha".  I will talk about the various modes shortly.

  Now near the bottom of the page there is a box labeled "I1" with
a single drop down inside it.  This connects program 1 to a position
in a program tray.  For now set it to P1-A:1.  This says that when
a program pulse is received on P1-A:1 then perform the function of
program 1.  Remember, our "Go" button was set to output a program
pulse on this particular position.

  The last thing we need to do before starting our setup is to turn on
the power to this unit.  In the box labeled "Power" select the "On"
setting.

  Our setup is now ready to run.  Notice that the current value in the
accumulator is +0000000000.  Now go back to the "Init" tab and hit the
"Go" button one time.  Then come back to the "Acc" tab and notice that
the accumulator now has a value of +0000000001.  Now try hitting "Go"
a few more times and notice that the accumulator increases in value by
1 for each press of the "Go" button.  Congratulations!  You have 
created your first ENIAC setup.


3. Introduction to the Accumulator
----------------------------------

  ENIAC contains 20 accumulators and the vast majority of functions 
carried out by ENIAC will occur in its accumulators.  Each accumulator
can store a 10 digit signed decimal number.  In addition to storing
a single 10 digit number, an accumulator can either send its value
or receive a value from another unit.  It is also possible to connect
two accumulators together to work with 20 digit numbers.

  Lets now take a tour of the accumulator screen in the emulator.

  In the top left corner is a control labeled "Accumulator"  This lets
you select which of ENIAC's 20 accumulators you want to work with.

  In the top middle is the display for the value currenly loaded into
the current accumulator.  It is important to know that negative numbers
are indicated in 10s compliment form, so for example, -1 would show on
the value display as -9999999999.  Refer to the section on 10s 
compliment to understand how to interpret these numbers.

  Below the value display are 5 boxes labeled "alpha", "beta", "gamma",
"delta", and "epsilon".  These 5 boxes represent the Accumulator's 5
digit input ports.  These ports can be connected to digit trays in
order to receive numbers from another unit.  Each port consists of two
drop-downs, the top one specifies which digit tray the port is
connected to.  The bottom drop-down selects whether or not an input
filter is being used and which filter is being used.

  Next to the digit input ports are two boxes labeled "A" and "S".
These two boxes are the accumulator's two digit output ports.  These
ports can be connected to digit trays to transmit the accumulator's
value to another unit.  The A and S digit output ports behave a little
differently.  Any value sent out the A port is sent as-is.  Any
value sent out the S port is sent as the compliment of the value 
stored in the accumulator.  For example, if the accumulator is holding
a value of +125, then if it is sent out the S port it will be sent
as -125.  This is how a value in an accumulator can be subtracted from
another one.

  Below the digit ports are twelve boxes labeled "1" through "12". 
these are the accumulator's twelve programs.  Each program can be 
setup to allow the accumulator to perform its various functions.  Each
program consists of two controls, the Clear/Correct switch, which can
be set at either "C" or "0".  The function of this switch depends on
whether the program is a receive program or a transmit program.  When
the program is a receive program and the Clear/Correct switch is set
at "C" then at the end of each addition time where this program is
active 1 will be added to the accumulator in the lowest digit.  You
saw this occuring during our first setup above.  If the accumulator
is set for a transmit operation then if the Clear/Correct switch is
set at "C" then the accumulator's value will be cleared at the end
of the program.

  Below the Clear/Correct switch for each program is the Mode switch.
This switch selects which action the accumulator will perform when
the particular program is stimulated.  The mode switch can be set at:
"alpha", "beta", "gamma", "delta", "epsilon", "0", "A", "AS", or "S".
The first five: alpha, beta, gamma, delta, and epsilon are receive
modes.  When these modes are activated the accumulator will listen
for a digit value connected to the associated digit input port.  For
example, if the mode switch is set for "delta", then the accumulator
will be listening for a digit on the "delta" input port.  The A, AS,
and S are all transmit modes, when these modes are active the value
stored in the accumulator will be sent out the selected digit output
port.  For example, if A is the selected mode, then the value will
be sent out the A digit output port.  The "0" setting is an idle
setting that will not receive nor transmit a number when it is 
active.  However, it is considered a transmit mode for the purposes
of the Clear/Correct switch, this makes is an easy way to clear the
accumulator's value, select the "0" mode with the Clear/Correct
switch set at "C".

  Below the 12 program controls are 8 boxes labeled "Rep 5" through
"Rep 12".  These are the repeat switches for programs 5 through 8.
When any of these programs are stimulated they will be repeated the
number of times specified by the associated repeat switch.  For 
example, if program 5 is set at mode A and the repeat switch for
program 5 is set at 3, then the accumulator's value will be sent
out the A port 3 times over 3 addition times.  Note that only
programs 5 through 12 have repeat switches, programs 1 through 4
will only ever execute one time per stimulation.

  Below the repeat switches are four boxes labeled "I1" through "I4".
These are the program pulse inputs for programs 1 through 4.  These
are connected to program trays to receive program pulses from other 
units.  When a program pulse is received by one of these inputs, the
associated program will be triggered to run upon receiving the next 
CPP pulse from the cycling unit.

  The bottom row of boxes, labeled "IO 5" through "IO 12" .  These
provide the program input and outputs from programs 5 through 12.  
Unlike programs 1 through 4 there are also program outputs associated
with programs 5 through 12, pulses will be sent out the output when a
given program has completed its function.  In the IO box, the top 
drop-down is for the input pulse and the bottom drop down is for the
output pulse.

  Just to the right of the program 4 box is a box labeled "Sig Digits",
this box contains two controls: the selective clear switch which has
a "C" and "0" setting.  When this switch is set at "C" then the value
stored in the accumulator will be cleared whenever one of the Clear
inputs on the Initiatiing Unit are stimulated.  Below the selective
clear switch is the significant figures switch, this switch specifies
how many digits of the accumulator are significant for subtraction/
clearing operations.  This switch will be looked at more in depth a
bit later.

  Lastly there are two boxes on the left and right edges labeled:
"Left" and "Right".  These provide the ability to connect an accumulator
to another in order to use 20 digits for calculating.  This will be
discussed later in this document.


4. Our second setup
-------------------

  Now let us put some of what we have learned above to use and build a
setup to multiply 5 by 9.  We will start designing our program on 
coding forms to help us with setup.  The coding form will allow us to
figure out most of the setup before touching the actual machine.  A
basic coding form takes the form:

+------+--------+-------+---------------------+---------------------+--------+
| Step | In Pls | Tray  | Source              | Destination         | Out P  | 
+------+--------+-------+---------------------+---------------------+--------+
|      |        |       |                     |                     |        |
+------+--------+-------+---------------------+---------------------+--------+
|      |        |       |                     |                     |        |
+------+--------+-------+---------------------+---------------------+--------+

  Our first step will be to load 5 into an accumulator.  We will use a 
method similar to our first setup.  The coding form for the entry looks 
like:

+------+--------+-------+---------------------+---------------------+--------+
|    1 | P1-A:1 |       |                     | A1 5 C alpha R5     | P1-A:2 |
+------+--------+-------+---------------------+---------------------+--------+
 
  Here is what each of these entries mean:

     1            - First step of the program
     P1-A:1       - This step is triggered by program pulse P1-A:1
     A1           - Accumulator 1 will be the destination
     5 C alpha R5 - This specifies we will be triggering program 5, which
                    should have its clear switch set to "C" and its mode
                    switch set to "alpha" and its repeat control set to 5.
     P1-A:2       - The program should end with a unit sending pulse P1-A:2.

  Next we will transmit accumulator 1 to accumulator 2 9 times.  here is
the entry on the coding form:

+------+--------+-------+---------------------+---------------------+--------+
|    2 | P1-A:2 | D1-A  | A1 6 0 A R9         | A2 5 0 alpha R9     |        |
+------+--------+-------+---------------------+---------------------+--------+

  And again a quick explanation of each value:
     2            - Second step of the program
     P1-A:2       - The triggering pulse for all units involved is
                    P1-A:2.
     D1-A         - D1-A is the digit tray that will carry the value.
     A1           - Source is accumulator 1
     6 0 A R9     - This specifies that on accumulator 1 we will be
                    using program 6, which needs its clear switch set
                    to "0", the mode switch set to "A" and the repeat
                    control for program 6 set to 9.
     A2           - The destination of this step is accumulator 2.
     5 0 alpha R9 - This specifies we will be using program 5 of 
                    accumulator 2.  Its clear switch should be set to
                    "0", its mode switch set to "alpha" and the repeat
                    switch for program 5 set to 9

Our complete setup is therefore:

+------+--------+-------+---------------------+---------------------+--------+
| Step | In Pls | Tray  | Source              | Destination         | Out P  | 
+------+--------+-------+---------------------+---------------------+--------+
|    1 | P1-A:1 |       |                     | A1 5 C alpha R5     | P1-A:2 |
+------+--------+-------+---------------------+---------------------+--------+
|    2 | P1-A:2 | D1-A  | A1 6 0 A R9         | A2 5 0 alpha R9     |        |
+------+--------+-------+---------------------+---------------------+--------+

We will start with step 1.

Start by selecting the "Init" tab and press the "New" button to clear
out any setup that may already be loaded.

  While still on the "Init" tab, set the "Init. Pulse" output to P1-A:1.

  Now select the "Acc" tab and make sure that Accumulator 1 is currently
selected.  Be sure the power to this panel is set to "On".  

  The first step will be to load 5 into this accumulator.  We will do
this using 5 repeats on program 5.  Be sure that program 5 is set to
"alpha" and the Clear/Correct switch for program 5 is set at "C".

  Next in the "Rep 5" box, set the number of repeats to "5".

  Now connect the input pulse for program 5 (Top drop-down in the "IO 5"
box to P1-A:1.

  The output pulse of program 5 (bottom drop-down in "IO 5") needs to
be set to P1-A:2.

  The first step is now done, you can test that you setup everything
correct by going back to the "Init" tab, pressing "Clear", followed by
"Go".  Go back to the "Acc" tab and verify that the accumulator is now
holding a value of +0000000005.


  Now we need to setup the next step.  

+------+--------+-------+---------------------+---------------------+--------+
|    2 | P1-A:2 | D1-A  | A1 6 0 A R9         | A2 5 0 alpha R9     |        |
+------+--------+-------+---------------------+---------------------+--------+

We need to trigger program 6 from P1-A:2, so on "IO 6", on the input
side (upper drop-down) connect this to P1-A:2.

  Now on program "6", be sure the Clear/Correct switch is set at "0",
and then set the mode switch to "A".  

  Set the repeat control for program 6 to "9".

  Now we need to connect the A digit output port to a digit tray so
that the value of this accumulator can be added to another.  Set the
drop-down in the "A" box to D1-A.

  Now select accumulator number 2.  and be sure its power is "On".

  We want this accumulator to receive the values being transmitted by
accumulator 1, so first set the input control of program 5 (Upper
drop-down in the box "IO 5" to P1-A:2.

  Now be sure that program 5 has its Clear/Correct switch set to "0"
and then set the mode switch to "alpha".

  Set the repeat control of program 5 to 9, which matches the value
set on the repeat control for program 6 (The one transmitting the
value) on accumulator 1.

  Next we need to connect the "alpha" digit input port to the same
digit tray that accumulator one is trasmitting on, D1-A.

  Now go back to the "Init" tab, press the "Clear" button followed
by the "Go" button, then switch back to the accumulater 2 page and
see that accumulator 2 is now holding +0000000045.

  You should now know how to chain program steps together as well
as how to transfer numbers from one accumulator to another.


Note.  This tutorial is incomplete and will be completed at some 
point in the future.
