Beginner Electronics - Beginner Electronics – 29 – Binary Half-Adder

Electronics, Howto & Style

Beginner Electronics

29 Lessons

Beginner Electronics – 29 – Binary Half-Adder

what is going on everyone my name is Cody Moore and welcome back to electronics episode 29 in this episode we are going to learn what a binary half

adder is we are going to learn how to make a half adder circuit and we are going to design it and then we are going to build that circuit so what is a binary half adder well it's basically

going to be the simplest form of adding binary numbers together in fact it's going to be such a simple addition machine that it's only going to be able to add single digit binary numbers

together so we are going to build a circuit that takes two inputs it's going to take some input a and some input B and it's just going to add those two binary digits together so if we input

two low signals to zeros it's just going to add 0 plus 0 in binary what is 0 plus 0 in binary it's 0 of course so the sum of that is 0 now what if we changed our inputs if we did 0

plus 1 well of course 0 plus 1 is also 1 in binary the next case over 1 plus 0 well that's just the same thing just reversed so that's still equal to 1 of course then we have the special case of

1 plus 1 in binary and we know that this equals to or 1 0 in binary now remember when we were adding numbers say we added a 1 plus a 1 in binary we know that 1 plus 1 equals 2 so we bring down the 0

and then we move the 1 over to the next column well this one right here that is called the carry bit or rather the carry output of this addition of this column of numbers here and it's called that

because you carry that digit from the to that one 0 that we get from this we carry that 1 over to the next column to continue the addition so 1 plus 1 is 2 or 1 0 so we are going to call this 0

the sum of 1 plus 1 but we know that we had to carry over an extra one to the next / so we are actually gonna need two outputs from our binary half adder

because in the case of 1+1 we have to indicate that this zero isn't our full answer no we actually have an extra one over here that we have to carry on to other additions if we were to eventually

in the next video add larger and larger binary numbers together now of course in the above three cases here these are all such small additions 0 1 & 1 that there is no carry out that carry out bit can

be said to be 0 because if we take a look at 0 plus 1 in binary over here we get 0 plus 1 is 1 and we never carried over a bit we can kind of imagine that there is a 0 for our carry out here it

doesn't affect the answer right 0 1 is the same as just 1 so that is our truth table about what our binary half adder is going to do all it does is add two single-digit binary numbers together and

it gives us some sum and then a carry out value if necessary so we can add numbers up to two and it might not seem like a lot but this circuit is going to be used in the next video to create a

binary adder that can be expanded to as many binary digits as we want okay so how can we design a circuit for this so we know that our half adder circuit is going to require two inputs so let's

just begin by saying we'll have input a and we'll have input be just as wires they're either going to be low or high 0 or 1 and we also know that our half adder is going to have two outputs a sum

bit and then a carry out bit in this carry out bit well kind of for today represent the second decimal position in a binary number so 1 0 would be represented by a sum bit of 0 and a

carry bit of 1 you can think of it as our second binary position all right so we have two inputs and we're gonna have two outputs let's focus on getting one output correct to begin with let's

focus on the Sun bit so the only time that the Sun bit has to be one is if one or the other of a or B is one but they can't both be one because we still need a zero in that case does this look

familiar to any of the logic gates that we learned I think it does if we look just at this portion of the table this is identical to the exclusive or gate that we learned about so we can simply

take our a and B inputs and put it through an exclusive or gate to get our some output so let's go ahead and do that we'll make a and we'll make B go on in to an exclusive or gate which looks

kind of like this and that is all we need for our sum output okay great we're almost there next we have to handle our carry output the second position the second bit

position of our Edition circuit so we know that the only time that we want a 1 for this carry bit is when both a and B are also one and I said the answer right there in that sentence we just have to

use an and logic gate because remember an and gate only gives us an output of 1 if both a and B are 1 otherwise it'll always give us zeros so all we have to do is put a and B through a NAND gate so

we'll go ahead we'll take our same B input and I'll just move it down over here we'll take our a input and we'll kind of move that down as well and this will all be fed in to a single and gate

and this will become our carry and that's all we have to handle we know that we can have our two inputs a and B here and we will always generate the proper sum and carry outputs using this

