Now continuing with the analogy, imagine that you two cables
two cables can either have no current applied
so no current equates to 00 or for example you could have no current
on the first cable but have current on the second cable and that equates to 01
once again no current equals 0, current equals 1
And continuing with that example, you could have current on the first cable
and no current on the second cable, that gives us the value of 10
or we could have a current on both cables, so current on cable 1
and current on cable 2, gives us a value of 11, so in this case, we have
2 cables but there are 4 combinations or 4 options, 00 no current on both
01 no current on first, but current on second or 10 current no current
or 11 which means current on both
The reason for this is that we have 2 cables and 2 possible states
either on or off, so 2 cables with 2 possible states gives us the value of 4
or 2 to the power of 2 equals 4, or if you prefer 2 x 2 = 4
So just ot summarize, in this example, we have 2 cables and 2 states per cable
2 cables times 2 states equals 4 combinations
thus 2 x 2 = 4 or 2 to the power of 2 equals 4
So extending that analogy to 8 cables, the reason why we're using 8 is that
an IPv4 Address consists of 4 octets or 4 8 bit values
In this case, we might have no current on the first 7 cables
and current on the last cable that gives us 7 binary 0s and a single binary 1
we could once again go through all the various combinations as per the previous
examples where we put current on the last cable as in this example
or current on the second last cable and then go through all the combinations
until we reach the situation where we had current on all the cables
if you went through all the combinations, you would end up having
256 combinations or 256 binary values, 2 states across 8 cables gives you 256
Now for the sake of time we're not going to do that here but if you do
decide to work it out, you would see that you have 256 binary combinations
Now let's do a quick comparison between decimal and binary systems
Decimal is based on a 10 based system where it has values from 0 to 9
this is the numbering system used in everyday Math or Maths or Mathematics
whichever term you prefer. Binary, however, is 2 based system
which is the foundation of computer operations
once again we have 2 values either 0 or 1, this is once again what we're
going to concentrate on throughout the rest of this video
So all examples are going to be using a combination of 0s and 1s
Here's some basic Math examples for those of you who may have forgotten
2 to the power of 0 equals 1, 2 to the power of 1 which in other words
2 multiplied together 1 time in another words 2 x 1 = 2
Now extending that, 2 to the power of 2 which is 2 x 2 = 4
2 to the power of 3, which is 2 multiplied together 3 times
in other words 2 x 2 x 2 = 8, 2 to the power of 4 which is once again
2 multiplied together 4 times equals 16
Continuing 2 to the power of 5 equals 32
2 to the power of 6 is equals to 64
2 to the power of 7 equals 128
2 to the power of 8 equals 256
So that's some basic Math, essentially 2 to the power of a value is the
value multiplied by itself, in this case, 2 to the power of 8 is
2 multiplied by itself 8 times which gives you 256
Now this is kind of basic Math is really important
when working with Binary, IP Addressing and Subnetting
Now if you were ever going to learn a table to help you Binary and Subnetting
then this would be it. In the real world, we typically use calculators
but it's well worth knowing how to do this manually
to help you with your understanding. So if you ever need to work out
Subnetting or Binary manually, I suggest that you write down this table
because it will make your life a lot easier when working out binary to
decimal and decimal to binary. What you have in this table is firstly your
base exponent, so 2 to the power of 7, 2 to the power of 6, 2 to the power of 5
all the way down to 2 to the power of 0
put binary 1s below that and then the decimal equivalent
So 2 to the power of 7 equals 128, 2 to the power of 6 equals 64
2 to the power of 5 is 32, 2 to the power of 4 is 16, 2 to the power of 3 is 8
2 to the power of 2 is 4, 2 to the power of 1 is 2
and lastly 2 to the power of 0 is 1
Now these values are really important in IPv4,
so it's well-worth remembering this table