NATIONAL BUREAU OF STANDARDS REPORT

1984

PROGRAMMING AND CODING HANDBOOK FOR SEAC

Joseph H. Levin

<NBS>

U. S. DEPARTMENT OF COMMERCE

NATIONAL BUREAU OF STANDARDS
U. S. DEPARTMENT OF COMMERCE

Sinclair Weeks, Secretary NATIONAL BUREAU OF STANDARDS

A. V. Astin, Director

THE NATIONAL BUREAU OF STANDARDS

The scope of activities of the National Bureau of Standards is suggested in the following listing of

the divisions and sections engaged in technical work. In general, each section is engaged in specialized research, development, and engineering in the field indicated by its title. A brief description

of the activities, and of the resultant reports and publications, appears on the inside of the back

cover of this report.

Electricity. Resistance and Reactance Measurements. Electrical Instruments. Magnetic

Measurements. Electrochemistry.

Optics and Metrology. Photometry and Colorimetry. Optical Instruments. Photographic

Technology. Length. Engineering Metrology.

Heat and Power. Temperature Measurements. Thermodynamics. Cryogenic Physics. Engines

and Lubrication. Engine Fuels. Cryogenic Engineering.

Atomic and Radiation Physics. Spectroscopy. Radiometry. Mass Spectrometry. Solid State Physics. Electron Physics. Atomic Physics. Neutron Measurements. Infrared Spectros- copy. Nuclear Physics. Radioactivity. X-Ray. Betatron. Nucleonic Instrumentation. Radiological Equipment. Atomic Energy Commission Radiation Instruments Branch.

Chemistry. Organic Coatings. Surface Chemistry. Organic Chemistry. Analytical Chemistry.

Inorganic Chemistry, Electrodeposition. Gas Chemistry. Physical Chemistry. Thermochemistry.

Spectrochemistry. Pure Substances.

Mechanics. Sound. Mechanical Instruments. Fluid Mechanics. Engineering Mechanics. Mass

and Scale. Capacity, Density, and Fluid Meters. Combustion Control.

Organic and Fibrous Materials. Rubber. Textiles. Paper. Leather. Testing and Specifications. Polymer Structure. Organic Plastics. Dental Research.

Metallurgy. Thermal Metallurgy. Chemical Metallurgy. Mechanical Metallurgy. Corrosion.

Mineral Products. Porcelain and Pottery. Glass. Refractories. Enameled Metals. Concreting

Materials. Constitution and Microstructure.

Building Technology. Structural Engineering. Fire Protection. Heating and Air Conditioning. Floor, Roof, and Wall Coverings. Codes and Specifications.

Applied Mathematics. Numerical Analysis. Computation. Statistical Engineering.

Electronics. Engineering Electronics. Electron Tubes. Electronic Computers. Electronic

Instrumentation. Process Technology.

Radio Propagation. Upper Atmosphere Research. Ionospheric Research. Regular Propagation

Services. Frequency Utilization Research. Tropospheric Propagation Research. High Frequency

Standards. Microwave Standards.

©Office of Basic Instrumentation ©Office of Weights and Measures.
NATIONAL BUREAU OF STANDARDS REPORT

NBS PROJECT NBS REPORT

1102-50-51E6 September 30, 1952 19 8U

PROGRAMMING AND CODING HANDBOOK FOR SEAC

by

Joseph H, Levin

tl uu Approved for public release by the

The publication, reprint r irt, Is prohibited

uniett permistion itobta Director of the National Institute ofrdtiWMhlngton 25,d,c. Suchpermissi Standards and Technology (NIST) has been specifically prepared If that a On October 9, 2015 for Its own use.
Contents

Introduction

Summary of SEAC Specifications

Part I - Description of SEAC

1.0

1.1

1.2

1.3

l.U

i

2.1

2.2

3.0

U.o

5.0

6.0

7.0

7.1

7.2

7.3

7.U

7.5

8.0

8.1

8.2

8.3

General Characteristics

Words, Instructions, and Numbers

Storage

Routines

b-Address and 3-Address Modes

Memory

Acoustic Memory

Electrostatic Memory

Input and Output Equipment

Arithmetic Unit

Control Unit

Manual Controls

Operations

Arithmetic Operations

Comparison

Logical Operations

Input and Output Operations

Base Operation

Coding

Coding in the U-Address System

Coding in the 3-Address System

Getting a Routine into the Machine
9.0 Subroutines

Part II -

11.0

10.1

10.2

10.3

10.it

10.5

11.0

11.1

11.2

11.3

11. h

12.0

12.1

12.2

12.3

13.0

13.1

lU.o

lU.i

lit. 2

lit. 3

lit.it

lit. 5

lit.6

lit. 7

lit. 8

Programming and Coding for SEAC

Systems of Number Representation

Decimal System

Binary System

Comparison of Decimal and Binary Systems

Arithmetic Operations in the Binary System

Octal and Hexadecimal Systems

Conversion Between Number Systems

Conversion from p~ary to q-ary Using p-ary Computation

Conversion from p-ary to q-*ary Using q-ary Computation

Conversion Using Known Equivalents

Exercises

Representation of Information on Input and Output Media

Teletype Tape Preparation

’’Machine Hexadecimal”

Binary Coded Decimal Representation

Instructions in h-Address System

Ways in Which an Instruction May be Written

Coding of Routines

Example of a Routine

Method of Getting Information Into Machine

Overflow

Scaling

Low Order Multiplication

Shifting

Example

Selection of Input and Output Media
Ik 9 Compression

15.0 Flow Diagrams

15.1 fioample

16.0 Preliminary Coding in Terms of Symbol! o Addresses

16.1 Conversion to Pinal Code

17.0 Modification of Instructions

17.1 Example 1

17.2 JBxercises i17.3 Example 2

17. h Function Table Technique of Instruction Modification

18,0 Timing

18.1 Addresses in Acoustic Memory Only

18.2 Addresses in Eleotrostatio Memory Only

18.3 Addresses in Acouatlo and iftectrostatio Memories

18. h Remarks

19,0 Subroutines

19.1 Conventions for Standard Subroutines

19.2 Transcription of Total Routine Onto Input Medium

19.3 List of Standard Constants

19. U Method of Incorporating Subroutines

20.0 Some Special Features of the 3‘“&ddreas System

20.1 Example 1

20,2 Example 2

21.0 Remarks
PROGRAMMING AND CODING HANDBOOK FOR SEAC

Introduction

The construction of SMC is on® aspect of th® National Bureau of

Standards’ digital oomputer program. Known in the pre-operation phases

of its development as the NBS Interim Computer [l], this machine was

constructed by the Electronics Division for the Applied Mathematics Division

with a major part of the financial support coming from the Offioe of the

Air Comptroller. The projeot was undertaken in an effort to provide a

modest scale automatically-sequenced electronic digital computer to fill

the need for computing facilities during the time that larger scale machines

were reaching their completion stages. Emphasis was placed on simplicity

in design and on earliness in completion. Thus, for example, there was to

be no division instruction, no absolute comparison instruction, no logical

transfer instruction, eto. But during the course of the development it was

realized that with comparatively little additional effort, such facilities

could be added. The completed machine contains all of these features and

others, and is in fact a full scale computer. It took less than 18 months

for the planning, design and construction of the SEAC and less than 6 months

for testing. The machine performed its first integrated computational

operation on April 7, 19£0. It carried out some miscellaneous mathematical

exercises, such as the factorization of numbers into primes, the computation

of sine-cosine tables, and the solution of some diophantine equations, during

the months of April and May. On May 9, it carried out its first significant

computation, the tracing of optical rays through lens systems, for the NBS
«2

Optics Division* and on June 30, 19^0 the SMC was officially announced

and dedi cated [2 ].

Since that time the SMC has been in continuous use Zk hours per day,

7 days a week* At the present time approximately 70 per cent of this time

is spent on problems of importance in mathematics, physics, engineering,

management, etc. In particular, a high percentage of the computing effort

on the SMC is devoted to problems of importance in national defense. Approxi**

mately 30 percent of the SBAC time is spent on scheduled engineering work*

via., research on components, installation of new equipment, and preventive

maintenance. Unscheduled maintenance amounts to about 20 per oent of the

total time assigned to computing, [9],

The programming for and operation of the SMC is done in the Computation

laboratory of the Applied Mathematics Division, Most of the calculations

on the SMC are performed as technical services in line with the role of

the Applied Mathematics Division as a central computing laboratory and

mathematical service facility for Government agencies,

if

'

.

'

.

.

• This Handbook is direoted toward two classes of readers - one includes

those engineers, mathematicians, physicists, etc., who are potential customers

for SMC services. For such persons a general familiarity with machine

> v<r eharaoteri sties and coding principles will facilitate the formulation of

problems and will make it possible to produoe realistic estimates of ooding

time and computing time. The second olass of reader is composed of employees

of the Computation Laboratory and others who in one way or another become

engaged in actual coding for SEAC, Part 1 of this report is addressed primarily

to the first class of persons and Part XI to the second olass. Part II is
«^«o

pitched on the level of the new employee who is an average college graduate

with a major in mathematics. These employees may he aware of number systems

other than the decimal , but in general they have no working knowledge of

such systems; hence Part II begins with a discussion of the binary system

which is used by the SEA© and the hexadecimal (base 16) number system which

is more convenient than the binary for coding. Part II also contains a

discussion of conversions between number systems and then goes into the details

of coding for SMC.

The intention is to make this report as self“contained as possible.

Hence general descriptions are given of certain SMC components which are

described in great detail elsewhere. For the reader who wishes to go into

greater detail on certain aspeots of SMC or other computing machinery design

or operation, a list of references is given. In particular. Reference U,

listed at the end of Part I, gives a comprehensive treatment of the subject

and contains a very complete bibliography up to the year 1950. It does not,

however, oontain SEAC design features. Reference 8 deals with devices in

terms of design, philosophy, and internal organization, rather than in terms

of specific mechanisms or circuits, and therefore achieves a generality not

likely to be outdated by new developments.

The first codes were prepared for SMC in the Machine Development

Laboratory of the Applied Mathematics Division in 19ij9, considerably before

construction of the maohine was completed. It was during ‘that period that

the conventions for standard subroutines described in Part II, Sect, 19,

were established. The faot that these conventions are still used and are

found to be highly convenient attests to the reasonableness of the deoisions
made at that time. In those days of coding for a still non-existent machine

(in the operational sense) the Machine Development Laboratory staff prepared

a basic library of fundamental subroutines, most of which are listed among

the references at the end of Part II, and the incorporating routine described

in Part II, par, 19,

4 . The members of the Maohine Development Laboratory staff

who contributed in this effort under the direction of Dr. E. W, Cannon are

Dr. Merle M. Andrew, Mr, Ira C, Diehm, Mrs, Florence Koons, Dr* Samuel Lubkin,

Mrs. Ethel C, Marden, Mrs. Ida Rhodes and Mr. Otto Steiner*

At the time that the SEA'C was put into use, programming, coding, and

operation were taken over by the Computation Laboratory. An early report,

"A Manual For Coding On the SEAC", prepared by Dr, M. M. Andrew, was issued

in May 1950, and contained in particular the basic library of subroutines

referred to above. As work with the SEAC got under way, practical programming

and coding experience was acquired and new techniques were developed. The

staff also grew and classes were organized whenever necessary for the instruction of ihooming personnel. Instruction notes were prepared in mimeographed form by members of the C. L. Staff, under the direction of the undersigned. Some of these notes have been used extensively in the preparation of

this Handbook. In particular, the undersigned wishes to express his appreciation to Mr. Ira C, Diehm for his assistance in the writing of Sections 13,

lit and 18 of Part II, to Mrs. Viola D. Hovsepian for her assistance in the

writing of section 17 of Part II, and to Mrs. Ethel C. Marden for her

contributions in the writing of Section 19 of Part II. In addition, indebtedness is acknowledged to Dr. Samuel Lubkin whose dittoed notes on number

systems have been used almost verbatim in Section 10 of Part II.
•

5

"

SUMMARY OF 3SAC SPECIFICATIONS [3 ]

l„ Number System Binary

Z. Word Length h$ Binary Digit®, (bb digits of

numerical information, 1 digit

for sign)

3. Memory

Typo Capacity Average Acoess Time

(a) Acoustic

(b) ELeotrostatio

Totals

512 words

£L2 words

102b words

216 microseconds

60 microseconds

Ue Intermediate Storage

Type

No„ of

Channels

No. of

Units

Maximum

Capacity

Maximum

Speed

(a) Reel “less magnetic

. tape unit

i b (at present) 10,000

words/unit

7Q00 words/

ndne

(b) Servo-magnetic

' tape unit

1 10,000

words/

channel

blOO words/

min.

5. Input-Output Type Maximum Speed

Keyboard

Teletype

Magnet! o Wire

(manual)

30 words/ndn.

3100 words/min*

60 Type of Arithmetio Unit Serial

7, Modes of Operation

8, Numbers of Orders

Available

(a) b-Address

(b) 3-Addres*

1

Currently being installed
9„ Speed of Operation (includes access time)

Type of Acoustic Memory Electrostatic

Operation (Average Time) Memory

(a) Addition 900 microseconds 200 microseconds

(b) Multiplication 3000 microseconds 2lt00 microseconds

10 . Basic Repetition Rate 1 megacycle

11. Power Requirements 15 kw0

12. Number of Tubes 1200 (approximately)

13, Number of Crystal Diodes 19000 (approximately)

lU, Net Floor Space 150 square feet
tn^i

PART I

DESCRIPTION OF SEAC

l e O General Characteristics, The SEAC is a general-purpose automatic

binary digital electronic calculator. It is general-purpose in the sense that

it is capable of any computation which can be formulated in terms of numerical

operations? i.e, , addition, subtraction, multiplication, etc, A complete list

and description of the operations performable on SEAC are given later in

Part II , Sect, 13 of this report. The SEAC is automatic in the sense that it

ii independent of a human operator once computations are begun. The automatic

feature implies that at any stage in a computation without any intervention

from an operator the machine ’’knows** what it is to do next. This in turn

requires r (a) the existence of a means of representing ”instructions” within

the machine? (b) the ability of the machine to ” store” both instructions

and numbers? (c) the presence of ’’control” facilities to interpret and execute

1

' the instructions in their proper sequence? (d) the presence of facilities for

carrying out certain arithmetic and other operations? (e) the presence of

communication facilities between the machine and its operator,

1,1 Words 9 Instructions, and Numbers , A Single instruction is a

command to the machine to execute a simple operation such as, addition,

subtraction, multiplication, division, comparison, reading, writing, etc.

Instructions are written in a numerical code and are indistinguishable in

appearanoe as well as in method of storage from numbers. The generic term

”information" is used to include both instructions and numbers. The unit

of information is the **word” which for the SEAC is defined to be a sequence
of h$. binary digits/. The least significant digit position is reserved as

a sign digit, zero for plus and one for minus. Any word may be interpreted

either as an instruction ©r as a number,, The particular interpretation mad©

depends ©n whether within the machine the word is channeled when ©ailed for

from the component in which it is stored into the "control unit”, whera words

are interpreted as instruction®, or into the "arithmetic unit”, where words

ar® interpreted as numbers. A given word may b® interpreted as an instruction

at on® stag© ©f a calculation, and as a number at another stage of the calculation.

A negative number is represented by its absolute value together with a

negative sig^a. The location of the binary point in numbers is between the

1

second and third binary positions from the left „

1.2 Storage. The storage function is performed by various storage devices

which may be classified into two categories? internal, or "fast" storage, and

external, or "slow” storage (®fc Ref. It, Chap. lit). The internal storage or

"memory” consists of both acoustic and electrostatic systems each of which is

capable of storing 512 words. There is thus a total internal memory capacity

