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;
- 2 919 890 998 ÷ 2 = 1 459 945 499 + 0;
- 1 459 945 499 ÷ 2 = 729 972 749 + 1;
- 729 972 749 ÷ 2 = 364 986 374 + 1;
- 364 986 374 ÷ 2 = 182 493 187 + 0;
- 182 493 187 ÷ 2 = 91 246 593 + 1;
- 91 246 593 ÷ 2 = 45 623 296 + 1;
- 45 623 296 ÷ 2 = 22 811 648 + 0;
- 22 811 648 ÷ 2 = 11 405 824 + 0;
- 11 405 824 ÷ 2 = 5 702 912 + 0;
- 5 702 912 ÷ 2 = 2 851 456 + 0;
- 2 851 456 ÷ 2 = 1 425 728 + 0;
- 1 425 728 ÷ 2 = 712 864 + 0;
- 712 864 ÷ 2 = 356 432 + 0;
- 356 432 ÷ 2 = 178 216 + 0;
- 178 216 ÷ 2 = 89 108 + 0;
- 89 108 ÷ 2 = 44 554 + 0;
- 44 554 ÷ 2 = 22 277 + 0;
- 22 277 ÷ 2 = 11 138 + 1;
- 11 138 ÷ 2 = 5 569 + 0;
- 5 569 ÷ 2 = 2 784 + 1;
- 2 784 ÷ 2 = 1 392 + 0;
- 1 392 ÷ 2 = 696 + 0;
- 696 ÷ 2 = 348 + 0;
- 348 ÷ 2 = 174 + 0;
- 174 ÷ 2 = 87 + 0;
- 87 ÷ 2 = 43 + 1;
- 43 ÷ 2 = 21 + 1;
- 21 ÷ 2 = 10 + 1;
- 10 ÷ 2 = 5 + 0;
- 5 ÷ 2 = 2 + 1;
- 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.
2 919 890 998(10) = 1010 1110 0000 1010 0000 0000 0011 0110(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 32.
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, 32,
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 2 919 890 998(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:
2 919 890 998(10) = 0000 0000 0000 0000 0000 0000 0000 0000 1010 1110 0000 1010 0000 0000 0011 0110
Spaces were used to group digits: for binary, by 4, for decimal, by 3.