circuit and this is what we call the binary half adder now again it can't add any giant binary numbers or anything like that that's gonna come in the next video but this will help us do that

alright so I've already built the circuit out and it's kind of similar to the circuit that I built in our logic gate video just with obviously the and gate added to it so here I have my X or

gate chip of course I'm only using the first three pins so pins 1 & 2 are a and B inputs and the third pin is the output of the XOR chip so I just have this here wire being my a input this wire being my

B input and those are just connected to disconnected wires for now then I have the output of my XOR chip through a resistor to an LED now this will end up being my sum bit because this is the

output of the XOR gate we said that that would be our sum output next I route the exact same inputs so I have another wire going over here to the first pin of this chip now this is the 74 LS 0 8 chip and

that is very similar to the XOR gate chip but it's an end gate chip it has four separate and gates in it again I'm only using one of the and gates so pin 1 that's connected to my a input the same

exact a input pin tubes connected to my B input and then pin 3 is the output which leads to another resistor in LED and of course this will be my carryout bit because that is the output of the

and gate for the circuit all right so let me move this a little bit out of the way here and let me connect my inputs we'll start off with adding 0 plus 0 so ground plus ground of course and

remember we have input a and B so let me go ahead and power on the circuit here and once I plug it in you will see that nothing happens and that is correct because zero plus zero is zero with no

carry okay great let us try zero plus one so I'll move input B to power and we see that we get our some bit illuminated but our carry bit is still off so zero plus one equals

one with no carry that's correct if we do the opposite we should get the exact same thing so if we move input a instead if I can get it out and move that over to positive power now we have one plus

zero and that of course still gets us the same thing as some bit of one and no carry and of course if we add one plus one so if I move input B also to positive power now we have one plus one

and we have no some bit remember our sum bit is zero in this case but we have our carry bit illuminated meaning that we have the value of two so this is our half adder now of course we still have

the issue of if one of these is disconnected we kind of go into an unknown state for instance it can kind of flicker between both inputs based on what's unplugged and what's plugged in

but we're gonna be covering pulldown and pull-up resistors which will solve this problem essentially in other videos but if you'd like to solve that problem yourself you're gonna want to search for

pull-up or pulldown resistors just thought I would mention that for the people who are interested in exploring the subject a little bit more anyways this is our binary half adder and in the

next video we are going to expand upon this that way we can add larger binary numbers together such as I don't know an 8-bit binary number thank you all so much for watching and I'll see you in

the next episode

Today we learn about, design, and build a binary half-adder!

Need source code? See my website: https://codenmore.github.io/
Follow me on Twitter – @CodeNMore – http://www.twitter.com/CodeNMore
Comment, PM, or Tweet me for help!

Teaching to understand all subjects to the fullest extent!

    2's complement 555 555 timer 8-bit addition advanced alu amazing and and gate arduino arduino uno arithmetic astable attiny attiny85 awesome base 10 base 2 battery Battery (Invention) beginner binary bipolar junction transistor bistable bjt breadboard build building button capacitance capacitor charge circuit circuits components computer Computer Science (Field Of Study) computers decimal development digital logic diode easy education electricity electronics Electronics (Field Of Study) Engineer (Profession) engineering Engineering (Industry) episode 1 episode 10 episode 11 episode 12 episode 13 episode 14 episode 15 episode 16 episode 17 episode 18 episode 19 episode 20 episode 21 episode 22 episode 23 episode 24 episode 9 Experiment explained first floating inputs full adder half adder hard hardware Help how how-to ic integrated citcuit intermediate Invention (Literature Subject) invert gate inverter learn LED Light-emitting Diode (Invention) logic gate logic gates Math measure Mechanics microcontroller monostable multimeter non latching relay not gat npn transistor ohm ohms law Open-circuit Voltage oscillator parallel part 1 part 10 part 11 part 12 part 13 part 14 part 15 part 16 part 17 part 18 part 19 part 20 part 21 part 23 part 24 plans pnp transistor potentiometer Power programming relay relays resistance resistor Robot Robots schematic schematics scratch series software speaker subtraction switch switching symbol Technology Tips transistor Tricks tutorial two's complement variable resistor Watt Wattage xor xor gate