If you want program memory that’s relatively cheap then there’s exactly one solution that will fit your budget: HP 9100A state machine electromagnetic printed circuit ROM. Since the drive and sense line planes need to be very close together, you need either a 4-layer board and have the two inner layers used for it, or the thinnest PCB you can find - and prototype it first to make sure your drivers and sense amps work well. And of course you’ll need to write a script to generate the KiCaD PCB file for it, since you won’t want to draw tens of thousands of trace segments by hand.
Alternatively, if you feel like doing lots of manual winding, then you can do rope memory similar to the HP 9100A control ROM. That calculator had two ROMs at quite different physical scales, both electromagnetic. The rope memory there used toroidal cores with dedicated sense windings. That’s different from the Apollo Guidance Computer where cores had no dedicated windings - there was a global sense line.
So, if you can afford the time to do lots of toroid core winding then you could have a core-based ROM like 9100’s control store, and that ends up being cheap per bit if your time is free. You could even use reed relays as sense “amplifiers” for this, with an impedance matching transformer, but such memory makes even more economical sense for transistorized systems.
If you want to build a relay computer from relays you buy from mainstream distributors, ie. parts that would be reasonably available to anyone else building it, then a £400 budget won’t go very far. For example, 4-pole form C relays will cost you £5 each or thereabouts - so that’s <100 relays and <400 poles.
What I’ve found is that you can definitely buy thousands of small and fast relays on eBay for <£100/thousand but you never know which ones you’ll get. I’ve got 6,000 SPST reeds for <$500 total but that is not necessarily a representative outcome, and those thousands were spread across three, no, four (!) different part types, all having different coil power ratings and different coil voltages. My ongoing project has grown from 7,000 to well over 10,000 relays at this point and it’d cost more than £40k for someone to just go and buy same relays at distributor prices. Never mind the other parts that aren’t cheap but are called for in thousands, like the hexadecimal rotary dip switches for the PROMs. Or the inconvenient fact that one of the key relays I use is only made to order and the minimum order size is 100k pieces, and they still cost well over a dollar. So even if you wanted to buy them “new”, it’d have to be a group buy for a big bunch of people all building the same computer, and willing to sit down and solder thousands of relays.
Needless to say this scale is out of reach of hobbyists without scouting for serious eBay deals, being lucky, and then basing the design on what parts were available for cheap vs. any preexisting design. And my budget was most definitely hobbyist in that regard. And yes, it took unreasonable amounts of time to literally scroll across thousands - more likely tens of thousands at this point - of eBay listings just to find the “long tail” of the deals - the ones that were mislabeled enough to stay outside of mainstream search results. Buying 1,000 Hamlin reeds for $40 shipped to my door is a Pyrrhic victory if it takes 12 hours to locate the listing (it took me a bit over that in fact). I looked in my notes just now and I averaged about 6 hrs of eBay searching per 1,000 relays, and with other parts I needed I’d already put in about 100 hours just in eBay time. That’s not engineering or design or anything - just staring at results and looking for outliers. Finding relays en masse at $1 each is easy. “relay lot” in eBay search, sort highest price first, 200 results per page, and you’ll find at least a couple listings right this very moment that could be used in any reasonable relay computer project, if you got thousands of dollars in spending money for it, that is. Finding them for over an order of magnitude less is a whole another story, given the prevalence of junk they get mixed in with, even if eBay search allows some degree of fine-tuning and additive/subtractive terms. So that’s the less-than-glamorous side of such projects, and probably why many people lose interest at some point: the iron will of follow-through determines success, and you must have the ample time available to dedicate to it or it won’t happen.
I was very much driven by the specs of the available parts, and e.g. having reeds that respond in ~0.3ms made a big difference in what I could do, since complex and multi-layered combinatorial logic became possible that still had propagation times measured in single milliseconds. Eg. an 8x8 integer multiplier that produces a result in under 5ms. But if I didn’t have those fast reed relays then I’d have implemented a wider and slower pipelined multiplier, and there’d be no way to target sub-10ms clock cycles. Same goes for RAM and registers - if I didn’t have so many bistable relays, I couldn’t have implemented low power densely packed memory. Astable relay memory is extremely power hungry and requires lots of airflow to stay cool enough not to diminish relay life, never mind that it’d just all melt together if an “all ones” memory state was permitted with relays in physical contact with no gap. But with bistable relays that’s no problem at all, since only relatively few coils are active at any given time, and one can lay them out so that adjacent bits in a word don’t come near each other, so that no typical acces pattern would produce a hot spot on the board.
Large relay projects that use physically small relays need to pay very close attention to fanout and to keeping the contact loads under control. The scale of popular relay computer projects like Harry Porter’s is not sufficient to make this a driving factor. But once you’re past a couple thousand relays, and don’t use diodes for switching, then fan-out trees and contact load management become constraints that drive the entire design, and require out-of-the-box thinking. Therefore a corollary: making relay computers out of physically large relays that can carry 2-8 Amps per contact is a whole different ballgame than making relay computers out of relays that will have long life only if you keep the contact loads under 100mA, ideally at 50mA or less. Eg. Harry Porter’s popular design can’t be used as-is with such relays, never mind that none of the implementations use relay memory, which really would drive the point about fan-out home. In my case, the design was built around memory, with memory being designed first, as it proved most challenging. The first kilobit was the hardest to design, and in my case there were different designs since I didn’t have huge lots of the same type of relay. I’d have a kilobit of memory done all from the same relay type, two if I was lucky. Sometimes buying the 1,000 relays of a given type cost as much as buying the remaining 30 or so needed to finish the given kilobit (there always seems to be one or two bad ones per thousand in those eBay lots - I have no idea why).
I’ve been investigating the cheapest way to build a homebrew discrete computer and the transistors give you the best “bang for the buck”, especially that you can then use very cost effective PROM, and a computer without a PROM is not much use. Now I admit that my application was such that there was no need to change the code – essentially a calculator with lots of fixed code used to implement math functions. But even for a machine that targets lots of user programmability, a solid library of functions will shrink the size of user programs and place less demand for scarce RAM. Speaking of RAM: no surprise there; core memory is very cost efficient if you’re willing to thread the cores yourself and consider your time free. That can be an order of magnitude cheaper than bipolar static RAM, since that uses two transistors per cell, and also some resistors and capacitors. If you’re OK with dynamic RAM then a diode steered capacitor array can also be very economical, but relatively slow, since the capacitors have to be much larger than the capacitance of diode junctions, and power consumption becomes critical as well.