Recent Posts

Sunday, 13 August 2017

Subnetting Example 2

Conversion of decimal into binary

Example 2:

Convert decimal number 150 into binary value and can you identify which class it comes ?

Note: You should always move from left to right.


Solution:

It is a class B decimal value 150 

Base position       2^7   2^6   2^5   2^4   2^3   2^2   2^1   2^0

Decimal value      128     64     32     16      8       4       2        1

Binary value         1       0      0       1      0       1      1        0

128 + 16 + 4 + 2 = 150

We can also check through adding only "1"s bit in the table which is shown above.

Rough note:

We can do this adding method given below;

Decimal calculations                                                               Bit in binary
128 is less than 150                                                                     on the bit
128 + 64 =  192 is greater than 150                                             off the bit
128 + 0 + 32 = 160 is greater than 150                                        off the bit
128 + 0 + 0 + 16 = 144 is less than 150                                       on the bit
128 + 0 + 0 + 16 + 8 = 152 is greater than 150                            off the bit
128 + 0 + 0 + 16 + 0  + 4 = 148 is less than 150                          on the bit
128 + 0 + 0 + 16 + 0 + 4 + 2 = 150 is equivalent 150                   on the bit
128 + 0 + 0 + 16 + 0 + 4 + 2 + 1 = 151 is greater than 150          off the bit

This is another way of doing this calculation in which we can also do like this subtracting method which is given below;

Decimal calculations                               Bit in binary
150 - 128 = 22 is less than 150               on the bit
22 - 64 cannot be subtracted                   off the bit
22 - 32 cannot be subtracted                   off the bit
22 - 16 = 6 is less than 150                      on the bit
6 - 8 cannot be subtracted                        off the bit
6 - 4 = 2 is less than 150                           on the bit
2 - 2 = 0 is less than 150                           on the bit
0 - 1 cannot be subtracted                         off the bit

Therefore, this is the binary value 10110110.



No comments:

Post a Comment

Popular Posts