1. Divide the number repeatedly by 2:
Keep track of each remainder.
Stop when you get a quotient that is equal to zero.
- division = quotient + remainder;
- 1 684 947 410 ÷ 2 = 842 473 705 + 0;
- 842 473 705 ÷ 2 = 421 236 852 + 1;
- 421 236 852 ÷ 2 = 210 618 426 + 0;
- 210 618 426 ÷ 2 = 105 309 213 + 0;
- 105 309 213 ÷ 2 = 52 654 606 + 1;
- 52 654 606 ÷ 2 = 26 327 303 + 0;
- 26 327 303 ÷ 2 = 13 163 651 + 1;
- 13 163 651 ÷ 2 = 6 581 825 + 1;
- 6 581 825 ÷ 2 = 3 290 912 + 1;
- 3 290 912 ÷ 2 = 1 645 456 + 0;
- 1 645 456 ÷ 2 = 822 728 + 0;
- 822 728 ÷ 2 = 411 364 + 0;
- 411 364 ÷ 2 = 205 682 + 0;
- 205 682 ÷ 2 = 102 841 + 0;
- 102 841 ÷ 2 = 51 420 + 1;
- 51 420 ÷ 2 = 25 710 + 0;
- 25 710 ÷ 2 = 12 855 + 0;
- 12 855 ÷ 2 = 6 427 + 1;
- 6 427 ÷ 2 = 3 213 + 1;
- 3 213 ÷ 2 = 1 606 + 1;
- 1 606 ÷ 2 = 803 + 0;
- 803 ÷ 2 = 401 + 1;
- 401 ÷ 2 = 200 + 1;
- 200 ÷ 2 = 100 + 0;
- 100 ÷ 2 = 50 + 0;
- 50 ÷ 2 = 25 + 0;
- 25 ÷ 2 = 12 + 1;
- 12 ÷ 2 = 6 + 0;
- 6 ÷ 2 = 3 + 0;
- 3 ÷ 2 = 1 + 1;
- 1 ÷ 2 = 0 + 1;
2. Construct the base 2 representation of the positive number:
Take all the remainders starting from the bottom of the list constructed above.
1 684 947 410(10) = 110 0100 0110 1110 0100 0001 1101 0010(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 31.
- A signed binary's bit length must be equal to a power of 2, as of:
- 21 = 2; 22 = 4; 23 = 8; 24 = 16; 25 = 32; 26 = 64; ...
- The first bit (the leftmost) indicates the sign:
- 0 = positive integer number, 1 = negative integer number
The least number that is:
1) a power of 2
2) and is larger than the actual length, 31,
3) so that the first bit (leftmost) could be zero
(we deal with a positive number at this moment)
=== is: 32.
4. Get the positive binary computer representation on 32 bits (4 Bytes):
If needed, add extra 0s in front (to the left) of the base 2 number, up to the required length, 32.
Decimal Number 1 684 947 410(10) converted to signed binary in one's complement representation: