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;
- 160 481 517 728 110 ÷ 2 = 80 240 758 864 055 + 0;
- 80 240 758 864 055 ÷ 2 = 40 120 379 432 027 + 1;
- 40 120 379 432 027 ÷ 2 = 20 060 189 716 013 + 1;
- 20 060 189 716 013 ÷ 2 = 10 030 094 858 006 + 1;
- 10 030 094 858 006 ÷ 2 = 5 015 047 429 003 + 0;
- 5 015 047 429 003 ÷ 2 = 2 507 523 714 501 + 1;
- 2 507 523 714 501 ÷ 2 = 1 253 761 857 250 + 1;
- 1 253 761 857 250 ÷ 2 = 626 880 928 625 + 0;
- 626 880 928 625 ÷ 2 = 313 440 464 312 + 1;
- 313 440 464 312 ÷ 2 = 156 720 232 156 + 0;
- 156 720 232 156 ÷ 2 = 78 360 116 078 + 0;
- 78 360 116 078 ÷ 2 = 39 180 058 039 + 0;
- 39 180 058 039 ÷ 2 = 19 590 029 019 + 1;
- 19 590 029 019 ÷ 2 = 9 795 014 509 + 1;
- 9 795 014 509 ÷ 2 = 4 897 507 254 + 1;
- 4 897 507 254 ÷ 2 = 2 448 753 627 + 0;
- 2 448 753 627 ÷ 2 = 1 224 376 813 + 1;
- 1 224 376 813 ÷ 2 = 612 188 406 + 1;
- 612 188 406 ÷ 2 = 306 094 203 + 0;
- 306 094 203 ÷ 2 = 153 047 101 + 1;
- 153 047 101 ÷ 2 = 76 523 550 + 1;
- 76 523 550 ÷ 2 = 38 261 775 + 0;
- 38 261 775 ÷ 2 = 19 130 887 + 1;
- 19 130 887 ÷ 2 = 9 565 443 + 1;
- 9 565 443 ÷ 2 = 4 782 721 + 1;
- 4 782 721 ÷ 2 = 2 391 360 + 1;
- 2 391 360 ÷ 2 = 1 195 680 + 0;
- 1 195 680 ÷ 2 = 597 840 + 0;
- 597 840 ÷ 2 = 298 920 + 0;
- 298 920 ÷ 2 = 149 460 + 0;
- 149 460 ÷ 2 = 74 730 + 0;
- 74 730 ÷ 2 = 37 365 + 0;
- 37 365 ÷ 2 = 18 682 + 1;
- 18 682 ÷ 2 = 9 341 + 0;
- 9 341 ÷ 2 = 4 670 + 1;
- 4 670 ÷ 2 = 2 335 + 0;
- 2 335 ÷ 2 = 1 167 + 1;
- 1 167 ÷ 2 = 583 + 1;
- 583 ÷ 2 = 291 + 1;
- 291 ÷ 2 = 145 + 1;
- 145 ÷ 2 = 72 + 1;
- 72 ÷ 2 = 36 + 0;
- 36 ÷ 2 = 18 + 0;
- 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.
160 481 517 728 110(10) = 1001 0001 1111 0101 0000 0011 1101 1011 0111 0001 0110 1110(2)
3. 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.
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 160 481 517 728 110(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.