

Let’ say you need to see the fourth segment of that address, 69c4, in binary: Take the example address used earlier in this article: IPv6 addresses represent 16 bits, or 2 octets, between each colon. You don’t even have to memorize the sixteen binary numbers corresponding to the sixteen hex digits you only have to know that the four place values are 8, 4, 2, and 1. Just break it into two 4-bit numbers, 01:

It’s just as easy to convert in the other direction. So just put those to values together, and you have your conversion: You know that the binary equivalent of c (decimal 12) is 1100. You know without the aid of paper that the binary equivalent of 8 is 1000 Take the hex number 8c (every possible value of a binary octet can be represented with two hex digits): But look how much easier it is to convert between hexadecimal and binary. These conversions are easy and can be quickly worked out on a piece of paper. Knowing the place values, we can see that there are 1’s in the 128, 16, 8, and 2 places. That’s smaller than 8, so we write a 0 in the “8” place it’s larger than 4, so we write a 1 in the “4” place:ĥ-4 = 1, so there is a 0 in the “2” place and a 1 in the “1” place, and we’re done:Ĭonverting from binary to decimal uses a similar sequence of simple arithmetical steps, except we add instead of subtract. That’s smaller than 32, so we write a 0 in that place it’s larger than 16, so we write a 1 in that place:Ģ1-16 = 5.

We start out with all eight place values unknown:Ģ13 is larger than 128, so we write a 1 in the “128” place:Ģ13-128 = 85, which is larger than 64, so we write a 1 in the “64” place:Ĩ5-64 = 21. If we want to find its binary equivalent, we first have to know the place values of a binary octet, which from left to right are: It’s difficult to remember 256 different values, so we resort to a bit of arithmetic to convert between decimal and binary.įor example, take the decimal number 213. Instead we choose to decimally represent the 256 possible values in an octet because computers and routers regularly work with octets (bytes). A decimal digit, on the other hand, has only 10 possible values (0 – 9), so there is no one-to-one correspondence between decimal digits and any group of binary digits.
