Use whichever method is most logical to yourself
Once again, many people have many different methods to speed up calculations
Don't try and learn them all, just learn the ways that makes the most sense to you
and that are easy to learn
Now let's extend our discussion to IPv4 Addresses
An IPv4 Address is used to uniquely identify a device in an IP Network
IPv4 Addresses are 4 octets in lenght, in other words they are 4 grouping of 8 bits
or 4x8, each octet is 8 bits in lenght in the range 0 to 255
Juts imagine that a bit is a logical cable that can have current or not have current
In other videos I'm gonna explain IP Addressing in a lot more detail as well as Subnetting
but for now just understand that an IPv4 Address is 4 octets
in other words 4x8 bits
IPv4 Addresses can be represented in both binary and decimal format
So here's an example 10.1.23.19 is the decimal representation of an IP Address
in this case IPv4 that can be represented as follows in binary
so 10 equates to 0000 followed by 1010
0000000 followed by a 1 in binary is the equivalent of decimal 1
00010111 is the binary equivalent of 23
and 00010011 is the equivalent of 19
This is kind of like saying tomato versus tomatoe or router versus router
use whichever term you prefer, for networking however it's important that
you know both decimal and binary
So let's start with 10, 8+2= 10, in other words this bit is on and this bit is on
the other bits are set off, 8+2= 10 and thus 00001010 is the equivalent of 10 in decimal
8+2= 10 other bits are set off, only these 2 bits are on
What about 129? 128+1= 129, this bit and this bit are set on
and other bits are set off, thus 10000001 is equivalent to 129 in decimal
using our language analogy, this is French and this is English
different language but we are saying the same thing
What about 16? So 16 = 16, this is an easy one
this bit is the equivalent of 16, so that bit is set on and the other bits are set off
so 00010000 in binary is equivalent to 16 in decimal
and lastly 123, 64+32+16+8+2+1= 123, in other words the first bit is off
second bit is on which =64, third bit is on which is 32, 4th bit is 16
5th bit is 8, 7th bit is on which is 2 and last bit is 1
so 64, 32, 16, 8, 2, 1 gives us a 123
In other words 01111011 is the equivalent of a 123 in decimal
So just to reiterate, remember 2 to the power of 0 equals 1 in decimal
2 to the power of 1 equals 2 in decimal, 2 to the power of 3 equals 8 in decimal
2 to the power of 4 is 16, 2 to the power of 5 is 32, 2 to the power of 6 is 64
So 64+32+16+8+2+1= 123, so the most significant bit is set off
the 2nd, 3rd, 4th, 5th bit is set on, the 6th bit is set off
and the 7th and 8th bit is set on, that gives us this value in binary
which is the equivalent of 123 in decimal
I'm hoping that this shows you how to convert a decimal IP Address into binary