Before attempting subnetting, one must understand how to work with binary and decimal number conversions. Let's review this first.
20=1
21=2
22=4
23=8
24=16
25=32
26=64
27=128
The following pattern for solving binary numbers to decimal numbers and decimal numbers to binary numbers should be used. Always remember to read from right to left instead of left to right. Also notice that each place doubles in value from right to left.
27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
The above should be memorized. Later this will be important to remember when figuring out the number of subnets and hosts per subnets. Therefore, this skill must be practiced and reinforced as often as possible. Here are a few sample problems.
Example 1 (binary to decimal)
11001011 = 203 or
27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 |
Example 2 (binary to decimal)
01011110 = 94 or
27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
0 | 1 | 0 | 1 | 1 | 1 | 1 | 0 |
By writing out the chart and placing the 1's and 0's under the proper place in the chart, all that is left is to add up the place values that have 1's under them and the total will be the decimal number value.
To convert decimal numbers to binary numbers, place 1's in the place values until all the place values with 1's add up to the total. If any numbered place adds a value that is larger than the decimal number, 0's should be placed in those place values.