1. Start with the positive version of the number:
|-183 761 713 803 299| = 183 761 713 803 299
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;
- 183 761 713 803 299 ÷ 2 = 91 880 856 901 649 + 1;
- 91 880 856 901 649 ÷ 2 = 45 940 428 450 824 + 1;
- 45 940 428 450 824 ÷ 2 = 22 970 214 225 412 + 0;
- 22 970 214 225 412 ÷ 2 = 11 485 107 112 706 + 0;
- 11 485 107 112 706 ÷ 2 = 5 742 553 556 353 + 0;
- 5 742 553 556 353 ÷ 2 = 2 871 276 778 176 + 1;
- 2 871 276 778 176 ÷ 2 = 1 435 638 389 088 + 0;
- 1 435 638 389 088 ÷ 2 = 717 819 194 544 + 0;
- 717 819 194 544 ÷ 2 = 358 909 597 272 + 0;
- 358 909 597 272 ÷ 2 = 179 454 798 636 + 0;
- 179 454 798 636 ÷ 2 = 89 727 399 318 + 0;
- 89 727 399 318 ÷ 2 = 44 863 699 659 + 0;
- 44 863 699 659 ÷ 2 = 22 431 849 829 + 1;
- 22 431 849 829 ÷ 2 = 11 215 924 914 + 1;
- 11 215 924 914 ÷ 2 = 5 607 962 457 + 0;
- 5 607 962 457 ÷ 2 = 2 803 981 228 + 1;
- 2 803 981 228 ÷ 2 = 1 401 990 614 + 0;
- 1 401 990 614 ÷ 2 = 700 995 307 + 0;
- 700 995 307 ÷ 2 = 350 497 653 + 1;
- 350 497 653 ÷ 2 = 175 248 826 + 1;
- 175 248 826 ÷ 2 = 87 624 413 + 0;
- 87 624 413 ÷ 2 = 43 812 206 + 1;
- 43 812 206 ÷ 2 = 21 906 103 + 0;
- 21 906 103 ÷ 2 = 10 953 051 + 1;
- 10 953 051 ÷ 2 = 5 476 525 + 1;
- 5 476 525 ÷ 2 = 2 738 262 + 1;
- 2 738 262 ÷ 2 = 1 369 131 + 0;
- 1 369 131 ÷ 2 = 684 565 + 1;
- 684 565 ÷ 2 = 342 282 + 1;
- 342 282 ÷ 2 = 171 141 + 0;
- 171 141 ÷ 2 = 85 570 + 1;
- 85 570 ÷ 2 = 42 785 + 0;
- 42 785 ÷ 2 = 21 392 + 1;
- 21 392 ÷ 2 = 10 696 + 0;
- 10 696 ÷ 2 = 5 348 + 0;
- 5 348 ÷ 2 = 2 674 + 0;
- 2 674 ÷ 2 = 1 337 + 0;
- 1 337 ÷ 2 = 668 + 1;
- 668 ÷ 2 = 334 + 0;
- 334 ÷ 2 = 167 + 0;
- 167 ÷ 2 = 83 + 1;
- 83 ÷ 2 = 41 + 1;
- 41 ÷ 2 = 20 + 1;
- 20 ÷ 2 = 10 + 0;
- 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.
183 761 713 803 299(10) = 1010 0111 0010 0001 0101 1011 1010 1100 1011 0000 0010 0011(2)
4. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 48.
- 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, 48,
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.