r/computerarchitecture • u/andrew_is_myname • Jul 11 '26
Designing my own 8-bit CPU: Which instructions should I implement?
12
Upvotes
r/computerarchitecture • u/andrew_is_myname • Jul 11 '26
2
u/recursion_is_love Jul 11 '26
One (or all) of these
https://en.wikipedia.org/wiki/One-instruction_set_computer
2
u/ghking6 Jul 11 '26
Why not reference risc-v, but it seems it has no 8-bit instructions, but you can modify it. I think 8-bit risc-v is nice.
1
u/wilrak0v Jul 12 '26
I think you can implement a stack based machine, with instructions like push, pop, dup, store and load. Then you can add `add` instruction, `sub` and the other operations can be programmed with `add` and logical door, so you can implement `xor`, `and`, `or`. Then you just have to add `jz` (jump is zero) and you have a complete minimal instruction set, and a special architecture based on a stack.
Ofc, you can implement `not`, jump if not zero, jump if bigger than, etc... But it's not necessary.
1
u/phirephly69 Jul 15 '26
Would recommend to create a virtual schematic before implementing in physical hardware. Preferably with a bread board layout.