of 102b words. The memory locations (usually referred t© as "cells”, or

"registers”) are numbered serially, 0,1, 0 . . ,1023, and these numbers are called

"addresses".

The external storage media consist of teletype tape, magnetic tape, and

i magnetic wire. These media are essentially identical with the "input” and

"output" media which are required for purposes of communication between the

1

This choice was influenced by a number of factors, one being the convenience

©f being able to handle oommonly used numbers such as 1, 2,77“? etc., in

unsealed form. For a full discussion of this choice see Ref. 7.
machine and the operator.

Since stored information must be readily accessible at any time, a

measure of the efficiency of a storage system is ’’access time”, i.e., the

time required to withdraw a word from storage. The access time is much

shorter for internal storage than for external storage - on the order of

microseconds as oompared with hundredths or tenths of seconds, or seconds,

1.3 Routines

The sequence of words (instructions and numbers) that

must be introduced into the memory in order to carry out a computation is

called a ”routine”. The process of drawing up suoh a sequenoe of instructions

and numbers is called "programming". The process of translating these numbers

and instructions into the coded form required for feeding into the machine is

oalled "ooding”. Within the maohine, instructions specified in the routine

are interpreted in the control unit, which also supervises their execution,,

The execution involves withdrawing the numbers to be operated upon from

storage into the arithmetic unit. Because of the dual aspect of words

mentioned in par. 1.1, a word which is an instruction at one stage of a

calculation may be called into the arithmetic unit at another stage to be

operated upon as a number, and vice versa. This ability on the part of the

SEAC to modify or change its own instructions is an essential characteristic

of this type of machine.

l.U Four-Address and Three-Address Modes . The SEAC was originally

constructed as a ii-address machine. That is, normally, each coded instruction

includes four address references as well as the operation to be performed

(l) address of first operand; (2) address of second operand; (3) address

where the result is to be stored; and (U) address of the next instruction
“10'

to b© performed. Circuitry was later added (March, 1952) to enable it to

operate in the 3=&ddress mode. In this mode, item (I4 ) above, the address

of the next instruction to be performed is not exhibited. The control

normally proceeds through the instructions in their address “Sequence,,

Conditional transfer of control oan be performed as described in Part II,

Sect, 20,

2,0 Memory, There are many sources where one may obtain as complete

and as detailed a discussion of memory devices as is desired (of„, for example.

Ref. U), However, in order to make this report reasonably self“contained and

because some conception of the prinoiples behind the memory devices aid in

understanding many features of the coding process and of the machine operation,

the essential nature of these devices on the SEAC will be her© desoribed0

It is possible to represent numbers by a series of disturbances (usually

eleotrioal or sonic pulses) following each other at a single point along a

path or a circuit at successive times. It is on the other hand possible to

represent numbers by conditions (usually static voltages) at a series of

points all occurring at the same time, A pure time distribution is termed

"serial” while a pure space distribution is termed "parallel" „ The former

in general is more economical as concerns equipment but involves time duration

not required for the latter,

2.1, Acoustic Memory. The acoustic memory system exemplifies the

serial type of number representation in which numbers are represented as

a succession of digits available at a given place in a time sequence. The

basic unit of the acoustic storage system is the acoustic delay line

(cf. Ref. h, pp, 3Ul"3U8), This consists essentially of a mercury filled
-11 -

glass tub© dosed at the ends -with quartz crystals. These crystals have

the property of becoming slightly deformed tinder the influence of an electrical pulse. Conversely, when one of these crystals is subjected to a mechanioal distortion it emits an electrical impulse. In other words, electrical

energy is transformed by these orystals into mechanical energy, and meohanical

energy into eleotrical energy. This effect is known as piezoelectric” effect.

Electrical pulses representing a sequence of binary digits are introduced

at one end of the tube or ”tank”, These are transformed by orystals through

piezoelectric contractions and expansions into sound waves and transmitted

through the mercury. The receiving crystal at the exit end of the tube

vibrates under the influence of the sonic signals from the mercury, generating

electrical pulses which thorough appropriate circuitry are amplified, reshaped

and then re-circulated through the mercury. Since the velocity of sound in

mercury is very low (about .06 in. per microsecond) compared with the velocity

of an eleotrical impulse this type of device provides means for packing a

great many pulses into a small linear range.

In the SEAC in fact each tube is Zh inches long and is capable of storing

38U pulses or 8 groups of i*8 pulses each. Only the first 1*5 0 f any U8 pulse

group represent information and these h$, as seen before, constitute a word.

Thus a single delay line or "tank” is capable of storing 8 words, and since

there are althogether 6h tanks, this means an acoustio memory capaoity of

512 words. The contents of a tank are available, i.e. may be read one binary

digit at a time, after leaving the tube. The time for the complete contents

of a tank (i.e., eight words) to pass a given point in the circuit is called

one ’’major cycle”. Since the pulse rate is one megacycle a major cycle is
‘12

3dll miocoseccmds, One®eigh1hof this time is called a minor oyole, That

is, tho time for the oontents of a single word to pass a given point is

ii8 microseconds. The interval between the time that a word is oalled for

and the time that it has been read is oalled the "access time". The word

nearest the exit end of the delay line has the shortest aooess time and

that nearest the entranoe has the largest, the average aooess time being

216 microseconds. This value can sometimes be materially reduoed for a

specific problem by special planning of coding taking into aooount the time

of each operation, but this is not always practical (of. Part IX, Scot. 18),

2,2 Hectrostatio memory. Xn the SB&C the parallel type of storage

is realised in the electrostatic memory (of. fief. U, pp„ 35k“370). This

system is oomposed essentially of a bank of kS cathode ray tubes. Storage

in one of these tubes depends on electrical charges placed at discrete points

on the target surface of the tube. Means are provided for charging these

points to desired potentials corresponding to digits 0 or 1, under the influence of the eleotron beam in the tube. Deflection circuits are furnished

for aiming the beam at any desired point. The pattern for the oharges is

ohosen to be a rootangular lattice. At the present time this lattice consists

of 32 points along one side and 16 along the other, so that a single tube

may store 16 x 32 $12 binary digits. The states of corresponding lattice

points, one from each tube, represent a set of k$ binary digits, whioh oonsti®

tute a word. The scheme described is thus oapable of storing 512 words.

Heading and writing oircuits are provided which make it possible to record

or oall for all the digits of a word simultaneously, thus giving the parallel
13“

1

feature. The effective acoess time for this memory is about 60 microseconds

as compared with an average access time of 216 microseconds for the acoustio

2

memory , The use of oathode ray tubes in this kind of memory was first demonstrated

by P. C. Williams [5 ], of the University of Manchester, England. The tubes are

frequently called "Williams tubes", and the memory is usually referred to as

the "Williams memory" (oil Ref. U, pp. 366-370)*

3,0 Input and Output Equipment. In addition to the two types of

internal storage just described, the SEAC has various means of external

storage which are more appropriately discussed under the heading of INPUT

and OUTPUT equipment.

In order for the machine to carry out a sequenoe of computations it

is necessary to be able to communicate to it the routine to be followed

together with all necessary numerical data. Similarly it is necessary to

have facilities for oommunicating results of the machine's computation to

the operator. This communication involves the translation (via one or more

intermediate stages) from one type of word representation convenient for the

coder or operator to a representation suitable for the machine, and vice versa.

Typioal input information has successively the foms of characters on a typewritten page, holes in a punched paper tape, magnetized areas on a wire,

electrical and sonic pulses in the acoustic memory, or charged spots on the

"^During this 60 mioroseconds there have really been 5 references of 12

microseconds each to the electrostatic memory* one cycle of reading or

writing,, and four cycles for regeneration of the pattern,

2

As of this writing memory check circuits are being installed both in the

acoustio and electrostatic memories.
cathode ray tubes in the electrostatic memory. Output information takes

these forms in the reverse order. It is clear that all of these forms

represent types of storage. As listed above they are in increasing order

of accessibility to the machine. The first three are varieties of "external

storage" , while the last two, which have already been disoussed, are examples

of "internal storage". Historically, Teletype apparatus was the first inputs

output equipment to be used with SEAjS, but with the inauguration of faster

magnetic media it has assumed a secondary role. It remains, however, a

necessary intermediate stage in passing from the printed page to the magnetic

wire? i.e. input information must first be manually punohed on Teletype tape

which is then fed into an "inscriber" to make a wire recording. This recording

may be filed away and stored indefinitely until needed, on the SEAC. For reading

wire-reoorded information into the SEAC memory the cartridge on which the

wire is wound is plugged into an input receptacle in the control panel. An

output receptacle is also provided to accommodate a second cartridge for

recording output information. When recording is completed, the cartridge

may be removed and plugged into an "outscriber" which reads the wire and

makes a punched paper tape. Output information may be fed back into the

SEAC by plugging the output cartridge into the input receptacle. It is to

be noted that the inscriber and outscriber are items of auxiliary equipment

not connected directly with the SEAC. Thus the SEAC can generally devote

most of its time to actual computations and relatively little time need be

spent on input and output, A variation on the foregoing procedure consists

in punching input information on punched cards which are then fed into a

"card -to »wire" recording device"

1*. This recording is again ready for filing

1

Currently under construction.
or for feeding into the SEA.C. The SEAC is also provided -with a number of

m&gnetio tape units which are intended for intermediate storage. Each of

these units is equipped with a reading, a writing, and an erasing head, so

that information read out to these tapes at any stage of the calculation are

available1 for recall into the internal memory at any subsequent stage of the

calculation. These tapes are accessible only through the machine. All of

the input and output units may be operated under maohine control. The selection

of the unit to be employed at any stage of the computations is controlled by

the oode and the switch settings on an "external selector" panel which is

associated with the manual controls (of. par. 6.0). A schematic diagram

showing the possible paths for flow of input and output information, and the

interrelation between the SEAC and the various items of auxiliary equipment

is given in Fig. 1.

U.0 Arithmetic Unit, (cf. Ref. 1|, Chap 13.) All of the arithmetic

operations are performed in the arithmetic unit; namely the usual operations

of addition, subtraction, multiplication, and division. The arithmetic unit

is also capable of making either an algebraio or absolute comparison between

two numbers and determining which is the largest. Finally it performs the

operation^ of extraction and logical multiplication. All of these operations

arb described in greater detail in Part I, Sect. 7 and Part II, Sect. 13.

Thq binary point is fixed by the arithmetic unit between the second

and third binary positions from the left (see Footnote 1, pg, 8), Addition

is the fundamental operation in the arithmetic unit and is performed serially;

i.e. , corresponding digits of the addend and augend are added one pair at a

time together with any carry which may have come from the previous steps.
5 ®

0 ti 1 &

fit o

«

"S t* £ &

fit o

tJ

€> 5

§

A* O

•c*«

*i >»

H* Q-1 A* -?
-17

Subtraotion, multiplication, and division make use of addition, and henoe

are also performed in a serial fashion. For this reason the SEAC is said

to have a "serial" type arithmetic unit. In contrast a parallel arithmetic

unit would simultaneously add all corresponding digits of addend and augend,

generating the carries. Another parallel operation simultaneously adds all

these oarries to the initial sum. This may result in further carries in

which case the process is repeated.

5.0 Control Unit. The function of the control unit is to guide the

operation of the machine under the influence of the coded instructions stored

in the memory, Under the supervision of this unit an instruction about to be

performed is transferred from the memory into the " instruction register"

idlere it is held during the time that it is being interpreted and executed,

(the transfer into the instruction register does not clear the memory cell

from which the instruction was taken. )

6.0 Manual Controls . Hoarly all the operations of the SEAC may be

controlled from a central group of control; panels. These panels include

facilities for clearing the memory and control circuits, for starting and

stopping the machine, and for causing the machine to proceed one step at a

time through a program. One of the panels of this group is the "external

selector" panel mentioned earlier. Another contains the receptacles for

input and output oartridges together with necessary control switches.

Adjoining the oontrol panel is Teletype equipment for input and output.

Hear by are the various magnetic magneto tape devices together with their

oontrol switches.
7,0 Operations. The operations that the SEAS is capable of performing

are described more fully in Part II, Sept. 13. Here they are classified

into five main categories.

7a l Arithmetic Operations .

a. Addition and Subtraction.

b. Multiplication. The product F of two Ut binary digit numbers

A

B - b

*-1% *1 V and

-i V .

b. 1w2**° w

l|2

iwher^-eaeh a»i and b^ is 0 or 1^ is an 88 binary digit number*

p P„3 F-2 ?-l P/I . Pi Pg 0,0 PltE P^3 • « • Pq^p

idlere each is 0 or 1. On the SEAC there are three types

of multiplication operations*

'(l) The ”high order” product of A and B is

P

H

’ P-1i p*v, h

the *3 high order rounded” product of A and B is

P

H

* p

!i3*

2

•hZ

(iii) The "leer order” product ©f A and B is

P

L

00-P

il3 P

Ui ••• P

8l*

Note 8 In all oases the digits p^j and p^ are lost. Also, in all

cases the sign of the resplt is that ef the high erder

product.

o. Division. This operation yields the unreunded quotient.

The remainder does net appear.
»19

N, B, There is n# automatic over-flow indication for any of

the above operations,

7.2 Comparison. Beth algebraio and absolute.

7.3 Logical Operations .

a, Logical transfer. Shis instruction enables ©ne to replace

any designated portion of a word by the corresponding portion

of another word.

b. Logical multiplication. Digit by digit multiplication of

two numbers.

7.U Input and Output Operations ^ Tape or Wire Movement Operation®.

Words may be read into the internal memory from any of the input-output

media, or via© versa, in one word or in eight word blocks. Input and

output media have been described in par, 3.0. The selection of a particular

medium is indicated by the oode and the switch settings on the external

selector panel,

7. 5 Base Operation. This operation has different meanings depending

on whether it is used in the four address mode or three address mode. In

the Ij-address mode, it has the effect of translating references to certain

addresses by any prescribed amount, and also provides a means of switching

control. In the 3*addresa mode it provides a way of switching control only.

The base operation in the two modes will be described more fully in Part II,

Soots. 1$ and 20,

8.0 Coding, Coding for the SEAC may be done either in the U-address

or in the 3~address system. These systems will now be described.

8.1 Coding in the H-'Address System. In the Is-address system an in®

struction word has the following compositions
Symbol vC fi Y £ Op Sign

Io( of Binary

digits xo 10 10 1© 4 l

where each 9t the k Me letter® represents m address la the memory and

% stands for on eptHti&vn, St« plus and minus arc represented by 0 and 1

respectively, thus «a inetruetien tMM&cfa of a sequence of binary

digits^ the extreme right tod digit Indicating the sign. Since each

address is represented by 10 binary digits s there are 2 10 * 1024 addresses

possible* which ceittoide® f&th the size of the sseaery* Similarly, there

are 2^ * 16 possible For operations falling into the categories

of pars* 7,1 and 7,3* the Interpretation of the above instruction las the

operation Op is applied to the contents of o< and fa « the result is put

into address 'V j the next instruction is found in S „ The cemparison

operations In par, 7,2 provide a way of selecting between two possible paths

for the control to follow, For example, in algebraic comparison, if the

number in <^\ i® less than that in fa , then the control goes to IT ; otherwise it goes to S , ta the case of an absolute eerapariaen, the

comparison is mad© between absolute values, For the input and output

inetructions in par, ?, 4 the operations are performed on blocks of one

word or eight words depending on whether fa is odd or even, respectively.

In the case ©f an odd fa one word is called into "IT* on an input instruction

©r read out ©£ "tf on an output "Instruction, Por operating ©a a block e£
«21 »

eight words must t>o & multiple of eight and then the addresses affected

by the order are K , 1 ..., 7f * 7. The designation of input or output

unit called for is dene partly by the code and partly by the external selector

twitches, A Minus sign after an instruction is normally a signal to the

machine to halt after completing the instruction. However, with appropriate

switoh settings en the manual panel it is possible either to over-ride all

oeded halt signals, or to over-ride all halt signals except those associated

with input and output instructions.

8.2 Coding in the 3

CTAddress System. The 3-address system for SEAC

was designed with a special ’’floating address feature”, which will be des«

eribed below. A 3~address instruction has this composition:

Symbol /3 a b c d Op Sr No. of

Binary

Digits

12 12 12 1 1 1 1 k 1

Xn this system the , /S } and 7T addresses play the same role as in

the U-address system. The absence of a £ address is explained by the

fact that the control normally proceeds sequentially through the addresses

of the memory. The control may be transferred or ’’jumped" however, to the

^

address of an appropriate comparison instruction just as in the

ii-address system. Associated with the control are two "address counters",

C

o and C^. The 0 and 1 values of the single binary digit d are used te

select the first or tho second of these oounters. Normally eaoh time an

The eight addresses If, b"* 1, ...,

V* 7, where 0 (mod. 8), belong

to a tank (see par. 2.1). The tanks are numbered (in decimal) 0,1, ...63.

The number of the tank to which an address belongs is the integral part

of tho quotient upen division by 8.
“22 <=

tnstrmo'tien Is perfemed til# counter selected is advanced one unit

indi eating where the eenirol goes next, also, is the

counter selected, 3tn transferring' centre! by means ©f a eemp&riaen

(either algebraic ©r absolute} iftetrttot&Mt, the counter selected by d

is set t® the mime V" of the comparison instruction, and the centre!

gees to the contents #£ this V* . this is the only way t© select &j,

initially. Thereafter tfj remains selected as long as d * 1, The oeatrel

returns to €

0 iwmodiately after m instruction appears in which d * 0,

ae ©esapfiri sen instruction being necessary in this case.

the digits m&y ho called fleshing address Indicators®

corresponding to addresses , j$ t IT , respectively. For example, if

a * 0 S then in the control united is interpreted as an absolute number,

while if a » 1, then o( is interpreted relative to the address in which

the instruction being executed appears. Similarly for b and o,

The fact that 12 binary digits are provided in the 3~a-ddreS3 system

ftp the f & } and V addresses moans that with this system it i®

possible t© expand the memory of the SfA® from the present 2^ words te

12

2 words, The floating address feature, and the presence of the two

fddress counters 4Z& and facilitate the handling of subroutines in the

3«address system. This will be treated in more detail in Part U, Sect,

20 of this manual,

8 C 3 Petting a Routine inte the Me chine. The question remains hew

to get a routine into the machine. A feature of SBt€ design is that when

the STAIT button is pressed after the memory and control circuits have been

cleared preparatory to starting a new problem, the first instruction perfumed
=23=

i® a call for eight words ©f information These eight words would normally

•\T "jtJ

' *• ./ consist of a short routine for reading in the main problem routine and then

• v... .

" V ; i " .

’

*•. , -

1 j, .v; . k sending the control to this main routine0 \

9.0 Subroutines, Certain prooesse® such as centersi on of numbers ’ amrrmintm V • “

.

' 5 i r,, from binary t® decimal and vice versa, calculation of certain, common trans»

• \

'

, . •.

, oondontal functions (e„gc sin x, e , et©„ ), arithmeti© operations with numbers

, -'* it

expressed* in.; floating binary point form, etc, occur in a great many problems,,

! ' Ji

v

• For processes of this sort it is convenient to maintain a library of precoded

su nes” 0 Such a library is.

„

existence for the SEA.C and is being

• .

•

. o, '>• steadily augmented [6 Jo The subroutines making up this library are punched

’

• •• •••• W 4 .... on short strips ©f teletype tape and filed for ready usec Programmers are

... ....... > . thus relieved of the task of coding processes' of the type described above

,

:

' m2

when they occur, but need merely t® draw the required subroutines from the

file and copy them by means of mechanical reperforating equipment onto the

-

• • ' 1 v/v C-i'i -s

.

• .

' v,. |

• , <*-/ master routine tape, Duplication of coding effort is thus avoided, the

possibility ©f coding errors is reduced, and much time is consequently saved0

The library subroutines have been carefully cheeked so that the users may ' - . * fry feel secure in using th®m0

. ...

'

• '"<t Subroutines are coded without reference to the actual positions they V '

.

• *

- will occupy in the memory0 Necessary changes in subroutine instructions to

make them conform to their actual positions are made by a special prencoded

preparatory routine (see Part n, Se©tc 19 of this report

)

0 Associated with ©aeh subroutine in the library is a description.

including a list of specifications which briefly summarizes the pertinent

information concerning the subroutine, such as title, file number, number
®f mils occupied, where the argument gees* where the result appears, »toc

finis the user can determine qui ekly what the subroutine dee© and hew t®

use it. 4 mere detailed explamtien together with the cede itself is also

included in the subroutine description, sc that a mere careful study may be

made if necessary, A list ©f SM€ subroutine descriptions i® included in

the bibliography at the end of Fart 11 0

Reference©

l a NBS Interim Computer, Technical Hews 'Bulletin,, National Bureau of

Standards, yc. 33, ppc 16-17, (F@b c 19ii9),

2. SBA€, The National Bureau of Standards Eastern Automatic Computer,

Technical News Bulletin g National Bureau ©f Standards, v. 3i*, ppa

1-8 (September, t9$D ) c

3, NBS Electronic Computer® Laboratory Staff, The Operating Characteristic®

©f the SHAC, Mathematical Tabl es and Other Aid© to Computation. v„ IV,

,

a®, 32, ppc 229 , 230 (October, 19£D) 0

ho Engineering Research, Associates, Highspeed Computing Bern ce©

McGr&w Hill B©@k £se , 19£>c

5. Williams, F0 C. and T c Kilburn, A Storage System for Use With Binary

Digital Computing Machine, Proceedings of the Institute of Electron!©

Bfagineers a Part III, pp0 81=100 (March, 19i*9)

6 0 Le^in, J0 H0 , Construction and Us® of Subroutines for the S2AC,

Proceedings ©f the Association for Computing Machinery. (May 1952).

f0 Lubkin, S.

, Decimal Point Location in Computing Machines,

Mathematical Table© and Other Aids to Computation. v0 HI, no. 21,

pp0 (January, 19i*8) 0
’2 Sr

8. Bartree, B. R. * Calculating Instruments and Machines , in© University

of Illinois Press, 191*9.

9„ Alexander^ 3, H. , The Rational Bureau of Standards Bastera. Automatic

'3©mfut©r, Review of 11 act real o Digital Compute rs j Joint M EE~XRE

.Boraputer Conference , Feb, 19 £2.

. f

1 '

)
26-

PART II

PHOGHAMMOO iSD CODING FOB SMC

10 0 Systems ef Humber Representation, Several number systems come inte

play in connection with. SEAS programming, The principal ©nes, of course, are

the decimal and the binary. In addition, however, the ”®otalM (base 8), and

"hex&deoiml98 (base 16) h&ve a number of convenient feature®

1

„ These systems

^11 be described in this section*

10.1 Decimal System, In the usual manually performed arithmetic, numbers

are represented in the decimal system. In this system a number is represented

by ordered sequence of character®, ©ailed digits (in remembrance of the

©ystem 8 ® origin). Successive characters occupy successive horizontal positions

and have unequal weights in the ratio of 10 to 1 for the same character while,

in any on® position, ten different characters ar® used to present the numbers

0 through 9, A similar system can be used in machines. For example, ten

lev©!® ©f voltage can b© used to represent the numbers 0 through 9 on each

©f a group of lines with each of which is associated a power of 10o

10.2 Binary System. A more common number system for digital computers

is the ®binaryw

. In this system (used ©n the SEA€), there are only 2 character®,

0 and 1, representing th© numerical values of zero and uniby, and different

positions are associated with different powers of 2, The use of only 2 types

1

The words “octal** and ’’hexadecimal*” are hybrid words which have become

established through usage. Though actually **octaraI“ or "octadic” , and

"sedeoimal** or “hexadeoadic” would have been preferable, this Handbook

will conform to the established parlance.
of digits aakes 'tikis system particularly convenient for representation by

oertain types of eleotrlcal and Mechanical devices; e.g. the digits 1 and

0 say be Made to correspond te the conducting and non«oonduoting states of

a vacuum tube, te the presence er absence of a pulse, to the closed and open

states of a relay, etc. Moreover, rules of computation are particularly

simple for the binary system in view of the existence of only 2 types of

digits and can, therefore, be easily mechanized.

10. 3 Comparison of Pooim&l and Binary Systems . To emphasize some

similarities as well as differences between the decimal and binary systems

oeaelder the following examples of number representation in the two systems,

respectively

(a) 38.701 s >101 8*10° 7-lcT

1 0*10"2

l*lo“3

(b) 1011.01 S 1* 2^ * 0*22

* i* Z

1 + 1*2° * 0*2”^ 1*2“2

. In (a) the point is called a "deoimal point”, and the "base” or "radix" is

100 In (b) the point is called "binary point", and the base or radix is

2. In both cases the deoimal or binary point serves to separate the integral

and fractional parts of the number. In arithmetic operations in the binary

system, the binary point is handled quite analogously to the decimal point,

as will be illustrated in the examples which follow. Systematic methods for

converting from binary to deoimal and vice versa will be discussed in Sect. 11„

10. U Arithmetic Operations in the Binary System. Addition in the

binary system uses the following relatiens
“18’

© * 0 - 0

1 1 * 10 (0 and carry 1),

With these rule# for individual digits, it is simple to add any two binary

number#. For example, 11001,01 may be added to itself as follows 8

11001.01

11001,01

II 1 1 carries

110010.10 sum

fhi# result could, ©f course, be obtained immediately by noting that the

addition of a zero to tho right of an integer in the binary system causes

multiplication by 2 analogous to the multiplication by 10 resulting from a

similar operation in the decimal system.

Subtraction is equally simple, using the relations

0°0*1»1I0

1 - 0 » 1

„ 0 - 1 1 and borrow 1 .

For example, .1101 may be subtracted from 1.1010 as follows*

1.1010

,1101

111 borrows

mrmfiiina ii iTwiiro

. 1101 difference

The Multiplication Table in the binary system is much simpler than in

the decimal system end is given by

0x0®0xl“lxQ»0

1 x 1 • 1
-29-

Exoept for this simple table and the above rules for addition,

multiplioation in the binary system is performed in the same way as in the

decimal system. For example, 1.101 may be squared as follows:

1,101

1,101

1101

11010

1101

First partial product

Second and third partial products

Fourth partial product

10.101001 Final product

Division is also accomplished in a manner similar to that used in the

decimal system. For example, 1010.1100 is divided by 11.01 as follows:

11.01 ) 1010.1100 ( 11.01

1101

10001

1101

10000

1101

11

giving a quotient of 11.01 and a remainder of .0011,

It should be noted that sinoe 2° is an unrepeated factor of 10

n

the

process of conversion of a binary fraction into deoimal form terminates

with the same numbers of decimal digits after the decimal point as there

were binary digits after the binary point. However, 10 is not a factor of

any power of 2; hence, in general, the binary fraotion equivalent to a

given decimal fraction does not terminate after a finite number of digits.

It a limited number of digits were to be retained and the remainder dropped,

it would result in making most numbers too small with an average systematic
-30 -

error of about half in the last retained digit, The same difficulty arises

whenever a value is given to more digits than can be retained. The process

of multiplication, for example, produces more digits, in general, than were

present in either of the original factors. The same is true in division;

in fact, most divisions yield quotients which cannot be' exactJy expressed

in any finite number of digits. To terminate a number after a given number

of digits, the familiar "Round-Offn procedure is commonly used. This consists

of choosing that number having the desired number of digits which is olosest

to the original unrounded value, and, in the special o&se where the latter

lies exactly midway between two consecutive numbers of the desired type, of

choosing the higher in absolute value. This is particularly simple in the

binary system since it merely requires that, for round-off to n digits, we

take the first n digits and add uniiyto the last place if the (n+l)st digit

is a one, adding nothing if it is a zero, inother way of stating this is

that we add the (n«l)st digit to the last place of the number formed by the

first n digits. The bias remaining after suoh round-off is negligible*.

For example, round-off of the binary number 1011,00011100.., by this method

gives, for 2 through 6 digits after the binary points

1011.00

1011.001

1011.0010 ?

1011,00100

and 1011.000111 respectively.

1

For a full discussion of round-off error, of. Ref. 2.
•31

10,5 Octal and Hexadecimal System# „ On© difficulty of the binary

system is the large number of digits required as compared to the decimal

system where equivalent accuracy is desired. Since XogglO — 3„3, the former

requires about 3.3 times as many digits as the latter. The fact that only

the two digits 0 and 1 occur, while advantageous arithmetically and in the

design of a computing machine, makes typographical errors likely when typing

a long sequence of digits. It is, therefore, advantageous to group several

binary digits together for convenience of handling. If each 3 binary digits

3 are handled as a unit, we have the number base 2 ® 8 and call the resulting

number system the "octal number system" . This system has only about 1.1

times as many digits as the decimal for equal accuracy, involves ne new digits,

and eenversiea between it and the binary systdm is trivial, using the following equivalences $'

Octal

1

2

3

h

5

6

7

000

001

010

Oil

100

101

110

111

Obvieusly, ne 8 er 9 is used in the octal system. The arithmetic for

this system is very similar te that for the decimal system, noting that 8

i
-32

(decimal) 53 10 (ootal), 9 (decimal) * 11 (octal), 10 (decimal) * 12

(octal), etc. For many purposes, however, it is preferable to oonsider

each octal digit as merely a shorthand representation for 3 successive

binary digits.

Similarly if each U binary digits are treated as a unit, we have the

number base 2^ * 16. The corresponding number system is the "hexadecimal

number system". This system requires approximately .83 times as many digits

as the decimal system for a given accuracy. Sixteen characters are required

in the hexadecimal system for number representation. We introduce 6 new

characters. A, B, F, in addition to the usual deoimal characters and

have the following equivalences:

Binary Hexadecimal Decimal

0000 0 0

0001 1 1

0010 2 2

0011 3 3

0100 h k

0101 5 5

0110 6 6

0111 7 7

1000 8 8

1001 9 9

1010 A 10

1011 B 11
33-

Binary Hexadecimal Decirs

1100 0 12

1101 0 13

mo X Ik

1111 F 15

for purposes of coding the hexadecimal system has been found to

be more useful than the ootal and has been generally adopted,
11 c 0 Conyers! on Between Number Systems,, It is convenient and useful

to discuss this subject first in terms of a number system with base p and

another system with base q0 Two distinct cases of conversion from p^&ry

to q=ary arises (a) using p-ary computation! and (b) using q-ary computation,,

It oan then be seen at once that the method embodied in case (a) applies to

(l) conversion from decimal to binary using decimal computation! and (2)

binary to decimal using binary computation. Likewise case (b) applies to

(l) conversion from decimal to binary using binary computation! and (2) binary

to decimal using decimal computation. Since a human computer working at a

desk calculator generally prefers the decimal system for computing purposes*

he would convert from ono system to the other by methods (&,1) or (b,2) 0

But the SS&C being a binary computer* would use methods (a, 2) or (b,l) 0 In

any event only two of these four methods are essentially distinct, as noted

above. The integral parts of the numbers will be separated from the fractional

parts, and each part will be treated separately.

11.1 Conversion From p-^ary to q°=ary Using p°ary Computation. Consider

first the conversion of an integer P. This number may be represented in

q»ary as follows?

(1) P “ a

fc q

k

+ ... + a

2 q

2 a

x q + a

Q

, a^O,

where the are integers in the q^ry system, and are to be determined

together with k„ The calculation is accomplished by successive divisions

by q in the following manners

P/q - n

0+a^/q - a

fcq + ... + &

3q +a

2 q+a

1

+a

Q/q

n^q - nj+mj/q » &

k

q

k“2 * • • . * B.^q+a.^&^/q

n

x/q * ng+ffig/q * a

fcq * . .. e^+ag/

q
W* • \Vq * a/q

In each step, the quotient and remainder are integers, and < q. then a^ * (expressed in q-ary) sinoe all terms on the right exoept for

the last are integers, the prooess terminates when for some i * k, n^ 0,

R&cample 1. Convert the decimal number P - 213 to binary using deoimal

computation.

Solution. In this case p

* 10, q* 2. The calculation may be arranged as

follows

2) 213 Remainders ;

