Step 4: Logic Gates

A computer consists of thousands of logic gates arranged to carry out certain functions. A logic gate is a component in digital electronics whose output depends on the state of its inputs. Most logic gates have two inputs and one output. You can think of logic gates as the decision-makers in digital electronics. The six main logic gates used in digital electronics are:

AND Gate: Output is high when all if its inputs are high.

OR Gate: Output is high when any of its inputs are high.

NOT Gate: Only has one input. Output is high when its input is low.

NAND Gate: Output is high unless all of its inputs are high.

NOR Gate: Output is high when none of its inputs are high.

XOR Gate: Output is high when an odd number of inputs are high.

Tri-State Buffer: A buffer that is controlled by a third logic signal.

It is important to mention now the difference between a high "1" signal and a low "0" signal. A high signal can either be a connection to positive voltage or it can be a floating input. A floating input is one that is not connected to any output. An example of a floating input would be one that is not connected at all or one that is connected to the output of a 3-state buffer that is not activated. A low signal is present when an input is at ground.

Logic gates can be fed into each other to produce almost any function imaginable. For instance, two NOR gates can be fed into each other to store one bit of data in a RS_NOR latch while power is supplied to the circuit.
<p>Great manual!</p><p>I've made it using Your design, but on an unusual medium: pixels :D Here's the simulator if you wanna see this in motion operating: <a href="https://realhet.wordpress.com/2015/09/02/bitmap-logic-simulator/" rel="nofollow">https://realhet.wordpress.com/2015/09/02/bitmap-lo...</a></p><p>I programmed it to calculate the Fibonacci series, it has an extra 16 byte ROM for the program, the fetch is only 2 cycles and different instructions can break the micro-word sequence earlier as when they finish, so instruction times are ranging from 3 to 5 cycles.</p><p>It was fun to input a program only using switches, like in ancient sci-fi movies. Well, it was fun for the 1st time... After I rather made a ROM.</p>
<p>Good job bro...Nice software</p>
<p>Realhet, that is spectacular! I really like your idea of using simple CA rules to make a logic sim. It is almost like Redstone in Minecraft, but so much more powerful and less latent (and also devoid of a jungle of wires, that must be nice). Congrats on the great project. Do you know of any other users of your program yet? I'll make sure to keep an eye on your site for updates, and I'll share your work with my friends. I'm sure they will really enjoy it.</p>
<p>Subscribed just to push &quot;I Made it!&quot; button and to say a <strong>BIG</strong> thank you to K.H.! :D</p>
<p>Help, I am trying to build a 8 bit computer from this but I don't understand, im building this so I can show off to my little brother... I don't understand how many chips he used and I dont understand anything past the ALU's basic add and subtract, and the register, any help would be great, please email me at hurster100@gmail.com... Once again thanks</p>
<p>What do you recommend for a power supply? I really want to do this project, but I have no idea what to do for a power supply.</p>
<p>Hi, I'm thinking about starting this project, I find it really intresting and my question is Should I make it, because I'm 17, I know binary and some eletronics, please help!</p>
<p>i want to ask about about the uses of this 8 bit computer</p>
<p>Since its 8-bit, you can do anything that requires 16 bytes of memory ( depending on your RAM ). Unless you add some external drive... which would allow you to do so much more. But just with 16 bytes of RAM you can probably do operations like:</p><p>A+B=C, then</p><p>C+B=D,then</p><p>D+A=Z,</p><p>I think.</p><p>But with an external drive of some sort your 8 bit computer will be able to do stuff like this https://www.youtube.com/watch?v=qYvr0b8jqbg ...i think?-e-dah-puzi-1998</p>
<p>16 bytes? How did you get that? Surely an 8-bit address buffer should be able to address 2^8=256 bytes of memory?</p>
<p>i am new in this topic </p><p>i think we can point to 16 Bytes memory with 5 bit address.</p><p>16 Bytes = 4 * 4 (bytes) = 32 * 32 (bit) =&gt; 2^5 = 32</p><p>am i wrong ?</p>
<p>or is it right?</p><p>to say memory we calculate this way !!!</p><p>4*16 or 5*32 or 6*64 </p><p>so if this is true </p><p>4*16 = 64 bit </p><p>64/8 = 8 byte</p><p>so for 8 byte memory we can address with 4 bit .??!!!!</p>
<p>Yeah....some people like to have a 4 bit memory address and 4 bit op code...I would personally do an 8 bit op code and memory address.</p>
<p>I mean I guess if you're not addressing much memory then it's Ok, but it would severely limit what you could do with the thing. With 256 bytes, you could even do some kind of really simple pong game.</p>
<p>Yeah....some people like to have a 4 bit memory address and 4 bit op code...I would personally do an 8 bit op code and memory address.</p>
<p>how many wires do I need? </p>
A thousand?
<p>That is a lot of wires! COOL!!!! Do you play Super Mario Bros. on it?</p>
<p>How do I use the CD4029 as a ring counter? I bought it and all I've been able to get it to do is count up/down in binary, resetting at either 15 or 9. Any help?</p>
<p>and what do you do with the carry out of the lasy 1-bit adder?</p>
<p>I am looking forward to making this project! I couldn't find anything like it no matter how hard I looked! Thank you for making this project available. :3</p>
<p>How do you ensure that the program counter starts out at zero?</p>
Got a little ahead of yourself there eh? What an utter disaster. If you need to use a breadboard and premade leads you are way out of your league here. Congratulations on your hairball. Time to cough it up.
<p>What type of PROM are you using? I didn't see any parts listed for the PROM?</p>
<p>good jop, i motivated by your project, i am gonna make one sooner . i want to know how much this projects coast you ? is there any additional advice to build one like any mistakes must avoid or things that may save time ?</p>
Sure! Try using shorter breadboard wires, and plan out the layout of your computer beforehand. This will save you a bunch of grief in the future of dealing with EMF related issues and dirty clock signals.
<p>Very well structured into topics. Very well explained and crafted. Awesome job!</p>
<p>your funny</p>
<p>I think someone forgot to cable manage :P</p>
<p>Im guessing your a linus fan. ( By your picture and your comment).</p>
<p>Yes I am definitely a Linus fan :) But, my image is not a parody of Linus's image, rather its a parody of Steve Jobs famous image, so is Linus's. The comment inspiration is more Luke, not Linus. </p>
<p>thanks for all the info and references. <br>your 8 bit computer looks like a pile of wires lol. <br>its cool though. </p>
It is awesome! One question though, I didn't quite understand what your computer is capable of doing. What can it actually do?
<p>Presumably execute simply binary programs. Adding numbers, subtracting numbers, multiplication, division, maybe some more complex things like calculating square roots or powers. Anything that a standard computer can do within the limited memory it has (256 bytes).</p>
Thanks for letting me know.
<p>Are logical operations like AND , OR, NOR, or XOR essential in performing complex operations like square rooting, or a game. I just wanna know if they are needed. If so, which operation is used the most.</p>
<p>Every single kind of computation your computer does relies fundamentally on the operations of AND, OR, NOR, NOT and XOR. Actually, even AND, XOR and NOR can be composed simply of OR and NOT gates.</p>
<p>What ROM ic's did you buy.</p>
<p>Can anyone tell me which RAM IC I should buy?</p>
<p><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?freeText=74189&langId=-1&storeId=10001&productId=49883&search_type=jamecoall&catalogId=10001&ddkey=http:StoreCatalogDrillDownView" rel="nofollow">http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?freeText=74189&amp;langId=-1&amp;storeId=10001&amp;productId=49883&amp;search_type=jamecoall&amp;catalogId=10001&amp;ddkey=http:StoreCatalogDrillDownView</a>...</p><p>Two of these chips can be your 16x8 RAM</p>
<p>i like your instructable and i'am building it i'am wondering if it's possible to calculate big numbers with this computer or i am limited to 8 bit numbers only?</p><p>in 32 bit computer you can calculate bigger number than 32 bit, i think it's a software thing but anyone can make it clear how it's done ?</p><p>Sorry for my english.</p>
<p>You certainly can, you just have to do the calculations over a series of operations, also storing and loading from RAM. As opposed to having the CPU's ALU do it all for you. Just like how you would have to manually calculate Floating Point operations on old CPUs. Yes it is much slower!</p>
lots of registers and a big ALU would allow bigger number calculations to be done.
just an idea, couldn't you use a decoder for the binary to decimal conversions, instead of using an arduino (using another computer I think is technically cheating)?
<p>haha sonic screwdriver. This is awesome</p>
<p>this is so awesome i am about to cry. congrats</p>
<p>This is amazing will try this hmm.. maybe next year</p>
<p>I love it. Thanks a lot. Nicely explained. Awesome. :D</p>

About This Instructable




Bio: All of my life I have been interested in learning the way things work. It was always hard for me to use something and just ... More »
More by spel3o:How to Build an 8-Bit ComputerMake a Pocket Watch Chain for Your iPodHow To Change Your MAC address (Snow Leopard)
Add instructable to: