Posts

The problem with memory

Image
It's time, at last, to start looking at the design for the computer's memory and this is a bit of a game changer as it's the final part of the jigsaw that lets the computer run a program. However, it's also the part of the computer that leaves me in a bit of a quandary.

The problem with memory is that typically you need quite a lot of it and that's something that doesn't come easy with relays. In a way the registers already present in the computer are a kind of memory ... they store a single byte of data. So, effectively you can get two bytes worth of storage on one of the usual computer cards. You can maybe see where this is going.

Each instruction in a program takes a byte of memory therefore a 10 line program needs 10 bytes of memory. How long does a program need to be? Well is depends but for this kind of computer 20 to 30 wouldn't be unreasonable it you're going to do something 'interesting'. It's not just the instructions that need sto…

More Laser Cut Parts

Image
I've nearly got the design for the memory cards done and ready to share but once that's out the way it'll be time to get on with some construction again. With that in mind I cracked out the credit cards and got buying more relays plus some other bits and bobs and whilst I was in a spending mood I decided it was high time to treat the computer to some more laser cut parts.

The two displays (A and B) in the upper enclosure have been looking a bit 'unfinished' and it was always my intention to get some laser cut panels made up eventually which would surround the switches and LEDs and give it a more 'polished' look. Additionally the panels would also carry an engraved legend to explain what each group of switches/LEDs represents in the displays. The process for making these is just the same as before when I got the laser cut panel for the primary switches.

As before I've chosen to get my laser cutting done through RazorLab who provide starter templates for …

Incrementer Design

Image
In my last post I covered the design of the 16-bit half adder which takes whatever value is currently on the address bus and increments it by one. To make this incremented value useable we need to create a register so that we can store the value ready for pushing back on to the address bus. Typically this incremented value would then be loaded into the program counter to get it ready for the next instruction in memory.

By now you're probably sick of seeing register designs (I know I am) and this particular register is similar to all the other registers seen so far in the computer. Just like the program counter this register holds a single 16-bit value which can be gated on to the address bus. The main difference here is that the register is loaded directly from the 16-bit half adder via an inter-card connector. Here's the design for this register:
As with other register cards the relays that latch each bit value are on the bottom half of the card with bit 0 at the bottom righ…

Incrementer Design: 16-bit Half Adder

Image
In the last post I introduced the design for the 1-bit Half Adder. This post covers connecting sixteen of these units together to make the 16-bit Half Adder.

So, diving straight in, here is what sixteen of the 1-bit Half Adder units look like all together on the usual 55 x 40 hole pad board:
Each half adder bit is made up of two relays (as seen in the previous blog post) and starting at the bottom right of the diagram above the bit stages run upwards from 0 to 3 and then continuing on in rising columns to the left until bit 15 at the top left. Between each bit the carry out lines of the prior bit are connected to the carry in and the carry out lines connect to the carry in of the next bit effectively chaining each bit together to form a ripple carry adder circuit.

We can now connect up the inputs and outputs of the 16-bit half adder as follows:
Each bit of the half adder is directly connected to the address bus meaning that the adder is always active even when the output isn't ne…

Incrementer Design: 1-bit Half Adder

Image
Typical isn't it?! ... you wait 10 months for a post and then two come along at once. Well, all being well, this should be the first of a short flurry of posts as I move on to the design of the incrementer.

The incrementer takes any value currently on the 16-bit address bus and adds one to it, or rather, it increments it (clue is in the name of course). Typically that value on the address bus is going to come from the program counter (in order to point it at the next instruction in memory) but it'll also be possible to bump the upcoming XY register eventually too.

One complication in the incrementer is that because the address bus can only hold one value at a time it's necessary to have a built-in 16-bit register which can hold the result of the incrementation ready to be gated back on the address bus and off into the destination register. So, for example, the PC register is selected and the incrementer register loaded with the PC value +1. Once that's done the increm…

Register Design: Program Counter

Image
It's been a while since my last post ... pretty much 10 months in fact ... and I'd love to say I've been quietly working on my relay computer in the meantime but I haven't. Designing, building and blogging about the various parts of the computer is really time consuming and unfortunately I'm just one of those people who has way too many hobbies. Anyway, after picking up some subscribers on YouTube I thought it was high time (or maybe I felt guilty enough) to focus back on the computer and get it through to the next milestone ... where it can step through a simple program stored in its memory without any human intervention (beyond entering the program itself and setting the computer running).

So where to begin? The three units that'll need building are the program counter, incrementer and memory. To recap: the memory holds the instructions that make up the program to be executed; the program counter points to the current instruction (line of program) in the memo…

Yet another diversion

Image
It's been a bit quiet on the relay computer front again for a while ... well it is summer after all and there's no point staying inside the house tending to my hobbies when I can be running around outside getting sunburnt. Of course though, this is the UK and summer consists mostly of rain (as do most of the other seasons here) so what other excuse do I have for not posting in ages?

Well, I have been busy working on the relay computer but not in the way you might expect. A comment on one of my YouTube videos recently got me thinking ... it was a question around if I simulate the computer at each stage before building it for real. I had to admit that so far I'd been crossing my fingers and just going for it but as I get in to more complicated areas the benefits of simulating first seemed quite appealing. It just so happened that this coincided with needing to brush up on my web developing skills so this seemed a good time to kills two birds with one stone as the old saying …