I remember seeing the Wizard of Oz, and near the end
they pull back the curtain to reveal who
really is acting as the wizard.
And that's what I'd like to do right now with IP version 4.
Even though IP version 4, it's represented as dotted decimal--
here we have four numbers right here,
and they're separated by three periods--
what's really happening is that's just for us
humans as a convenience.
What's really going on behind the scenes
is that each one of these numbers
represents one byte of data--
8 bits which go into one byte of data.
So each of these numbers--
130, 16, 33, and 17--
sometimes these numbers are referred to as an octet.
And an octet is nothing more than 8 bits
that are all represented together in the same grouping.
So whether you want to call this first number the first number,
or the first bite, or the first octet, all of those
mean the same thing.
Now, the great news for you and I is that, in converting,
if we needed to, to convert binary to decimal or decimal
to binary, it's really straightforward,
because in either method we're going to use we're
going to first write out this table.
We have a decimal number that we're
going to convert to binary.
So we're going to do that one first.
And it's really just a game.
And I call it the, does it fit game.
And here's how we play it.
We take a number--
so we're going to first start with 130,
and we're going to write it out.
And all we need to do is take this very first number
on the far left, 128, and ask ourselves
the question, does it fit.
Does 128 fit into 130?
Yes or no?
It's a binary question.
If the answer is yes, we're going
to put a bit on in that position.
And we're also going to subtract that value of 128
from the number we're trying to convert.
So the remainder of this is 2.
130 minus 128 is 2.
So we take that remainder, and we play the game again.
Does 64 go into 2?
No.
Well, it might a fraction of the time, but we're looking for,
does that number go in an entire time at least once?
And if the answer is, no, it doesn't, we put a 0 there.
How about 32?
Does it go into 2?
No, it doesn't.
So that gets a 0.
Does 16 go in?
No, it doesn't.
That gets 0.
8-- does it go into 2?
Nope.
How about 4?
Nope.
And then we get down to 2.
Does 2 go into 2?
And the answer is yes it does.
It goes exactly one time.
So we'll subtract 2 from it, and we are down to 0.
So the question is, does 1 go into 0.
And the answer is, it does not.
And so, we're going to put a 0 there as well.
It's sort of like accounting.
If you love accounting with debits and credits,
trying to get them to equalize, that's all we're doing here,
is we're trying to whittle this number down to 0.
So this number right here 10000010 is 130 in decimal.
So let's do one more together.
And let's go ahead and do 16.
The game is, we want to convert 16 into binary.
We're going to play the, does it fit game.
So we're going to write out on our paper 16--
the number we're after--
and ask ourselves the question, does 128 go in?
The answer is, no--
negative.
Does 64 go into 16?
No-- negative.
Does 32 go into 16?
It does not.
Does 16 going to 16?
[MAKES SIREN NOISE]
The lights go off.
Yes, it does fit.
So we take that number that we just
put in, we subtract that from our number,
we take the remainder, and we play the rest of the game.
You can stop playing until you've given all 8 bits
in that octet or that byte.
So 8 doesn't go in to 0, nor does 4, nor does 2, nor does 1.
This is our binary number that represents 16.
It is 00010000.
So we're going to input-- when we configure routers
and devices with IP addresses, we're
actually going to put in the value of 16
for that second octet.
But what the computer knows, or the router knows,
is that this is the binary value of that second octet.
I'd like you to take this number, 33, and your mission--
which I hope you accept--
is to convert 33 into the 8-bit binary number
that 33 is representing.
What I would encourage you to do is
start by writing out this table, and then simply writing out 33
and playing the game called, does it fit.
So does 128 go in?
Does 64 go in?
Et cetera, et cetera.
Every time it does go in you put a 1,
and you subtract that value from your number
and play the game again, continuing on
with the remainder.
So go ahead pause me right now, work out the binary equivalent
of the decimal 33, and when you come back,
we'll validate what that answer is in binary.
[MUSIC PLAYING]
So the game goes like this--
33 is right here.
We say, does 128 go into 33?
The answer is no.
64 doesn't go in.
32 does.
So we're going to put a 1 there.
We'll say, minus 32, and our remainder is 1.
16 doesn't go.
Nor does 8.
Nor does 4.
Nor does 2.
But 1 goes in cleanly one time.
And our accountant is happy because we've
had a zero balance at the end, which is how it should be.
So the decimal number of 33 is representing our binary number
of 00100001.
If that's the answer that you've got, absolutely, great job.
I hope this has been informative for you.
And I'd like to thank you for viewing.