The circuit diagram of the system was designed using KiCad. The complete circuit diagram is downloadable below, the following picture set shows some of the key diagrams of the system.
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:
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 will find this detail in the circuid diagram.
In the actual design, for a subtraction it would be necessary to invert the Subtrahend and add 1. This could be speed up by defining a command, a new mathematical operation.
This operation would need a multiplexer in the ALU input to distinguish between the inverted/not inverted data bus and a little logic to set the Carry of the adder for the LSB to 1.
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.