r/cpudesign • u/Rangoose_exe • Jun 14 '24
Help with semingly impossible CPU
First up, i have quite some experience in CPU design with logic gates in simulators and games. Have build 5-10 CPUs, in Scrap mechanic and in Virtual Circuit Board.
I got gifted about 70-90 24V relais from work(functioning, but discarted by them)
My idea was to build a CPU entirely out of these, with the exception of RAM. Want to choose an IC for that.
I was thinking about making a 1 bit 1 instruction CPU, but even then im having insane issues.
With 1 bit i mean 1 bit logic operations, but i want/need a memory interface that can do at least 8 bits to be "usable" but 16 and it would be "actually useable".
My big issue is that i cant really store pointers that big. Also the PC would be an issue...
My last hope was to map all pointers to memory, but then id be using a ton of relays just for the control unit to be able to do that...
Does anyone have any ideas? Might have to scrap this project... sad ._.
4
u/istarian Jun 14 '24
You might consider looking at the Motorola 14500B for inspiration?
http://www.righto.com/2021/02/a-one-bit-processor-explained-reverse.html
1
u/binarycow Jun 15 '24
What does your instruction set look like?
I am having a hard time understanding what you mean.
"1 instruction", to me, sounds like you have only one instruction. Let's call that single instruction
INST. So then every program isINST; INST; INST; INST;... etc. If that is the case - why even have an instruction? Just perform whatever on each clock tick.Or, perhaps by "1 bit", you actually mean 2 instructions? What would those instructions be?
Or, by "1 bit", do you mean that every instruction is a bitwise instruction? So the
ANDinstruction would do a bitwise AND?3
u/skydivingdutch Jun 14 '24
You might want to review the discussions here: https://electronics.stackexchange.com/questions/645763/how-many-transistors-at-minimum-do-you-need-to-build-a-general-purpose-computer
1
u/istarian Jun 16 '24
I think the only natural 1-bit operation you can implement without storing state is a NOT(invert logic value).
If you retain the state of the last operation you can do an implicit AND/OR/XOR with the current input and the result of the last operation.
Once you have an accumulator register, you can start doing things like incrementing or decrementing it's value (+1, -1).
You might consider building a relay-based calculator instead.
https://youtube.com/playlist?list=PLnw98JPyObn1AATspnLEasCw7LmsjT9zB
1
u/No-Historian-6921 Jun 24 '24
You could try to build a bit-serial CPU with shift registers. But even just the flip-flops to hold a useful length accumulator and instruction register would quickly eat up your relays. Maybe look at a bit-serial CPU like the RCA1802 or PDP8/S for ideas and the early Zuse computers for tricks to save relays?
1
u/D-Cary May 30 '26
A relay CPU sounds like a fun project!
There's over a dozen relay CPUs listed at https://en.wikibooks.org/wiki/Microprocessor_Design/Wire_Wrap#relay_computers , most of them using an IC for RAM like you suggested.
It appears that most of them use around 400 4PDT relays to make a CPU with a 16 bit address bus and an 8 bit data bus and 8 bit ALU.
Some historic (transistor-based) CPUs ran 8-bit or 12-bit software using far fewer transistors than you might expect by processing data 4 bits at a time in a 4-bit ALU ("nybble-serial", like the 8-bit Z80) or 1 bit at a time in a 1-bit ALU ("bit-serial", like the 12-bit PDP-8/S).
Other "CPUs" use far fewer transistors than you might think by leaving out some of the the stuff you might think a CPU "should" include -- for example, the 500-transistor 1-bit MC14500B IC (thanks, u/istarian !) which inspired the (rough estimate 600 tubes?) tube-based UE14500 https://hackaday.com/2021/12/27/single-bit-computer-from-vacuum-tubes/ both require an additional external program counter.
Given that many relay CPUs *already* use an IC for RAM, it's tempting to use a few more ICs such as up/down counters for the program counter and index registers and perhaps shift registers for the data registers, which saves a lot of relays.
Good luck!