In this post I will try to explain the Basic operations we will use for subnetting.
conversions
Binary to Decimal
The decimal number is equal to the sum of binary digits (dn) times their power of 2 (2n).
For networking we will use the table down below
Reference table
27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
---|---|---|---|---|---|---|---|
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Example:
convert 101101
we set each 1 from right to left
27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | Number |
---|---|---|---|---|---|---|---|---|
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | |
1 | 0 | 1 | 1 | 0 | 1 | BIN | ||
0 | 0 | 32 | 0 | 8 | 4 | 0 | 1 | 45 |
we add the value of each result together to get 45
Decimal to Binary
Reference table
27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
---|---|---|---|---|---|---|---|
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Example:
convert 78
we compare 78 to every value on table.
78 >= 128 = No 78 >= 64 = YES -> 78 - 64 = 14 14 >= 32 = NO 14 >= 16 = NO 14 >= 8 = YES -> 14 - 8 = 6 6 >= 4 = YES -> 6 - 4 = 2 2 >= 2 = YES -> 2 - 2 = 0 0 >= 1 = NO
we replace every yes by 1 on reference table
27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
---|---|---|---|---|---|---|---|
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 |
78 = 01001110