2. 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;
- 2 082 696 911 547 852 516 ÷ 2 = 1 041 348 455 773 926 258 + 0;
- 1 041 348 455 773 926 258 ÷ 2 = 520 674 227 886 963 129 + 0;
- 520 674 227 886 963 129 ÷ 2 = 260 337 113 943 481 564 + 1;
- 260 337 113 943 481 564 ÷ 2 = 130 168 556 971 740 782 + 0;
- 130 168 556 971 740 782 ÷ 2 = 65 084 278 485 870 391 + 0;
- 65 084 278 485 870 391 ÷ 2 = 32 542 139 242 935 195 + 1;
- 32 542 139 242 935 195 ÷ 2 = 16 271 069 621 467 597 + 1;
- 16 271 069 621 467 597 ÷ 2 = 8 135 534 810 733 798 + 1;
- 8 135 534 810 733 798 ÷ 2 = 4 067 767 405 366 899 + 0;
- 4 067 767 405 366 899 ÷ 2 = 2 033 883 702 683 449 + 1;
- 2 033 883 702 683 449 ÷ 2 = 1 016 941 851 341 724 + 1;
- 1 016 941 851 341 724 ÷ 2 = 508 470 925 670 862 + 0;
- 508 470 925 670 862 ÷ 2 = 254 235 462 835 431 + 0;
- 254 235 462 835 431 ÷ 2 = 127 117 731 417 715 + 1;
- 127 117 731 417 715 ÷ 2 = 63 558 865 708 857 + 1;
- 63 558 865 708 857 ÷ 2 = 31 779 432 854 428 + 1;
- 31 779 432 854 428 ÷ 2 = 15 889 716 427 214 + 0;
- 15 889 716 427 214 ÷ 2 = 7 944 858 213 607 + 0;
- 7 944 858 213 607 ÷ 2 = 3 972 429 106 803 + 1;
- 3 972 429 106 803 ÷ 2 = 1 986 214 553 401 + 1;
- 1 986 214 553 401 ÷ 2 = 993 107 276 700 + 1;
- 993 107 276 700 ÷ 2 = 496 553 638 350 + 0;
- 496 553 638 350 ÷ 2 = 248 276 819 175 + 0;
- 248 276 819 175 ÷ 2 = 124 138 409 587 + 1;
- 124 138 409 587 ÷ 2 = 62 069 204 793 + 1;
- 62 069 204 793 ÷ 2 = 31 034 602 396 + 1;
- 31 034 602 396 ÷ 2 = 15 517 301 198 + 0;
- 15 517 301 198 ÷ 2 = 7 758 650 599 + 0;
- 7 758 650 599 ÷ 2 = 3 879 325 299 + 1;
- 3 879 325 299 ÷ 2 = 1 939 662 649 + 1;
- 1 939 662 649 ÷ 2 = 969 831 324 + 1;
- 969 831 324 ÷ 2 = 484 915 662 + 0;
- 484 915 662 ÷ 2 = 242 457 831 + 0;
- 242 457 831 ÷ 2 = 121 228 915 + 1;
- 121 228 915 ÷ 2 = 60 614 457 + 1;
- 60 614 457 ÷ 2 = 30 307 228 + 1;
- 30 307 228 ÷ 2 = 15 153 614 + 0;
- 15 153 614 ÷ 2 = 7 576 807 + 0;
- 7 576 807 ÷ 2 = 3 788 403 + 1;
- 3 788 403 ÷ 2 = 1 894 201 + 1;
- 1 894 201 ÷ 2 = 947 100 + 1;
- 947 100 ÷ 2 = 473 550 + 0;
- 473 550 ÷ 2 = 236 775 + 0;
- 236 775 ÷ 2 = 118 387 + 1;
- 118 387 ÷ 2 = 59 193 + 1;
- 59 193 ÷ 2 = 29 596 + 1;
- 29 596 ÷ 2 = 14 798 + 0;
- 14 798 ÷ 2 = 7 399 + 0;
- 7 399 ÷ 2 = 3 699 + 1;
- 3 699 ÷ 2 = 1 849 + 1;
- 1 849 ÷ 2 = 924 + 1;
- 924 ÷ 2 = 462 + 0;
- 462 ÷ 2 = 231 + 0;
- 231 ÷ 2 = 115 + 1;
- 115 ÷ 2 = 57 + 1;
- 57 ÷ 2 = 28 + 1;
- 28 ÷ 2 = 14 + 0;
- 14 ÷ 2 = 7 + 0;
- 7 ÷ 2 = 3 + 1;
- 3 ÷ 2 = 1 + 1;
- 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.
2 082 696 911 547 852 516(10) = 1 1100 1110 0111 0011 1001 1100 1110 0111 0011 1001 1100 1110 0110 1110 0100(2)
4. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 61.
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) is reserved for 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, 61,
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:
2 082 696 911 547 852 516(10) = 0001 1100 1110 0111 0011 1001 1100 1110 0111 0011 1001 1100 1110 0110 1110 0100
6. Get the negative integer number representation:
To get the negative integer number representation on 64 bits (8 Bytes),
... change the first bit (the leftmost), from 0 to 1...
Number -2 082 696 911 547 852 516(10), a signed integer number (with sign),
converted from decimal system (from base 10)
and written as a signed binary (in base 2):
-2 082 696 911 547 852 516(10) = 1001 1100 1110 0111 0011 1001 1100 1110 0111 0011 1001 1100 1110 0110 1110 0100
Spaces were used to group digits: for binary, by 4, for decimal, by 3.