1. Start with the positive version of the number:
|-651 271 713 805 810| = 651 271 713 805 810
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;
- 651 271 713 805 810 ÷ 2 = 325 635 856 902 905 + 0;
- 325 635 856 902 905 ÷ 2 = 162 817 928 451 452 + 1;
- 162 817 928 451 452 ÷ 2 = 81 408 964 225 726 + 0;
- 81 408 964 225 726 ÷ 2 = 40 704 482 112 863 + 0;
- 40 704 482 112 863 ÷ 2 = 20 352 241 056 431 + 1;
- 20 352 241 056 431 ÷ 2 = 10 176 120 528 215 + 1;
- 10 176 120 528 215 ÷ 2 = 5 088 060 264 107 + 1;
- 5 088 060 264 107 ÷ 2 = 2 544 030 132 053 + 1;
- 2 544 030 132 053 ÷ 2 = 1 272 015 066 026 + 1;
- 1 272 015 066 026 ÷ 2 = 636 007 533 013 + 0;
- 636 007 533 013 ÷ 2 = 318 003 766 506 + 1;
- 318 003 766 506 ÷ 2 = 159 001 883 253 + 0;
- 159 001 883 253 ÷ 2 = 79 500 941 626 + 1;
- 79 500 941 626 ÷ 2 = 39 750 470 813 + 0;
- 39 750 470 813 ÷ 2 = 19 875 235 406 + 1;
- 19 875 235 406 ÷ 2 = 9 937 617 703 + 0;
- 9 937 617 703 ÷ 2 = 4 968 808 851 + 1;
- 4 968 808 851 ÷ 2 = 2 484 404 425 + 1;
- 2 484 404 425 ÷ 2 = 1 242 202 212 + 1;
- 1 242 202 212 ÷ 2 = 621 101 106 + 0;
- 621 101 106 ÷ 2 = 310 550 553 + 0;
- 310 550 553 ÷ 2 = 155 275 276 + 1;
- 155 275 276 ÷ 2 = 77 637 638 + 0;
- 77 637 638 ÷ 2 = 38 818 819 + 0;
- 38 818 819 ÷ 2 = 19 409 409 + 1;
- 19 409 409 ÷ 2 = 9 704 704 + 1;
- 9 704 704 ÷ 2 = 4 852 352 + 0;
- 4 852 352 ÷ 2 = 2 426 176 + 0;
- 2 426 176 ÷ 2 = 1 213 088 + 0;
- 1 213 088 ÷ 2 = 606 544 + 0;
- 606 544 ÷ 2 = 303 272 + 0;
- 303 272 ÷ 2 = 151 636 + 0;
- 151 636 ÷ 2 = 75 818 + 0;
- 75 818 ÷ 2 = 37 909 + 0;
- 37 909 ÷ 2 = 18 954 + 1;
- 18 954 ÷ 2 = 9 477 + 0;
- 9 477 ÷ 2 = 4 738 + 1;
- 4 738 ÷ 2 = 2 369 + 0;
- 2 369 ÷ 2 = 1 184 + 1;
- 1 184 ÷ 2 = 592 + 0;
- 592 ÷ 2 = 296 + 0;
- 296 ÷ 2 = 148 + 0;
- 148 ÷ 2 = 74 + 0;
- 74 ÷ 2 = 37 + 0;
- 37 ÷ 2 = 18 + 1;
- 18 ÷ 2 = 9 + 0;
- 9 ÷ 2 = 4 + 1;
- 4 ÷ 2 = 2 + 0;
- 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.
651 271 713 805 810(10) = 10 0101 0000 0101 0100 0000 0011 0010 0111 0101 0101 1111 0010(2)
4. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 50.
- 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, 50,
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.