2) 106 1

2) 53 0

2) 26 li

2 ) 13 0

2) 6 1

25 3 0

2 ) 1 1

0 1

The result of the conversion is therefore 11G1O101. This conversion is

an example of case (a,l) in par, 11,0.

Example 2. Convert the binary number P * 110101011 to decimal using

binary computation.
>36“

Solution, Sere, p

* 2, q 10 ( a 1010 in binary),

1010) 11010101 .Remainders %

1010) 10101

1010) 10

0

11 (* 3 in decimal)

1 (" 1 in decimal)

10 (* 2 in decimal)

The result of t&e conversion is 213. This is an example of case (a,2) in

, -O' par. 11. 0^ and illustrates how the conversion would he accomplished in the S£AC.

The conversion of a fractional quantity is performed similarly, A

fraction P may he written in q-ary as follows-t

( 2 ) *1 »2

p * a-l<J * tt-2 « *»..9 *

In this case the a^ are determined by successive multiplications by q thus;

*» * *-l

*

‘„2 O * ».

3

«s‘2 ... 3 a_

x n

x

n

~l *

* a

-2

4 a

~3 * %

^“

2 4 — 5 %

* n

„2

a

-2 q * a

-3 * %

** 4 a-$ q

’2

4 ... 5 a *

« n

etc.

At each step the corresponding a^ is obtained as the integral part of the

product. Only the fractional part of this product is used in the next

multiplication.

Example 3. Convert P * .213 to binary using decimal computation

(p=»10, q«2).

Solution, The calculation is as follows;
-37'“

Integer carry i .213

x 2

0 , 1*26

x 2

0 .852

x 2

1 . 701*

1

0

1

1

i

! 0

1

x 2

.1|08

x 2

.816

x 2

.632

x 2

. 261* * 2

.528

x 2

•to.,

$o that .213 * .001101101., , la binary fora.

Example 1*. Convert the binary number P - .001101101 to decimal

using binary computation (p-2, <j»10).
“38“

Solutions

Integer carry?

10 (“2 in decimal)

1 (•! in decimal)

10 (“2 in decimal)

1000 (®8 in decimal)

.001101101

x 1010

,001000010

X 1010

.010010100

X 1010

. 1110010

.1110100

The converted result is thus ,213 to 3 decimal places.

11.2 Conversion From p~ary to q~ary Using q-ary Computation.

integer P in (l) would have the following form in p»arys

The

* - v'H-/"1

* ••• * v^o

This number could also be written

£ * .p

i=0 S"1

s-i

P*p(...p(p(p*b b ) + b ) # -* b ) + b .

Using the q»ary representations of p and K (i=l,..,,s) and performing the

indicated operations starting with the innermost parentheses, the q=ary

representation of P is obtained.

Ebcample 1, Convert the decimal number P 213 to binary, using binary

computation.

Solution. Here, p

- 10, q

* 2; bg * 2, b^ - 1, b^ * 3, The calculations

are given in the left hand column of the following tables
-39'

Binary Decimal Notation

10 2 b

2

x 1010 x 10

10100 20 b

2 P

+ 1 + 1 + b

\

10101 21 b

2 p

+ b

x x 1010 x 10 .. P

11010010 210 p(b

2 p

+ b

x

) + 11 * bn 11010101 213 pCbgP + b

x

) + b

Q

Wbxb the binary equivalent of 213 is 11010101. This examples illustrates

the method used by SE1C in decimal to binary conversion [9.U]«

The computation may be laid out in the following convenient arrangement?

m b

2-m

(Dec.)

7 V ^ ‘)2~i p

