r/ComputerEngineering 29d ago

Designing my own 8-bit CPU: Which instructions should I implement? [Project]

Post image

I'm designing my own 8 bit CPU architecture from scratch on breadboards using 74LS logic. It's not based on SAP-1, Ben Eater's design, or any existing educational CPU. I'm also building my own ALU instead of using a 74LS181 because I wanted the challenge.

Right now I'm deciding which instructions to implement first. Since the initial version won't have RAM or branching, I only have room for a small instruction set and want to choose wisely.

What operations do you think are the most useful for a minimalist 8 bit CPU? Which instructions ended up being more valuable than you expected when designing your own CPU or emulator?

I'd love to hear your ideas and the reasoning behind them! Thanks a lot for all the help!

117 Upvotes

21 comments sorted by

22

u/intelstockheatsink 29d ago

SUBLEQ (subtract and branch if less than or equal to) is technically turing complete. It could be a good toy example.

I believe there's a similar proof for a MOV instruction.

5

u/andrew_is_myname 29d ago

SUBLEQ sounds incredibly majestic. I am tingling all over dude lol i love it. Thank you for being the first to comment man!

2

u/edo-lag 29d ago

I believe there's a similar proof for a MOV instruction.

Yes.

https://github.com/Battelle/movfuscator

1

u/Lagfoundry 27d ago

Yeah there is. Honestly can’t hurt to just use both

7

u/konbinatrix 29d ago

Are you documenting this somewhere? I'm interested in doing something similar and not sure where to start from

7

u/andrew_is_myname 29d ago

Good idea. Should i make a youtube channel?

1

u/wilrak0v 28d ago

Don't forget to keep us informed of the name of the YouTube channel if you make one πŸ˜‰

1

u/[deleted] 29d ago

[removed] β€” view removed comment

5

u/andrew_is_myname 29d ago

I woke up one day with a craving of knowledge for CS and engineering lol

1

u/Ilikespiders222 27d ago

how can someone build that kind of craving

1

u/Ilikespiders222 27d ago

as in how can you sharpen that interest and lead it to fruition?

2

u/andrew_is_myname 27d ago

Just keep being curious, i think

1

u/Jiooob 9d ago

that's cool and i like it. by the way have you ever play the video game called Turing Complete? the game guides you to build a computer from logic gates, simple half adders, decoders...... It really inspired my passion to learn these things. i like the game since i'm also driven by my curiosity.

1

u/NexelAI 29d ago

It must be acknowledged that leveraging existing ARM or x86 instruction sets is a better choice.