Decimal Base to Binary Base conversion Algorithms

Decimal Base to Binary Base Conversion Algorithm-

To convert a decimal number to a binary number, the decimal number is divided by binary number base i.e. 2 successively. The quotient and remainders are noted down at each stage. The quotient of the preceding stage is divided by 2 at the next stage. The process is repeated until the quotient becomes zero. Now to make binary equivalent, put the remainders in reverse order. For Example-


Algorithm-
  1. Begin
  2. Get the decimal number whose binary equivalent you want.
  3. Divide the decimal number by binary base 2
  4. The quotient and remainders are noted down at each stage
  5. The process is repeated until the quotient becomes zero
  6. Now to make binary equivalent, put the remainders in reverse order.
  7. Stop.

Post a Comment

0 Comments