1. Divide the number repeatedly by 2:
Keep track of each remainder.
We stop when we get a quotient that is equal to zero.
- division = quotient + remainder;
- 3 532 608 468 ÷ 2 = 1 766 304 234 + 0;
- 1 766 304 234 ÷ 2 = 883 152 117 + 0;
- 883 152 117 ÷ 2 = 441 576 058 + 1;
- 441 576 058 ÷ 2 = 220 788 029 + 0;
- 220 788 029 ÷ 2 = 110 394 014 + 1;
- 110 394 014 ÷ 2 = 55 197 007 + 0;
- 55 197 007 ÷ 2 = 27 598 503 + 1;
- 27 598 503 ÷ 2 = 13 799 251 + 1;
- 13 799 251 ÷ 2 = 6 899 625 + 1;
- 6 899 625 ÷ 2 = 3 449 812 + 1;
- 3 449 812 ÷ 2 = 1 724 906 + 0;
- 1 724 906 ÷ 2 = 862 453 + 0;
- 862 453 ÷ 2 = 431 226 + 1;
- 431 226 ÷ 2 = 215 613 + 0;
- 215 613 ÷ 2 = 107 806 + 1;
- 107 806 ÷ 2 = 53 903 + 0;
- 53 903 ÷ 2 = 26 951 + 1;
- 26 951 ÷ 2 = 13 475 + 1;
- 13 475 ÷ 2 = 6 737 + 1;
- 6 737 ÷ 2 = 3 368 + 1;
- 3 368 ÷ 2 = 1 684 + 0;
- 1 684 ÷ 2 = 842 + 0;
- 842 ÷ 2 = 421 + 0;
- 421 ÷ 2 = 210 + 1;
- 210 ÷ 2 = 105 + 0;
- 105 ÷ 2 = 52 + 1;
- 52 ÷ 2 = 26 + 0;
- 26 ÷ 2 = 13 + 0;
- 13 ÷ 2 = 6 + 1;
- 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.
3 532 608 468(10) = 1101 0010 1000 1111 0101 0011 1101 0100(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 32.
- 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, 32,
3) so that the first bit (leftmost) could be zero
(we deal with a positive number at this moment)
=== is: 64.
4. Get the positive binary computer representation on 64 bits (8 Bytes):
If needed, add extra 0s in front (to the left) of the base 2 number, up to the required length, 64.
Decimal Number 3 532 608 468(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.