We're not going to be doing addition of numbers that are not in base 10.
So let's just clarify how this works.
If we have some base to numbers k just zeros and ones because that's all that's allowed and base.
OK.
We're going to add these together the way we add them is we have to realize that one plus one is no
longer two but it's one zero because that is true in our numbering system.
One plus zero.
Sorry about that one plus zero is one zero plus one is one and zero class zero is zero.
The only other case that could happen is I could have a carry and I'd have one plus one plus one would
be one one because that's three.
So let's look at the number and see if we get one plus one is zero carry one plus one is zero.
Kerry put a one there one plus one is zero Kerry but one plus one plus one is 11 or three.
And Kerry we follow through with this logic doing each step putting it in and and that and at the end
this is what you should get this is all in base 2.
So this is how you would add you would just carry because we could only carry a one and that would be
the logical step for carrying.
Now let's make sure that we can do subtraction.
First of all if we have three numbers three spots rather three bits this is zero.
That's one that's two that's three and now four is going to be I'm going to write it in here.
That's for five.
Is this six.
Is that sorry and seven.
Is that OK.
So here are our numbers.
Now we said that what we could do is we can make half of these positive and half of these negative so
we're going to make these numbers positive.
And these numbers negative.
Now the justification is how do we know that there are negative Well we could do this thing called two's
compliment.
OK.
So if this is the equivalent of 0 1 2 3 What would this is going to be the equivalent of negative one
negative to negative three negative four.
Now remember any number that is a one in front is going negative.
What do you do.
Step one flip the bits.
Step two.
Add one so we know how to do addition already in binary.
So we should be OK with adding one.
So let me flip the bits and add one and I'm going to do it on this chart so hopefully what I'll get
is a system that is going to be consistent.
That's going to be you know pretty important.
So let me take one flip the bits and add one.
So let me take one that's 001 and I'm going to flip the bits so instead of having 0 0 1 I flip the bits
so they all flip 0 becomes Welnick cetera and I add one.
So that becomes a negative one.
This is one right there.
This is negative 1.
Perfect they flip the bits in it was consistent in my system this is one that's negative 1.
Let's try to and see what happens.
I do negative too.
I'm going to start with my two counting.
I'm going to flip the bits and then I'm going to add one.
Now what happens when I add 1 to this.
If I add 1 we get a carry.
Which means I'm going to get this and that is my negative 2 1 1 0.
So perfect so this system of two's compliment seems to work in order to get me negative bits.
So let's just confirm that if we were to add three plus minus one we get to 2.
Son going to write three over here.
This is three and I'm going to add to it a minus 1.
This is minus one.
And I should be that if I add these together I should get two.
So let's see if it's consistent.
OK.
Because remember three plus minus one is the same thing as saying three minus one.
All right.
I'll just do Ed..
So that's one plus one is zero carry the one that's 11 and then carry the one in I get that.
Now what we're going to do is we're actually going to chop off.
We're actually going to chop off anything extra because I'm only dealing in three bits so I don't need
that one.
This is the number two when you can check our charts.
In fact that this is the two.
OK.
That is the number two but it's right over there.
And so in fact it's I got a two which again you chop off any extra bits the extra bits are we are only
using three bits or anything extra we're chopping off.
This is the number two.
And in fact that works out to three plus minus one is two.
So we're going to need this because we're going to show that you can do anything with logic and that
means that you can do addition and if you can do addition in binary and you can somehow figure out a
way to do addition with logic then you can do subtraction if you can do subtraction then you are you
know you can really do multiplication because that's just addition.
And then you could do it's additive imitation.
Then you can do division and we'll explain that in the next video.