Harry Porter's Relay Computer
Page created: 17 November 2009
Last updated: 17 November 2009
All circuit diagrams were hand drawn. They have been scanned and are available as JPEG files below.
If you have read the paper or watched the video on this website, then you will be able to understand most of these circuits. However, neither the paper nor the video discuss the instruction decoding, control and sequencing circuitry in much detail. Anyone interested in really understanding my computer will need to study the drawings for these circuits.
In many cases there is first a drawing showing the circuit at a more abstract level, followed by a wiring diagram of the same circuit showing the relays and their contacts in their correct positions. The separation of a more abstract circuit diagram and a more concrete wiring diagram was important in reducing the soldering errors during construction.
These drawings are presented in roughly the order they were built. Since the circuits get more complex and my
notation and abbreviations increase, it is best to examine them in order.
Programmer's Reference Card
This is a one page summary of the instruction set. It is complete and accurate.
I keep this nearby whenever I code a program.
Three input lines are decoded to eight output lines. Exactly one of the 8 output lines will be high, as determined by the input lines. This circuit, which requires 3 relays, is used to decode the ALU function code (3 bits) into control signals to drive various enable circuits within the ALU.
With all relays, one terminal of the coil is connected to ground.
To reduce clutter in the drawings, this ground connection is never shown.
In the abstract circuit drawings I use my own symbol for relays, as discussed in the paper/video.
To connect wires to each other, I used red "butt connectors", which are cheap, reliable, and quick and easy to crimp.
In some of the earlier drawings, you'll notice some small red boxes (which might look like resistors or diodes) to indicate where I planned to connect the wires.
I generally use a simple circle to represent an LED, rather than the proper symbol. All LEDs are connected to ground and the LEDs I used have a built-in resistor, so they can be used like a traditional light, wired straight between 12V and ground.
If anyone ever follows these drawings exactly, I made one big but easy-to-fix mistake. In the decoder for the ALU, the value for CLR (i.e., no-op) is "111". I should have used "000" and reassigned the other functions accordingly. A general principle for control lines is that "0" should correspond to "do nothing/no connection" and "1" means "do something". As a result of this mistake, the ALU tends to want to put B+C on the data bus, when the instruction decoder is disconnected or turned off and this is confusing/annoying.
Two relays are used to gate 8 lines onto a bus.
One Bit Logic Block
Two relays are used (per bit) to compute AND, OR, NOT, XOR, and SHL.
This is the 8-bit adder that forms the core of the ALU.
This circuit provides a single output that is high whenever the 8 data bus lines are all low.
The computer has a number of registers and most are 8 bits in length. This circuit is used repeatedly for the registers. You can see by the burn mark on drawing number 5 that it was close at hand for many evenings of soldering.
Front Panel Layouts
These show the dimensions of the acrylic panels on each of the 4 cabinets, along with the placement and meaning of the relays. Every relay, every switch, and every LED is shown in these drawings.
Register Unit Attack Plan
When building the register unit, I knew that I would want to build and test each register before moving on to the next register. This shows how I used the switches and LEDs for the data bus to test each register as it was added.
16-Bit Increment Unit
The Program Control Unit mostly just contains more registers and resembles the Register Unit very closely. There are not too many new diagrams for it. However, it does contain a 16-bit increment unit, which is used to increment the program counter, and this is shown here.
The control signals for the ALU and the registers must be driven by the control logic in the Sequencer Unit. We begin by showing what the exact timing for the control signals will be. (See "Inter-Cabinet-Cabling-1" below for a full list of the control lines.)
The first diagram details the 19 so-called "timing pulses" which are named "P-A" through "P-T". (There is no "P-P" pulse.) These come on irrespective of which instruction is being executed. The remainder of the diagrams show which control lines have to be driven for each instruction: when the control line should come on and how long it should stay on.
The clock pulse has a single square wave output, which forms an input to the state sequencer (the finite state machine).
This was one of the trickiest circuits and I prototyped it. The prototype did not behave as expected and after thinking about why it didn't work, I came up with the design shown here. The problems: (1) on power-on, the circuit must come up in a known state and be ready to start ticking, (2) there must be a switch to allow the user to stop the ticking, (3) no matter when the user flips the switch, the last clock pulse must be full length, and (4) there must be a switch to allow the user to single step the clock pulse.
State Sequencing Circuit
The sequencer is a finite state machine (FSM) with 24 states, numbered s0 through s23. The clock pulse causes it to step through all 24 steps in order. Instruction execution begins in state 0. Each time around this cyclic state loop, a single instruction is executed. The longest instructions take all 24 states to complete.
Some instructions take fewer steps so there is a way to conditionally jump from a state back to the beginning, state s0.
This is handled by the 4 abort relays. Each abort relay is driven by an abort line (i.e., ABORT-8, ABORT-10, ABORT-12, ABORT-14) and once this line goes high, the relay will latch and stay on. The state of the abort relays is used by the FSM at critical moments to determine whether to proceed to the next state or to jump back to the beginning. For example, if ABORT-8 is on, the FSM will go from state s7 to state s0. Otherwise, it will go to state s8.
Instruction Decoding and Control
The goal of the clock and FSM state sequencer is to produce a sequence of timing pulses, named P-A through P-T.
Each timing pulse starts at a specific time and lasts a specific duration. The timing pulses occur unconditionally depending only on the state of the FSM state sequencer.
The first diagram shows how the timing pulses are derived from the FSM state sequencer.
These timing pulses and the current value of the instruction register act as inputs to the instruction decoding circuits.
The output of the instruction decoding circuit is to drive the control lines to the registers and the ALU as appropriate.
The control circuit also contains a 3 bit register called the Condition Code register. The Condition Code register is controlled by a line named LD-COND and loaded from the CY, Data7=Sign, and Z lines from the ALU. The outputs of this register are named "CY=0", "S=1", "Z=0", and "Z=1" and are used by the instruction decoding. I didn't need to put the abstract circuit for this register down on paper, but the last wiring diagram does show it.
Instruction Decoding and Control - Wiring Diagrams
Instruction Decode Relay Map
This shows where each relay in the instruction decoding circuit is located. Like the wiring diagrams, this is a rear view since that it what I looked at during construction.
Main Memory Unit
The Main Memory uses a IC chip to store 32K bytes. These circuits show how the TTL chip is interfaced to the 12-volt relay circuits.
Cabling Between the Cabinets
There are a lot of connections between the cabinets as detailed in these diagrams. In order to transport the cabinets separately, each cable between two cabinets has a male-female pair of connectors in the middle, allowing the cable to be broken. I used DB-9 connectors which are cheap, easy to solder, and reasonably reliable.
About the Author
Harry H. Porter III, Ph.D.
Computer Science Department
Portland State University
Relay Computer, main page:
Harry's Website: www.cs.pdx.edu/~harry