In computing, binary (or base-2) is a numeric system that only uses two digits 0 and 1.
While the decimal numeral system is the standard system for denoting integer and non-integer numbers.
Formula to convert decimal to binary.
To convert binary to decimals you need to know the Least Significant Bit(LSB) and the Most Significant Bit (MSB). MSB is at the bottom of the column of remainders and the LSB is at the top.
In our case we will use the Repeated Division-by-2 Method, whereby you divide the decimal by 2 until the remainder is 0.
Example:
Convert the decimal number 300 to binary.
Number 300 | |||
Divide by 2 | |||
Result | 150 | Remainder | 0 (LSB) |
Divide by | |||
Result | 75 | Remainder | 0 |
Divide by 2 | |||
Result | 37 | Remainder | 1 |
Divide by 2 | |||
Result | 18 | Remainder | 1 |
Divide by 2 | |||
Result | 9 | Remainder | 0 |
Divide by 2 | |||
Result | 4 | Remainder | 1 |
Divide by 2 | |||
Result | 2 | Remainder | 0 |
Divide by 2 | |||
Result | 1 | Remainder | 0 |
Result | 0 | Remainder | 1(MSB) |
Therefore, to know your binary value, you will need to write the remainders starting with the most bottom one which is the MSB.
= 100101100
The value above is the decimal number 300 in the binary value system.