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;
- 84 868 486 263 ÷ 2 = 42 434 243 131 + 1;
- 42 434 243 131 ÷ 2 = 21 217 121 565 + 1;
- 21 217 121 565 ÷ 2 = 10 608 560 782 + 1;
- 10 608 560 782 ÷ 2 = 5 304 280 391 + 0;
- 5 304 280 391 ÷ 2 = 2 652 140 195 + 1;
- 2 652 140 195 ÷ 2 = 1 326 070 097 + 1;
- 1 326 070 097 ÷ 2 = 663 035 048 + 1;
- 663 035 048 ÷ 2 = 331 517 524 + 0;
- 331 517 524 ÷ 2 = 165 758 762 + 0;
- 165 758 762 ÷ 2 = 82 879 381 + 0;
- 82 879 381 ÷ 2 = 41 439 690 + 1;
- 41 439 690 ÷ 2 = 20 719 845 + 0;
- 20 719 845 ÷ 2 = 10 359 922 + 1;
- 10 359 922 ÷ 2 = 5 179 961 + 0;
- 5 179 961 ÷ 2 = 2 589 980 + 1;
- 2 589 980 ÷ 2 = 1 294 990 + 0;
- 1 294 990 ÷ 2 = 647 495 + 0;
- 647 495 ÷ 2 = 323 747 + 1;
- 323 747 ÷ 2 = 161 873 + 1;
- 161 873 ÷ 2 = 80 936 + 1;
- 80 936 ÷ 2 = 40 468 + 0;
- 40 468 ÷ 2 = 20 234 + 0;
- 20 234 ÷ 2 = 10 117 + 0;
- 10 117 ÷ 2 = 5 058 + 1;
- 5 058 ÷ 2 = 2 529 + 0;
- 2 529 ÷ 2 = 1 264 + 1;
- 1 264 ÷ 2 = 632 + 0;
- 632 ÷ 2 = 316 + 0;
- 316 ÷ 2 = 158 + 0;
- 158 ÷ 2 = 79 + 0;
- 79 ÷ 2 = 39 + 1;
- 39 ÷ 2 = 19 + 1;
- 19 ÷ 2 = 9 + 1;
- 9 ÷ 2 = 4 + 1;
- 4 ÷ 2 = 2 + 0;
- 2 ÷ 2 = 1 + 0;
- 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.
84 868 486 263(10) = 1 0011 1100 0010 1000 1110 0101 0100 0111 0111(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 37.
- 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, 37,
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 84 868 486 263(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.