Electromechanical computer built from relays

This is Zusie, a computer built out of electromechanical relays. [Fredrik Andersson] picked up a lot of about 100 telephone exchange circuit boards, each with about 16 relays on them. After getting to know a heat gun really well he ended up with 1500 working relays with which to play. The machine runs slowly, it iss noisy, but it definitely works. After the break you can see it running and assembly code program that he wrote.

The instruction set is based on boards running microcode. These store the operational commands for each instruction the processor has available to it and they run in parallel with the rest of the operations.

We’re always surprised to see that these home-built processors work. Mostly because of the complexity involved in assembling them. How hard is it to find a shorting connection or a malfunctioning relay? Those problems aren’t limited to this application either, what do you do if a transistor-logic CPU has a malfunctioning chip?

[Thanks Daniel]

40 thoughts on “Electromechanical computer built from relays

  1. Normally I don’t care about typos and such but:
    “_yo_ can see”
    “running _and_ assembly code”
    “We’re always _surprise_”
    “_are_ limited to this application either”

    Really?

  2. They get paid for writing these articles too sneakypoo. Teribble!

    Take some pride in your work and run a spell checker before hitting post.

  3. @sneakypoo –
    These days, decent writing skills cost money. HAD ain’t got no money, so what you pay for is what you get. Is it annoying? Yes, but only to people who know how to conjugate. It’s a dying skill. The rest of us just let it go.

    Some language books contain passages claiming that most of the population only knows or uses about 25-35% of any given language – and that in most cultures, they generally use just two or three thousand words/symbols/labels. You don’t really need much to meet a girl, start a family or to get a job writing teasers for hackaday.

    Live and let live, I say.

  4. tHiS iS AnnoYinG, and t1S 0r T4At, everything else doesn’t bother me.
    It is medically proven that grammar policing is mental disorder (type of Obsessive–compulsive disorder). Grammar nazi literally believe(sometimes unconscious) that wrong sentence can cause end of the world since it disturb the “proper” order of things, just like OCD person might believe that flipping a switch odd number of times will kill his family

  5. I worked on a machine once that ran mostly on relay logic. My job was to replace the relay logic with a PLC. Pretty crappy job since some of the plans weren’t updated for 20+ years, and some were in German from the original manufacturer.

  6. I want to see an asynchronous-clock version. Anyway.. why hand-wire it when you can simulate and autogenerate/route the boards?

  7. @therian

    It isn’t abnormal to appreciate good grammar. Writing proper, readable sentences is just another way to take pride in your work. Surely you can tell the difference between, say, a chair made of beautifully finished and polished hardwood, and one made of shipping crates and rusty nails? They both keep you off the ground, but one is pleasant to use and the other is ugly and painful. Writing is the same way.

  8. @DarkFader: me too, though I fear the contact bounce and variability of propagation time would make it impossible.

    I think if was going to try this I would start out with the Picoblaze instruction set and shoot for a Harvard RISC machine. That ought to be doable with about 500 4-pole relays.

  9. @nes

    Picoblaze instruction set? RISC? That’s a pretty big machine you’re describing here. Some of the core features of RISC architectures are the large number of general purpose registers and a 2 or 3 operand instruction set, luxuries you can’t really afford if you’re wiring each and every gate by hand.
    Try to really, REALLY minimize the instruction set and go for an accumulator or stack machine. And if you want something even smaller, check out the Turing tarpits like Brainfuck, which can be implemented using three counters and a small state machine (not including the memory or I/O), or actual Turing machines.
    Keep it fun, keep hacking and post your results here!

  10. @macw

    Exactly. Written language is no different than spoken language in that its proper use conveys respect for your audience and lends credibility to the speaker/author.

    @smoker_dave

    I can only hope you misspelled terrible in an act of sarcasm?

  11. I was just informed my Zusie was on display here – thanks for featuring it guys =)

    And thanks for all the positive comments!
    It will be even cooler once the cabinet and the motor-driven clock (oh yeah!) I’m working on is finished.. ;-)

  12. @third: I think if you leave out the interrupt mechanism and the compute parity instruction it comes to about ~120FFs and about the same number of four input LUTS. I’m basing my guesstimate on 2 four pole relays per LUT and 2 per flip flop. I reckon that’s pretty reasonable for an 8 bitter, though I have forgotten the register set which would require another 128 bits of RAM. Perhaps this could be done in a more relay-efficient way than two per bit.

    The downsides are that the instruction set is not very efficient compared to other RISCs, let alone microcoded machines.

    Don’t know about stack machines. Surely you’d still have the same problem with storage as you would with a register set in RAM.

  13. @Nablaman:

    Your comment: “motor-driven clock” reminded me of a similar device. Have you ever seen the stepping relays and motorized clock of an old pin ball game?

    I can’t find a really good picture of a pin ball motor acting like a clock. I did find this image. If I had to guess, that black square thing at the center of the photo looks like a likely candidate:

  14. @st2000 Interesting! Stepping relays were used for the early Zuse machines for sequencing microinstructions, but I did not know that they were used for pinball games. I thought they were designed basically for use in telephone exchanges. I would enjoy getting my hands on some of those!

  15. @nes (said):
    “Don’t know about stack machines. Surely you’d still have the same problem with storage as you would with a register set in RAM.”

    Ah, this is were people got crazy back in the 20th century. While you are thinking more relays… …them people were thinking about things like acoustic waves in columns of mercury or the persistence of the phosphor on a CRT.

    I’m thinking the Apollo guidance computer used something called rope memory:

  16. @Nablaman (said):
    “Interesting!… I did not know that (stepping relays) were used for pinball games…I would enjoy getting my hands on some of those!”

    Warning! Old (bowling) arcade machines are big, heavy and have a very low WAF (Wife Acceptance Factor)!

    Got-to run…

  17. This would be such a cool exhibit!
    Build this CPU first in relays.
    Then with Tubes.
    Then with Transistors.
    Then with TTL ICs.
    Then with a CPLD.
    And have each running the same program!
    Just to show how much smaller and faster things have gotten.

  18. @Nablaman

    Actually, if you pick your time period right, tubes aren’t so bad. By the early 1970’s you could purchase entire gates in miniature form factor that approached old RTL and discrete transistor package formats. The russians took a while to catch up to our semiconductor tech, so they stuck with small tubes.

    In 1976, when the MIG-25 pilot (victor whatshisname) defected to the west via japan, we discovered that the planes “very advanced flight computer” consisted of thousands of tiny tubes… you could pack 6 to 8 of them into a space the size of your thumb. Tubes were much more rugged than semis, and could survive EMP blasts.

    You can still find a lot of these tubes around, and some are still in limited production. You can still find pretty advanced scientific computers [well, calculators] based on thyratons if you look around. Thyratons need higher voltages, but run pretty cool and act like SCRs.

    Google anita calculator for a decent example. In general, once you throw out the need for wide, accurate or linear response curves, tubes can be pretty small. I’ve seen combination tubes that had multiple log elements (NAND, NOR) in one bulb.

    Apart from the need for 400vdc and cooling, building these demo systems from miniature tubes (seriously, this stuff is still in use) shouldn’t be hard.

    If you use decatrons and their ilk, and stick to diodes for the microcode, and don’t try to get carried away with program size, tubes offer a lot of advantages – namely a 3,000 to 6,000 hz cycle rate. That’s a speedup of 10 – 500x faster than relays.

    Also, it isn’t that hard to build either mercury delay line memory [you can still find prepackaged miniature lines circa 1960/1970 as surplus if you don’t want to fool with mercury] or core memory.

    At these speeds, you can also use mechanical memory, following zuse’s 1930 design – or, with very little work and a high persistence phosphor tube, you can implement a small but speedy scratch pad.

  19. @eddie

    Zuse was largely ignored during WW2, and his toys were used to calculate wing spar dimensions – not very sexy. Wikipedia is a mess on this guy, read the original sources.

    He was in collaboration with Nazi Germany to the same extent that Radio Shack “collaborated” with the Bush administration.

  20. @eddie I absolutely agree with alan turing’s dog, Zuse was a german working in Germany during the war. To not in any way have any connection with the Nazis would require him to live under a rock somewhere (which incidentally he almost did during the later years of the war – he hid in an Alp town in Bavaria to save himself, his family and his machines, both from Nazis and allies.) His interest in politics seems to have been slim to none, he was just a genius who got sick of doing hand calculations for bridge construction and invented the computer (!) to do this mundane work for him.

    @alan turing’s dog Thank you for the information on the tubes! I will definitely look into this in more detail. May I ask what your background is with your knowledge in these topics?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s