More the knowledge lesser the ego, lesser the knowledge more the ego.*Albert Einstein*

### Konrad Zuse—the first relay computer

During his study of civil engineering in the Technical College of Berlin Charlottenburg (Technischen Hochschule) Konrad Zuse (biography of Konrad Zuse) faced a serious problem, while studying the construction of buildings and roads. This type of constructions require solving of huge systems of linear equations, which was very hard to be done by means of a logarithmic rule or even mechanical calculator of this time. Zuse recalled later:*I was a student in civil engineering in Berlin. Berlin is a nice town and there were many opportunities for a student to spend his time in an agreeable manner, for instance with the nice girls. But instead of that we had to perform big and awful calculations.*

Some time in 1934 the young Kuno (as his friends called him) started thinking about computers. After the graduation from the Technical College in 1935, he started as a design engineer at the Henschel Flugzeugwerke (Henschel aircraft factory) in Berlin-Schönefeld, but resigned a year later, deciding to devote entirely to the construction of a computer.

Kuno arranged a workshop in the apartment of his parents and decided to devote entirely to the construction of the computer. Initially he was helped not only by his parents, who allowed him to use the largest room of their apartment as a workshop, and gave him some money (although his father was a post office clerk and didn’t have much money), but also by his sister Lieselotte, and several of his fellow-students and friends. Thus he managed to collect several thousand marks for materials, moreover some of them practically helped his in the workshop. The most innovative was his friend Helmut Schreyer (1912-1984), which will play important role in the construction of the Zuse’s computers.

Konrad Zuse (on the right) and Helmut Schreyer working of the Z1 in the apartment of Zuse’s parents

#### The first computer of Konrad Zuse—V1 (Z1)

In 1936 Zuse finished the logical plan for his first computer, the *V1* (V for *Versuchsmodell*—experimental model). Actually all the first computers of Zuse was named with V (V1 to V4), but after the WWII he changed their names to Z1 to Z4, in order to avoid the nasty association with the V1-V4 military rockets. The manufacturing begin in the same year and the prototype was ready in 1938 (see the lower photo), making the Z1 the first relays computer in the world.

Construction of the Z1 in the apartment of Zuse’s parents

Z1 was a machine of about 1000 kg weight, which consisted from some 20000 parts. It was a programmable computer, based on binary floating point numbers and a binary switching system. It consisted completely of thin metal sheets, which Kuno and his friends produced using a jigsaw. The only electrical unit was an electrical engine with power 1kW, which was used to provide a clock frequency of one Hertz (one cycle per second), actually it had also a crank for manually cycling the machine. Z1 consisted of 6 basic units: Control unit; Arithmetical unit; Input/Output; Memory; Memory selector; Tape reader (see the lower drawing).

The *punch tape and punch tape reader* are used for programming of Z1. The *control unit* supervised the whole machine and the execution of the instructions. The *arithmetic unit* (with two registers—R1 and R2) was an adder, and all of the operations were internally reduced to additions or subtractions. The *memory*, which consisted of 64 words, each containing 22 bits, was formed from three blocks. The first block contained 64 words for the exponents and signs (8 bits for each word). The other two blocks each contained 32 words for the mantissa (14 bits for each word). The *selection unit* interpreted the address for the memory, managed by the control unit. The *input devic*e was a keyboard, numbers were presented to the machine in a decimal form with an exponent, then they were converted to binary normalized floating point representation and transferred to the memory. Similarly, the *output device* converted the binary floating point number in Register R1 into a decimal number with an exponent and showed them on a annunciator.

A block of Z1 (© Horst Zuse)

The Z1’s programs (Zuse called them *Rechenplans*) were stored on punch tapes by means of a 8-bit code. The instruction set of the Z1 consisted of eight instructions as follows:

1. Two instructions for input/output:

•**Lu**—to call the input device for decimal numbers

•**Ld**—to call the output device for decimal numbers

2. Two instructions for reading/writing from/to memory:

•**Pr z**—read the contents of the memory cell into Registers *R1* or *R2*

•**Ps z**—write the contents of Register *R1* to the memory cell

3. Four arithmetical instructions:

•**Ls1**—add the two floating-point numbers in the Registers *R1* and *R2*

•**Ls2**—subtract the two floating-point numbers in the Registers *R1* and *R2*

•**Lm**—multiply the two floating-point numbers in the Registers *R1* and *R2*

•**Li**—divide the two floating point numbers in the Registers *R1* and *R2*

#### The first reliable model—Z2

When in 1936 Konrad invited his friend Helmut Schreyer to come and see his machine, Helmut came, saw his strange plates and expressed spontaneously: "You have to do this with tubes." First reaction of Kuno was negative— "this is another one of the mad *schnapsideas* (drink ideas) of my friend!". With tubes can be built radio equipment, but calculating machines? Almost at the same time the same the idea came to the mind of the american physicist John Atanasoff, and he namely will be the first man to build an electronic computer (see the ABC computer).

