Remainder Method of Decimal to Binary Conversion - Number System

Integer Conversion

Divide the given number of decimal system by the radix R of the proposed system
and get a quotient Q1 and a remainder R1.

Divide the quotient Q1 by the radix R again to get quotient Q2 and a remainder R2.

Divide the quotient Q2 by the radix R again to get quotient Q3 and a remainder R3.

In this process the successive quotients are divided by the radix R of the proposed system repeatedly until the quotients become less than the radix R. Thus, the required number can be obtained by writing the last quotients first and then remainders in the reverse order, i.e.,

Qn Rn Rn-1 Rn-2 ..... R2 R1

Example

Convert decimal 31 to binary. This can be done as follows:
Integer number=31

31 divide by 2 remainder 1 (Quotient 15)
15 divide by 2 remainder 1 (Quotient 7)
7 divide by 2 remainder 1 (Quotient 3)
3 divide by 2 remainder 1 (Quotient 1)
1 divide by 2 remainder 1 (Quotient 0)

Hence by writing these remainders in reverse order we get binary equivalent of 31

(31) 10 = (011111) 2
or (31)10 = (11111)2