i*0

P 2 Vi P^1

i^Ot

0 2 1010 10100

1 1 10101 11010010

1 2 3 11010101

L —

Example 2. Oonvert the binary number P -- 10111 to decimal.

Solution. Here p 4 2, q. * 10; b^ * 1 # b^ » 0. b

g

« 1 # b

x = 1,

bn

e 1. The calculations are as follows?
m I

1

m . A m-i

M Vi p

jj“T m-ii

p S

0 1 i 2

1 0 2 U

2 1 5 10

3 1 11 22

k 1 23

The result is thus 23.

If P is a fractional quantity, as in (2), we proceed in a similar

manner. Supposing that P is a terminating fraotion when written in p~ary,

it may he represented in the following ways:

p - b.

1

p-1^p-2

»...»b_

sp-» - jrz ’>-

( .-i)'r(s'i)

- i/p(... l/pCi/pCh/p h

seol ) b

s-2 ) ... b^.

* i ~ « • A A Again, making use of the last of these representations, and starting with

the innermost parentheses, the indicated calculations are performed using

<l-ary representations.

V

t Example 3. Convert the binary number P * ,001101101 to decimal

(p-2, q»10).

Solution:
a ^-(lO®a)

h

~(m~i)

i^O “(9-d)P

-(m-i)

1/p b«(9„i)P

i*0

1 1 1 .5

2 0 o.S -25

3 1 1.25 .625

U 1 1.625 .8125

5 0 0. 8125 .1*0625

6 1 1.1*0625 .703125

7 1 1.703125 .8515625

8 0 0.8515625 .1*2578125

9 0 0.1)2578125 .212890625

The result of this conversion is ,212890625,

Example h„ Convert the decimal number P ,213 to binary (p*10,

q-2), giving the result bo 9 places.

Solution,

a *-( ii^m)

m~l / . \ £ * §

1 3 11 .0100110011

2 1 1,0100110011 .0010000101

3 2 10.0010000101 .001101101

The result is ,001101101.
ll e 3 Conversion Using Known Equivalents . The number to be

converted may be broken up into a sum of simple numbers whose q—ary

representations are known or tabulated. For example a conversion table

for the decimal digits and for positive and negative powers of ten would

in many cases be a highly useful tool. To convert 213, one would then

merely have to determine from the table that 3 (decimal) * 11 (binary),

10 (decimal) “ 1010 (binary), and 100 (deoimal) * 11Q0100 (binary). Then

213 - 2 x 100 + 1 x 10 3; i.e.,

11001000

1010

11

11010101

so that 213 " 11010101 in binary.

The examples in the foregoing paragraphs have all been in terms of the

deoimal and binary systems. For purposes of hand computations, however, it

is easier to work in terns of decimal and ootal, or deoimal and hexadecimal

the latter being more appropriate for the SEAC. The conversion from hexadecimal or octal to binary, or vice versa, is immediate,

11, U Bxeroises.

1. Using a decimal computation oonvert the following integers

to hexadecimal: 1023, 18?56, 783113.

2. Using decimal computation check the results of Ex. 1 by

converting back to decimal.

3. Using hexadecimal computation oonvert the integers of Ex. 1

to hexadecimal.
li, Using hexadecimal computation check the results of Ex. 1

by converting back to deoimal,

5, Using decimal computation convert the following numbers to

hexadecimal: .1, .0023577, 73.U0961.

6. Using decimal computation obeok results of Ex, 5 by converting

back to decimal.

7* Using hexadecimal computation, convert the numbers of

Ex, 5 to hexadecimal.

8, Using hexadecimal computation check the results of Ex, 5

by converting back to decimal.

9, Using the decimal « hexadecimal equivalences 10 * A^ 100 * 6li,

1000 » 3E8, 10000 * 2?10, 100,000 - 186A0, convert the following numbers to hexadecimal: 1023, 1875®, 763113

10.

Using the hexadecimal - decimal equivalences 10000* 65536,

1000 - U096, 100 - 256, 10 - 16, 1 * 1, check the

results of Ex, 9 by converting back to decimal.

Answers

1. 3FF, U9iiU, BP309

5. 1999... , .009A83A, i*9.68DC3
12.0 Representation of Information on Input and Output Media.

As indicated in Part I, the unit of information is a "word” which may be

either an instruction or a number. It is convenient in writing a word to

group the binary positions into a sequence of 11 hexadecimal positions,

followed by a sign position, The reasons for this are: (l) Hexadecimal

notation is much more compact, more rapidly written, and less subject to

errors in writing or transcription than binary notation. (2) Hexadecimal

notation is well adapted for use with the auxiliary equipment, particularly

the Teletype equipment which uses a U-hole code; i.e. , information is punched

on Teletype tape in groups of k binary digits. The Teletype keyboard

characters are also in hexadecimal. Pig. 2 shows how successive hexadecimal

characters as well as plus and minus signs, space, and carriage return

symbols look when punched on Teletype tape. The tape engages with a sprocket

in the reading unit by means of the small perforations to the left of the

oenter. Note that a plus or minus sign is represented by a single binary

position.
TELETYPE

o |

o 0

s> 0

o 0 0

o 0

o 0 0

o 0 0

o 0 0 0

0 o

0 o 0

0 o 0

0 o 0 0

0 o 0

' 0 o 0 o

0 o 0 0

0 o 0 0 o

0 ©

0 0 o

0 o

0 0 o 0 0 0

BINARY

0000

0001

0010

0011

0100

0101

0110

0111

1000

1001

1010

1011

1100

1101

1110

nu

0

1

KEYBOARD

CHARACTER

0

1

2

3

k

5

6

7

8

9

A

B

C

D

E

F

Space

Carriage Return

Fig, 2, Representation of Keyboard symbols on Teletype tape
In input or transcribing operations th© Teletype tape moves into the reader

in the direction of the arrow, so that in the figure, the bottom characters

would be read first.

In representing numbers on input and output media it must be kept in

mind that the SEAC has a "built in" fixed binary point, between the second

and third binary positions from the left (See Footnote 1, Part I, pg, 8),

This means that only numbers less than k in absolute value can be represented

in "unsealed" form. The location of the binary point is immaterial in adr '

dition or subtraction operations, but it is significant in multiplication

and division. In the representation of instructions, it is ignored

(of. Sect. 13).

12,1 Teletype Tape Preparation. In preparing Teletype tape, it is

necessary to punch 13 characters per word: a space character, followed by

11 hexadecimal characters, and a sign. Any character at all may be punched

in the spaoe position. It does not affect the contents of the memory.

However, for use with auxiliary equipment it is desirable to punch either

a carriage return symbol, or a "plus" symbol in this position. Fig. 3

illustrates the punching of two numbers on Teletype tape: the number on

line 3 of Fig. U, and the number ADF8£ U5&A2 C- (the sign is customarily

written after the hexadecimal or binary representation to conform to the

representation within the machine), whose decimal equivalent is

-2,71828 18281* ^90 ~e (of. par. 12 . 2 ). In Fig. 3 a plus sign has been

used in the space position in the first word, and a carriage return in the

second word.

t
-U7-

0 0 0 0

00 0000 00000 00 00

009000000000000000000000000

o 00 0000000 0

0 00000000 00 000 0000000

Fig. 3* Number representation on Teletype tape

Teletype punching is a preliminary step required, for putting information on any input medium. If the input medium ia to be magnetic wire,

the information must first be punched onto Teletype, then read from this

onto the wire by means of auxiliary apparatus (the " ins crib er" )

.

12.2 "Machine Hexadecimal11 . Care must be taken in preparing hexadecimal

representations of numbers for punching on Teletype tape, inasmuch as the

representation required for Teletype punching differs from the "true hexadecimal" representation obtained by the methods of Section 11. For example,

the number tt * 3 * 1^159 26535 69S appearing in line 1 of the tabulation in

Fig. b, when converted by any of the methods already discussed, either to

binary or to "true hexadecimal", yields the number shown on line 2 or line

b, respectively. Assembling the bb- binary digits on line 2 in groups of U as

shown (ignoring the binary point), and substituting for each group the

corresponding hexadecimal digit, the representation on line 3 is obtained,

and this is what would be punched on Teletype tape for purposes of feeding

into the Teletype input or for transcribing onto magnetic wire . This is

also what would be printed by the output typewriter if the machine were asked
“1|8 “

to print the contents of some addresp in -which the number on line 2 were

stored. It is referred to in the UBS Computation Laboratory as the ’’machine

hexadecimal" representation as distinguished from the "true hexadecimal"

representation in which the "hexadecimal point" separates the integral and

fractional parts of the number.

1 Decimal 3.1U139 26535 898

2 Binary 11.00 1001 0000 1111 1101 1010 1010 0010 0010 0001 0111

3 Machine

Hexadecimal C 9 0FDAA2217

h True

Hexadecimal 3.2 k 3 F 6 A 8 8 8 5

5 Binary Coded

Decimal 0011 0001 0100 0001 0101 1001 0010 0110 0101 0011 0110

Fig. 1*. Forms of number representation

The binary point does not appear explicitly in any punching or printing

operation, but it is always understood to be between the second and third

binary positions from the left. Ignoring the binary point it is seen that

the machine hexadecimal form may be obtained from the true hexadecimal by

multiplying the latter by U, and vice versa.

To convert a number from decimal to machine hexadecimal it is convenient

to use a slight adaptation of the method of par. 11.1s Multiply by ij. to

get the first hexadecimal digit, and by 16 to get succeeding hexadecimal

digits. The converse problem is to interpret decimally a hexadecimal form
printed out by the output typewriter. To perform this conversion, the

"hexadeoimal point" may be assumed to be at the extreme left. Convert

this fractional number to decimal by any of the methods discussed in

Seot. 11, and multiply tha result by U, This is the desired decimal

equivalent,

Kxeroises t

1, Convert the following numbers to the machine hexadeoimal form

for punching on teletype taper 3.209125, 10-3,

.15915 U9U31 218

2. Convert the following numbers, assumed to have been printed out

by the typewriter, to deoimal: 1090? DC192 $, OOA3D 70A3D 7,

66666 66666 6.

Answers

1. £33621* DD2F1 B, 00106 2l*DD2 F,OA2F9 836ED 2

2. .25881 90i*5l 000, .01000 00000 000,1.60000 00000 000

12,3 Binary Coded Deoimal Representation. In general it is desirable

to have facilities for feeding input data, and receiving output data in

decimal form. This may be done by representing decimal numbers in "binary

coded deoimal" form. In this representation, eaoh deoimal digit is represented

by a group of four binary digits. For example, the number on line 1 in

Fig. U in binary coded decimal form would be written as shown on line 5*

Since deoimal and hexadecimal notations are identical for digiti 0, 1, . ..,9,

the Teletype apparatus would here print 3 li*15® 28536, It should be noted

that in a single cell a number can be represented in binary coded decimal

form to at most 11 significant deoimal digite. On the other hand.
the hk digits of a number stored in binary form, as on line 2, are equiva»

lent to slightly over 13 (i.e.

,

i 3. 3) decimal digits (line l)a A

