Computing History · Early Computing
Instruction Encoding on the Harvard Mark I Paper Tape
How a 24-channel tape carries three eight-bit fields per instruction, what the index numbers address, and why a one-way sequence unit made program loops physical.
The instruction tape of the Harvard Mark I is twenty-four channels wide. One row of twenty-four punched positions carries one instruction, and the row divides into three equal groups of eight channels: the binary index of the result, the binary index of the source datum, and the operation code. No field is reserved for a literal constant, a second operand, or a mode bit. The division follows from the tape: twenty-four channels split three ways give eight channels per field, read as eight bits each, and 8 bits bound the index space at 256 values regardless of how many registers the machine contains.
Three fields on a twenty-four channel row
The machine was the Automatic Sequence Controlled Calculator, conceived by Howard Aiken, built by IBM at Endicott, shipped to Harvard in February 1944, and dedicated on 7 August 1944. It began Navy Bureau of Ships computations in May 1944. Its arithmetic was electromechanical, built from switches, relays, rotating shafts, and clutches, about 765,000 components in all. The 72 accumulators each held a 23-digit decimal number, and each was an adapted IBM adding machine. In that arrangement the location named by the first field is where the sum lands, and because the accumulator already holds a number, that stored value is the operand it adds from. The second field names the other operand: another accumulator, one of the 60 sets of 24 rotary switches that hold constants, or an input register fed by a separate numeric tape. The third field selects the operation, from addition and subtraction through multiplication, division, and evaluation of a logarithm or trigonometric function.
Read as a word, an instruction is 24 bits with three equal fields and no spare bits. A decoder for the documented layout is small enough to be exact:
MASK = (1 << 8) - 1
def decode(row):
"""Split one 24-channel tape row into the three documented fields."""
if not 0 <= row < (1 << 24):
raise ValueError("a row is 24 channels wide")
result = (row >> 16) & MASK # field 1: index of the result location
source = (row >> 8) & MASK # field 2: index of the source datum
opcode = row & MASK # field 3: operation code
return result, source, opcode
# result index 12, source index 47, operation 3
print(decode((12 << 16) | (47 << 8) | 3)) # (12, 47, 3)
The decoder enforces the format’s only structural rule: a row is 24 channels, and every field is bounded by 255. There is no escape sequence, no extended opcode, and no field that reinterprets another field. All 24 channels are allocated to the three fields, so there is no parity or check channel either; a mispunched hole changes the instruction rather than flagging it.
What 256 indices can name
An eight-bit field gives 256 index values, 0 through 255. Every storage location, every set of switches, and every register associated with the input, output, and arithmetic units was assigned a unique identifying index, represented in binary on the tape, so the index space is a complete map of the machine’s reachable state. The two largest groups can be counted from the documented configuration: 72 accumulators and 60 switch banks consume 132 of the 256 values, leaving 124 for input registers, output registers, and the registers inside the arithmetic units. The remainder is not generous, and it is fixed. A new class of register would have to take indices from that remainder or force a wider field, which would mean a different tape format.
Because the field holds an index and not an offset, there is no base register and no indirection. An instruction names its operand absolutely, and a program cannot compute an index and then use it. A routine that must touch accumulator 40 on one pass and accumulator 41 on the next is two sequences of rows, not one sequence with a counter, unless the tape is repunched. The switch banks are the same constraint seen from the other side: a value that changes between runs can be dialled into a bank and named by index, but it cannot be assembled from parts at run time. Constants are therefore a scarce resource with exactly 60 named slots, and a computation that needs more has to be restructured around the ones it has.
The other half of the constraint is on the instruction side. Instructions came from the tape and were executed as they were read. They could not be executed out of the storage registers, so an accumulator held a number and nothing else. The format has no way to describe an instruction held in storage, because it has no field that could name a register as a source of code rather than as a source of data. Whatever the machine was, its control was external to its memory.
A loop is a length of tape
The sequence mechanism was unidirectional. The current instruction was executed and then the next was read; nothing in the machine held a next-instruction address that a program could assign. The position of the reader was the program counter, and it moved forward only.
Two techniques follow from that. A loop can be copied out as many times as it is to run, which makes the length of the tape proportional to the number of iterations. Or the end of the program tape can be joined to its beginning, so the tape physically recirculates and the same rows are read again. A body of forty rows run five hundred times occupies twenty thousand rows in the first case, and forty rows plus a join in the second. The static program and the executed program are different objects, and only the first is written down anywhere.
Recirculation has no exit condition inside the format. Conditional branching was performed manually at first, so leaving a spliced loop depended on an operator decision taken at the machine. The modification made in 1946 introduced automatic program branching by subroutine call, which gave the machine a way to leave a stretch of tape and return to it. Until then, control flow was a property of the paper.
Data lived on a different medium. A separate tape could hold numeric input, but the instruction tape and the data tape were not interchangeable, and neither was addressable in the sense the index space implies. The contrast with the ENIAC, programmed by switches and cables is about where the program lives rather than whether it is stored at all: cables hold a configuration, tape holds a sequence, and neither is reachable as a numbered datum. The stored-program machines that followed put the next address in storage, which turned a loop from a length of tape into a counter and a jump.
Mechanical phases instead of fetch cycles
Three additions or subtractions per second set the base rate at about 333 milliseconds per operation. Multiplication takes about 6 seconds, division about 15.3 seconds, and a logarithm or trigonometric function more than a minute. Against the addition rate, a multiplication costs roughly eighteen additions, a division roughly forty-six, and a function evaluation more than 180.
Those ratios, not the tape, determine how long a job runs. A sequence of 500 additions, 100 multiplications, and 20 divisions works out to about 1,073 seconds, near eighteen minutes, from the documented per-operation times alone:
# Elapsed-time model from published per-operation times, in seconds.
ADD = 1 / 3 # three additions or subtractions per second
MUL = 6.0
DIV = 15.3
def elapsed(adds=0, muls=0, divs=0):
return adds * ADD + muls * MUL + divs * DIV
print(round(elapsed(adds=500, muls=100, divs=20), 1)) # 1072.7
The model is arithmetic on published figures, not a measurement. It ignores tape movement, the time to set switches, and the cost of reading a row, none of which the sources quantify.
Timing inside an operation is mechanical. The 50-foot drive shaft, about 15 metres, is coupled to a 5 horsepower motor and serves as the system clock, so the phases of a multiplication are positions in a rotation rather than states in a sequencer. The encoding carries no field for timing, priority, or dependency; the order of rows on the tape is the order of execution. Because the next row is read only after the current operation finishes, a six-second multiplication is six seconds during which no new instruction is read. A program dominated by multiplication spends nearly all of its time in the arithmetic units and very little at the reader, while a program dominated by addition is paced by the same three-per-second rate that governs everything else.
Credit assigned by press release
Aiken’s press release for the machine listed him as sole inventor. IBM chairman Thomas J. Watson had several IBM engineers on the project, and the attribution angered him. He attended the dedication reluctantly, and Aiken built further machines without IBM. The documented record carries both contributions: the conception and the sequence design associated with Aiken, and the construction at Endicott. Aiken and Grace Hopper described the machine in Electrical Engineering in 1946, in a paper titled The Automatic Sequence Controlled Calculator.
The machine was dismantled in 1959. Sections went to IBM, the Smithsonian Institution, and the Harvard Collection of Historical Scientific Instruments.
The architecture label arrived thirty years later
The term Harvard architecture dates from the 1970s, in the context of microcontrollers, and was applied to the Harvard machines only retrospectively. Richard Pawson argues in IEEE Annals of the History of Computing in 2022 that the label applies only to the Mark III and Mark IV, not to the Mark I or II, and that the Mark I instruction tape is not evidence for the later term.
The format supports that reading. The machine has one index space, the 256 values that name accumulators, switch banks, and registers, and the instruction stream is not in it. Instructions cannot be read out of the storage registers, and the data tape and the instruction tape are not interchangeable. What separates instruction from data on the Mark I is a read-only medium and a one-way reader, not two address spaces with different widths and different instructions for reaching them. The tape is a record of what the machine should do next, in order, and it says nothing about where the machine keeps what it knows.
References
- The Myth of the Harvard Architecture — Richard Pawson; IEEE Annals of the History of Computing, Vol. 44 No. 3, 2022
- The Automatic Sequence Controlled Calculator — Howard H. Aiken and Grace M. Hopper; Electrical Engineering, 1946
- The Origins of Digital Computers: Selected Papers, 3rd edition — Brian Randell (ed.); Springer-Verlag, 1982
- A History of Modern Computing, 2nd edition — Paul E. Ceruzzi; MIT Press, 2003