The young engineers Konrad Zuse (left) and Helmut Schreyer (right)

Zuse and Schreyer continued to work together on the mechanical models, but Schreyer’s idea was not dead. Schreyer wrote his doctoral thesis on this topic at the Institute for Research of the Technical University Berlin Charlottenburg and created several logical circuits with tubes. In 1938 Zuse and Schreyer demonstrated the electronic circuits to some german scientists, and even exposed their idea of building an electronic computer, but when they mentioned that such a device will require some 2000 tubes and several thousand glow lamps, this was categorizes as a "fantasy". The largest electronic devices of this time consisted from several hundred tubes. Later on Schreyer will try again in vain to interest the authorities in their work, proposing to the army to build an electronic computer for the airforce from about 2000 tubes, but when he explained that 2 years will be enough to manufacture the machine, the reaction was "We will win the war long before your computer will be ready, why bother?".

Zuse was unsatisfied with the reliability of the binary switching metal sheets used in the Z1, especially in the arithmetical unit. He was acquainted with relays, used in telecommunications, but namely Schreyer was the one, who had a big experience with the relays and switching schemes as a telecommunications specialist. The friends made some some approximate considerations, but they showed, that a relays computer will require several thousands of relays, so a room full of relay cabinets seemed unacceptable to them. Besides that, the relays were too expensive for the scare funding of Zuse. That’s why he decided to construct his second computer, Z2, with arithmetic and control units made by relays, but to keep the mechanical memory of Z1 (this will also require less space). He managed to find 800 old relays from phone companies and with the help of his friends fixed them to be suitable for his purpose. These old relays will become a reason for a lot of problems with the reliability later on.

Trying to find funding, in 1937 Zuse got into contact with the former manufacturer of mechanical calculators—Kurt Pannke. The first contact was a failure, Dr. Pannke said to him: "…at the field of computing machines virtually everything, until the last possible approaches and sophisticated devices, has already been invented. There is hardly anything left to invent." Nevertheless, Dr. Pannke agreed to visit the workshop of Zuse, and was so impressed by the his work, that decided to grant him seven thousand Reichsmark, which made possible the work to continue.

The manufacturing of Z2 began in 1938 and the prototype was ready next year. Z2 was quite similar to Z1, with the following differences:

1. The Z2’s arithmetic unit consisted of a 16-bit fixed-point engine.

2. Schreyer proposed to use a 36-mm film tape, instead of the paper tape of Z1.

3. The memory is smaller—16 cells with 16 bits each.

4. The Z2 is faster then Z1—3 Hz.

The instruction set of the Z2 consisted of the same eight instructions of Z1. Z2 worked reliable enough for arithmetic calculations. So Zuse was convinced his next computer, Z3, to be built completely out of relays.

As yearly as 1937 Zuse has already devised the ides of a full "von Neumann" type machine, despite of the fact, that his first relays computers are not "von Neumann" machines (they didn’t have the "stored-program" ability). Zuse was aware of this fault, as well as of another important one—the lack of a conditional branch instructions, but can you try to imagine a computer with 64 words memory to be a "stored-program" machine? Can you try imagine a computer, with a processor, built from metal plates, to have internal conditional branch instructions? I cannot! It was too early and Zuse didn’t have needed resources, to make such a machine.

At the same time, Zuse developed the theoretical base of his computers. He was acquainted with the binary digital system of Leibniz (so called *Dyadik*), but he didn’t know anything about George Bull and his algebra. He had to study not only Bull, but also the mathematical logic of Hilbert, Frege, Schröder and other logicians. Unfortunately he missed Babbage and his notation, which could make his research much easier. Finally he developed his own system and called the notation "Conditional Combinatoric" (Bedingungskombinatorik).

#### The first workable programmable computer in the world—Z3

In 1940 Z2 was successfully demonstrated to the *Deutschen Versuchsanstalt für Luftfahrt* and Zuse obtained partially funding for the development of his third computer, Z3, which he began to build in 1939. Z3 (see the lower photo) was ready in the spring of 1941, and in May, 1941, it was presented to the scientists in Berlin. Z3 and was built completely out of relays (600 for the arithmetic unit, 1400 for the memory and 400 for the control unit). In all other aspects it was similar to Z1 and Z2: it used binary numeral system and floating-point numbers, a floating-point arithmetic unit with two 22-bit registers, storage capacity of 64 words with 22 bit word length, control via 8-channel tape (i.e., a command consisted of 8 bits). The input was via a special keyboard. Output by displaying the results on light stripe including the location of the decimal commas. It was a little bit faster—5,33 Hz. The principle of work of the machine however, was improved, introducing some parallelism: a 22-bit word of data could be moved from the memory to the Register R1 and vice versa in one step (clock cycle). The same holds true for the arithmetic unit, where, amongst other things, parallel adders were used.

The reconstructed Z3 computer of Zuse in Deutschen Museum, München

The arithmetic unit of the Z3 was Zuse’s masterpiece. The instruction set of the Z3 consisted of nine instructions, the same eight instructions of Z1 and Z2, and one additional—Lw (square root). Division and square root needed 20 cycles (about four seconds), multiplication—16 cycles (about 3 seconds), addition and subtraction—less than a second. Actually internally all the arithmetic operations are reduced to addition or subtraction (subtraction is an addition of the complement of one number and the number). The multiplication algorithm is like the one used for decimal multiplication by hand. That is, it is based on repeated additions of the multiplicator according to the individual digits of the multiplicand. The division algorithm is similar to that for multiplication, except that repeated subtraction is used. The square root was calculated by a division. The Z3 included also the ability to perform arithmetic exception handling. Zuse even provided possibility of micro-sequencing and pipelining of the instructions, and a carry-look ahead circuit for the addition operation, in order to minimize the execution time (later on Zuse will improve this mechanism, designing a program look-ahead mechanism, i.e. program can read two instructions in advance, and test them to see whether memory instructions can be performed ahead of time).

#### The S1 and S2 Computers

After the development of Z3, Zuse received an order from his first employer—Henschel aircraft company for the development of specialized computer for measuring the surface of wings of airplanes. The machine S1 was ready in 1942 and contained approximately 600 relays and had hardware-wired programs. The company ordered another machine, which was ready in 1944. S2 was the successor of the S1, and consisted of approximately 800 relays and about 100 dial gages in order to measure the surface of the wings. The S2 can be regarded as the first process computer in the world.

#### The Z4 Computer

In 1942 Zuse started the development of his next computer—Z4. The goal of the Z4, was to build the prototype for a machine, that was intended to be produced in the thousands. The lack of materials however, and a tragic situation in Germany (it was wartime and Berlin was attacked almost every day by bombers), made this task almost impossible. In March 1945 Zuse eventually fled from Berlin with his pregnant wife Gisela and the semi-finished Z4 computer. He arrived at Hinterstein, Bavaria, and hid the computer in a barn. He desperately wanted to resume work on the Z4, but his first problem was to survive the years after the war. In order to get some food, he made woodcuts and sold them to the farmers and the American troops. The Z4 was reassembled as late as 1948. The next year Zuse was contacted by prof. Eduard Stiefel from ETH-Zürich, who inspected the machine and found it suitable for scientific calculations. Despite of the little bit old-fashioned technology of Z4 (at the same time in USA are developed electronic computers), Stiefel was impressed by the simplicity of programming and the powerful arithmetic unit with its exception handling capability, that’s why he decided to by the Z4. Encouraged by this, Zuse founded the his own company (Zuse KG) and started to build an improved version of Z4 for EHT, adding a conditional branch capability, instructions for printing the results on a Mercedes typewriter or a punch tape, storing numbers on the punch tape in order to transfer them into the Z4’s memory, writing results on a punch tape and others. Restoring the Z4 cost the Zuse KG about 60000 DM. The ETH paid an amount of around 100000 DM. With this money it was possible to found the Zuse KG and restore the Z4. (It is worth mentioning that the average income at this time was about 180 DM per month.) The Z4 was a great success for both the ETH and the Zuse KG.

The Z4 computer of Zuse in ETH-Zürich

The Z4 in Zürich was put in action in September 1950 and proved to be reliable. For surprise of all, the memory of Z4, consisting of thousands of metal sheets, screws and pins, was the most reliable feature of the machine. The Z4 worked very reliably and also worked during the night without supervision, something unbelievable in this time. The improved Z4 consisted of about ten relay cupboards containing 2200 standard relays, plus 21 stepwise relays for the micro-sequencer. The Z4’s memory was a mechanical one with 64 words, each containing 32 bits. The structure of the mechanical memory was similar to the memory of the Z1 (and Z2 and Z3). However, while the Z1 had a word length of 22 bits, the word length of the Z4 was extended to 32 bits. Each word was directly addressable by the instructions on the punch tape.

The Z4 made use of a unit called a Planfertigungsteil (program construction unit),which was used to produce punch tapes, containing instructions for the Z4 in a very easy way. For this reason, it was possible to learn the programming of the Z4 in as little as three hours. The Z4 had a large instruction set in order to calculate complicated scientific programs. The arithmetic processor was a powerful binary floating processor. The set of instructions is as follows:

