how to convert ip address decimal value to binary easy way

Dark Mode

4,877 views

11 votes

Best answer

I found a good way. To find the binary equivalent of decimal value X, start from the binary value of a number we know is a factor of X and append 0 if the number is divisible by 2 and append 1 if its not.

For eg: to find out the binary equivalent of 30, first write the binary equivalent of 15 which is 1111, now append 0 to it and it becomes 30→ 11110. Binary value of 31 would be 11111, appended with a 1 in the end.

We can even start from end, i.e., if we want to find the binary equivalent of 168, we will put 0 in the end and divide 168 by 2, and get 84, 0. 84 is also divisible by 2, so we put one more 0 after it→ 42, 00, next would be 21, 000, now for 21 we put a 1 before the three 0s→ 10, 1000. Now we know the binary value of 10, so substituting, we get, 10101000 as the answer.

For eg: to find out the binary equivalent of 30, first write the binary equivalent of 15 which is 1111, now append 0 to it and it becomes 30→ 11110. Binary value of 31 would be 11111, appended with a 1 in the end.

We can even start from end, i.e., if we want to find the binary equivalent of 168, we will put 0 in the end and divide 168 by 2, and get 84, 0. 84 is also divisible by 2, so we put one more 0 after it→ 42, 00, next would be 21, 000, now for 21 we put a 1 before the three 0s→ 10, 1000. Now we know the binary value of 10, so substituting, we get, 10101000 as the answer.

0

4 votes

Porocedure-1:

Network address=IP address && Network Mask (and operation in binary equivalent).

Procedure-2:

Mask:255.255.224.0 So third octet having 3 bits netid and 5 bits host id

So block size is(2^5) i.e. 0,32,64,96,128......so on

By looking to the ip addres125.134.112.66, third octet 112 comes under 96 subnet. Hence Ans.

Network address=IP address && Network Mask (and operation in binary equivalent).

Procedure-2:

Mask:255.255.224.0 So third octet having 3 bits netid and 5 bits host id

So block size is(2^5) i.e. 0,32,64,96,128......so on

By looking to the ip addres125.134.112.66, third octet 112 comes under 96 subnet. Hence Ans.