KnowledgeBoat Logo
|

Computer Science

How will you convert a Decimal number to a Binary number

Number System

25 Likes

Answer

  1. Divide a decimal number by 2 and obtain quotient and remainder. The remainder will be the least significant bit (LSB) of the binary number.
  2. Divide quotient by 2 and again obtain the next quotient and remainder.
  3. Repeat the above step unless quotient becomes 0.
  4. The last remainder will be the most significant bit (MSB) of the binary number.
  5. Arrange all the remainders from MSB to LSB. It will be the binary equivalent of the given decimal number.

Answered By

13 Likes


Related Questions