In: Computer Science
For a netmask of 255.255.128.0, tell
a) how many bits are defined for network number portion
b) how many bits are defined for host number portion.
(Be sure not to include any spaces in your answers. Just indicate the number for each answer.)
a) 17 b) 15 Explanation: ------------- 255.255.128.0 Let's convert all octets to binary separately Converting 255 to binary Divide 255 successively by 2 until the quotient is 0 > 255/2 = 127, remainder is 1 > 127/2 = 63, remainder is 1 > 63/2 = 31, remainder is 1 > 31/2 = 15, remainder is 1 > 15/2 = 7, remainder is 1 > 7/2 = 3, remainder is 1 > 3/2 = 1, remainder is 1 > 1/2 = 0, remainder is 1 Read remainders from the bottom to top as 11111111 So, 255 of decimal is 11111111 in binary 255 in binary is 11111111 Converting 128 to binary Divide 128 successively by 2 until the quotient is 0 > 128/2 = 64, remainder is 0 > 64/2 = 32, remainder is 0 > 32/2 = 16, remainder is 0 > 16/2 = 8, remainder is 0 > 8/2 = 4, remainder is 0 > 4/2 = 2, remainder is 0 > 2/2 = 1, remainder is 0 > 1/2 = 0, remainder is 1 Read remainders from the bottom to top as 10000000 So, 128 of decimal is 10000000 in binary 128 in binary is 10000000 Converting 0 to binary Divide 0 successively by 2 until the quotient is 0 Read remainders from the bottom to top as So, 0 of decimal is 00000000 in binary ==================================================================================== || 255.255.128.0 in binary notation is 11111111.11111111.10000000.00000000 || ==================================================================================== number of ones = 17 number of zeros = 15