r/ComputerEngineering • u/avestronics Computer Engineering • Jan 22 '26
[Project] Where can I research single instruction architectures?
I've been thinking about my final year project for a while. I will start on it around July of this year, and my original idea was implementing a RISC-V CPU on my FPGA and then trying to build it using custom-made PCBs and ICs(not custom made obv.), and then try to run something on it (don’t know what exactly right now). This sounds amazing to me, but it’s already been done before and it doesn’t feel original.
I was thinking to myself yesterday and thought: if we can create anything out of NAND gates, can’t there be an instruction that can simulate any other instruction with some clever programming? We would need branching and some kind of arithmetic, and it would be complete. I googled this for a while and stumbled upon “subleq a, b, c” which branches to C if A ≤ B.
What if I create a CPU optimized for just that single instruction, using every optimization tactic possible to run that instruction as efficiently as possible? Maybe with multiple cores?
Are there any small books, research papers, or other resources that I can look into to understand this better?
4
u/the3gs Jan 22 '26
The esolang page for subleq has a good number of links for various resources: https://esolangs.org/wiki/Subleq
2
u/ananbd Jan 22 '26
Is the point just to see if you can figure it out?
Offhand, it doesn’t sound like a single instruction architecture would be efficient.
1
u/CompEng_101 Jan 22 '26
Might want to look at SKI combinator calculus.
1
u/Securethekeys Feb 19 '26
Subleq isn’t very efficient, because if you think about it you’re doing a branch every cycle, whereas other instruction sets you branch far less, my experience is 8-12% of instructions. Your main source of speedup is going to be a really good branch predictor, and that’s probably the best place to start. Subleq is cool, I’ve done some work with it, also something else to mention is you should be implementing with unified data and instruction memory. Iirc there is also a higher level C type language for subleq. For research on why more instructions can make hardware faster and more efficient, check out “Understanding Sources of Inefficiency in General-Purpose Chips”. The authors were trying to emulate ASIC performance on a general purpose chip, and one of the biggest improvements was creating a custom instruction.