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
Download

  • 1 × 24V Relay
  • 1 × Diode

  • New video...CPU is adding numbers from 1 to 10 and from 1 to 22

    Peter3 days ago 0 comments

    So, a very important step is finished...the system now is able to add numbers controlled by a program. The following video shows some details:

    and in the following short the relay CPU is adding the numbers from 1 to 22 in 6 seconds:

  • Finished a little module...

    Peter4 days ago 0 comments

    Here you see the module for the "MOP X" command...perform a mathematical operation (selected by some bits of the opcode) with a constant stored in the adress after the command and store the result in the accu register. This module is put into the command bus of the control board.

  • Finished the 8 bit ALU board

    Peter6 days ago 0 comments

    So, the first step to a complete 16 bit ALU is a 8 bit ALU...and I finished the 8 bit ALU board (together with a 16 bit Accu register and a 16 bit result register):

    There is a lot of free space on the board...for the missing 8 ALU boards, 3 relays for the carry logic and some branch logic.

  • Finished the ALU result register

    Peter05/15/2024 at 19:08 0 comments

    So, here you see the complete ALU result register. It is a 16 bit register. The board with the 17 black relays is the storage board, 16 relays to store the 16 bits (the relays are holding themself active when switched on), one relay to switch off VCC to clear all 16 storage relays. The two other boards are used as an input enable board from the ALU or as an output enable board to the databus...

  • Finished the first part of the ALU result register

    Peter05/11/2024 at 19:41 0 comments

    So, the following little module is able to store a 16 bit value...and will be used as the ALU result register. Two little boards will be next, one as input enable into this register, one as output enable from this register to the data bus.

    You see 17 relays for 16 bit...thats because one relay is used to switch out the 24V to clear the register, this is done by a "Clear" input signal.

  • Finished the first of 3 plates...

    Peter05/06/2024 at 14:14 0 comments

    So, what you see here is the complete adress-module of the relay CPU...the first of three plates is now complete:

    This module is able to hold a 10 bit program-counter, add +1 if necessary, read/write the program-counter to/from the databus, load a adress from the databus into a adress-register and write the program-counter or the adress-register into an adressbus-register...which is connected to the adressbus.

    In the following picture you see the interface:

  • Finished a new register...

    Peter05/05/2024 at 19:57 0 comments

    The following picture shows a new 10 bit register for the adress-module. This register holds the adress if a command wants to access the memory, for example LDA M(X),,,Load the accu with the value stored in adress X. This new register holds the adress, a multiplexer is then switching between the program counter or this new register to copy one of them to the adressbus-register. Thats the way the memory is accessed.

    The register was finished in one day and is tested...so the next days I will integrate it into the adress-module.

  • Tested a 8 bit ALU

    Peter05/01/2024 at 15:34 0 comments

    So, I connected the first 8 ALU boards to implement a 8-bit ALU and tested it. The Shift Left/Right, AND, OR and NOT commands worked perfect. And in the following two pictures you see the calculation of 0x7F + 0x21 = 0xA0 (or: 127 + 33 = 160).

    The first picture shows 0x7F + 0x20 = 0x9F (1001 1111, you see the red LEDs).

    The second picture shows you 0x7F + 0x21 = 0xA0 (1010 0000).

    How fast the calculation realy is will be shown in a video, I plan to finish the 16 bit ALU and measure (and documend) the calculation speed of the 16 bit ALU. I need the calculation time to be able to choose a clock timing for clock 1 of the relay system.

  • Finished the first 8 1-bit ALU boards

    Peter04/22/2024 at 04:36 0 comments

    The first 8 ALU boards are finished, during the next days I will mount them together to a 8-bit ALU and test it. Two 8-bit ALUs are then mounted together to the 16-bit ALU used in the system.

  • Build and tested the first ALU bit...

    Peter04/14/2024 at 08:11 0 comments

    So, the first ALU board is build and tested...and it is working! Now I will start building the remaining 15 boards.

View all 70 project logs

Enjoy this project?

Share

Discussions

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