Task:
Part A
Being able to convert decimal values to binary (and vice versa) is very important in networking because this is the basis for how subnetting is done. You may have done some of these exercises in high school and probably didn’t know why it was important to be able to convert decimal values into binary, and vice versa. This hands-on activity will help you recall how this is done or will teach how to do it in case you never seen this before.
As you know, an IPv4 address consists of 32 bits that have been separated into 4 bytes (sometimes called octets), for example, 129.79.126.1. This is called the dotted decimal address. Each byte has 8 bits, and each of these bits can assume a value of 0 or 1. The following table shows how we convert each binary position to a decimal value:
Binary position 27 26 25 24 23 22 21 20
It is important to notice what the range of possible decimal values for each byte is. The lower bound is given when each bit is 0 and the upper bound is when each bit is 1. So 00000000 will give us 0 and 11111111 will give us 255. This is the reason why IPv4 addresses cannot go above the value of 255.
Part B
Now let’s practice the conversion of decimal value to binary. This is a bit trickier. Start by finding the highest binary position that is equal to or smaller than the decimal number we are converting. All the other placeholders to the left of this number will be 0. Then subtract the placeholder value from the number. Then find the highest binary position that is equal to or smaller than the remainder. Keep repeating these steps until the remainder is 0. Now, let’s practice.
Convert 60 into a binary number.
The placeholder that is equal to or lower than 60 is 32. Therefore, the first two bits for 60 are 0 and the third one is 1 − 001_ _ _ _ _ . The next step is to subtract 32 from 60, which equals 60−32=2860−32=28
The placeholder that is equal to or lower than 32 is 16, which is the fourth bit from the left. Therefore, our binary number will look like this: 0011_ _ _ _. The next step is to subtract 16 from 28, which equals 28−16=1228−16=12
The placeholder that is equal to or lower than 12 is 8, and this is the fifth bit from the left. Therefore, our binary number will look like this: 00111_ _ _. The next step is to subtract 8 from 12, which equals 12−8=412−8=4
The placeholder that is equal to or lower than 4 is 4, and this is the sixth bit from the left. Therefore, our binary number will look like this: 001111_ _. The next step is to subtract 4 from 4, which equals 4−4=04−4=0.
Given that our remainder is 0, the additional bits are 0, and we find that our answer: 60 in binary is 00111100.
Convert 182 into a binary number.
182 = 10110110
(Because 182−128=54,54−32=22,22−16=6182−128=54,54−32=22,22−16=6, and 6−4=26−4=2)
Deliverable
Calculate the binary value for each of the following binary numbers: 126, 128, 191, 192, 223
Submission Requirements: Please put your answers on a word document and submit. It is best to show your work just in case you get the answer wrong I may be able to provide partial extra credit. This exercise is worth 10 extra credit points.