Memory Loader
The Memory Loader is an alternate design that can be used in place of the Arduino Loader/Debugger. Using an Arduino or other microcontroller feels a bit like cheating when designing a TTL computer, so this Memory Loader design uses rocker switches and simple logic parts for an old-school feel.
In addition to the larger and easier to operate switches, the SAP-Plus Memory Loader offers several improvements over the manual-entry DIP switches on the classic Ben Eater SAP-1. Although it was designed to be used with the SAP-Plus, the Memory Loader can be easily interfaced to a SAP-1 or similar build. See the SAP-1 interfacing section for details.
The most noticable feature of the loader is the set of eight rocker switches labeled D0..D7. These switches are connected to the data bus through a transceiver and are used to set data values for the RAM. These switches are also indirectly used to set the MAR address value.
The loader contains a Loader Address Register (LAR) onboard. Similar to the data switches, the outputs of the LAR are connected to the data bus using a 74LS245 bus transceiver. The inputs of the LAR are connected to the eight data switches and are loaded when the SET button is pressed.
The LAR is implemented using two 4-bit counters. If the Address Increment switch is set to ON, the LAR will increment at the end of each operation. This feature greatly speeds up manual memory loading, because a new address does not need to be keyed in for each memory byte.
Memory Loader Design
The Ben Eater SAP-1 RAM design uses multiplexers to select either the bus or a set of dip switches to load the RAM and Memory Address Register (MAR).
The SAP-Plus Memory Loader takes a different approach. When active, the Loader disables the Microcode ROMs and generates its own control signals. By asserting a Write MAR (WMAR) or Write RAM (WRAM) signal, the Memory Loader can put a value on the data bus and the next CLK pulse will load the bus value into the MAR or RAM.
A flip-flop toggles between the Write MAR (WMAR) and Write RAM (WRAM) state. In the Write MAR state, the WMAR signal is asserted and the outputs of the LAR are placed in the system data bus. When the Clock button is pressed, the WMAR signal causes the data from the LAR to be clocked into the MAR.
In the Write RAM state, the WRAM signal is asserted and the outputs of the eight Data switches are placed on the system data bus. When the Clock button is pressed, the WRAM signal causes the data from the switches to be clocked into the RAM at the current MAR address.
The Memory Loader has two modes of operation that determine the state transitions between WMAR and WRAM. A switch on the Memory Loader board selects between RAM Write and RAM Read modes.
RAM Write Mode
In RAM Write mode, the flip-flop toggles with each press of the Clock button, so the Memory Loader alternates between writing the contents of the LAR to the MAR or writing the Data Switches to the RAM. A new byte is loaded into RAM with every two clock pulses.
In RAM Write mode, the LAR increments at the conclusion of the WRAM state when Address Increment is ON.
RAM Read Mode
In RAM Read mode, the flip-flop is held in reset, which keeps it in the WMAR state. Each clock press writes the current LAR value to the MAR. The RAM value at the MAR address can be observed on the RAM module’s LEDs.
In RAM Read mode, the LAR increments on every clock cycle when Address Increment is ON.
Controls
Loader Active Switch
This switch enables the Memory Loader. In the OFF position, the Loader does not assert any control signals and does not place any values on the system Data Bus. In the ON position, the Loader Active (LD_A) signal disables the control ROM(s) and the Loader places values for the MAR or RAM on the system Data Bus.
Data Switches
These switches place an 8-bit value on the bus when the Loader is in the WRAM state. The switches can also load the LAR.
Clock Button
The Clock Button generates a single system CLK pulse on the LD_C pin. This drives the system CLK line when the loader is active. Each CLK pulse also toggles the Loader state between WMAR and WRAM when in Write Mode.
Set Address Button
A press of the Set Address Button immediately loads the value of the Data Switches into the LAR. This can be done in any state or mode and does not require a CLK signal.
Address Increment Switch
When the Address Increment switch is ON, the LAR counts up by one automatically after each operation. In RAM Read Mode, the LAR is incremented on every CLK pulse. In RAM Write Mode, the LAR is incremented on each clock pulse when in the WRAM state.
Read/Write RAM Mode Switch
The RAM Mode switch sets the operating mode of the Loader. In Read Mode, every press of the Clock Button writes the LAR value to the MAR and optionally increments the MAR.
In Write Mode, each press of the Clock Button alternates between writing the LAR to the MAR or writing the value of the Data Switches to the RAM. If enabled, the MAR will increment after each RAM write.
Reset Button
The Reset button resets the on-board LAR back to zero. It also generates a pulse on the RST pin that acts as the master reset for the SAP-Plus. For SAP-1 and other builds, this RST pin can be combined with a RST signal being generated elsewhere to allow this button to act as a master reset.
Memory Loader Timing
The CLK signal is generated by the Clock button using a 555 one-shot. It produces a fixed 100ms pulse, but does not occur at regular intervals.
The RAM and MAR values change on the rising edge of the CLK signal.The flip-flop that controls the state is clocked on the falling edge of the CLK, so the Loader state does not change while the data is being clocked into the RAM and MAR. The LAR uses an inverted clock, so it also changes on the falling CLK edge.
In Write Mode, each CLK pulse toggles the Loader state between WMAR and WRAM. The LAR only increments in the WMAR state, so it changes values with every other clock press.
In Read Mode, the flip-flop is held in reset, so the Loader is always in the WMAR state. The LAR increments with every clock press in Read Mode.
SAP-Plus Interfacing
The Memory Loader connects to the SAP-Plus using a dedicated Memory Loader Interface Module. The Interface Module shares interconnects with the Microcode Module, so the Loader must be in a backplane A spot adjacent to the Microcode Module.
A 20-pin ribbon cable between the Loader and Interface modules carries the power signals from the SAP-Plus to the loader and carries the data and control signals from the loader to the SAP-Plus. The Interface Module is little more than an interface to the 40-pin bus, plus two 74LS245 bus transceivers that block the Memory Loader’s control signals when the loader is not active.
One of the bus transceivers drives the chip-select control signals that connect to the Microcode ROM Module. This transceiver is hard-wired to select either the MAR or the RAM for writing, depending on the state of the WMAR and WRAM signals. The other transceiver drives the miscellaneous control signals. A jumper block is provided to allow each signal to be wired high or low when the loader is active. By default, most signals should be low. The N signal can be set high instead, so that the Step Counter is held in reset while the loader is active. This prevents that counter’s LEDs from cycling during each CLK pulse. The CX signal can also be set high or low to select between program or data memory.
SAP-1 Interfacing
All of the connections needed to interface the Memory Loader are present on the 20-pin J1 connector. They can be easily connected to a SAP-1 using male-to-female Dupont breadboard jumper wires.
The Ben Eater RAM module uses four 74LS157 1-to-2 selectors to load the RAM and MAR from the data bus or from data switches. The Memory Loader can be interfaced by removing the switches and using the existing selectors.
To start, make the following connections:
- Connect all Vcc signals from the loader to +5V on the SAP-1.
- Connect all GND signals between the loader and SAP-1.
- Disconnect the PROG wire from the switch on the SAP-1 and connect it to the active-low ~LD_ACT signal from the loader.
With this complete, the loader can now control the selectors.
To connect the RAM
- Remove the 8-position DIP switch and connect the loader D0..D7 signals to the switch inputs of the selectors.
- There is a NAND gate that combines the CLK and RI signals. The output of the gate feeds another 74LS157 selector. Move the gate to the other side of the selector so that NAND inputs are CLK and the output of the selector and the NAND output drives the RAM WE signal.
- Connect RI to the selector input where the NAND gate was.
- Disconnect the pushbutton and connect the loader’s WRAM signal to the selector input.
The MAR connections are a little more difficult. The LOAD selector in the MAR circuit feeds the RAM address lines from either the 74LS173 MAR outputs or from the switches. To use the loader, the MAR moves to the other side of the selector so that the MAR outputs drive the RAM address lines and the MAR inputs are either the data bus or the loader’s data lines.
- Connect the outputs of the MAR to the RAM address lines.
- Connect the system data bus D0..D3 to the selector inputs where the MAR outputs were previously connected.
- Remove the 4-position switch and connect the loader’s D0..D3 lines to the other set of selector inputs.
- Remove the MI connection from the 74LS173 MAR and connect it to an input of one of the unused channels on the 74LS157 selector that is driving the RAM’s WE pin.
- Connect the output of that selector channel to the MAR’s enable lines that were previously connected to MI.
- Connect WRAM (which is acting as an active-low WMAR) from the loader to the other selector channel input.
The loader has its own Clock button that creates a CLK pulse, just like the button on the SAP-1. This CLK pulse is used by the loader itself, but it is also needed by the RAM and MAR on the SAP-1. The easiest way to interface this is with a 74LS32 OR gate. There may already be a spare one on the clock breadboard.
- Connect the existing CLK signal from the SAP-1 Clock Module to one input of the OR gate.
- Connect the loader LD-CLK signal to the other OR input.
- The output of the OR gate is the new CLK signal that connects to the rest of the SAP-1.
This allows the Loader to generate the master clock signal when it is active and allows the SAP-1 clock to generate the signal when the loader is inactive.
If a spare OR gate is not available, the CLK signal could also be selected using another spare channel of the 74LS157 that is selecting the MI and RI signals.






