So think about it like this when you need to send a signal to a computer and you need to indicate 1
you apply current, when you want indicate 0
you don't apply current.
Here we have a cable.
It's turned off no current is flowing binary value is 0.
I'll turn that on.
So current is now flowing binary value is 1.
We have two states either current or no current two binary values 0 or 1.
So one cable two states either current or no current.
If we extend that now and we've got two cables binary value is currently 0 0 there's no current
on either cable.
If I put current on the one binary value is now 0 1 change that current on the left no current on the
right binary value is now 1 0 turn them both on.
We've got current on two cables binary value is now 1 1.
So we either have no current on both binary value 0 0 or 0 1 or 1 0.
And lastly 1 1.
We have two states either on or off.
We have two cables two to the power of two is four.
At the moment current is applied the bulb is on that indicates 1 I can turn that off
that indicates 0.
So if I want to send you some numbers I could say 1 0 1 0.
And then finally a 1.
Let's put the lamp back on again.
That's how a computer can send information to another computer or that's how programs are written.
We might write a program in a high-level programming language like Python but as it goes down we end
up doing assembly language.
We end up writing 0s and 1s to tell the computer what it needs to do.
Now the important lesson here is we have two states either on or off.
If we have one cable we have two states on off on one cable.
But if we've got two cables we end up having four states we've either got a 0 0 no current or both cables
or 0 1 0 1 0 or 1 1 current on both cables.
So two states two cables means that we end up having four values.
You can write that as 2 x 2 equals 4 or 2 to the power of 2 equals 4.
Two states two cables equals four.
Now don't want to spend too much time on this analogy but let's assume we've got three cables in this
example we have three cables.
We've got two states current state is off.
So the binary value is 0 0 0.
Once again and I won't go through all the combinations we could have 0 0 1 or as an example 1 0 1 or
1 1 1.
So we have two states either on or off.
We have three cables.
So 2 x 2 is 8 or 2 to the power 3 is 8.
There are eight different combinations or options here.
Now I won't bore you extending that too much but we could do something very similar.
You tell me what binary value do we have here.
If we've got four cables answer is 0 1 1 1.
How many combinations do we have?
We have two states four cables.
2 x 2 x 2 x 2 = 16 or 2 to the power of 4 = 16, 16 different combinations.
In this example they are all on.
We have two states four cables 16 combinations.
So we've either got no current on the first cable, no current on the second, none on the third none on
the fourth. Whereas an example no current, no current, no current, current or no current ,no current, current
no current.
And if we go through all the possible combinations we're going to end up having 16 binary values.
So two states are shown over here four cables means 2 to the power of 4.
Sixteen possible combinations.
Again two states four cables gives us 16.
If we've got two states and we've got five cables that would give us 32 or if we have two states and
six cables that gives us 64 combinations. You could manually work this out you could manually go through
every combination.
But we're not going to do that.
But if you wanted to test this and verify that I'm talking the truth then you could do that.
So just to summarize if we've got two states and one cable 2 to the power of 1 is 2.
So two possible combinations. If we've got two states and two cables that gives us four combinations
or four possible states two to the three is eight two to the four is 16.
Now this is one that causes confusion in decimal
we don't start at one we've started zero and then we count zero one two three ignoring negative numbers
obviously but let's assume positive integer numbers we start at zero and then we count up now in binary
we've got 2 to the power of 0. So to two no cables as an analogy equals one.
So we don't start with one cable.
We start with zero cables.
Now this is once again just an analogy.
So if the analogy doesn't work too well for you then just stick with the math.
Just work with a math or maths if you prefer.
So what I need you to remember is 2 to the power of 0 is 1, 2 to the power of 1 is to 2
2 to the power of 2 is for 4, 2 to the power 3 is 8, 2 to the power of 4 is 16.
And if we continue 2 to the power of 5 is 32, 2 to the power of 6 is 64, 2 to the power
of 7 is 128, 2 to the power of 8 is 256 but in an IPv4 address we've got what's called
an octet which is eight binary values.
So we've got eight values but we start counting at zero.
So we've got 0,1, 2, 3, 4, 5, 6, 7. Let's formalize that by showing you a really important
table.
Now if you're ever going to learn a table then this is the table that I suggest that you learn.
It's really important for the CCNA exam.
Make sure that you know this table before you go and take your exam. Notice we have at the top here 2
to the power of 0, 2 to the power of 1, 2 to the power of 2, 2 to the power of 3, 4, 5
6 and 7
Notice we're counting from 0 to 7 but that's 1, 2, 3, 4, 5, 6, 7, 8
If we set this value to 1 in binary in decimal that equates to 1.
If we set this value to 1 in binary it equates to 2.
This value equates to 4.
This equates to 8, this to 16, this to 32, this to 64 ,this to 128.
Remember that 2 to power of 7 is 128.
And there's our seven 2 to the power of 6 equals 64.
Or if you like 2 to the power of 2 equals 4.
So when this bit is set on it means 4 in decimal.
Now in the real world, you're going to use a calculator but you need to understand the basics before
you use calculators.
So we're going to do a lot of this manually first.
And when you take your CCNA exam you can't take a calculator into the exam with you.
So you need to know how to do this in your head.
So we're going to do it manually but again for the real world you'll use a calculator. So in this table
we have what's called the base exponent.
So we've got starting on the right inside side 2 to the power of 0, 2 to the power of 1, 2 to the power of 2
2 to the power of 3 4 5 6 and 7.
And then we've got a binary equivalent.
So if we set this to binary 1 and then the decimal equivalent is 128.
If I set this to binary 1 decimal equivalent is 2.
To help you understand that let's do an example. Let's say I gave you a number of 255, 255
if we take the decimal equivalence is equal to 128.
In other words this bit is set on 64.
In other words this bit is set on 32, 16, 8, 4, 2 and 1.
In other words if I add 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 I get 255
in decimal that is represented as this in binary. So in binary eight binary 1s equates to 255
because this equals binary 1, this equals 128 in decimal.