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;
- 1 010 001 000 099 562 ÷ 2 = 505 000 500 049 781 + 0;
- 505 000 500 049 781 ÷ 2 = 252 500 250 024 890 + 1;
- 252 500 250 024 890 ÷ 2 = 126 250 125 012 445 + 0;
- 126 250 125 012 445 ÷ 2 = 63 125 062 506 222 + 1;
- 63 125 062 506 222 ÷ 2 = 31 562 531 253 111 + 0;
- 31 562 531 253 111 ÷ 2 = 15 781 265 626 555 + 1;
- 15 781 265 626 555 ÷ 2 = 7 890 632 813 277 + 1;
- 7 890 632 813 277 ÷ 2 = 3 945 316 406 638 + 1;
- 3 945 316 406 638 ÷ 2 = 1 972 658 203 319 + 0;
- 1 972 658 203 319 ÷ 2 = 986 329 101 659 + 1;
- 986 329 101 659 ÷ 2 = 493 164 550 829 + 1;
- 493 164 550 829 ÷ 2 = 246 582 275 414 + 1;
- 246 582 275 414 ÷ 2 = 123 291 137 707 + 0;
- 123 291 137 707 ÷ 2 = 61 645 568 853 + 1;
- 61 645 568 853 ÷ 2 = 30 822 784 426 + 1;
- 30 822 784 426 ÷ 2 = 15 411 392 213 + 0;
- 15 411 392 213 ÷ 2 = 7 705 696 106 + 1;
- 7 705 696 106 ÷ 2 = 3 852 848 053 + 0;
- 3 852 848 053 ÷ 2 = 1 926 424 026 + 1;
- 1 926 424 026 ÷ 2 = 963 212 013 + 0;
- 963 212 013 ÷ 2 = 481 606 006 + 1;
- 481 606 006 ÷ 2 = 240 803 003 + 0;
- 240 803 003 ÷ 2 = 120 401 501 + 1;
- 120 401 501 ÷ 2 = 60 200 750 + 1;
- 60 200 750 ÷ 2 = 30 100 375 + 0;
- 30 100 375 ÷ 2 = 15 050 187 + 1;
- 15 050 187 ÷ 2 = 7 525 093 + 1;
- 7 525 093 ÷ 2 = 3 762 546 + 1;
- 3 762 546 ÷ 2 = 1 881 273 + 0;
- 1 881 273 ÷ 2 = 940 636 + 1;
- 940 636 ÷ 2 = 470 318 + 0;
- 470 318 ÷ 2 = 235 159 + 0;
- 235 159 ÷ 2 = 117 579 + 1;
- 117 579 ÷ 2 = 58 789 + 1;
- 58 789 ÷ 2 = 29 394 + 1;
- 29 394 ÷ 2 = 14 697 + 0;
- 14 697 ÷ 2 = 7 348 + 1;
- 7 348 ÷ 2 = 3 674 + 0;
- 3 674 ÷ 2 = 1 837 + 0;
- 1 837 ÷ 2 = 918 + 1;
- 918 ÷ 2 = 459 + 0;
- 459 ÷ 2 = 229 + 1;
- 229 ÷ 2 = 114 + 1;
- 114 ÷ 2 = 57 + 0;
- 57 ÷ 2 = 28 + 1;
- 28 ÷ 2 = 14 + 0;
- 14 ÷ 2 = 7 + 0;
- 7 ÷ 2 = 3 + 1;
- 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.
1 010 001 000 099 562(10) = 11 1001 0110 1001 0111 0010 1110 1101 0101 0110 1110 1110 1010(2)
3. 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.
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 1 010 001 000 099 562(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.