What if we needed to convert a binary number that we're
given in binary to decimal.
But let's say we were given a binary number of 10100111.
How do we convert that to decimal,
the decimal equivalent?
Well, the answer is, we're going to take everywhere there
is a one, we're going to take that value from the placeholder
it's in and simply add them up.
So we're going to add up 128 plus 32 more
plus 4 plus 2 plus 1.
So we can do that longhand, 128 plus 32 plus 4 plus 2 plus 1.
8 plus 2 is 10, plus 4 more is 14, plus 2 more is 16,
plus 1 more is 17.
There's our 1, there's our 7.
Then we have in this column 3 plus 2 plus 1 is 6.
And in the hundreds position, we have a 1.
So that value of this binary number right here is 167.
And I put 167 equals 167, I guess
that's a little bit redundant.
So in converting from binary to decimal,
we simply look for the 1's and then add up
the values of those positions for our equivalent total value.
So now it's time for your exercise in converting binary
to decimal.
And what I'd like you to convert is this, this number right
here into decimal.
So go ahead and pause me.
When you're done, go ahead and resume,
and we'll confirm or answer.
All right, welcome back.
Let's see how we did.
So for this answer, which we'll call option number A here,
we have 64 plus 32 more plus 16 more plus 4 plus 2
and that's it.
So we add all of those up.
There's 4, 5, 6.
6 more is 12, plus 4 is 16, plus 2 more is 18.
We'll carry the 1, there's an 8.
So for the 10th position, we have 6 plus 1 more is 7.
Plus 3 more is 10, plus 1 more is 11, that would be 118.
And if that's what you came up with, congratulations.
You have the ability to convert from binary into decimal.
Now let me give you a couple more
that I'd like you to practice with as well.
Let's take this one right here.
Well, 00000000.
I want you to use that one if you would,
as well as this one, 11111111.
And one more, let's have you go ahead and do 11110000.
And we'll call those A, B, and C. And what I'd like you to do
is write out on paper what the decimal equivalent of A, B,
and C is.
And if you're saying, Keith, I think I've got the A, it's 0,
you'd be absolutely right.
It might take you a little bit longer for B and C.
So go ahead and pause me while you do all three of those.
Write out your answers and then click on resume,
and we'll compare notes.
OK, welcome back.
So let's take this first one, option A first.
And option A is 0 plus 0 plus 0 plus 0 plus 0, OK.
So A equals 0.
Now, this next one, we have some more adding to do.
So we have 128.
And here's what I'd recommend.
Don't just do it in your mind.
If you're new to this, do it as we have in this video,
by writing out, like 128 plus 64 plus 32, which
is what this is all about.
So for answer B, it would be 128 plus 64 more which is 192.
Plus 32 more, which is 224.
Plus 16 more, which is 240.
Plus 8 more, which is 248.
Plus 4 more, which is 252.
Plus two more, which is 254.
Plus 1 more is 255.
So B equals 255.
And you might say, well, Keith, you did that in your mind.
You didn't even write that out.
And that's because this is one of those values
that you're going to see a lot, of 255.
And it's just because of raw practice with these numbers
that they can do that in my head.
Otherwise, I'd be writing it out.
So 128 plus 64 plus 32 plus 16 plus 8 plus 4 plus 2 plus 1
equals 255.
And for answer C, we have 128 plus 64 plus 32 plus 16.
And if we add all that up the long way, the short way,
use a calculator or what have you,
it's going to end up to be 240.
If those are the three values that you got before we compared
notes, my hat's off.
If you didn't get these three numbers,
I would ask you to go back, manually,
like we did right here and here and add them up once again,
just to confirm that you're doing
the conversion from binary into decimal correctly.
Also, the valid range, if you will, for any octet,
any number in IP version 4 is going to be between 0 and 255.
It can't be any lower than 0 because then we're
going into negative numbers.
And it can't be any higher than 255.
Because in an octet, if every single binary number is on,
the maximum it can ever get to is 255.
But I also-- just with a little caution also,
I want to point out that 0 through 255
is actually 256 different numbers.
Because 0, indeed, is a value.
But the numerical high number you're ever going to see
is going to be 255.
I hope this has been informative for you.
And I'd like to thank you for viewing.