Sunday, February 4, 2024

Scratchpad Register board signalling

One of the prerequisites for testing my Scratchpad Register Array board is to get a clear picture of the signalling necessary to make it function outside of the rest of the i4004 CPU's circuitry.

Years ago I split the i4004 CPU into functional chunks, each of which would become a separate PC board. In doing so I tried to keep related circuitry together to minimize the inter-board signalling. Thus the Scratchpad Register board includes many subcircuits:

  • 8-row x 8-bit DRAM array
  • 3-to-8 row decoder
  • 3-bit row refresh counter
  • 3-bit address latch
  • 3-bit 2:1 address multiplexer
  • 4-bit 2:1 data output multiplexer
  • 4-bit 1:2 data input demultiplexer
  • Miscellaneous state decode logic

The inclusion of these subcircuits means the interface to the board is somewhat more complicated than it would be with direct access to the DRAM address and data signals.

To read and write the Scratchpad DRAM array, I need to emulate the execution of one of the i4004's instructions. The only instruction which allows a single Scratchpad register to be written is "XCH", which exchanges the contents of the accumulator and the specified register.

I have a spreadsheet which I use to track what signals appear on which pins of the inter-board connectors. This spreadsheet also identifies which board sources each inter-board signal, and which boards make use of each signal. From this I extracted only the signals used by the Scratchpad board and started a new spreadsheet with columns for each of the execution phases.

These inter-board  signals make up rows 2 through 21. To these I added the signals local to the SP board that control the DRAM array (rows 26-32 and 34-36), which I'd determined by analyzing the circuitry. By stepping through the execution of an "XCH R5" instruction (located at address 0x062 in the 400x simulator's sample program) I was able to chart out which signals are active during which phases of execution and what they do.

Why bother with a spreadsheet when the simulator shows this graphically? Two of the few deficiencies I've found in the otherwise superb 400x simulator is the lack of vertical grid lines or markers in the signal graph, and the ability to save a display configuration. The spreadsheet is persistent, makes it easier to find the signals of interest, and can also be annotated to explain the purpose of otherwise non-intuitive signal names like "(~POC)&CLK2&SC(A32+X12)".

No comments:

Post a Comment