1. Start with the positive version of the number:
|-47 061 713 804 088| = 47 061 713 804 088
2. 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;
- 47 061 713 804 088 ÷ 2 = 23 530 856 902 044 + 0;
- 23 530 856 902 044 ÷ 2 = 11 765 428 451 022 + 0;
- 11 765 428 451 022 ÷ 2 = 5 882 714 225 511 + 0;
- 5 882 714 225 511 ÷ 2 = 2 941 357 112 755 + 1;
- 2 941 357 112 755 ÷ 2 = 1 470 678 556 377 + 1;
- 1 470 678 556 377 ÷ 2 = 735 339 278 188 + 1;
- 735 339 278 188 ÷ 2 = 367 669 639 094 + 0;
- 367 669 639 094 ÷ 2 = 183 834 819 547 + 0;
- 183 834 819 547 ÷ 2 = 91 917 409 773 + 1;
- 91 917 409 773 ÷ 2 = 45 958 704 886 + 1;
- 45 958 704 886 ÷ 2 = 22 979 352 443 + 0;
- 22 979 352 443 ÷ 2 = 11 489 676 221 + 1;
- 11 489 676 221 ÷ 2 = 5 744 838 110 + 1;
- 5 744 838 110 ÷ 2 = 2 872 419 055 + 0;
- 2 872 419 055 ÷ 2 = 1 436 209 527 + 1;
- 1 436 209 527 ÷ 2 = 718 104 763 + 1;
- 718 104 763 ÷ 2 = 359 052 381 + 1;
- 359 052 381 ÷ 2 = 179 526 190 + 1;
- 179 526 190 ÷ 2 = 89 763 095 + 0;
- 89 763 095 ÷ 2 = 44 881 547 + 1;
- 44 881 547 ÷ 2 = 22 440 773 + 1;
- 22 440 773 ÷ 2 = 11 220 386 + 1;
- 11 220 386 ÷ 2 = 5 610 193 + 0;
- 5 610 193 ÷ 2 = 2 805 096 + 1;
- 2 805 096 ÷ 2 = 1 402 548 + 0;
- 1 402 548 ÷ 2 = 701 274 + 0;
- 701 274 ÷ 2 = 350 637 + 0;
- 350 637 ÷ 2 = 175 318 + 1;
- 175 318 ÷ 2 = 87 659 + 0;
- 87 659 ÷ 2 = 43 829 + 1;
- 43 829 ÷ 2 = 21 914 + 1;
- 21 914 ÷ 2 = 10 957 + 0;
- 10 957 ÷ 2 = 5 478 + 1;
- 5 478 ÷ 2 = 2 739 + 0;
- 2 739 ÷ 2 = 1 369 + 1;
- 1 369 ÷ 2 = 684 + 1;
- 684 ÷ 2 = 342 + 0;
- 342 ÷ 2 = 171 + 0;
- 171 ÷ 2 = 85 + 1;
- 85 ÷ 2 = 42 + 1;
- 42 ÷ 2 = 21 + 0;
- 21 ÷ 2 = 10 + 1;
- 10 ÷ 2 = 5 + 0;
- 5 ÷ 2 = 2 + 1;
- 2 ÷ 2 = 1 + 0;
- 1 ÷ 2 = 0 + 1;
3. Construct the base 2 representation of the positive number:
Take all the remainders starting from the bottom of the list constructed above.
47 061 713 804 088(10) = 10 1010 1100 1101 0110 1000 1011 1011 1101 1011 0011 1000(2)
4. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 46.
- 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, 46,
3) so that the first bit (leftmost) could be zero
(we deal with a positive number at this moment)
=== is: 64.
5. 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.