4-Bit Binary Adder- FINAL PROJECT

by 738675 in Circuits > Electronics

20648 Views, 5 Favorites, 0 Comments

4-Bit Binary Adder- FINAL PROJECT

4-Bit Adder.PNG

If looking to add numbers from 0 to 15, and you know how to rapidly convert from binary to decimal, well this project is for you. For my Engineering Final Project, I'll be creating a 4-bit Adder, a basic calculator that can add up to 4 bits of 2 binary numbers, using 74xx series IC chips/logic gates. If you're very new to this concept, I would advise you to review on your binary conversions and learn a bit about logic gates. This project doesn't require any coding experience, so an Arduino won't be required.

This means the you can calculate up to 1111 + 1111, which will give you 11110, aka 15+15 = 30. Unlike the 2-bit adder, that uses one half adder and one full adder, the 4-bit uses one half-adder and three full adders or four full adders. Each full adder has a carry value and a sum value, and the carry values contribute to the next full adder until the last full adder, where a carry value is left over as a 5th output.

The logic gates that I'll be using in this project is XOR, AND and OR gates. If you would like to build the full project, then here are the exact project Supplies needed.

Supplies

IMG_0152.jpeg

IDEATE

content-ideation-blog-e1513715047864.jpg

Now I will reflect on my semester in engineering. The project that inspired me the most is the UNIT 3 Project, where we were able to make a project using digital circuits, using Arduino-C code to control my components. For my project I made a Arduino Memory Game with an LCD monitor. The circuitry was pretty simple, however the writing was very hard and lengthy. Completing this project inspired me to learn more about programming and become a better programmer, by learning different languages like Arduino-C and learn different algorithms to control other components.

Something that captured my imagination the most, is definitely again UNIT 3, where we were able to make variety of different projects using digital circuits. This is because there were endless possibilities, and so many different at our disposal to create something innovative and meaningful.

The area of digital making I'm most interested is Binary Logic and Analog Circuit.

How It Works I

halfadder.bmp

The basic adding circuit is just a half-adder. 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.

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!

How It Works II

Full Adder.jpeg

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 above.

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.

Circuit Schematic

4bitadder (1).png

Now, since we know the logic behind half-adders and full adders, we are ready to make the 4-bit Adder. Above you can see the circuit diagram for the the 4-bit Adder. You'll need to combine 3 full adders and one half adder to build the 4-bit adder.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.

Above shows the concept. The blocks represent the adders and the arrows are the carry-ins and carry-outs.

Powering Your Components and Placing Them on the Breadboard

IMG_0153.jpeg

When making it IRL the first thing we have to do is place all of our need components onto the breadboard. Make sure everything is lined up ready to be wired up. In this picture, I connected the dip switches on the very left and the logic gates in proper order so wiring wouldn't be a problem afterwards. The order that I've placed the logic gates are XOR, XOR, AND, AND and OR. I also placed all 5 of my LEDs on the bottom right of the breadboards, and connected them directly to ground. Now, connect the DIP switches to power, and provide power & ground for each logic gate. Also make sure that the dip on the logic gate is facing towards the left.

Include the Half-Adder

Screen Shot 2021-04-24 at 8.08.51 PM.png

Next, start by making a half-adder which gives the first sum and carry for the 1st full adder of the 3. The wiring for this circuit is pretty easy. In this circuit, the 1st dip switch, 4th switch is connected to both XOR and AND gate, which goes for the 2nd dip switch 4th switch as well. The XOR output would be the first sum (s0) connecting to the AND output becomes the carry for the full adder.

Step 6: Add 3 Full Adders

IMG_0154.jpeg

After you've completed making your half-adder, start by making one of the three full adders. For the 1st full adder, it utilizes the carry from the half adder to be the carry input. The switches (1 to the left of the switches used for the half adder) are connected to both the XOR and AND just like the half adder. The special case with the full adder is that the carry of the previous adder is also included. In this case, the carry and the XOR output from the first XOR would go into another XOR gate. That would then become the sum for that adder, which in this case is s1.

Step 7: Add 5 LEDs and Test

capture2.jpg

Once the circuit is fully wired, I first tested the 4 bit adder with LEDs by connecting them onto a separate breadboard. Test if the 4 bit adder calculates correctly, by trying different calculations. Use a website like this Binary Calculator to check if your calculator is able to correctly calculate the values. If the 4 bit adder displays the correct values, then rest assure that you've made a 4-bit adder successfully. You should be proud of yourself, as you've made something pretty gosh damn impressive.

Final Product

4-Bit Adder- Final Project