Change the following IP addresses from dotted-decimal notation to binary notation: a. 114.34.2.8 b. 129.14.6.8 c. 208.34.54.12 d. 238.34.2.1
Answers
IP addresses from dotted-decimal notation to binary notation.
a) 114.34.2.8
2 | 114
2 | 57 ( remainder = 0 )
2 | 28 ( remainder = 1 )
2 | 14 ( remainder = 0 )
2 | 7 ( remainder = 0 )
2 | 3 ( remainder = 1 )
2 | 1 ( remainder = 1 )
0 ( remainder = 1 )
114 (in decimal) = 01110010 (in binary)
2 | 34
2 | 17 ( remainder = 0 )
2 | 8 ( remainder = 1 )
2 | 4 ( remainder = 0 )
2 | 2 ( remainder = 0 )
2 | 1 ( remainder = 0 )
0 ( remainder = 1 )
34 (in decimal) = 00100010 (in binary)
2 | 2
2 | 1 ( remainder = 0 )
0 ( remainder = 1 )
2 (in decimal) = 00000010 (in binary)
2 | 8
2 | 4 ( remainder = 0 )
2 | 2 ( remainder = 0 )
2 | 1 ( remainder = 0 )
0 ( remainder = 1 )
8 (in decimal) = 00001000 (in binary)
So, in binary conversion, the IP address 114.34.2.8 becomes
01110010.00100010.00000010.00001000
b) 129.14.6.8
2 | 129
2 | 64 ( remainder = 1 )
2 | 32 ( remainder = 0 )
2 | 16 ( remainder = 0 )
2 | 8 ( remainder = 0 )
2 | 4 ( remainder = 0 )
2 | 2 ( remainder = 0 )
2 | 1 ( remainder = 0 )
0 ( remainder = 1 )
129 (in decimal) = 10000001 (in binary)
2 | 14
2 | 7 ( remainder = 0 )
2 | 3 ( remainder = 1 )
2 | 1 ( remainder = 1 )
0 ( remainder = 1 )
14 (in decimal) = 00001110 (in binary)
2 | 6
2 | 3 ( remainder = 0 )
2 | 1 ( remainder = 1 )
0 ( remainder = 1 )
6 (in decimal) = 00000110 (in binary)
2 | 8
2 | 4 ( remainder = 0 )
2 | 2 ( remainder = 0 )
2 | 1 ( remainder = 0 )
0 ( remainder = 1 )
8 (in decimal) = 00001000 (in binary)
So, in binary conversion, the IP address 129.14.6.8 becomes
10000001.00001110.00000110.00001000
c) 208.34.54.12
2 | 208
2 | 104 ( remainder = 0 )
2 | 52 ( remainder = 0 )
2 | 26 ( remainder = 0 )
2 | 13 ( remainder = 0 )
2 | 6 ( remainder = 1 )
2 | 3 ( remainder = 0 )
2 | 1 ( remainder = 1 )
0 ( remainder = 1 )
208 (in decimal) = 11010000 (in binary)
2 | 34
2 | 17 ( remainder = 0 )
2 | 8 ( remainder = 1 )
2 | 4 ( remainder = 0 )
2 | 2 ( remainder = 0 )
2 | 1 ( remainder = 0 )
0 ( remainder = 1 )
34 (in decimal) = 00100010 (in binary)
2 | 54
2 | 27 ( remainder = 0 )
2 | 13 ( remainder = 1 )
2 | 6 ( remainder = 1 )
2 | 3 ( remainder = 0 )
2 | 1 ( remainder = 1 )
0 ( remainder = 1 )
54 (in decimal) = 00110110 (in binary)
2 | 12
2 | 6 ( remainder = 0 )
2 | 3 ( remainder = 0 )
2 | 1 ( remainder = 1 )
0 ( remainder = 1 )
12 (in decimal) = 00001100 (in binary)
So, in binary conversion, the IP address 208.34.54.12 becomes
11010000.00100010.00110110.00001100
d) 238.34.2.1
2 | 238
2 | 119 ( remainder = 0 )
2 | 59 ( remainder = 1 )
2 | 29 ( remainder = 1 )
2 | 14 ( remainder = 1 )
2 | 7 ( remainder = 0 )
2 | 3 ( remainder = 1 )
2 | 1 ( remainder = 1 )
0 ( remainder = 1 )
238 (in decimal) = 11101110 (in binary)
2 | 34
2 | 17 ( remainder = 0 )
2 | 8 ( remainder = 1 )
2 | 4 ( remainder = 0 )
2 | 2 ( remainder = 0 )
2 | 1 ( remainder = 0 )
0 ( remainder = 1 )
34 (in decimal) = 00100010 (in binary)
2 | 2
2 | 1 ( remainder = 0 )
0 ( remainder = 1 )
2 (in decimal) = 00000010 (in binary)
2 | 1
0 ( remainder = 1 )
1 (in decimal) = 00000001 (in binary)
So, in binary conversion, the IP address 238.34.2.1 becomes
11101110.00100010.00000010.00000001