How the number 16,351,232 is changed in base 256 to 0.249.228.0?
Answers
Explanation:
© 2009 Prof. Chin, ConsciousVibes.com
Last saved: 3/6/2016 12:33 PM
Page
1
of
4
Converting
to
Base
256
from
Decimal
To Convert a Decimal Number to a Base-256 dotted-decimal
Step1
Evaluate the number to be converted:
If the decimal number is less than 256, then use that decimal number for the 4
th
octet, andpad the rest with zeros so that the result is in dotted‐decimal form, with four octets.
If the number is >= 256, then continue to step 2.2 Divide the decimal number by 2563 Multiply the decimal portion of the result from step 2 by 2564 Subtract the result of step 3 from the original decimal number to yield the Base‐256 octet5 Examine the decimal portion of the result from step 2a.
If that decimal portion of the number is less than 256, then use that number for the nextoctet.
Use zeroes for any remaining octets, so that the number is in dotted‐decimal form, with 4octets.b.
If that number is larger than, or equal to 256, then continue from step 2, using that number.
Example 1
Find the last address in an IPv4 subnet with a network address of 16.0.0.0 /17, with 32,768 addresses persubnet.First, convert the number of addresses ‐ 1 to Base 256 (dotted‐decimal). 32,768 ‐ 1 = 32,767Once the conversion is complete, add that Base 256 dotted‐decimal value to the 1
st
address to determine thelast address in the subnet.First address in subnet 0 (the 1
st
subnet): 16 . 0 . 0 . 0Number of addresses (32,768 per subnet) ‐1 : 0 . 0 . 127 . 255Last address in subnet 0: 16 . 0 . 127 . 255 Convert 32,767 to an IPv4 address.1.
Is 32,767 larger than 256? Yes. Then proceed to step 2.2.
32,767 / 256 = 127.9963.
127 x 256 = 32,5124.
32,767 – 32,512 = 255 (this is the 4th octet of the dotted‐decimal)The 3
rd
Octet…1.
Since 127 is smaller than 256 you’re done dividing and the value for the 3
rd
octet is 127Using zeroes for any remaining octets yields a dotted‐decimal value