Example 2-2 Convert the decimal number 13 to binary
(1) Divide the decimal number by 2 and note a remainder
13/2 = 6 + remainder 1 (LSB)
The remainder is the least significant bit of the binary equivalent of 13.
(2) Divide the quotient from the previous division and note the remainder. The
remainder is the second LSB.
6/2 = 3 + remainder 0
(3) Continue this process until the quotient is 0. The last remainder is the most
significant bit of the binary number.
3/2 = 1 + remainder 1
1/2 = 0 + remainder 1 (MSB)
(4) To write the binary equivalent of the decimal number, read the remainders
from the bottom up.
1310 = 11012