How to build a 2 or 4 bit CPU

Jordan Hall

Reputable
Dec 15, 2014
13
0
4,510
Hey, Plat here! I am here to ask one question, how can I build a two or four bit CPU for basic adding, subtracting, ect? I am not here so a bunch of people can tell me that I can't do it. I can, I just need some guidance. So how can I start and roughly how long can this take me to make (out of curiosity). Also I hope that it can be breadboard bound for prototyping so I can maybe make a proto-board version. I have tried to look on YouTube but have had no luck and the same goes for searching online! I would like to add that this is for educational not practical uses, I just want to learn how a PC works on the most basic level! Thanks for reading, PlatinumNinja!
 

Jordan Hall

Reputable
Dec 15, 2014
13
0
4,510


If it was a homework question then I think that I would have found it by now xD, but to clarify it is not a homework question. The problem is that I don't know a whole lot about logic gates. This can be a problem when looking to build a cup from scratch xD also I think that we are learning about logic gates next year so the small advantage would be useful. Thank you BTW!
 
A series of XOR logic gates with an AND gate and Carry-bit will allow you to do basic addition.

0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0

Same input into an AND gate will tell you if you need to carry.

0 + 0 = 0
0 + 1 = 0
1 + 0 = 0
1 + 1 = 1 (for carry) add carry to next bit.

My Middle School students have built a circuit that will add two single bits and give the correct carry from a couple of Snap Circuits 750 kits. I taught them this to show how a computer works at the most basic level.

We have a cardboard model that works like a mechanical calculator too.
 

USAFRet

Titan
Moderator
How to Build an 8-Bit Computer
http://www.instructables.com/id/How-to-Build-an-8-Bit-Computer/

F5CAWI5H1KHA9ZO.MEDIUM.jpg
 

Jordan Hall

Reputable
Dec 15, 2014
13
0
4,510


Great! This is super useful! Thank you for this, yet more research is needed on logic gates you have helped me a lot and have taken me one step closer to solving this puzzle!
 

Jordan Hall

Reputable
Dec 15, 2014
13
0
4,510


Good idea, but I am considering making a transistor based project first. Then if I wish to make something more complex (maybe 8 bit manipulation) I will definitely look into the TI 7400 chips. Thanks!
 
You also need a part to carry Instruction set, without it all you'll be controlling is few of lights using toggle switches.
CPU is much more than couple of logic gates. What those students built doesn't even need any electronics, few switches, light bulbs, wires and a battery would do it.
 

Jordan Hall

Reputable
Dec 15, 2014
13
0
4,510


That's exactly what I want
 


It reminds me of a computer science class (some decades ago) where the class always answered "front panel loader" to any question that it could be an answer to. The prof eventually got tired of it and threatened us with a project where we had to use the FPL. We believed him and shut up :). We actually did have to use the FPL to boot the machine, if I remember: Run/Halt to Halt, set the the address of the OS bootloader ROM entry point on the address switches, hit the Load PC button, then Run/Halt to Run...

Man, that sucked.