Close
0%
0%

Homebrew 16 bit relay computer

Goal of the project is to develop and build a homebrew 16 bit relay computer

Similar projects worth following
The new relay system is a classical Accu CPU like some CPUs of the good old 80s. The system was simulated using the game "Logic World", now the real world build has startet!

If you want more information: you find the link to the project homepage on the left. And the complete circuit diagram in the download area. Just for fun.

Overview

The system ist a very simple CPU using an Accu register like CPUs in the 80s.  All mathematical operations are using the Accu, also all store / load operations. And, because it is a "High Performance" relay system, the program counter has its own adder which is only able to add 1 to the program counter.

Here you see an actual picture of the complete system:

The following diagram shows an overview about the system structure:

Note: The PC_HR register is necessary, because I can not write the changed PC based on its own value plus 1 direct into the PC...

One detail is important to understand the design of the system: all registers, which are realized by "self retaining" relays, have to be cleared before any information can be stored, also before the stored information can be changed. Thats the reason why the clock of the system is not an ordinary clock as you know it from digital systems. The clock of this system consists of 4 different pulses:

The control unit of the system is using the instruction register and a state register to select the control lines, a control line timing module is setting the Clear, Input-enable and Output-enable control lines based on the clock information.

And, of course, there is not only a state register...there is also a second state register which is cleared / loaded during cycles 0 and 1. You see this detail in the structure picture and in the circuit diagram. It is the same principle than I have to use for the program counter.

The following table shows the command set of the CPU:

The CPU is able to adress the memory using 3 different adressing modes. a) LD X is loading the Accu with the dataword stored in the adress after the opcode, b) LD M(X) is loading the Accu with the data stored in the memory adress stored after the opcode, and c) LD M(M(X)) is ... yes, indirect adressing. The dataword after the opcode contains the adress where the CPU finds the adress of the dataword that will be stored in the Accu. Is adressing mode c) really necessary? Maybe not. But it makes it easier.

And, as you can see, a CALL / RET set of operations is also avaliable. No, there is no stack realized, only one subroutine level is possible. The return adress is stored in the register SR.

The Simulation using "Logic World"

The following images show the Simulation of the complete system in the game "Logic World". This simulation was used to design the system and to check different design variants.

The relay element:


System overview:

Circuit diagram

The complete system circuit diagram is avaliable in the download section.

The software simulation:

To check if the command set of the CPU is useful, a software simulation using an Excel macro was developed. Using this macro it is possible to step through the code, watch registers and memory and to go forward until a breakpoint. The following picture shows the simulation with an program which multiplies two numbers using shift operations.

CircuitDiagram_120524.pdf

Circuit diagram of the relay computer

Adobe Portable Document Format - 1.91 MB - 05/12/2024 at 13:06

Preview

  • 1 × 24V Relay
  • 1 × Diode

  • Relay durability test

    Peter10/30/2024 at 21:39 0 comments

    To ensure that repeated test runs of the system do not lead to a relay failure (relays are mechanical components and do not have unlimited durability), I have now started a durability test of two relays. An Arduino switches on and off 50 times per second, using a transistor to control a relay. This relay, in turn, switches a second one. I will let this setup run until one of the relays fails.

  • Funny problem...

    Peter10/30/2024 at 21:33 0 comments

    I tried a new program. I wanted to multiply 3 pairs of numbers and add the results...perfect for using the CALL and RETURN functions. But the end-result was not correct. I analyzed videos of the runs (by checking the LEDs), I also tried the three multiplications and the addition of three results in seperate programs...everything was fine. I think that the three multiplications are influencing each other...but before I step deeper into the problem I write a program which is testing the complete hardware of the system, especially the ALU, to be sure that a program error is the reason of the little problem.

  • New commands CALL and RETURN are working...

    Peter10/30/2024 at 21:27 0 comments

    So, the new commands are working fine, but the wiring is a little bit crazy:

    The new board you see is the register which is able to store the return address.

  • Finished state machine control boards for two commands

    Peter10/20/2024 at 19:56 0 comments

    Last week I finished two boards for the CALL and the RETURN command. The CALL command stores the program counter into a register and jumps to the adress after the CALL command, the RETURN command copies the adress stored in the this register into the program-counter.

  • Finished a new module

    Peter10/11/2024 at 16:58 0 comments

    This module can store an address, it is used to store the return address for a CALL - RETURN sub-routine. It is not used like a stack in a common CPU, only one subroutine-level can be stored.

  • Great success. The relay CPU can now multiply

    Peter10/02/2024 at 20:05 0 comments

    The following video shows the multiplication of 13 * 18 by the relay CPU...and yes, the operation needs some time. The processed program can be found in the video description.

  • CPU is running a loop!

    Peter09/29/2024 at 14:55 0 comments

    A new video is online. Some new implemented commands are used and now you see the relay CPU running a loop...

  • Found a defect relay self-latch...

    Peter09/29/2024 at 14:50 0 comments

    While testing the conditional branch, I saw that the value of the instruction register was not correct...relay for bit[4] of the instruction register was not able to store the information. The result of this problem was that the BZ (branch if the value stored in the accu is zero) was not working.

    But i have 3 spare relais in the instruction register....bit[0..2] are not used at the moment. So i changed the wiring to use relay[2] instead of relay[4]...and the BZ command worked fine.

  • Found the real reason

    Peter09/22/2024 at 13:36 0 comments

    So, after a deeper inspection of the board I found the real reason of the problem...not the solder joint in the connector, one cable was connected to the wrong relay...and so databus[3] was connected to databus[4] because the databus[3] was was connected to the wrong relay:

  • Measured a connection between DB[3] and DB[4]

    Peter09/22/2024 at 08:21 0 comments

    So, I have now dismantled the system to be able to measure more accurately. And as I suspected, unfortunately, there is a connection between Data Bus[3] and Data Bus[4].

    No problem between DB[2] and DB[3].

    Connection between DB[3] and DB[4].

    And to be honest, the solder joint is not my best work:

View all 92 project logs

Enjoy this project?

Share

Discussions

Tom Goff wrote 10/02/2024 at 17:49 point

Great work! Konrad Zuse would be impressed with your hard work.

  Are you sure? yes | no

Peter wrote 10/02/2024 at 20:08 point

Thanks a lot...and today I uploaded a new video, the system is now able to multiply.

  Are you sure? yes | no

astonmartinus12312 wrote 09/20/2024 at 11:22 point

This project interested me a lot and I like such things since I was younger but when I wanted to try it myself, I don't have much to do this. I am student and now I have a lot of home assignments. I searched for the solution and one of my friends advised to try free essay examples website and gave me  https://eduhelper/essay-samples And now I have some free time to do what I like and gain some practical skills in it. Maybe that's can be my future career one day.

  Are you sure? yes | no

Ken Yap wrote 02/25/2024 at 23:44 point

👍 I commend you on your persistence with this epic project. I'm sure it will be a classic work when it's done. Looking forward to seeing that.

  Are you sure? yes | no

Peter wrote 02/28/2024 at 20:43 point

Thanks for your encouraging words. My plan is to be finished at the end of 2024...we will see.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates