Close

Simulation of display segments, and more debugging

A project log for RISC Relay CPU

Scientific calculator with a brain built out of relays.

roelhroelh 01/06/2019 at 15:560 Comments

For the simulator of #1 Square Inch TTL CPU, I used real graphics for the segments of the clock. Since the relay cpu can also control each segment of the display independently, I also added this feature to the simulator of the relay cpu ( Assembler and Simulator ).  To use it, just press "Assemble" and then "RUN", and start making calculations on the calculator keyboard that is on the screen. Since the segments of the display are directly connected to the register bits, you will see the same wild patterns during calculation as you would on the real CPU. Trigonometric functions don't work yet, all others do. (After each button click, have some patience until the script halts and the number (hopefully) appears.) The calculator program does not give messages yet for overflow, or out-of-range input (including zero divide).

The off-by-one error in the return address of a subroutine (reported in a previous log) is now handled by a workaround: A NOP instruction should follow each CALL instruction. 

Three small problems were found (but chasing them was a lot of work):

Main obstacle for finding these problems were that the design was done so long ago (between one and two years) that several details had slipped my mind and had to be reverse engineered from the schematics.

The relay calculator now sometimes gives a good calculation result for basic operations (digit entry, number display, addition, multiplication). More bug hunting is needed.

The "Architecture and Instruction list" in the file section was updated according to this log.

The online simulator-assembler was updated, but the source in the file section has not been updated yet.

Discussions