4 Bit Binary Adder Mini Calculator PDF

Title 4 Bit Binary Adder Mini Calculator
Author Balawal Rasool
Course Digital logic design
Institution University of Engineering and Technology Lahore
Pages 9
File Size 695.5 KB
File Type PDF
Total Downloads 74
Total Views 162

Summary

i am balawal...


Description

Home Sign Up! Browse Community Submit All

Art

Craft

Food

Games

Green

Home

Kids

Life

Music

Offbeat

Outdoors

Pets

Photo

Ride

Science

Tech

4 Bit Binary Adder (Mini-Calculator) by gigavolt on December 8, 2010

Table of Contents 4 Bit Binary Adder (Mini-Calculator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1. . Intro: 4 Bit Binary Adder (Mini-Calculator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. Step 1: The Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3. . Step 2: How It Works - Part . . .I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3. . Step 3: How It Works - Part. .II. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4. . Step 4: How It Works - Part . .III. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4. . Step 5: Building It On A Breadboard ..........................................................................................5 .. Step 6: For Those Who Don't Understand Or Are So-So With Binary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6. Step 7: Going Farther And Final Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6. Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7. .

http://www.instructables.com/id/4-Bit-Binary-Adder-Mini-Calculator/

Intro: 4 Bit Binary Adder (Mini-Calculator) If you need to quickly add numbers from 0 to 15, and you know how to rapidly convert to binary and back to decimal, this is for you...But if your human then this is just a fun project!! I'm going to show you how to make a 4 bit (0-15) adding calculator using 74xx series IC chips. The chips that I used are the very basic gates like OR, AND, XOR, NOR, NAND, etc. No actual adding chips are used so its one level up from transistors, and it's totally TLL!** By the way, this is another addition to the unofficial "Macroelectronics" catagory for all of you who have seen my diy ram instructables! **If you use the 74hc series or 74hct series, then its technically not TLL, but who cares about the techincal details!!

http://www.instructables.com/id/4-Bit-Binary-Adder-Mini-Calculator/

Step 1: The Materials This project only requires a few parts: 1 Breadboard, maybe 2 - It should have atleast 50-60 rows 2 74xx AND chips - I used the 74hc08 2 74xx XOR chips - I used the 74hc86 1 74xx OR chip - I used the 74hc32 1-2 DIP Switches - I used 2 8 switch DIP switches (I'm gonna expand to 8 bits) 8 1K ohm -or greater- resistors Lots of wire - Don't yell at me but I use bare copper! Its a bad habit, (some may argue that it's a dangerous one) I know, but I don't care!

Image Notes 1. Yup, they're from Jameco 2. Just a few -80- 74hcxx chips!! 3. I took this picture after I took the chips for the project so there is missing chips!

Step 2: How It Works - Part I The basic adding circuit is just that, basic! It consists of a XOR gate and an AND gate to give you the basic output with a carry bit. The XOR gate is short for exclusive or. In a regular OR gate, 0 and 0 equal 0, 1 and 0 equal 1, 1 and 1 equal 1. In an exclusive or gate, 0 and 0 equal 0, 1 and 0 equal 1, 1 and 1 equal 0. This is important because when adding 1 and 1 in binary you get 10, so the ones place has a zero, something that can't be done with a basic OR gate. OR: A B 0 0 1 0 0 1 1 1

Y 0 1 1 1

XOR: A B Y 0 0 0

http://www.instructables.com/id/4-Bit-Binary-Adder-Mini-Calculator/

1 0 1 0 1 1 1 1 0 So now, when you add 1 and 0, you get 1, but hold on...When you add 1 and 1, you get 0?? That can't be right! In order to fix that, we need to be able to have 1 and 1 equal 10. Welcome to the AND gate. As the name implies, an AND gate equals 1 when A=1 AND B=1. This it tied in parallel with the XOR gate and is the carryout bit, so that when you add 1+1, you CAN get 10!

Image Notes 1. Half Adder Circuit 2. Inputs

Step 3: How It Works - Part II Ok, so we can add 1 and 1, but what if we want to add 11 and 11, well the problem is that there is no carryin bit on the second adder. We need a full adder. In order to make a full adder, we have to use 2 XOR gates, 2 AND gates and an OR gate. The circuit for the full adder is shown below: The full adder works by putting inputs A and B through a XOR gate, then taking the output from that and XORing it with the Carry-in. This gives you the bit output. To make the Carry-out, you have to put A and B through an AND gate, and put the output of the A XOR B gate and the Carry-in through an AND gate as well. When you put those 2 outputs into an OR gate, you get a Carry-Out bit. So now we can put a bunch of these together and get a calculator.

Image Notes 1. The XOR gates do the actual adding. 2. The AND and OR gates calculate the Carry-Out bit

Step 4: How It Works - Part III Now that we have full adders, its time to put them together to make a calculator. To connect all of the adders together, you have to connect the carry-outs to the carry-ins in a cascading fashion. So the carry-out of the first adder connects to the carry-in of the second adder and so on. Below shows the concept. The blocks represent the adders and the arrows are the carry-ins and carry-outs.

Image Notes 1. Carry-out of the first adder becomes the Carry-in of the second adder 2. The Inputs 3. The Outputs

http://www.instructables.com/id/4-Bit-Binary-Adder-Mini-Calculator/

Image Notes 1. Bit 0 of the adder 2. Bit 1 3. Bit 2 4. Bit 3

Step 5: Building It On A Breadboard Ther are a few tricks to building this on a breadboard. The organization of the chips on the board is very important, I found that putting the chips in this order works well: XOR, AND, OR, AND, XOR, then the DIP switches. Another good idea is to build each adder one at a time and on one side of the logic gates. There are 2 XOR and 2 AND gates on each side of the chips so that makes construction a lot easier. The order that I put the wires on were: connections to the DIP switches, inter-gate connections, and finally connections to the LEDs. To wire up the switches, you first (this may only apply to cmos versions of the chips, I haven't been able to experiment TTL versions yet) connect the side not connected to the adder inputs to the supply voltage. Next connect the other side (the pins connected to the adder inputs) to ground through a 1K ohm, or greater, resistor. The LED's are connected to the outputs of the adders through a 1K ohm resistor. If you are using the 74LS series or similar (any series that can't source 5 mA or more) you will have to connect the output to a transistor to get to the required current.

Image Notes 1. LED for 1s place 2. LED for 2s place 3. LED for 4's place 4. LED for 8's place 5. LED for 16's place

http://www.instructables.com/id/4-Bit-Binary-Adder-Mini-Calculator/

Step 6: For Those Who Don't Understand Or Are So-So With Binary If you understand the phrase "There are 10 kinds of people in the world, those who understand binary and those who don't" go on to the next step! If not, stay here! The number system we know and love is base 10. This means that each new column of numbers is 10x the last column (if you don't believe me, divide 10 by 10 and you get 1 or divide 100 by 10 and you get 10, these relate to the 100's, 10's, and 1's columns). Binary, or base 2, is different in that each column is a power of 2 (so each new column is 2x the last) and it uses only 1s and 0s. Let's look at binary numbers. Take the number 10 for example. In binary, 10 is 2 in base 10 because the first column is the 1's column and the second is the 2's column (1*2=2). If we break this number down, we get 1 in the 2's place and 0 in the 1's. 2+0=2, so 10 is 2. Another number example could be 101. Now we have 3 columns to work with. In binary this is the 4's column because 1*2=2, in the 2nd column, and 2*2=4 in the 3rd column. Let's break this down, there is a 4 and a 1 and no 2s. 4+1=5 so 101=5. Now that you get the basics of binary, we can learn to convert to binary from base 10. To convert to binary, you have to subtract the power of 2 that it is greater than the number until you reach 0. This may sound confusing, as it is hard to explain without examples, so thats what we are going to do. Let's take the number 15. 15 is greater than 8 (powers of 2 include 1, 2, 4, 8, 16, 32, etc.) so we do 8-15=7. We also put a 1 in the 8's column. The next power of 2 is 4. 7-4=3, so we put a 1 in the 4's column. Next is 2. 3-2=1, so we put a 1 in the 2's column. And finally 1-1=0, so we put a 1 in the 1's column. When we put all of these together we get 1111. Now let's lake the number 11. 11-8=3, so we put a 1 in the 8's column. 3 isn't bigger than 4, so we have to put a 0 in the 4's column. 3-2=1, so we put a 1 in the 2's coulmn. And finally, 1-1=0, so we again put a 1 in the 1's column. This gives us the binary number, 1011.

Step 7: Going Farther And Final Notes Now you have a 4 bit adding calculator, congrats! I know that there are adding chips in the 74 logic family, and that there is a calculator much more sophistocated in my kitchen drawer, but this fun little project helped me and hopefully you too, learn more about adding numbers with electronics and logic. I hope to build an 8 bit adder, as a 4 bit adder is wimpy with up to 15+15, along with subtraction too!

http://www.instructables.com/id/4-Bit-Binary-Adder-Mini-Calculator/

Related Instructables

DIY RAM MemoryRegister Style by gigavolt

How to change the LED's in the Razer DeathAdder by Xillionous

Level Shifting Between TTL and CMOS by nevdull

LED Binary Calculator by Syst3mX

How to Convert Between base10, Hexadecimal, and Binary by nevdull

Smallest Binary Clock by macobt

Comments 19 comments Add Comment

shane11 says:

Feb 12, 2011. 5:14 PM REPLY

I cant seem to find a XOR GATE with the model number 74HC86 on jemeco thats an OR gate.

gigavolt says:

Feb 12, 2011. 9:27 PM REPLY

Are you sure? 74HC86N - Quad 2 Input Exclusive OR Gate??

shane11 says:

Feb 18, 2011. 8:13 PM REPLY

oooo whoops sorry bout that!!!!!!!!!

dungeon runner says:

Dec 31, 2010. 12:21 PM REPLY Damn! After seeing your DIY RAM instructables I was going to do just this myself. Oh well, beat to the punch. Maybe I'll post a more complete version, with subtraction and such. Good job.

gigavolt says:

Dec 31, 2010. 10:42 PM REPLY Thanks man! Yeah, I have the entire schematic for an 8-bit adder/subtractor (number range 127 to -128) I just need another breadboard and a few hours of free time (the hard part) and I can start. But if you beat me to it, good luck to you!!

shane11 says:

Feb 2, 2011. 11:51 AM REPLY

Could I possibly use your schematics for the 8 bit I would like to build that!!!! And also correct me if i'm wrong but this requires NO programmer right????

gigavolt says:

Feb 2, 2011. 12:08 PM REPLY Yeah, just give me a day or to to draw it up on the computer. I have it all in a sketch book, so it should be only like a day's wait. And no, it requires no programming what so ever, it's just logic chips and wires!

shane11 says:

Feb 2, 2011. 12:13 PM REPLY

Thats great that theres no programmer!!!!! Im seriously excited to build this!

gigavolt says:

Feb 3, 2011. 3:48 PM REPLY

These are the pics that I took of the sketchbook. I hope you can read them. Basically, the first picture is the 2's complementor. So the Bx input (x being the bit) would go into that to be made negative (or positive if already negative). The second picture is of the add/subtract selector. The Bx input is the normal, "un-negatized" B input, and the /Bx is the "negatized" input When the select line is pulled high, the calculator adds, and when it's pulled low, the calculator subtracts. The ADDx outputs are connected to the Add B input. You may want to put diodes on the outputs before connecting them together and then you will want to tie the line low through a 10K ohm resistor where both outputs are connected together. The third x inputs come from the selector's ADDx outputs. COi is the Carry In which is connected to the last bit's COo, which is the Carry Out. On the LSB, the COi is tied to ground. The Last picture is of the gate and chip count. Yes, you will need 10 AND Chips! Good luck and Have fun!!

http://www.instructables.com/id/4-Bit-Binary-Adder-Mini-Calculator/

shane11 says:

Feb 3, 2011. 4:21 PM REPLY

Very nice design thank you so much for taking time to take the photos.

gigavolt says:

Feb 3, 2011. 5:22 PM REPLY Yeah, no problem. I would like to see it, so when you finish it, send some pix! Or better yet, make an 'ible!

shane11 says:

Feb 4, 2011. 4:47 PM REPLY

I would be happy to!!!!!!!

shane11 says:

Feb 2, 2011. 9:03 PM REPLY

Does it matter the logic chips being in a starait line or is that just because your on a bread board?

gigavolt says:

Feb 3, 2011. 12:05 PM REPLY

Yeah thats the only reason. You could have them oriented however you wanted on a PCB.

rtty21 says:

Dec 22, 2010. 6:29 PM REPLY I have visited jameco before and I like the layout of their website, but personally, I like mouser more. It has cheaper products and they allow you to order in multiples of 1!! =D Have you ever tried mouser.com? if not, you definitely should!!

gigavolt says:

Dec 22, 2010. 6:45 PM REPLY I've tried mouser and I really like them. I just went with Jameco because I had the catalog available so I didn't have to search all over the web trying to find which parts I needed!

rtty21 says:

Dec 22, 2010. 6:26 PM REPLY Dude! I love this tutorial! you really went all out on your logic chip order! How much money was it to purchase all of those? my guess (for the 80 logic chips) around twenty to thirty dollars. p.s. A++Tut =D

gigavolt says:

Dec 22, 2010. 6:39 PM REPLY Yeah I know I went out of my way, but it was because I'm also looking at making an extremely simple CPU to make cylon eyes! Its all for the macroelectronics movement! And yes, the total with shipping was just under $30.

http://www.instructables.com/id/4-Bit-Binary-Adder-Mini-Calculator/

rtty21 says: I love that joke, and you are probably annoyed by me commenting on all of your videos!!

http://www.instructables.com/id/4-Bit-Binary-Adder-Mini-Calculator/

Dec 22, 2010. 6:33 PM REPLY...


Similar Free PDFs