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;
- 5 237 811 932 528 241 ÷ 2 = 2 618 905 966 264 120 + 1;
- 2 618 905 966 264 120 ÷ 2 = 1 309 452 983 132 060 + 0;
- 1 309 452 983 132 060 ÷ 2 = 654 726 491 566 030 + 0;
- 654 726 491 566 030 ÷ 2 = 327 363 245 783 015 + 0;
- 327 363 245 783 015 ÷ 2 = 163 681 622 891 507 + 1;
- 163 681 622 891 507 ÷ 2 = 81 840 811 445 753 + 1;
- 81 840 811 445 753 ÷ 2 = 40 920 405 722 876 + 1;
- 40 920 405 722 876 ÷ 2 = 20 460 202 861 438 + 0;
- 20 460 202 861 438 ÷ 2 = 10 230 101 430 719 + 0;
- 10 230 101 430 719 ÷ 2 = 5 115 050 715 359 + 1;
- 5 115 050 715 359 ÷ 2 = 2 557 525 357 679 + 1;
- 2 557 525 357 679 ÷ 2 = 1 278 762 678 839 + 1;
- 1 278 762 678 839 ÷ 2 = 639 381 339 419 + 1;
- 639 381 339 419 ÷ 2 = 319 690 669 709 + 1;
- 319 690 669 709 ÷ 2 = 159 845 334 854 + 1;
- 159 845 334 854 ÷ 2 = 79 922 667 427 + 0;
- 79 922 667 427 ÷ 2 = 39 961 333 713 + 1;
- 39 961 333 713 ÷ 2 = 19 980 666 856 + 1;
- 19 980 666 856 ÷ 2 = 9 990 333 428 + 0;
- 9 990 333 428 ÷ 2 = 4 995 166 714 + 0;
- 4 995 166 714 ÷ 2 = 2 497 583 357 + 0;
- 2 497 583 357 ÷ 2 = 1 248 791 678 + 1;
- 1 248 791 678 ÷ 2 = 624 395 839 + 0;
- 624 395 839 ÷ 2 = 312 197 919 + 1;
- 312 197 919 ÷ 2 = 156 098 959 + 1;
- 156 098 959 ÷ 2 = 78 049 479 + 1;
- 78 049 479 ÷ 2 = 39 024 739 + 1;
- 39 024 739 ÷ 2 = 19 512 369 + 1;
- 19 512 369 ÷ 2 = 9 756 184 + 1;
- 9 756 184 ÷ 2 = 4 878 092 + 0;
- 4 878 092 ÷ 2 = 2 439 046 + 0;
- 2 439 046 ÷ 2 = 1 219 523 + 0;
- 1 219 523 ÷ 2 = 609 761 + 1;
- 609 761 ÷ 2 = 304 880 + 1;
- 304 880 ÷ 2 = 152 440 + 0;
- 152 440 ÷ 2 = 76 220 + 0;
- 76 220 ÷ 2 = 38 110 + 0;
- 38 110 ÷ 2 = 19 055 + 0;
- 19 055 ÷ 2 = 9 527 + 1;
- 9 527 ÷ 2 = 4 763 + 1;
- 4 763 ÷ 2 = 2 381 + 1;
- 2 381 ÷ 2 = 1 190 + 1;
- 1 190 ÷ 2 = 595 + 0;
- 595 ÷ 2 = 297 + 1;
- 297 ÷ 2 = 148 + 1;
- 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;
2. Construct the base 2 representation of the positive number:
Take all the remainders starting from the bottom of the list constructed above.
5 237 811 932 528 241(10) = 1 0010 1001 1011 1100 0011 0001 1111 1010 0011 0111 1110 0111 0001(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 53.
- 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, 53,
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.
Decimal Number 5 237 811 932 528 241(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.