subroutine (decimal to binary conversion [9

U I) is available to convert

from binary coded decimal form to binary. Another subroutine (binary to decimal

conversion 19. UJ) converts from binary to binary coded decimal.
13.0 Instruotlon in U-Address System. In this and the following

section* the discussion will be primarily in terms of the It-address system,

since that is the system, which was first installed, and which has been

used almost exclusively to date. Most of the discussion, however, will also

apply to the 3*address system. The 3“*address system has been described in

Part I, par. 8.2, It will be discussed further in Sect. 20,

In the headdress system the form of an instruction word iss

1st

address

2nd

address

3rd

address

iith

address

Opera"

_ . . tion Sign

TJsual Notation gC V <5 Op *

No, of Binary

Digits 10 10 10 10 U 1

The binary point has no significance in an instruction. The sign is

usually plus. A negative sign at the end of an instruction will oause the

raaohine to halt after the execution of the instruction, provided the switches

on the manual panel are properly set. The point at which such a halt is

programmed is called a "breakpoint”.

The symbols , S stand for 10 binary digit addresses, ten

positions being required to refer to 2*^ * 102lj addresses. Operations in

both the 3*+- and U-address systems are represented by a k binary digit (1

hexadeoimal digit) code. This code is fully described in the accompanying

table. In this table and elsewhere in this Handbook, the notation (x)

means "the contents of address x”.

S3'
Designation

of

Output

medium

is
extreme

left

hand

digits

in

the

product

are

always

zero

(cf„

parlU„5).
13.1 Ways in Which an Instruction May be Written, An instruction maybe written down in a number of different ways, all equivalent, depending on

the tastes of the coder. Some of these are illustrated in Fig, 5< Line 2

illustrates an instruction in binary form, and it is seen to conform to the

composition given in par, 13, 0 . this representation corresponds most closely

to th® form in which the instruction is stored within the machine? i„e,

,

l

B s and 0

s ® corresponding to pulses or no pulsqs, respectively. However,

in coding a routine, it is inoonvenient to write instructions directly in

binary. The binary representation is long and it is easy to make errors in

writing down, reading, or transcribing a lengthy series of O's and I's, It

is more convenient to number the addresses and to code in decimal or in hexa~

decimal. It is easily seen, for example, that the instruction on line 2

could be written as on line $ in decimal, or as on line 1* in hexadecimal,,

In any case, however, before punching the oode on teletype tape, it would

first be necessary to rewrite the code in appropriate form. Just as in the

case of numbers, this appropriate form is referred to as ”machine hexadecimal”

and is illustrated on line 3, It is obtained as in par, 12,2, by dividing

the word into eleven groups of four binary digits each, and a sign, and

substituting for each group its hexadecimal equivalent. This representation

is also often called the " composed form” of the instruction. The "true

hexadecimal” representation on line 1*, in whioh each address is written as

a group of 3 hexadecimal digits, is also frequently called the ”decomposed

form” of the instruction.
-57-

X notation V s Op s

2 Binary 0111001001 0111001001 0100101000 liuioo&o 0101 ¥

3 "Machine Hex.'1 7 a S 0 9 U A 3 , t 6 5

¥

k "True Hex.

109 1C9 128 3E6 $

¥

$ Beoimal 1*57 It?? 1 296 998 5

¥

&8. 5. Forms of instruction representation

The rewriting in machine hexadecimal may he seem like unnecessary

duplication of labor, and the coder may prefer to code directly in this

ultimate system. While this i of quite practical with a little experience,

it may seem rather awkward at first. For example, it will he noticed in

the foregoing illustration that, inasmuch as It is not a faotor of 10, the

last two binary digits of the address may be oombined with the first two

binary digits of the & address to form the third hexadecimal digit on

line 3. Similarly, the last two digits of the "^address must be combined

with the first two digits of tbs «T address to form the eighth hexadecimal

digit on line 3. Thus the machine hexadeolmal form of the instruction does

not exhibit ae readily as the other forms given the actual addresses being

referred to. Indeed, it will be noted in the example that although the

and /3 addresses are identical, this fact is not immediately evident in the

machine hexadecimal representation, (h similar statement would apply for

identical V* and & addresses, ) TTpon closer inspection, however, it

will be observed that the first five hexadecimal digits in line 3 may be

obtained from the and 0 addresses in line k "by the formula 2

1 + &

,
ectjgac

Similarly the next five hexadecimal digits may be obtained from line h by

the formula 2

10 Y * <8 . The procedure for converting an instruction from

* "fy pure hexadecimal to machine hexadecimal may be reduced to a simple rules

(1) Multiply the ©! (or Y ) address, expressed in hexadecimal, by ht

(2) Align the right hand hexadecimal digit of this product with the

left hand hexadecimal digit of /*5?(or £ ), and add,

The sum gives the first five (or second five) digits of the machine hexadecimal representation. It has been found convenient to use an auxiliary

multiplication table to facilitate the hexadecimal multiplication by U„

Some of the awkwardness of coding directly in machine hexadecimal may

be alleviated by coding on a form with a double column down the side. One

column lists all the addresses serially, in hexadecimal^ The second column

is it x (1st, column) so that this form also constitutes a convenient multiplication table. Bach instruction is written on the line corresponding t©

its address, and the rule just given for composing instructions in machine

hexadecimal may be readily applied. An example of the use of such a form

is given in the next section.

%
ll*.0 Coding of Routines „ The Solution of any problem requires the

introduction into the machine of an appropriate routine, consisting of

instructions and numerical information. The planning of a routine generally

involves many considerations apart from the mathematical formulation^ e.g„

,

considerations relating to the range of magnitudes of quantitites involved

in the calculations, cell capacity, memory capacity, number of significant

figures maintained during calculations, time of computation, eto0 Some of

these matters will be discussed in the following paragraphs,

lU.l Example of a Routine, To illustrate the preparation of a simple

routine the following exercise will be proposed % To produce the first 100

triangular numbers, (The nth triangular number is defined to be the sum

Ik).

k-1

The routine may be written for any part of the memory. In this case,

it will be put in successive cells starting with 008. The routine is as

follows s
-60-

Instruction in

U x Address Address Machine Hex cL

True Hex

& Y S Op Explanation

020 (008 0300E 03009 5 OOF 00E OOF 009 5 n * 1 (n-l)

021* 009 OliOOF 0l*00A 5 010 OOF 010 00A 5

n - n-l

S* k - n k

1 1

n

j 028 00A 00001 0l*00B F 000 001 010 00B F Print S k

1

)

k

j 02C 00B 03C0D 0200C D OOF 00D OOg] 00C D

Yes—^008

n < 100? Ho _^ ooc

030 00C 00000 00000 (C— 000 000 000 000 C— Halt

031* 00D 00000 00006 1* 100* 2^

038 00E 00000 00000 1

—1*2 1*2

03C OOF (ooooo ooooo 0] n

01*0

i 010 [ooooo ooooo 0] JS

i

The instructions have first been written in true hexadecimal , and the

conversion to machine hexadecimal is facilitated by the presence of the

two columns to the left. Each word in the routine is explained in the

right hand column.

Though extremely simple, this example illustrates a number of points

about SEAC coding. It will be observed that at the end of the fourth

instruction the control is sent back to address 008, provided that n < 100,

Each time through this cycle of four instructions a new trisingular number

is generated. This iterative type of computation is typical of most, if

not at all, routines. An iteration is frequently enclosed in half brackets,

rj , as in this example, to make it more conspicuous. No entries have

been made in the last four lines of the fourth column, because the words in
-61 »

these addresses are numerical quantities and would not normally be written

in the true hexadecimal form of instructions. Brackets, such as in the last

two lines of column 3, mean ” subject to change*. In this case, OOP and 010

initially contain zeros, but are used in the course of the commutation to

store the successive values of n and k. Since these quantities quickly

1

={,2

become greater than k, all integers are multiplied by the scale factor 2

so that they can be accommodated in the storage. With this choice of scale

factor the 100th triangular number clearly does not overflow. At the end of

g|iP.

the 100th iteration OOF will contain 100*2 , so that the comparison in

address 00B will send the control to 00C. The instruction in 0015 clearly

does not affeot the oontents of any cell in the memory, but since it is

followed by a negative sign, it will oause the machine to halt (with proper

initial settings of the switches on the manual panel). In order to make this

routine complete it is necessary to add proper input instructions, and this

will be explained in the following paragraph,

111. 2 Method of Petting Information Into Machine, As explained in

Part I, par, 5.0, instructions are held in the instruction register while

being interpreted and oarried out. When the computer is halted, the last

instruction executed remains in the instruction register. If the MEMOEY

CLEAR button on the manual panel is now depressed the oontents of the memory

will become all zeros, but the instruction in the instruction register

remains unaffected. It the START button is now pressed, the £ of that

instruction specifies the address of the next instruction. But since the

memory has been cleared this is (when written in decomposed hexadecimal

form) r
-62 »

( 1 ) 000 000 000 000 0 +.

The interpretation of this instruction is: "Head eight words into cells

000 through 007, and go to 000 for the next instruction. M For the example

of the foregoing paragraph, it is readily seen that this next instruction

must be an input instruction}

Instruction in

U x Address Address Machine Hex

True Bex

oL @ Y £ Op Explanation

000 000 00000 02008 0 000 000 008 008 0 Head 8 words

into cells

008 - OOF

As a result of this instruction the routine of par. ll*. 1 will be read in and

the control will then be sent to the first instruction of this routine. The

remaining seven words called in by the instruction (l) could be anything,

since they are never referred to. The components of the routine would be

punched on Teletype tape in the following order:

(a) the input instruction (2),

(b) seven words of arbitrary information,

(o) the first eight words in column 3 of the routine in par. lit, 1.

Clearly the routine of par. 1)4.1 oould have been coded to go into

tank 0 of the memory; i.e., into addresses OOO^OO? (see Footnote, Part I,

par, 8.1), It could then have been read into the memory at onoe by

activating the instruction (l) in the manner described, and no other

read-in instruction such as (2) would have been necessary. If, however.
»63~

the routine of par, li*. 1 were to consist of a number of tanks of information

then an equal number of read-in instructions such as (2) would be required,

and it would be convenient to use tank 0 for the purpose of storing or

generating (of. Sect, 1?) these instructions. After the information has

been read into the memory, the read=in instructions are no longer needed,

and the addresses they occupy are available for other purposes^ It is a

generally recommended praotice to keep tank 0 available for contingencies

that arise in the course of operating the machine, For example* one may

wish to insert corrections* additions, or other modifications to the routine

after it has been fed into the memory. Or, at some stage of the computation

it may be decided to M dumpM the contents of the memory oat© magnetic wire

for storage or for checking. To accommodate the instructions for doing such

things §s these and other auxiliary operations, it is necessary at least to

have address 000 available, and preferably all of tank 0, The examples in

this Handbook conform to this recommendation.

The design of the manual panel makes it especially convenient to reserve

tank 0 for the uses described. For, by simple manipulations of the switches

it is possible to clear the instruction register, thus activating the in=

struotion (l). It is likewise possible to aotivate the instruction for a

single word input s 000 001 000 000 0C

This last facility makes it easy to introduce a single word into any

desired address at any time. For example, suppose it is desired to read a

word W into address 12A, and to then send the control to 086, This may

be done by first activating the single word input instruction above, and then
typing on the keyboard the instruction 00001 I1A886 0+ (i.e. , 000 001 12A 086 (),

in decomposed form). This is another single word input instruction which

will put the word W in its assigned location. The actual manipulations

of the controls for performing these and other operations will not be described

here. Basic instructions for operations of the manual controls are given in

Refs. 9.1, 8.1, 8. U, 8.5.

lU. 3 Overflow. In operations U,5,8 and 9, binary digits which over*

flow are lost. In the B operation, if overflow occurs (that is, if

J(/5

/(c6) I > a), the result of the operation, although it could be

determined in any given case, is not useful.

ia. a Scaling . If quantities larger than a appear in the data or may

appear in the computation, difficulties may frequently be avoided by ’’scaling".

The data may be multiplied by a constant small enough to make all quantities

less than a before they are read in, or the multiplication may be done in-

»aa ternally. In the triangular number routine, a scaling factor of 2 was

used. In other cases it is desirable to scale in the other direction; i.e.

,

to make quantities larger. In nearly all cases the scaling factor must be

kept in mind as the coding is done. If the ranges of the quantities appearing

in a computation are very large, it may be necessary to resort to storage

of numbers in double precision form, or in floating binary point form. The

ordinary arithmetic operations can then no longer be performed by single

instructions, but require the use of rather elaborate subroutines (cf. Sect.

19, and Refs. 9-13).
1U,

5

Lew Order Multiplication. The appearance of the 2 zeros to the

left of the binary point in low order multiplication should be borne in

mind each time that instruction is used. Thus (using the symbol A to

denote low order multiplication), (p*2

m

) A (q^*"*1 ) » pq. provided

pqs< 2' , Otherwise the integral part of the low order product,

pq*2u

, is lost. Examples of the results of this instruction are*

(1) 2^A2^ a 2^ (2

^

aots as a unity element),

(2) p*2~28 A

2“32

» p*2“18

for p <

2*18

(a left shift of 10 plaoes),

(3)

(4~2 ^)a 2’^' * 1-2

^

(because of the dropping of the two I's to

the left of the binary pSoint),

lU. 6 Shifting. Right and left shifts are frequently needed in coding.

Right shifts may be accomplished by multiplication by a negative power of 2,

A left shift of one binary place may be accomplished by adding the quantity

to itself. Other left shifts may be made by low order multiplication (as

in the second example of the preceding paragraph) if the two most significant

binary digits are not needed, or by division, if no overflow will occur.

If the two left hand digits are needed, and overflow may occur, the shift

cannot be made in a single instruction,

lk» 7 Example, The D and F type bars on the Teletype printer or

Flexowriter may be replaced by a decimal point and space respectively.

This facility permits the coder to improve the appearance of results by

inserting decimal points, and suppressing unwanted information.

Assume that a coded decimal quantity is in cell 100, in the form
-»66

d * 2

26

* d • 2

•30

d *2 -3U

d,« 2

U

•38

d^2 -ItB

that the decimal point is between d^ and d^, and that d^ and d^ are not

significant. Prepare a routine for printing numbers of this form out as

far to the left as possible, beginning the instructions in cell 030. The

printed copy should exhibit the decimal point, and any non-significant figures

are to be suppressed.

Solution* The code is as follows:

Instruction in

h x Add*^ ress Address Machine Hex

True Hex

oC & Y S op Explanation

000

1 030 0D900 0Fl*31 A 036 100 0 3D 031 A Shift left 20 places

och 031 OEJ037 OFl*32 1 038 037 03D 032 1 Insert dec. pt. and

spaces

0XJ8 032 OE500 0F033 B 039 100 03c 033 B Shift left 21; places

ota:

! 033 0P035 0FU3U 1 03C 035 030 03li 1 Insert d^

0D0 03U 00001 0FU00 F- 000 001 03D 000 F- Read Out

odU 035 FQOOO 00000 0 F#2“2

0D8 036 00000 10000 0 2

”22

ODC 037 0F00F FFFFF F Extractor

0E0 038 0D00F FFFFF F Dec. Pt. and spaces

for extraction

OEl* 039 00000 01*000 0 2'2U

1U* 8 Selection of Input and Output Media. There are at the present

time (September 1952) 12 units from which it is possible to read information

into the memory, or onto which it is possible to record inforaation from the
-67-

memory, These are (see also Summary of SEAC Specifications)*

(1) 1 Teletype unit - includes tape, reperforator and typewriter,

(2) 2 magnetic wire units, one for input and the other for output,

(3) k reel-less magnetic tape units, single channel,

CU) 1 servo-®agnetic tape unit, 5-ohannels (count as £ units) .

Any combination of units, up to 10 units, can be used in a single routine.

As pointed out earlier (Part I, pare. 3,0, 7.U; Part II, par. 13.0) the

selection of the medium used in a given input or output instruction is determined both by the oode and the external selector panel switch settings. For

both input and output instructions the first 19 binary positions (constituting

the address and all but the unit*s position in the ft address) have not

yet been assigned any significance. The £ positions consisting of the 3 lowest

order positions of °C and the 2 highest order positions of /S are used to

identify correspondingly numbered switohes (of whioh there are 10) on the panel*

Each switoh has 10 possible settings and each setting selects an input-output

unit, When the tape reverse operation, 7* is used, the desired magnetic tape

is selected in the same way as for input and output instructions. In addition

to the facilities described above, a "Direct Selection" switch is present whieh

enables one to override the selection specified by an instruction. By means

of this switch one can substitute any desired unit in place of the unit indicated by the instruction word (even when the instruction word fails to indicate any aotive oode number).

Details concerning the use of the- external eeleotor panel, and the

selection eode are given in Refs. 8.1 and 8.2. The reader should not attempt

1

Currently being installed.
=68

to prepare a complete program without first studying these references^

1U0 9 Compression? For many types of operation with magnetic media,

input and output speeds may he materially increased hy reducing the gaps be®

tween blocks (l word or 8 words) of recorded information. A longer gap is

required when the magnetic unit has to stop while the machine oomputes, and

then restart, than when the input or output instructions follow each other in

quick succession. The reduction of gap size is called "compression”^ It is

accomplished hy coding in of all pertinent readout instructions a "l" in

the Uth binary position from the left. Input and output speeds may be increased

by a factor of as high as ten by the use of the compression feature;,. The

greater the number of blocks read in or out under compression, the greater

the saving. A greater time saving is achieved by use of the compression

feature on magnetic wire than on magnetic tape. The tape and wire speeds

given in the Summary of SEAC Specifications are maximum speeds under compression,,

Further details on the use of the compression feature are given in Refs e

8.2 and 8„it c Again the reader should not attempt to prepare a complete

program without first studying these references^
-69'

15,0 Flow Diagrams. The first step in the programming of most problems

is the preparation of a "flow diagram". This is a block diagram or schematic which

presents an overall picture of the calculation procedure. It serves a number

of purposes:

(1) Once a careful flow diagram has been worked out, writing the code is

much simplified. Careful attention must nevertheless be given to

such matters as scaling,

(2) The flow diagram presents a graphic view of the calculation process.

It is muoh easier to grasp the logical organization of a program by

looking at this diagram than by looking at the code. The flow diagram

is therefore a convenient and useful means of communicating information,

(3) It is frequently neoessary to correct, amend, or modify a code, A change

in one part of a code generally entails changes in other parts also.

Since the flow diagram shows more conspicuously than the code the interrelationship between the various parts of the program, it is a recommended

practice to first make any required changes in the flow diagram, then in

the code.

A flow diagram may be drawn up in as much detail as desired. At one

extreme only the broad outlines of the calculation may be shown, or at the

other extreme there may be a 1-1 correspondence between the flow diagram

;(f symbols and the coded instructions. Sometimes it may be found convenient

to have two types of flow diagrams for a given program, a rough one and a

more detailed one.

For a comprehensive discussion of the procedures for flow diagram

preparation, the reader is referred to fief, 1, The flow diagrams in this
- **?0

Handbook for the most part use the conventions and notation described in that

reference. One minor deviation is in the symbolism for the "comparison box”.

The flow diagrams included in this report indicate comparisons in the following

ways s

As a simple example, the flow diagram for the triangular number routine

in par. llt.l would appear as follows s
-71-

15.1 Example. Prepare a flow diagram and coda for computing (gf < U),

2

by solving the equation x * N using the Newton-fiaphson method [7 J,

Solution, Denoting the i^ approximation to the root by x^, the ttewtonRaphson method yields for the (i+l) approximation *

*

*i*i

-

a An initial approximation near sere would produoe a larger new approximation

and there is danger of overflow. An approximation whioh is too large is

preferable; and sinoe N < i* in this case, x

Q

2 is satisfactory. With this

ohoice of Xq it follows that x^ < x

±

. This is evident, for example, from

a graphical interpretation of the reourrence relation. The flow diagram oan

be drawn as follows
72

Not© that both the flow diagram and ood© below are arranged to call in another

argument after each computed result is printed. A3J,that is necessary to continue

from the halted condition is to press the START button. Note also that the

printed results vdll be in binary form. The coding including read~in instructions

may be done as follows s

Instructions in

1* x Add”

ress Address Machine Hex

True Hex

oL> Y S Op Explanation

000 000 00000 02001 0 000 000 008 001 0 Read in

ool* 001 00000 01*008 0 000 000 010 008 0 Read in

008 002 00000 00000 0

OOC °°3 00000 00000 0

010 00i* 00000 00000 0

oil* 005 00000 00000 0

018 006 00000 00000 0

01C 007 00000 00000 0

020 obS 00001 05809 0 000 001 016 009 0 Read in N

02ll 009 05813 Oi*l*QA C 016 013 Oil 00A C Is N < 0?

028 00A 01*813 0500B 5 012 013 Oil* 00B 5 Store x

0

02C foofi 05016 05U0D B Oil* 016 015 OOC 8 Aj.

030 000 05015 051*S)D 5 oik 015 015 OOD 5 *i N/xi

031* OOD 01*815 Q5i*QE B 012015015 OOE B VV^Ap -

038 00E 05i*ll* 03C10 c 015 Oil* OOP 010 c X. . < x. f

14*1 1

Yes OOP

I© 010

)
*73'

Instruction in

h x Address Address Ms. chine Hex

True Hex

*c & X S op Explanation

03C OOF 05U13 0 £)0B 5 01 $ 013 Oiu OOBj £

0U0 010 00001 0^)08 F“ 000 001 Oil* 008 F» Read out 'sjlf, Halt.

0UU Oil 00000 00000 C- 000 000 000 000 C~ Heft.

01*8 012 80000 00000 0 2

oi*c 013 00000 00000 0 «0

050 Oil* 00000 00000 0

<

t

05U 015 00000 00000 0

058 016 00000 00000 0

05c

1 017 00000 00000 0
16,0 Preliminary Coding in terms of Symbolic Addresses, It is recomp

mended that after completion of the flow diagram for a problem, the code be

prepared first in terms of “’symbolic addresses'* instead of actual numerical

addresses. The latter normally would not be assigned until nearly the last

stage of the code preparation process. A common practice is to classify storage

locations according to the kinds of words they are to store, and to assign a

letter to each classification. Distinct storage locations within each classic

fieation are then identified by distinct subscripts. For example, it is

usually found that certain addresses are used exclusively for constant quantities,

others exclusively for instructions, ete0 Still others are working positions,

which may store different categories of words at different stages of the

calculation. Such positions have been referred to among Computation Laboratory

staff as "Temporaries”, They may be left empty by the read-in instructions,

Following are some storage classifications and symbols that have been used

in the initial preparation of a number of SEAC codes §

•Constants

Temporaries

Variable®

Instruction©

^

1

$ 000

T T

1$ *2? ° « e ¥v ¥w 3 ^ ° ° ° L

X*

L

2* °*

In practice it is feasible to mix actual addresses with symbolic addressee

ia the initial code. Car® should b® taken not to confuse these symbolic

addresses with the contents of the addresses.; e. g, , the contents of the

fixed address L>^ my be modified during the course of the calculation in

ways to b® described in Section 17„ la general the choice of notation may

b® left to the discretion and taste ©f the coder.
75-

There are several advantages in first coding in the manner desoribed

above > (l) The notation my be chosen so as to suggest the categories of

quantities being worked upon. This makes it easier not only to write the

oode in the first place, but to read it afterwards and to oheok it visually.

Thus, for example, using the illustrative notation above, the instruction

clearly conveys the meaning, ”the constant in address is multiplied by

the variable in V the result goes to the temporary storage cell Tg, and

the next instruction is found in L^*. This is somewhat more infonaation

then can be gleaned from an instruction such as:

0& 12A 239 176 8.

(2) It is usually desirable or convenient to assign a blook of the memory to

eaoh classification of storage location; e.g. , one blook for constants, one

blook for variables, etc. However^ it in usually^ not certain until the initial

code is completed how large a block is required in each category. Once this

Is determined, numerical assignments may be made for the addresses. (3) Once

a oode in terms of actual addresses is completed, any oorreotion in the address

of, let us say, a constant would necessitate correcting all instructions where

reference is made to this constant. If, however a preliminary code were prepared

using a symbol for the looation of this constant, no actual address assignment need be made until this preliminary oode is completed. Decisions as to

actual assignments made at this later stage are not very likely to require

changing afterwards.
-76

16.1 Conversion to Final Code. After the preliminary code has been

completed and checked, and the actual numerical address assignments have

been made, it can be converted directly to the machine hexadecimal form

without first converting to true hexadecimal. This conversion is facilitated

by the use of a form similar to that described in par, 13,1 but which contains

a third address column on the left. On eaoh line of this column is entered

the symbolic address corresponding to the numerical address given (see, for

example, codes in pars, 17,3, 17 , li).
75-

There are several advantages in first coding in the manner described

above t (l) The notation may be chosen so as to suggest the categories of

quantities being worked upon. This makes it easier not only to write the

code in the first place, but to read it afterwards and to check it visually.

Thus, for example, using the illustrative notation above, the instruction

*1 T

2

T

2

L

3

8

clearly conveys the meaning, n the constant in address is multiplied by

the variable in Vg, the result goes to the temporary storage oell Tg, and

the next instruction is found in L^n

. This is somewhat more information

than can be gleaned from an instruction such as:

0& 12A 239 1?6 8,

(2) It is usually desirable or convenient to assign a block of the memory to

eaoh classification of storage location; e.g. , one block for constants, one

block for variables, etc. However;, it i a usually' not certain until the initial

code is completed how large a block is required in each category. Once this

is determined, numerical assignments may be made for the addresses, (3) Once

a oode in terms of actual addresses is completed, any oorreotion in the address

of, let us say, a constant would necessitate correcting all instructions where

reference is made to this constant. If, however a preliminary code were prepared

using a symbol for the location of this constant, no actual address assignment need be made until this preliminary oode is completed. Decisions as to

actual assignments made at this later stage are not very likely to require

changing afterwards.
-76-

16.1 Conversion to Final Code, After the preliminary code has been

completed and checked, and the actual numerical address assignments have

been made, it can be converted directly to the machine hexadecimal form

without first converting to true hexadecimal. This conversion is facilitated

by the use of a form similar to that described in par. 13.1 but which contains

a third address column on the left. On each line of this column is entered

the symbolic address corresponding to the numerical address given (see, for

example, oodes in pars. 17.3, 17. k).
17.0 Modification of Instructions . If mis pointed out in Part I,

par. 1.3 that the ability of the SEAC toqperate on and modify its instructions

is one of its essential features. Much of the machine's flexibility and

versatility springs from this facility. All except the most trivial of routines

involves variable instructions. Some common cases -will be described.

Frequently it is necessary to subject successive arguments of a given

sequence of arguments tc a prescribed arithmetic process. This may be done

in two principal ways, both of which give rise to variable instructions.

(l) The argument about to be worked upon is first transferred to a standard

location as a starting point. A variable instruction is required to accomplish

this transfer. (2) Each argument is worked on from its initial location.

There is no transfer to a standard location and every instruction which refers

to the initial locations must be modified in passing from one argument in the

sequence to the next. The first method is frequently more economical, both

time- and space-wise, when the processing consists of several references to

the argument. The second procedure is more economical when each argument is

* to be operated on only once. This will become more evident in the following

two examples.

17.1 Example 1. Prepare a flow diagram and code for summing the memory,

starting with address 008, and printing the sum. Neglect all overflows.

Solutions Since the sum is supposed to begin with address 008, this

leaves addresses C00-O07 available for the summation routine. The summation

process involves only a single operation on each quantity - that of adding

it into a cumulative sum. It therefore appears that procedure (2) described

in paragraph 17.0 is suitable. The flow diagram and code can be drawn up

as shown below $
-78.

Not© 1* ^ contents of address i.

Not© 2 « In view of the fact that overflow is being neglected^ all

sums are understood to be modulo li0

x Add-

»ss Address

Instruction in

Machine Hex

True Hex

oo /S £ op

000 Togo 02007 01001 5 L008] 007 007 001 5

ooU 001 00002 OOCOU D 000 002 003 00

* D

008 002 FFGOO 00000 0 3FF 000 000 000 0

000 003 00006 ooooo 5 000 006 000 000/ 5

'

, ’

«\ * Vw 010 OOli 00001 01C00 F~ ooo oca 007 ooo fDili 005 00000 00000 0

018 006 001*00 OOOOO 0 001 000 000 000 0

01C 00? [00000 OOOOO 0]

Explanation

n-1 n

vf v f *i

Yes —$ 003

n < 102U? No —^ 00k

Constant for Comparison

Modify (000)

102 It Print -S a-i

1 in°k 8 constant for

modifi cation

a

i®

^ 8

tially)

ini«
"--79

Note the instructions to be iterated, indicated by the half brackets. In

this code, the instruction to be modified is in cell 000, and the modification

is accomplished by adding 1 to its oC address each time through the iteration,,

The memory sum is highly useful as a check number in determining whether a

routine has gone into the memory correctly, and is almost always inspected

before starting in on a computation. In normal practice the & of the read-out

instruction in 00l* would be the address of the first instruction of the routine

proper* With proper initial switch settings on the manual panel (HALT-PHASE

switch on BREAKPOINT ) the machine will halt after performing the, negative

instruction in OOli. Then, after the memory sum is inspected and found to be

correct, the START button is depressed and the oontrol proceeds to the main

computation. If the memory sum is in error, then the routine would normally

be fed in again, and another check made,

* 17.2 Exercises.

1, Prepare a flow diagram and routine to go into tank 0 fdr filling

the memory. Starting with address 008.

'2. -Prepare a flow diagram and routine to go into tank 0 for dumping

(i,e. , reading-out) the contents of the memory, starting with

address 008.

17. 3 Example 2. Prepare a flow diagram and routine to compute the

quantities

* Vf. ^ „ n—, > 1 " 1^ ..® 9 * - „ 9.

Solution, In order to illustrate the techniques of Section 16 an

initial code will be prepared using symbolic addresses instead of numerical
addresses,, The x^ will be assumed to be read into conseoutive addresses

o o o 9 V “whore we will require that V s- O(mod 8). Sinoe eaoh x„ A 8 1 i

must be referred to several times in computing u^, the first of the procedures

of paragraph 17o 0 will be found to be most economical, both in terns of space

and time. Two variable instructions are required here* one to transfer the

to a standard location! and a second to place the u^, as they are produced,

into the addresses where they are to be stored preparatory to printing. The

flow diagram for this problem is similar to others that have already been

presented. It will therefore not be drawn here but will be left as an exercise

for the reader.

In the initial code the notation used for addresses will be the same as

in paragraph 16,0, A convenient way to proceed with the coding is to begin

with the computation of the successive u^, and leave the preparatory and other

auxiliary steps to be coded later. Brackets, [ J, are used to distinguish

addresses which will have to be modified in the passage from i to i+1, Symbolic

addresses (K^ K

g

, ,,,) for constants, and working positions (T^, T

g

, ,,,), are

assigned as needed. The problem will be coded with variable instructions being

transferred to the working positions for modification and execution.
-81

Symbolic

Address

' i*- ji k oO

Initial Code

P x s Op Explanation

Fi 1 \

T

2 h *2-* T

2

h

¥ £ H T

2

T

3

L

2

9 4—y t

3

h

T

z

T

3 h

L

3

it 2

x. - x, —^ T. i 1

'

it L T T T L •5 x x? —^ T

3 2 3 3 U i i 3

2

\ *2 *3 T3

T

5

5 ^

1 3

T T T, [v ] L B u —^ V.

$ 3 k 1 5

i i

L_ T, L L_ D i < 8?

Yos '^' L

7

5

1 6 7 6 No —*L

g

fComparison constant;

L

6

V

8

000 Ti

F— [read out u , . . . , u^

h

T

x *3 Ti *8 5

1 Modify transfer

( instructions

h *5 K

U

T

s III )

K 0

i 1

\

1

&

—8

s

2 *1 in <=G

\

?CO

CM *1 in tf

Thus far the routine will compute the eight store them, and read them

out. Note that the word in L serves a dual purpose: it serves as a

6

constant against which the instruction in is compared to determine

when eight values of u^ have been computed; and it is also an instruction

for reading out the 8 words in ... , Vg. The & of this final instruction
#62**

will be left blank for the time being and will be filled in later after the

rest of the routine has been written, In the above routine, the ©< address

of the instruction in 3^ will take on the values V^, ... , and at the end

of the series of calculations will stand at the value V j and similarly for

the ]f address of the instruction in T^. If it is desired to compute the

function u for a second set of eight x* s it will first be necessary to set up

*• iaatraoti ““ T

i

“d T

s

t0 thslr **** «

TM

14 b*

necessary to set up these instructions if during the course of calculating

the u. it ie desired for any reason to restart the computing without having

1

1

to read the routine in again , These two possible contingencies illustrate

why it is always wise, if not essential, to preset the initial state of a

variable instruction before performing the instruction the first time, She

presetting process can he done as follows t

Symbolic

Address co /3 Y £ op Explanation

l

9 *io *1 T

i Ln $

* Set up (I,)

*10 T

i h h *

A

4 hi hz K

i

7

$

T

i *

Set up (T

tf ) hz r

3 *k

7

i

L

5

8

- -

1 -- ----- |

1 5

*The instruction 00000 OO&jC^ay)* (where a-^, a2 , a

3

are hexadecimal digits),

typed manually on the keyboard or read in on teletype, will send the control

to address ftxa2a

3

<
-83s

To make the routine complete and self-contained we shall add an instruction

to reed in the x

±

t

ooo ooo i lq o 13 X 9

Input instruct! on

t

The & of the instruction in X.g will now be filled in as L-^ Thus, after

reading out eight values of u^, the routine will call in eight more x

The method (2) of handling the instruction modification would have required

four variable instructions instead of two. Each one of these would have had

to be set up at the beginning, and each would have had to be modified in

passing from u^ to Vr

It is now possible to assign addresses in the foregoing code. To do

this on© need merely write beside the symbolic address for each instruction,

independent variable x^, constant, and wording position, its assigned address.

By inserting an additional column labelled h x Address, it is possible to go

through the instructions and write them down in machine hexadecimal form

directly without having to go through the intermediate stage of writing them

in true hexadeoimal. While in praetice no rewriting of the initial code is

necessary prior to writing the final code, this will nevertheless be done

here for purposes of presentation. At the same time the addresses will be

rearranged slightly in order to keep words of the same kind together in the

memory, Th© read-in instructions for this routine will be left to the reader.
Assigned

Address

Symbolic

Address /® y S op Machine Bex Explanation

J* x Address

Add** ress

020 008 000 000 Vj 0 00000 08009 0 \

02

* 009 *9 L

10 K

1

T

1

L

X 1 * 02815 061*08 5

028 OOA ho V

1 \ *,*i 5 0801 5 0680D 5

02C OOB hi bth Vi 5 03015 071*18 5

030 OOC ht t

3

t

U

v

i

L

S

B 06C1C 08011 B Read-in xi*

031* OOD

h.

T T L 9

2 2 3 2

0681A 06 00E 9 Compute V

038 OOg h

T

2

T

3

T

1* L

3

U 0681B 0700F 1* \and Read out*

03C OOF b ** T

3

T

3

L

U

5 0681B 06 CIO 5

Ql*0 010 h *8 t

3

t

3

T

S 5 0581B 06C1D 5

Ohh Oil h

T

1

L

6

L

7

L

6

D 061*12 01*012 D

oke 012 \ a 000 v

i

L

i3

p" 09000 08008 F»

ol*c 013 h

*1 h *1 H 5 061*17 06l*li* 5

050 Oil* h T

s

K

U Vi 5 071*18 071*19 5

/

05U 015 h

00000 00000 0

|

^0

058 016 K 1*0000 00000 0

I V Constants „a 05c 017 K

3

001*00 00000 0 I ^ 2 -1

in c*- 060 018 h 00000 001*00 0 2-28

=.l 4

i^in t

<<\

06l* 019 T

i

068 01A ** 060 01B T

3

\ Temporaries

070 01C h

07U 01D T

5

080 020 | Storage positions

a

* •

0

e for aad

o$c 02? *8
An inspection of this code will reveal that no word in the block of cells

from 006 to 018, inclusive, is changed in the course of the calculation*

This fact can be used to check the machine by summing this block at intervals

during the running cf the problem.

17, U ^unction fable Technique of Instruction Modification TJp to now we

have been modifying instructions in a regular manner. It is sometimes neces8ary to set up an instruction as a function of an argument which varies in an

unpredictable fashion. The instruction is made to depend on the argument by

introducing the argument into one or more address components of the instruction.

The technique is illustrated in the following example*

Example. A sequence of "quasi -’random” numbers n^, m 0, ... , K

can be generated by low order multipli cation of n^ * 5^ (with seal# factor

2~^2

) by itself to produce the first number, low order multiplication of this

result by

^

(again with scale faotor 2“^*2

) to produce the next number, etc*

Each number, n , obtained in the sequence becomes the multi plioand for the 9 m'

constant multiplier Determine a frequency distribution for this

sequence of numbers, using 32 equal class intervals.

Solution. The procedure may be outlined as follows?

(1) Generate a quasi “random number, n

ffi.

(2) Determine the olass Interval to which it belongs,

(3) Tally one in cell corresponding to this olass interval. The

instruction whioh does this is a variable instruction and is in

fact a function of the number generated.
$ O 0 Q § 37 37 Th® 32 class intervals are bounded by th© point® zs*©^ 1*2 $

$l°2 J

9 32® t

Ji E 2 SSvery integer. n% octffeosed of the five most

©ignifioant binary digit® ©f correspond© t© on© of th©®® pointy and

is fact ©an b# used to id@ati.fy th© class interval to which th® quantity

belongs ^ sine© < (n^ & i),s> 2^0 ffa® integer,, s

9 ^ is ‘the argument

for sotting up th© variable instruction in (3), which w® dmot® by th®

functional notation p(n s ) 0 We shall writ® t. # i®0p . $ 31 9 for th® tally

corresponding to th© interval i

e 2^ <n < fh& instruction P(n 8 )

3S, then changes t

,} to t * * 1. All the tallies are set to sero before th© % , actual computation is begun,, Following is th© flow diagram for this problem..
-87

Legend t

(1) ia telly for olass interval i*2^ <n < (i*l)»2^, **0*...# 31.

(2) Ki) is instruction which adds 1 to tally t^

(3) Operation symbol A in the second box following the remote connection

(l)>“ signifies low order multiplication.

(U) M is maximum value of m.

As in the example of par. 17.3 this problem will also be coded initially in

terms of symbolic addresses. After this is done, the address assignments will

be written alongside the symbolic notation, and the conversions to machine

hexadeoimal w^.11 be performed without rewriting the initial code. It is to

be noted parenthetioally that the process of clearing the tallies involves

instruction modification, and this has been done by method (l) of par. 17.0.

Note also that the storage locations Cq, ... , for the tallies must begin

with Cq ©(mod 8) in order to make use of 8 word output instructions.

h x Add- ress Address

Symbolio

Address

^ @ Y <£ Qp Maghinejies Explanation

020

02U

028

02C

030

03U

038

03C

008

009

00A

00B

OQC

OOP

00B

OOP

**1

*2

6

ft

h h

T

i

000 000 C

Q

T

1 *8 H

k

?

t

x 000 000 Sg

000 001, Sj

*2 S

1

S

1

T

1 * L

3

2

L_, D

5

T

1 ^ h 2

L

? 0

L

8

A

S

1

K

1 *1 S 3

02U1F 7F1FC $

00000 0A00A 2

7F021 02C0C D

081FC 7P1FC $

00000 7FOOD 2

00001 7F80B 0

06PFE 7F80F A

7F81A 7F010 3

(Clear tallies

31

Set m*0

Bead in n^0

(5

1 7*2^)

A(n •2“^2 )-- n- .*2“^ ' m+1

m+l
"Syffil 4%AM0 1 Add>o Add„

a

p

Y 5

04

© 010 % S3 m

T

'l

L

10

044 on

L

10

L

n l2

©48 012 1

11 \ % co L12

04

C 013

TL

12

a

h S2

Xi13

050 014

L

13 S2 *5

y

L

14

054 015 li4

000 000 °0

L

!5

058 016

L

15

000 000 Gg l

i6

05C 017 1

l6

000 000G ^ 16

L

IJ

06O 0X8L

17

000 000 c24

064 019

L

IS

000 ooi S-X

000

06g OXA

Ki

060 DIB \

07© 01G

K3

074 01X>

eF \

OJB Oil

K5\

QJC

Q 3JT

030 020

k7000 000 001 000

064 021 000 000 c31

000

QAO Q2S c

Op Machine Hex Explanation 9 ojuc 71011 9 n° 6 and y"

a*l

of -S 3 0491C Tff^D 5 ( Set up P(

a8 » 3 0742S 0A013 5

art*) 5 075^1 7FC14 5 /

m+Xm

Yes~*L

m< M? ’ l0 “* L

l4

D 71011 030X5

D f 00000 QAOlS ff f 00000 0C0X7 I l Print f 00000 OEOXS y ( 0 31

00000 100X9F

y- 00001 JfgQQ 1- Print

31000 00000 0

0BXA2 BC2SC 5 5l7.g-42

00020 OSOOO 0 2-13 + 2-23

00000 00000 1

=42 2

M>r^2

00000 00000 0 0 0 00000 001+00 0 2~gg 0 00000 X1C00 0 Comparison

Constant

Storage loca-
«39m

i*xAddv Add,

Symb,

Add, /S x $ °P Machine Hex, Explanation

Wit

V 1FD IK

<* 53

• \

temporary: P(n‘

)

7F8 1FE s

i

a * n

7FC IFF ** m .

Before sending the control to the above routine, the number H must be

inserted in to control the number of quasi -random numbers to be

generated. It can be seen that the process need not begin with -*17

, but could just as well begin with any number in the sequence ®3ais is

the reason for printing n^ at the conclusion of the run. On the next run,

this can be the nQf and the generation process can resume from where it left

off the previous time, the tallies, of course, would all start from sero

again.
<agO<*

18.0 Timing. Calculation of timing is done differently for the

acoustic memory, because of its serial nature, than for the electrostatic

memory, which is parallel in nature. The discussion of timing mill first

be carried out for each of these memories separately. It mill then be

simple to understand how timing is determined when both memories are used.,

18.1 Addresses in Acoustic Memory Only. In the acoustic memory, k®

binary positions are required for the storage of each word, k*> of which are

for information. The basic repetition rate of the SKAC is 1 megacycle

(l million pulses per second) so that k® microseconds (millionths of a second)

are required for a word to pass a given point. A tank in the acoustic memory

holds 8 words, or 8*1$ 3 3®k binary digits. Therefore 38k microsecond# are

required for a complete circulation of the contents of a tank^ This unit

of time is called one "major cycle". One eighth of this time, or k8 micro**

seconds, is called a "minor cycle". The oontents of all tanks are circulated

synchronously. The number of minor cycles within a major cycle are counted

a "minor oyole counter" which takes one step each minor cycle, counting

from 7 to 0. All words whose addresses have the same residue modulo 8 (i, e.',

whose addresses have the same remainder upon division by 8) move simultan©“

ously into position to be read (though only one can actually be read at a time),

and at this instant the reading in the oounter is this residue.

The execution of an instruction (not input, output, or tape reverse)

in the instruction register involves four phases. Starting from the halted

condition these ares

(l) Location of new instruction, specified by (normally) or ^ of

instruction currently in instruction register, and bring new instruction
-91*

into the register,

(2) location of 0 address of this new instruction,

(3) location of address of the now instruction and perform operation,

i* (U) Result of operation (for aon-oomparlson operations) goes to 6 of the

new instruction, tn comparison this is & "dummy” phase.

The time required in minor cycles for the execution of a phase is the

number of steps taken by the counter during that phase. At least one step

is taken during any phase. This implies that if the counter readings are

the same at the beginning and end of a phase, then at least 8 steps were

taken during that phase. With the exceptions (2) and (3) noted below, the

counter reading at the end of a phase is always the least positive residue

modulo 3 of the address associated with that phase. Counting the minor

cycles corresponding to a specified phase is facilitated by the following

figure*

3

0

Ite
«92 -

Oiven the addresses in hexadecimal associated with 2 successive phases, count

in the figure from the last digit of the first address to the last digit of

the second address in the direction of the arrow. The number of steps obtained

(which will vary from 1 to 8) normally is the time in jasinor cycles for the

second of the two phases, for all operations, Exceptions to the foregoing rules

are as follows :

(l) For multiplication and division operations, add UU minor cycles tp the

(time obtained by application of the above rule,

(2\tn comparison operations, phase k is always 1 minor oycle, regardless

of what )f is,

(3) In the base operation, 1, phases 2 and 3 are always 1 minor oyole each;/

The time for a complete instruction is the sum of the times for U successive

phases, starting with phase 2 0

The times for input and output instructions are obtainable from the Summary

of SEAC Specifications preceding Part I,

Example 1 0 Find the time for executing the following instruction:

Address oL 0 S Op

1A2 2A1 012 118 117 D

The calculation is conveniently exhibited in tabular form:
-93<

Minor Clyde Counter

Reading at Time in

>:f.M

ry:r,Trra End Minor Cycles Remarks

Phase 2 2 2 8

* 3 2 1 1

k 1 0 1 Item (2) in list of M Exceptions”

1 0

f° ( 8 Control goes t© Y

It u

« « n S

( 18

Total Time * <In

Control goes t© ^

« « n S

Example 2t Find the time for executing the following instruction*

Address V £ °£ . 017 100 115 10D 206 A

Calculation*;

Minor Cj

Read

rcle Counter

ing at Time in

Beginning End Minor Cycles Remarks

Phase 2 7 5 2

3 5 h 1*9 Item (l) in list of "Exceptions”

k k 5 7

1 5 6 7

Total Timet 65
18* 2 Addresses in Electrostatic Memory Only, If all addresses are

in the electrostatic memory the rules for calculating timing are particularly

simple %

(1) Phases (l) and ( 2 ) are always 1 minor cycle each*

(2) Phase (3) is 1 minor cycle for all operations except multiplication and

division. These operations require k5 minor cycles*

(3) Phase (U) is 2 minor cyoles for all operations except

(1+) For operations G,D,E, phase (li) is 1 minor cycle*

18. 3 Addresses in Acoustic and Electrostatic Memories . The rules given

in paragraphs 18.1 and 18.2 are sufficient for this case. The method of

j calculation will he illustrated by some examples.

Example 1,

Address ©6 Y <T Op

10A 3li« 20D 019 018 3

In this example, addresses 3hC and 20X) are in the electrostatic memory. The

calculation is as follows §

" Reacting; at Time in

Beginning End Minor Cyoles Remarks

Phase 2 2 1 1 Par. 18.2

« 3 1 0 1 Par. 18.2

e U 0 1 7

" JL 1 0 1

Total HO
Kxample 2

Address & Op

3*3 09C 3W 1P8

a8

Minor Cycl<

Bendifl

t Ofcmter

t at Time in

Beginning Knd _J$,nor Cycles Remarks

Phase 2 5 k 1

• 3 k 7 k$ Bar. 18.2

• k 7 5 2 Bar. 18.2

* 1 5 8 $

• Times

* 53

10. U Remarks. It is generally not advisable to spend much time in trying

to minimize the time lor a routine by rearranging addresses, etc. Such a

procedure is generally difficult, time consuming, and likely to give rise to

coding errors. Moreover, the time saved on the maohine by optimum timing is

likely to be balanced by the time lost in coding. And finally, the overall

time for a problem is often determined principally by speed of input and output,

rather than by speed of computing. It is usually more desirable to reduce

computing time by selecting an efficient method of solution and by reducing

input and output time than by rearranging addresses. Some of the early SE1C

subroutines were coded for the acoustic memory -with a view to minimizing

computing time, this practice was abandoned in the preparation of most later

subroutines.
"96“

19.0 Subroutings,, The need for certain types of mathematical calculations

may be anticipated, and they may be coded, recorded, and filed in advance of

their use. The series of instructions comprising such a calculation is called

a "subroutine”. The same series of instructions may be used many times in

any problem, with varying arguments (or initial conditions). Some examples of

SBAC subroutines are: conversion of numbers from deoimal to binary, conversion

from binary to decimal, generation of trigonometric functions, etc.

This procedure of pre~coding and filing results in a considerable saving

of coding time. For before filing, these subroutines will always have been

carefully checked, prepared on tape, and tested. Duplication of much work is

thus avoided. Furthermore, these subroutines may be coded with special attention

to economy in memory space as well as computing time.

list and description of selected SSAC subroutines available as of this

writing (Sept., 19f>2) Is given at the end of this Handbook (fiefs, 9~13),

19.1 Conventions for Standard Subroutines. In preparing SEA.C subroutines

certain conventions have been adopted which render these subroutines more

convenient for general use and eliminate unnecessary duplication and consequent

waste of memory space. Subroutines conforming to these conventions are referred

to as "standard subroutines".

(l) The second tank (oells 008-OOF) is reserved for temporary storage in all

standard subroutines. Certain constants commonly used in subroutines and

elsewhere are called "standard constants", and are assigned standard

locations in addresses 010-027. It should be kept in mind that these

constants must be read into their as signed locations whenever using the
subroutines, For this purpose they have been prepared on tape and

are on file together with the subroutines. In paragraph 19,3 is

appended a list of the standard constants. Additional constants

needed in any subroutine are placedat the end of the subroutine*

(2) For convenience in use all standard SEAC subroutines are coded with

the destructions beginning in cell 100, In general, however, the

coder will want to specify a different set of locations for each sub*

routine used* This becomes a necessity, in any case, whenever more

than one subroutine is used. The desired locations for the subroutines

are determined by the coder, and the subroutines are accordingly read

into those positions in the memory. Certain modifications are then

required in the instructions to make them conform to their actual

positions in the memory, and this is accomplished by the modifying

routine described in par. 19. Uo.

. (3) la all standard subroutines the argument is sent to 00D before

entering the subroutine, and the result of the calculation is also

sent to 00D, The control then goes to OOF for the exit instruction.

Care must be taken that the exit instruction in OOF is properly set

up before entering a subroutine,

19,2 Transcription of Total Soutine Onto Input Medium, A problem involving subroutines may be transcribed onto the input tape or wire in various

arrangements* One convenient arrangement slight be as follows s

(1) Input instructions (000-007),

(2) Temporary storage (008-00F),

(3) Standard constants (010«*027),
;98=

<M

(5)

(6)

19.

(a) Instructions for incorporating subroutines (028-037)*

(b) One word for each subroutineg followed by word containing

all zeros (03&, 039 *.. „)j (See par. 19 . 1*)*

Subroutines in success! on^

Body of main routine,

3 list of Standard Constantsa

Standard Machine Hexadeci

Address Constant Representation

010 =0 00000 00000 0-

on “3 €0000 00000 0-

01% •*2 80000 00000 0*

013 *1 1*0000 00000 0+

Oil* .2-1 20000 00000 0

©15 10000 00000 0*

016 *z~h 01*000 00000 0*

01? 2°8

(*1 ino<) (001*00 00000 Q*

018 .2“1« OOOOi* 00000 0*

019 .2“3g 00000 0001*0 0*

01A .2-1*2 00000 00000 i>

01B .2-3®(*l inS) 00000 00001 0*

01C »2"28(« in }r) 00000 001*00 0

010 2”22 00000 10000 0*

01E -fr2~20 00000 1*0000 0*

OIF +2”18(n in/3) 00001 00000 0*
“99 «

Standard

Address

] Constant

Machine Hexadecimal

Representation

020

“i2 2 OOOltO 00000 0+

021

“10 2 00100 00000 0*

022 it - 2 (o< extractor) FFCOO 00000 0+

023 *2”®“ extractor) 003FF 00000 0+

02U 2 2 extractor) 00000 FFCOO 0+

025 2

38

(cT extractor) 00000 003FF 0+

026 ^ - 2

4*2 FFFFF FFFFF F*

02? [Reserved for Absolute values,

]

Method of Incorporating Subroutines. This oode incorporates

subroutines into the main routine -without a manual modification of the

orders making up the subroutines.

As pointed out earlier, all subroutines are written as though they

are stored in the memory starting with hexadecimal address 100. However,

when used in a problem they are read into blocks of memory locations

assigned them by the coder, which will not usually begin with cell number 100, Any reference to addresses 100 and over in their instructions

must therefore be modified by the difference between 100 and the beginning

of the actually assigned block.

For example, suppose that the decimal to binary conversion subroutine

(9. It] is placed in the block of memory cells 09C - OA?. Then we have the

following condition in the first two cells of the blocks

Address True Hex

09C 00D 013 103 10B D

091) 00D 016 008 107 A
=100=

In order to make the subroutine work in its assigned location, the above

two instructions must be modified to read?

Address True Hex

09 C 00D 013 09F 0A7 D

09D 00D 016 008 0A3 A

For each subroutine the addresses of the first and last words to

be changed are specified in cells 038, 039,... Constants and instructions

not to be modified are placed at the end of the subroutines to which they

belong. The routine for incorporating subroutines takes the subroutines

one at a time and performs the required modifications.

It is to be noted that 027 is assumed to contain «0 to accomplish

the logical transfer operation in the seventh instruction of the routine.

This is permissible because *0 is read into address 027 with the standard

constants, and since this is the first routine exeouted by the computer,

027 still contains +0,

Preliminary Information for Use of Routine for Incorporating Subroutines

1. Let = address containing first word of ith subroutine.

2. Let b^ = number of words of ith subroutine to be changed.

3. Store 2°° (a^+b^*»l) 2 a^ in locations 038, 039, ... ,037+11, where

n is the number of subroutines? and store 0 in looation 038+n.

U. The instruction to be executed after the completion of this subroutine is located in 007.

5. The number of addresses occupied by this preparatory routine is 17+n.

6. In order to restore a sign to address 027 before performing

calculations, make sure subroutines are arranged with positive sign

for last instruction of last subroutine to be modified.
-101 -

(OoluBai headed mo indicates timing in minor cycles)

Instruction in

1* x Address Address Bechine Sex

True Hex

at, /S Y Sot, no Explanation

OAO 028 OBOEI* 0BU32 1 038 021* 020 032 1 11* Set up oorreotion instruetion

-18

008 032 08019 02833 A 038 019 OOA 033 A 55 Obtain 2 a^

occ 033 O8I4OA 02837 B 021 OOA OOA 037 fi 52 Obtain 2

ODC 037 02022 0Ali3U 1 OOA 022 029 03l» 1 19 Set up storing instruction

ODO 03U 02813 02829 k OOA 013 OOA 029 1* 11

«=8 Obtain 2 a<-l *

2 -®^

100 }

OAli 029 OOOIO 02036 5 [e^ ] 010 008 036 5 12 Store word of subroutine

0D8 036 02035 O902C 1 008 035 027 02C 1 10 Extract 2nd binary

digits of addresses

OBO O2<0 0900A 02C2D 8 027 OOA OOB 020 8 63 Find correction tern

OBlt 020 0200B 00031 5 008 OOB M 031 5 11* Correction instruction

ocU 031 0A438 0A82E c 029 038 02A 028 c 1^11 Test for end of subroutine

0A8 02A 05C29 0Al*30 5 017 029 029 030 5 10 Modify (029) for next word

oco 030 07020 0Bl*29 5 01 C 0?D 020 029 5 15 Modify (02D) for next word

0B8 02B 0*1*10 0B02P 5 [039 ]010 038 02F 5 18 S*"?8(at%-1)2

'8 *

OBO 02F 05C2E 0B82B 5 017 028 02B 02 B 5 12 Modify (028) for next

subroutine

OAO 02B 014038 0A007 c 010 038 028 007 0 19/20 Test for last subroutine

ooi* ; 035 I4OIOO 1*0100 0 - 100 100 100 100 0 - Extractor

OBO 038 (LjZ '28

0*1* 039 (agebg-l)2

•

OWJ+lm 037m ( VVi>2

"8* V'*

8

080+lpa 038m 00000 00000 0 000 000 000 000 0
-102 -

Time required is approximately 6| milliseoonds per instruction requiring

modification.
-X03-

20.0 Some Special Features of the 3~addrcfifl System. there ere a

number of advantages in the use of the 3~addrese system on the SBd£.

One obvious advantage oen be seen ,by recalling the opposition of a

3-addrese Instruction (of. Pert I, per. 8.2), Since each address is

represented by 12 binary digits (exactly 3 hexadecimal digits) instead

of ten, the decomposed (true hexadecimal) form of an instruction, is

identical with ite composed (machine hexadecimal) form.

Also, it was indicated in Part X, par. 8.2 that the handling of

subroutines in the 3-address system ie facilitated in 2 ways§ (l) the

neoessity to print an exit instruction before entering a subroutine

(see par. 19,1 (3) ) can be eliminated by use of the binary digit d to

select one or the other of the address counters C0 and C^. Characteristically, during the course of the main routine we would have d » 0,

the control being thus referred to counter C

0

. One would get into a

subroutine by means of a comparison instruction in nhioh M < (/S),

y is the address of the first subroutine instruction, and d » 10

Counter would then be reset to Y 9 and the control would be established

by Cj as long as d * 1. The last subroutine instruction executed would

have d * 0, thus causing the control to return to Co* picking up shore

it left off, (2) The need for the incorporation routine of pare 19.]*,

arising from the fact that subroutines are usually precoded for blocks

of cells beginning with a standard address, is eliminated by Ufa of the

digits a,b,o. References in the subroutine instructions to words stored

in standard locations outside the subroutine (such as standard constants,

and standard temporary locations) do not depend on the aotual location of

the subroutine in the memory. On the other hand, references to words
-loi*-

within the subroutine (such as other instructions, or non-standard

constants included with the subroutine) oust be adjusted to conform to

the actual subroutine location. For each address in the fomer category

,

the corresponding digit a, b, or c is made zero, indicating that the

address is to be interpreted in an absolute sense. The effect of

assigning the value one to any of these digits is to eause the corresponding

address to be interpreted relatively to the address of the instruction

itself. Thus, for example, letting k be the hexadecimal digit formed by

the binary digits a,b,c,d, the instruction

Address o< /* r k Op

2C8 013 003 005 7 5

would be interpreted during execution as

Address ft r K Op

2C8 013 2CB 2CD 7 5

One oomplioation that arises in this type of application is that

the base with respect to which floating addresses are interpreted ohanges

each time the control advances. Suppose, for example, that a subroutine

in its originally coded form contains the two instructions

Address ft r K Op

009 00E 010 008 9 1

• 0

00B

•

013 OOE

•

009

•

5

•

5

Suppose further that in actual use the above two words are stored in

057 and 059, respectively. Theno^ of the first instruction will be

interpreted as 057*008=065; and of the second instruotion will be

interpreted as 059*008=067. Thus, whereas it was originally intended
that o< of the first instruction and /S of the second refer to the same

location, this is no longer the case. The address that we really wish to

transform 00E to is clearly 95C. The difficulty is resolved by rewriting

the subroutine before use, so that every address to be interpreted

relatively is decreased by the address of the instruction of which it is a

component. If the application of this rule would yield a negative address,

then add 1000 (in hexadecimal) to the address in question before subtracting

the address of the instruction. Thus, in the example given, replace 00B

in the first instruction by 00E=009»005s and in the second by 00E°00B*b003.

Then in the actually used locations, the interpretations will be 0£7*00 5*0 5C

and 059*003“05C, respectively, as desired.

A further complication in the use of 3-address coding as compared

with headdress is that much more care has to be taken in arranging

instructions in proper sequence. While in the headdress system the path

of the control is completely flexible, in the 3-address system a change

from the originally coded path can be achieved only by inserting an

appropriate comparison instruction.

The standard constants in par. 19. 3 were chosen primarily with

convenience for U-address coding in mind. These constants, while

numerically the same regardless of the coding system used, sometimes

have different applications in the two systems. For example, in

U-address, "1" in the , /£ , Y, and £ addresses are, respectively,

«=»XS cz>28 equivalent to 2 , 2 ,2 , and 2 , In 3-address, however, "1" in

o(t/St ud Y are equivalent to 2~^, 2 , and 2 respectively.

Similarly, in U-hddress, the , /S f Y > and £ extractors are represented
-106-

by 2^- 2"®, 2*® - 2°^

, 2 2~*^, and 2 2 respectively; whereas

in 3-address theo^ , /S’, and extractor e are given by 2^- 2 2 2

and 2 2 respectively. It will be noted that 2

^

and the 3-address

extractors are not included among the standard constants.

fining is calculated in the 3-address system exactly as in U-address.

It must only be noted that in phase k, the looation of the new instruction

is specified by the appropriate counter, since there is no cT address.

The preparation of a cod© in 3-address will be illustrated by the

following two examples.

20.1 Example 1 . Prepare a subroutine for the calculation of the

square root.

Solution. A flow diagram and ii -address routine for square root

computation was given in par. lf>. 1 . The same notation and method of

computation will be used here. The subroutine will be coded beginning

in address 000. Some of the assumptions for standard ^-address subroutines

(par. 19 . 1 ) will be made here; namely, that the standard constants of

par. 19.3 ore in the memory, that the argument is in 00D, and that the

result goes to 000. Addresses 008-00F will be available as temporaries.

The code is as follows t

Address o<

•* <

• **.*****•"'* ft r °P Explanation

j 000 000 010 009 3 C N < 07

001 013 010 OOA 1 5 *0 “ 1

Joog 00A 000 ooc 1 B H/x

1

003 000 OOA 00B 1 5 *i * nA

i

ooli 00B Oil* 00® 1 8 4(*i

* * **!

005 00* OOA 00? 3 0

*i*i

< H1

*
-107-

Address /« y k Op Explanation

006 00A 010 000 0 5 Ylf 000

007 ODE 010 00A 1 5 *i>l *i

008 000 001 002J F 0 Cofitrol-M^ 002

009 000 001 000 0 F- Error halt

111 this code, we have made d«l on all instructions except that in

006, the last to be performed, and in 009 where it is rather immaterial

since an error is indicated and the machine halts. The only instructions

where addresses are to be interpreted relatively are in 000 ( Y interpreted

relatively, c“l), 005 ( If interpreted relatively, c=l), and 008 ( f ¥ interpreted relatively, a^b*©58!). If we rewrite these instructions

according to the rule described in par. 20.0, we see that the instruction

in 000 is unchanged and the instructions in 005 *nd 008 ‘become

Address o< ¥ k Op

005 00B 00A 002 3 0

006 FF8 FF9 FFA F 0

20.2 Example 2. Using the subroutine of Example 1, write a routine

for the computation of

V “* * 1 ’ •••’ 8>

including read-in instructions, and read-out instructions for the u^.

Solution. As in Example 1, addresses 008-00F will b© used for

temporaries, and the standard oonstants will be assumed to be in 010-027.

The input instructions for the routine will be written in tank 0. The

eight will be stored in OltS-OltF, and the will be sent to the same

address. The subroutine of Example 1 will be stored in 030-Olj.l. As in
-108-

the example of par, 17 . 3, all variable instructions will be preset to

their initial states before entering the aotual computation. This example

illustrates, among other things, how the base operation, B, may be used as

a tally (in addresses 001 and 032 j see tabulation of operations in par,

13. 0 ).

Address ft r M Op Explanation

000 000 000 [008] 0 0 Head in 8 words

001 [020 J 027 ooa 0 E Head-in completed?

002 000 000 008 0 0 Constant

003 001 000 000 0 0 Constant

00l» 000 002 000 0 5 Modify (000)

005 001 003 001 0 5 Modify (001)

008 002 003 000 0 0 Control — 000

007 000 000 000 0 0

008

•

t * Temporaries

OOP l ^

010

»

f I

t Standard constants

027 J

028 000 000 ol*e 0 0 Head in x., i K 1,...,8

029 01*2 010 02C 0 5 Preset 02

02A 01*3 010 031 0 5 Preset 031

02 B oua 010 032 0 5 Preset 032

f02C [01*8 ] 010 008 0 5 *3 008

Q2D 008 010 000 0 5 xj 000
109-

r—

Address .

' —

, r a P V 6' °p Explanation

02E 010 013 038 1 D Enter subroutine

02F 00D 008 008 0 9 x.3/2

1

030 013 008 008 0 $ 1 + x,3/2

i

031 008 j OOD [01*8] 0 B Xji/(1 + 3^3/2) = U;L

032 [02F] 036 033 0 E If x < 8* go to 033

If i = 8 9 go to 037

033 02C 021 02C 0 $ Add 1 to a of 02G

03i* 031 ol*$ 031 0 $ Add 1 to Y of 031

03$ 032 021 032 0 5 Add 1 to a of 032

036 010 013 020J 0 D Control —> 02C

037 000 000 01*8 0 F- Read out u„ s i = lj,ooos> 8

038 OOD 010 009 3 C

\

039 013 010 OOA 1 $

f03A OOA OOD OOC 1 B

03B OOC

| OOA OOB 1 $

03C OOB Oil* OOE 1 8 v Square Root Subroutine

03D OOE OOA 002 3 D

03E OOA 010 OOD 0 $

03F OOE 010 OOA 1 $

i oUo FF8 FF9 ffaJ F D

ola 000 001 OOD 0 F- ,/

01*2 01*8 010 008 0 $ Constant instruction

01*3 008 OOD Ol*8 0 B Constant instruction

olOt 02F 036 033 0 E Constant instruction

ol*$ 000 000 001 0 E

2“3l*
-110-

Addross °< ft & k op Explanation

oue

oU7

Oi|8

Oi»P

000 000 000 0 0

000 000 000 0 0

Blank

of x. and u.

i i
-111 -

21.0 Remarks . There ar© many aspects of SEAC programming and

operating that have not been discussed in this Handbook. Such topics

at the use of the manual controls, techniques of code-checking both on

and off the SEAC, use of breakpoints, assembly and composition routines,

instructions for use of auxiliary equipment, descriptions of subroutines,

etc., have been omitted. However, information is available on these

subjects in the Computation Laboratory Technical Memoranda, and the

Electronic Computers Laboratory Technical Memoranda listed in the

references below. These memoranda are prepared in an effort to maintain

a record of current developments in SEAC operating and programming,

REFERENCES

1. Goldstine, H. H. and von Neumann, J.

, Planning and Coding of Problems for

An Electronic Computing Instrument , Institute for Advanced Study,

Prinoeton, N. J.

, 19ii7.

2. von Neumann, J,

, and Goldstine, S. H. , Numerical Inverting of Matrices of

High Order, Bulletin of the American Mathematical Sopiety, pp, 1021-1099

(Hov., 19li7).

3. Isaao, E. J.

, and Trabka, E, A., Machine Aids to Coding , Cornell Aeronautical

Laboratory, Mar., 19*22,

U, Wilks, M. V,

, Wheeler, D. J.

, Gill S. , The Preparation of Programs For An

Electronic digital Computer, Addison-Wesley Press, Inc., 1951,

5, Leinor, A. L.

, Provision for Expansion in the SEAC, Mathemati cal Tables

and Other Aids to Computation, pp. 232-2 37* (October, 1951)

6, Machine Development Laboratory Staff, The Incorporation of Subroutines

into a Complete Program on the RBS Eastern Automatic Computer , Matftemati cal

fables and Other Aide tc Computation,, pp. 16h«168 (July, 1950),
> 112 ^

7. Soarborough, J, B.

, Burner! cal Mathemati cal Analysis

,

pp, 1?8 -18h, The

Johns Hopkins University Press, 1930,

8, Electronic Computers Laboratory, National Bureau of Standards, Technical

Memoranda .

8.1 No. 16 M, External Selector Unit for SEAC, Oct., 1951.

8.2 Ho. 19 M, Installation of External Selector Panel on $£&£, Oct., 1951.

8.3 No. 30 M, The Outscriber, Mar., 1952.

8.I4. No. h2 M, Operating Instructions for Magnetic Input-Output Devices

in SEAC, June, 1952.

8. 5 Ho, U3 M, Three-Address Operation of SEAC Control Panel, Jul., 1952,,

8.6

No, kh M, E 1.1, E 1.2 (512), E 2,2 (l02h) Dump Routines, Jul., 1952.

9 e Computation Laboratory, National Bureau of Standards, SEAC Operating and

Programming Notes , I, (April, 1952); includes following 1

9.1 Tech. Memo, No. 1, Operation of SEAC Control Panel as of Oct., 1951*

9.2 Tech, Memo, No, 2, Non-Mathematical Routines,

9.3 Tech, Memo, No. 3* Conversion Subroutines for Integers*

9.

U Tech. Memo. No, k9 Decimal to Binary and Binary to Decimal Subroutines.

9.5 Tech, Memo, No, Subroutines for 2 and e*\

9.6 Tech, Memo. No. 6, Subroutines for 'jlir , '^TN,

9.7 Tech. Memo, No. 7* Subroutines for Sin x and Cos x.

10.

Computation Laboratory, National Bureau of Standards, SEAC Operating and

Programming Notes , II , (July, 1952); includes followings

-1

10.1 Tech. Memo. No, 8, Subroutine for Tan a/b

10.2 Tech, Memo, No. 9, Hexadecimal -Decimal Converter Table

10.3 Tech, Memo. No. 10, Four-Hexi Converter Table,
113“

10,

U Tech, Memo, So, 12, Subroutine for Decimal to Binary Conversion

of a Double Precision Number with Fixed Binary Point,

10.5 Tech. Memo, No, 13, Subroutine for i Differences, i*l,2,...,6

10.6 Tech, Memo, No, lii, Three-Address System and Base Order,

10.7 Tech, Memo, No, 15, Preparation of Pure Hexadecimal Coding for

Punched Card Composition.

11, Computation Laboratory, National Bureau of Standards, SEAC Operating and

Programming Notes , III , (Aug., 1952)j includes following?

11.1 Tech, Memo, No. 16, Magnetic Tape to Wire Transfer and Cheok Routine,

11.2 Tech, Memo, No, 17, Subroutines for Basic Arithmetic Operations and

Square Hoot in Floating Decimal Form,

11.3 Tech, Memo. No. 18, General Dump Routine (512 or 1 02U Word Memory)

11, U Tech. Memo. No. 19, Memory Decomposition Routine (512 or 1021* Words)

11.5 Tech. Memo, No. 20, Flow Charts for Magnetic Tape Checking Routines.

12. Computation Laboratory, National Bureau of Standards, SBAC Operating and

Programming Notes , IV, (Sept., 19$2); includes followings

12.1 Tech. Memo. No. 21, Composition Routine (SEBBE).

12.2 Tech, Memo. No. 22, Basic Arithmetic Operations I, Floating Binary

Point, Single Precision Numbers.

12.3 Tech. Memo. No. 23, Subroutine for Cube Root, Single Precision,

Floating Binary Point.

12, U Teoh. Memo. No, 2U, Subroutine for sin z, cos z, z*x+iy

12.5 Teoh. Memo, No, 25, Corrections and Changes to Technical Memoranda

Numbers l“2ii.
X3c Computation Laboratory, National Bureau of Standards, SBAC Operating

and Programming Notes , V, (Sept., 1952)$ includes followings

V £ 13.1 Tech* Memo, No, 26, Interpretive Subroutine for Operations on

Complex Numbers,

13.2 Teoh, Memo. No, 27, Subroutine for Square Root of a Single

I. Preoision Number with Floating Binary Point,

13.3 Tech. Memo. No, 28, Subroutine for Sinh y. Cosh

y, jyf< 2.063U.

13, U Tech, Memo, No, 29, Code Checking,

13.5 Tech, Memo. No, 30, Basic Arithmetic Operations for Double

Preoision Numbers with Fixed Binary Point.

13.6 Teoh. Memo. No. 31, Interpretive Subroutine for Operations on

Double Precision Numbers.
THE NATIONAL BUREAU OF STANDARDS

Functions and Activities

The functions of the National Bureau of Standards are set forth in the Act of Congress, March

3, 1901, as amended by Congress in Public Law 619, 1950. These include the development and

maintenance of the national standards of measurement and the provision of means and methods

for making measurements consistent with these standards; the determination of physical constants and properties of materials; the development of methods and instruments for testing materials,

devices, and structures; advisory services to Government Agencies on scientific and technical

problems; invention and development of devices to serve special needs of the Government; and the

development of standard practices, codes, and specifications. The work includes basic and applied

research, development, engineering, instrumentation, testing, evaluation, calibration services, and

various consultation and information services. A major portion of the Bureau’s work is performed

for other Government Agencies, particularly the Department of Defense and the Atomic Energy

Commission. The scope of activities is suggested by the listing of divisions and sections on the

inside of the front cover.

Reports and Publications

The results of the Bureau’s work take the form of either actual equipment and devices or published papers and reports. Reports are issued to the sponsoring agency of a particular project or program. Published papers appear either in the Bureau’s own series of publications or in the

journals of professional and scientific societies. The Bureau itself publishes three monthly periodicals, available from the Government Printing Office: The Journal of Research, which presents

complete papers reporting technical investigations; the Technical News Bulletin, which presents

summary and preliminary reports on work in progress; and Basic Radio Propagation Predictions,

which provides data for determining the best frequencies to use for radio communications throughout

the world. There are also five series of nonperiodical publications: The Applied Mathematics

Series, Circulars, Handbooks, Building Materials and Structures Reports, and Miscellaneous

Publications.

Information on the Bureau’s publications can be found in NBS Circular 460, Publications of

the National Bureau of Standards ($1.25) and its Supplement ($0.75), available from the Superintendent of Documents, Government Printing Office. Inquiries regarding the Bureau’s reports and

publications should be addressed to the Office of Scientific Publications, National Bureau of

Standards, Washington 25, D. C.