r/ComputerEngineering • • Nov 15 '24

Completed 4-Bit cpu

https://circuitverse.org/users/234843/projects/centurn-solo-140-v1-0-with-program

Hello I’m a sophomore in high school and I have completed my first extremely simple cpu. Its specifications are as follows.

  • 4-Bit calculations, (add, subtract, AND)

  • 96 bytes of EEPROM storage

  • 32 bytes of RAM

  • Simulated at 20HZ but can most likely be upped to much much higher speeds

The instruction set is as follows.

0000 Do nothing 0001 move register 3C to register 1A 0010 move register 3C to register 2B 0011 add register 1A and register 2B to register 3C 0100 subtract register 1A and register 2B to register 3C 0101 AND register 1A and register 2B to register 3C 0110 set register 1A to [address] (next storage address) 0111 set register 2B to [address] (next storage address) 1000 set [address] (next storage address) to register 3C 1001 set register 2B to [0000] 1010 set register 1A to [0000] 1011 set selected storage register to [address] (next storage address) 1100 N/A (Not used) 1101 jump to [address] (next storage address) 1110 jump to [address] (next storage address) if zero flag is set 1111 jump to [address] (next storage address) if carry flag is set

I’ve made a simple program for the cpu to run that tests all the instructions that are pre programmed into the cpu. If you would like you can make your own, I would love to know how it goes if you do.

I’m excited to finally finish this project but this is just the first step. My next cpu with be a 4-bit cpu with a 8-bit memory bus and 16 selectable input drives. I will also include I/O and possibly a very simple L1 cache to learn the basics of it. As well as a full rework of the instruction set that will also of course include a full redesign of my microcode.

Just a few questions as well. Should I move to logisim from circutverse? Are there any major/noticable issues you notice that I could fix?

38 Upvotes

6 comments sorted by

9

u/Orangutanion Nov 15 '24

Now stick a booth multiplier in there lol

5

u/Diligent-Egg-8100 Nov 15 '24

I’ll try to expand my mathematical computations in my next instruction set so I’m not so limited lmao. Just wanted to finish this so I could get a proof on concept and support from others. Hopefully I can get multiplication in my next instruction set. But right now I’m mostly looking into storage space: most likely going to be 1.5KB of storage for EPPROMS and 500 bytes or so or RAM.

3

u/Orangutanion Nov 15 '24

just FYI if you go for division, please save yourself the trouble and do a ROM. Doing it any other way is really nasty.

3

u/krzyzj Nov 15 '24

You taught yourself? What resources did you use?

5

u/Diligent-Egg-8100 Nov 15 '24

Yes I did teach myself it took a while but I did it. I used google safari anything that could get me information. Not too difficult when many others have done similar on an even more complex level while leaving amazing documentation. Hopefully I can learn stacks and cache for my next cpu but I’ll see what i can do.

2

u/duckman0_ Nov 16 '24

Nice! I did a similar thing in minecraft