📜 ⬆️ ⬇️

A fistful of relays, or a computer on electromagnetic relays. Part 1 - ALU

I will tell you about how you can create a computer (more precisely, while only a part of it) on electromagnetic relays with your own hands.



How it all began


It all started with what I read about a computer on electromagnetic relays, created by Harry Porter - an enthusiast from the University of Portland. Here is his picture next to this computer:


')
Since I enjoy old computers (part of my collection can be seen in this album ), I also wanted to create something like this. I began to look for other projects and found many

Other modern computers on electromagnetic relays


Some of them more or less repeated the project of Harry, some only showed that the creation of such a computer is possible. For example, DUO 14 Premium , shown in the picture below, can execute a program containing up to 8 simple commands.



Project


So, I planned to create a computer similar to the HPRC . I wanted it to be able to count at least something real, and also to make all its elements vivid - one could trace the work of the ALU, registers, counter of instructions, etc.

I decided to start production with ALU. To determine the requirements for it, I outlined a set of instructions, and also figured out what tires and signals would be needed. The ALU has a parallel construction (all bits are calculated simultaneously) and is intended for 8-bit calculations.

I immediately decided what to do the subtraction module. In many other computers, this module is not implemented, since its work can be performed using negation and addition. Thus, the ALU will perform the following operations: addition, subtraction (with and without hyphenation), logical AND, OR, NOT, EXCLUSIVE OR, and also shifts to the right (with hyphenation or in a circle). The schemes for addition and logical operations I took from the HPRC.

Another rare feature is that the result of the calculation snaps into the shadow register. It is necessary so that the same general purpose register can be used as an input and as an output.

Since the ALU should work without other components of the computer so far, for its debugging, toggle switches that supply power to them are connected to the relay coils. The results of the calculations can be observed using LEDs connected to the outputs of the circuits. Regardless of the snap-on result, the computing units operate continuously, so with the help of indicators you can simultaneously observe the results of all operations.



Relay


A voltage of 24 V was chosen, not 12 V, as in most other modern computers on electromagnetic relays, in order to make the wires thinner. Subsequently, it turned out that this solution also has a drawback - there are no LEDs with an integrated resistor designed for 24 V, so the resistors had to be bought and soldered separately.

Since visibility should be one of the main features of a computer, I chose a relay with transparent housings and built-in LEDs. In addition to the fact that they look beautiful, it allows not to install extra LEDs to indicate input signals.

Already after starting the assembly of the computer, I, reading one of the blogs, realized that I did not have enough protective diodes to prevent arc discharges and knocking out indicators when the relay was opened. So I bought 100 pieces of 1N4448 diodes and soldered them parallel to each of the coils.

Materials


Since the computer should be visual, why should it not be beautiful? Harry used mahogany for the hull. I found merbau wood from suitable materials, in the form of planed boards of the same thickness.

All components are mounted on a 6 mm plexiglass sheet. The relay is glued, and everything else is either installed in specially drilled holes, or screwed. Plates with inscriptions are carved out of brass. The most difficult thing was to find brass bolts of a suitable size for fixing the plates. In Russia it was nowhere to order, but then I almost accidentally found them in a hobby shop in Helsinki.

Job


I started by buying a power supply, three dozen relays, wires, and switches for controlling inputs and internal signals generated by the ALU. The relays contain 4 two-position switches. In some cases, all 4 switches are not used, but it’s almost impossible to save using a relay with a smaller number of contacts.


These relays cost me about 200 rubles, so I began to look for cheaper options, as they estimated that about 100 pieces were needed for the entire ALU module. I managed to order one batch of 100 pieces at a wholesale price of just over 100 rubles per relay. But with this supplier, the relays themselves should not have appeared soon, so I continued searching.

It turned out that you can order relays directly from China are much cheaper. I ordered another batch of 100 pieces for about $ 1 each (the dollar at that time cost around 30 rubles). Subsequently, it turned out that some relays, obtained from China, are obviously defective. For example, in the following picture you can see that the wires inside the relay are intertwined. Fortunately, to fix this bug, it was enough to swap external connections to this relay in the same way.


In addition, there were quite a lot of relays with oxidized contacts. In some cases, this turned out to be critical, and the relay had to be thrown out. But sometimes it was still possible to transfer the inputs and outputs to other contacts — redundant relay with 4 switches played a role.

In the manufacture of the case, it was necessary to master the simple work of wood processing, but the soldering took most of the time - for many relays, it was necessary to solder the wires to all 14 terminals.

Results


The article was not very long and slightly superficial. More information can be found on the project website . If the community has an interest, I can write more about the characteristics and working principles of both the ALU and the designed computer.

From the moment I decided to make my computer, a year and a half has passed. During this time, I designed the architecture and command system in general, and also created the first computer module, an arithmetic logic unit. Formally, of course, semiconductors are used in ALU - in LEDs for indication and in protective diodes. But all logic is built on electromechanical relays. In this block, only external connections are missing, but I will do them after other blocks appear, to which the ALU will be connected. Next I plan to do a block of registers.



Statistics


The ALU consists of 88 relays, debug signals are given using 43 toggle switches, the outputs are displayed using 70 LEDs. Block dimensions - 74x56x14 centimeters.

Relays with various kinds of faults were found around 10. It is difficult to accurately determine, as some of them remained in a slightly modified scheme.

Expenses



While it turns out 2 times cheaper than Harry. This does not include solder and flux, sandpaper, defective and damaged parts, as well as the cost of the tools that I had in the process of making the case.

What can be done better


Upon completion of the implementation of the first module of my computer, I came to the conclusion that some things could have been done better:
  1. Probably, the number of relays used in the ALU could be reduced by combining the modules of addition and subtraction. I think that in this way 8 relays could be saved.
  2. When working on the next module, you need to try to drill the holes carefully. This time some of them turned out with small (and one - with large) cracks.
  3. Practice has shown that in our city it is not very easy to make high-quality laser engraving on brass. Apparently, the next time for the manufacture of inscriptions will have to try to apply photolithography.
  4. Probably, for often switching circuits, such as a clock generator, it is necessary to use duplication, since the relays proved to be not very reliable.


Links


Project website: github.com/Dovgalyuk/Relay
Other computers:

Source: https://habr.com/ru/post/220865/


All Articles