1. Instructions for Input: *<-*, *At1*, etc.: These allow numbers to be read from the punch tape.

2. Instructions for Output: *->*, , , etc.: These instructions cause binary numbers to be converted into their decimal equivalents and the results to be displayed with lamps, on the MERCEDES typewriter as floating or fixed point numbers, or on the punch tape.

3. Instruction for reading from memory: *A n*. For example *A 17*. This reads the contents of memory cell 17 into the Register R1. If Register R1 is occupied, then the contents are loaded into Register R2.

4. Instruction for writing to memory: *S n*. For example *S 18*. This writes the contents of Register R1 into the memory cell 18.

5. Dyadic operations: *+, -, x, /, MAX*, and *MIN*

6. Monadic operations: *x2, SQR(x), 1/x, | x | , sign(x), x*1/2, x*2, x*(-1), x*10, x*3, x*1/3, x*1/5, x*1/7, x*Pi, x*1/Pi*

7. Instructions for comparison: *x = 0, x >= 0, | x | = infinity* test the value in Register R1 and set Register R1 to +1 if the condition is fulfilled, if not, then the contents of Register R1 are set to –1.

8. A conditional branch instruction: *SPR*. The instruction *SPR* skips the punch tape to the instruction ST, if Register R1 contains +1 (if Register R1 contains –1 then there is no impact).

9. Instructions for switching the punch tape readers (the Z4 had two punch tape readers).

Like the Z3, the Z4 supported powerful arithmetic exception handling. The computing times were: addition and memory access, half a second; multiplication, 3 seconds; division and square root, 6 seconds; overall performance, 2000 instructions, or 1000 arithmetic operations per hour.

Zuse KG continued to manufacture relays computers—Z5 (1952), Z7 and Z11 (1954), drawing computer Graphomat Z64 (1957). As late as 1957 Zuse decided to change the relays technology with electronics. The Z22 was ready in 1958 and was an electronic computer (based on vacuum tubes), it was also the first "stored-program" computer of Zuse. In 1961 the Zuse KG launched the Z23, which was a powerful transistor computer with almost the same logic as the Z22. The next computer of Zuse was Z31, which contained a decimal arithmetic unit, and it was especially designed with banking and commercial applications in mind. In 1964 was launched the Z25 computer, which was a small and cheap machine that would be suitable for many different applications. The last computer of Zuse was Z43 (1964), a modern transistor computer with TTL logic. In 1958, Zuse designed a parallel computer, which was never built. He called it the *Feldrechenmaschine* (field calculation machine) consisting of 50 processors.

Konrad Zuse was a genius as an engineer, but not so good as an entrepreneur. Since the beginning of 1960s Zuse KG got deeper and deeper into financial difficulties and in 1964 was bought by the steel company Rheinstahl, but continued to manufacture computers till 1969, when was bought by Siemens AG. The Zuse KG sold about 250 computers from 1949 to 1969 of a value of some 100 Million DM.

#### Plankalkül—the world’s first complete high-level language

From 1942-1946 (at the same time as he was developing the Z4 computer), Zuse was also developing ideas as to how his machines could be programmed in a very powerful way (that is, more powerful than arithmetic calculations only). In addition to pure statements for number calculations, Zuse also used rules of mathematical logic. On the one hand he used the powerful predicate logic Boolean algebra as language constructs. On the other hand he developed a mechanism to define powerful data structures, commencing with the simple bit (binary digit) and working up to complicated hierarchical structures. In order to demonstrate that the Plankalkül language could be used to solve scientific and engineering problems, Konrad Zuse wrote dozens of example programs. In his notes one can find the sorting of lists, search strategies, relations between pairs of lists… He even used more than 60 pages to describe programs for chess-playing and predicted, that in some 50 years a computer can beat the human world chess champion. It proved to be an amazingly true foresight.

Zuse used an unusual technique for the statements in Plankalkül. Each data item was denoted with V (variable), C (constant), Z (intermediate result), or R (result), an integer number to mark them, and a powerful notation was used to denote the data structure of the variable. Zuse used the word *plan* for *program*. The highlights of Plankalkül are:

1. Data types: floating point, fixed point, complex numbers; arrays; records; hierarchical data structures; list of pairs.

2. Assignment operation, for example: V1 + V2 => R1.

3. Conditional statement, for example: V1 = V2 => R1. This means: Compare the variables V1 and V2: If they are identical then assign the value *true* to R1, otherwise assign the value *false*. Such operations could also be applied on complicated data structures.

4. Possibility for defining sub-programs.

5. Possibility for defining repetition of statements (loops).

6. Logical operations (predicate logic and Boolean algebra).

7. Operations on lists and pairs of lists.

8. Arithmetic exception handling.