Method of IP Address conversion

Source: Internet
Author: User

According to the TCP/IP protocol, IP addresses are made up of 32-bit binary numbers and are unique across the Internet.

I am also today again learned again, mainly say when giving you an IP address such as: 192.168.1.1, you can convert to binary, or give you 11000000 10101000 00000001 00000001, you can convert to 10. Well, let's go over it again. Here three methods are introduced by difficulty to easy.

One is division.

When you give this IP address 192.168.1.1, divide it into four segments, except 2, first 192÷2=96 again with 96÷2=48 48÷2=24 24÷2=12 12÷2=6 6÷2=3 3 divided by 2 in 1, and finally equals 1100000000, as long as you can do in addition to 0, The inability to do so (including the last except 1 o'clock) is 1. That 192 is 11000000,168 is 10101000,1 is 00000001.

The second is subtraction

First of all, the number of 128 64 32 16 8 4 2 1, and then when you give a number to reduce the number of the above requirements is to be reduced to the positive is not negative, subtract the number of 1, did not do subtraction of 0. 192-128=64 and 64 minus 64 is just equal to 0, that is 11000000, again, such as 50,50 only minus 32 equals 18, 18 minus 16 equals 2, 2 minus 2 equals 0, that's 00110010, and this method is more obvious than division.

If the above two are still not learned, then I will come up with the last killer, whether you have not learned before, even if you have not learned as long as you know the number you want to get--that is, using Windows with its own calculator, click on the top view-programmers. All right, now. Enter a number in point binary it will be converted automatically, decimal also the same.

Note : More wonderful tutorials Please pay attention to the triple computer tutorial section, triple Computer office group: 189034526 welcome you to join

Related Keywords:
Related Article E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth \$300-1200 USD