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;
- 3 506 643 727 934 778 987 ÷ 2 = 1 753 321 863 967 389 493 + 1;
- 1 753 321 863 967 389 493 ÷ 2 = 876 660 931 983 694 746 + 1;
- 876 660 931 983 694 746 ÷ 2 = 438 330 465 991 847 373 + 0;
- 438 330 465 991 847 373 ÷ 2 = 219 165 232 995 923 686 + 1;
- 219 165 232 995 923 686 ÷ 2 = 109 582 616 497 961 843 + 0;
- 109 582 616 497 961 843 ÷ 2 = 54 791 308 248 980 921 + 1;
- 54 791 308 248 980 921 ÷ 2 = 27 395 654 124 490 460 + 1;
- 27 395 654 124 490 460 ÷ 2 = 13 697 827 062 245 230 + 0;
- 13 697 827 062 245 230 ÷ 2 = 6 848 913 531 122 615 + 0;
- 6 848 913 531 122 615 ÷ 2 = 3 424 456 765 561 307 + 1;
- 3 424 456 765 561 307 ÷ 2 = 1 712 228 382 780 653 + 1;
- 1 712 228 382 780 653 ÷ 2 = 856 114 191 390 326 + 1;
- 856 114 191 390 326 ÷ 2 = 428 057 095 695 163 + 0;
- 428 057 095 695 163 ÷ 2 = 214 028 547 847 581 + 1;
- 214 028 547 847 581 ÷ 2 = 107 014 273 923 790 + 1;
- 107 014 273 923 790 ÷ 2 = 53 507 136 961 895 + 0;
- 53 507 136 961 895 ÷ 2 = 26 753 568 480 947 + 1;
- 26 753 568 480 947 ÷ 2 = 13 376 784 240 473 + 1;
- 13 376 784 240 473 ÷ 2 = 6 688 392 120 236 + 1;
- 6 688 392 120 236 ÷ 2 = 3 344 196 060 118 + 0;
- 3 344 196 060 118 ÷ 2 = 1 672 098 030 059 + 0;
- 1 672 098 030 059 ÷ 2 = 836 049 015 029 + 1;
- 836 049 015 029 ÷ 2 = 418 024 507 514 + 1;
- 418 024 507 514 ÷ 2 = 209 012 253 757 + 0;
- 209 012 253 757 ÷ 2 = 104 506 126 878 + 1;
- 104 506 126 878 ÷ 2 = 52 253 063 439 + 0;
- 52 253 063 439 ÷ 2 = 26 126 531 719 + 1;
- 26 126 531 719 ÷ 2 = 13 063 265 859 + 1;
- 13 063 265 859 ÷ 2 = 6 531 632 929 + 1;
- 6 531 632 929 ÷ 2 = 3 265 816 464 + 1;
- 3 265 816 464 ÷ 2 = 1 632 908 232 + 0;
- 1 632 908 232 ÷ 2 = 816 454 116 + 0;
- 816 454 116 ÷ 2 = 408 227 058 + 0;
- 408 227 058 ÷ 2 = 204 113 529 + 0;
- 204 113 529 ÷ 2 = 102 056 764 + 1;
- 102 056 764 ÷ 2 = 51 028 382 + 0;
- 51 028 382 ÷ 2 = 25 514 191 + 0;
- 25 514 191 ÷ 2 = 12 757 095 + 1;
- 12 757 095 ÷ 2 = 6 378 547 + 1;
- 6 378 547 ÷ 2 = 3 189 273 + 1;
- 3 189 273 ÷ 2 = 1 594 636 + 1;
- 1 594 636 ÷ 2 = 797 318 + 0;
- 797 318 ÷ 2 = 398 659 + 0;
- 398 659 ÷ 2 = 199 329 + 1;
- 199 329 ÷ 2 = 99 664 + 1;
- 99 664 ÷ 2 = 49 832 + 0;
- 49 832 ÷ 2 = 24 916 + 0;
- 24 916 ÷ 2 = 12 458 + 0;
- 12 458 ÷ 2 = 6 229 + 0;
- 6 229 ÷ 2 = 3 114 + 1;
- 3 114 ÷ 2 = 1 557 + 0;
- 1 557 ÷ 2 = 778 + 1;
- 778 ÷ 2 = 389 + 0;
- 389 ÷ 2 = 194 + 1;
- 194 ÷ 2 = 97 + 0;
- 97 ÷ 2 = 48 + 1;
- 48 ÷ 2 = 24 + 0;
- 24 ÷ 2 = 12 + 0;
- 12 ÷ 2 = 6 + 0;
- 6 ÷ 2 = 3 + 0;
- 3 ÷ 2 = 1 + 1;
- 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.
3 506 643 727 934 778 987(10) = 11 0000 1010 1010 0001 1001 1110 0100 0011 1101 0110 0111 0110 1110 0110 1011(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 62.
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, 62,
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.
Number 3 506 643 727 934 778 987(10), a signed integer number (with sign), converted from decimal system (from base 10) and written as a signed binary in two's complement representation:
3 506 643 727 934 778 987(10) = 0011 0000 1010 1010 0001 1001 1110 0100 0011 1101 0110 0111 0110 1110 0110 1011
Spaces were used to group digits: for binary, by 4, for decimal, by 3.