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 737 844 619 ÷ 2 = 1 868 922 309 + 1;
- 1 868 922 309 ÷ 2 = 934 461 154 + 1;
- 934 461 154 ÷ 2 = 467 230 577 + 0;
- 467 230 577 ÷ 2 = 233 615 288 + 1;
- 233 615 288 ÷ 2 = 116 807 644 + 0;
- 116 807 644 ÷ 2 = 58 403 822 + 0;
- 58 403 822 ÷ 2 = 29 201 911 + 0;
- 29 201 911 ÷ 2 = 14 600 955 + 1;
- 14 600 955 ÷ 2 = 7 300 477 + 1;
- 7 300 477 ÷ 2 = 3 650 238 + 1;
- 3 650 238 ÷ 2 = 1 825 119 + 0;
- 1 825 119 ÷ 2 = 912 559 + 1;
- 912 559 ÷ 2 = 456 279 + 1;
- 456 279 ÷ 2 = 228 139 + 1;
- 228 139 ÷ 2 = 114 069 + 1;
- 114 069 ÷ 2 = 57 034 + 1;
- 57 034 ÷ 2 = 28 517 + 0;
- 28 517 ÷ 2 = 14 258 + 1;
- 14 258 ÷ 2 = 7 129 + 0;
- 7 129 ÷ 2 = 3 564 + 1;
- 3 564 ÷ 2 = 1 782 + 0;
- 1 782 ÷ 2 = 891 + 0;
- 891 ÷ 2 = 445 + 1;
- 445 ÷ 2 = 222 + 1;
- 222 ÷ 2 = 111 + 0;
- 111 ÷ 2 = 55 + 1;
- 55 ÷ 2 = 27 + 1;
- 27 ÷ 2 = 13 + 1;
- 13 ÷ 2 = 6 + 1;
- 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 737 844 619(10) = 1101 1110 1100 1010 1111 1011 1000 1011(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 3 737 844 619(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 737 844 619(10) = 0000 0000 0000 0000 0000 0000 0000 0000 1101 1110 1100 1010 1111 1011 1000 1011
Spaces were used to group digits: for binary, by 4, for decimal, by 3.