Saturday 6 October 2018

October 06, 2018 - , No comments

IPv4 Subnetting: Decimal to Binary Conversion - Subtraction Short Method


Subtraction (Short Method)
Procedure: Subtract the given number to the value of maximum number(255).

Rule:
  1. If the result of maximum number (255) subtracted from given number equals to zero (0) set every bit position to one(1).
Given number: 255           
n=255           255-255 = 0

255 = 128 64 32 16 8 4 2 1
11111111 = 1 1 1 1 1 1 1 1

Binary Equivalent:     11111111

  1. If the result is not equal to zero (0) we will considered it as excess value. Evaluate if what particular constant value of bit position will consummate to the excess value and set it to zero(0) and the rest set it to one(1).

Given number: 217
n = 217         255-217 = 38           32 + 4 + 2 = 38       

128     64      32      16      8        4        2        1
                     0                           0        0

Note: 38 was considered here as the excess value, so the constant value of bit position that consummate the excess value will be set to zero(0) and the rest to one(1). You just need to add the constant value of bit position corresponds to one(1).

217 = 128 64 32 16 8 4 2 1
11011001 = 1 1 0 1 1 0 0 1

Binary Equivalent:     11011001

0 comments:

Post a Comment

If possible, leave a positive comment. No hate speech or elicit comments. Thank you.