1. Divide the number repeatedly by 2:
Keep track of each remainder.
Stop when you get a quotient that is equal to zero.
- division = quotient + remainder;
- 12 303 366 090 ÷ 2 = 6 151 683 045 + 0;
- 6 151 683 045 ÷ 2 = 3 075 841 522 + 1;
- 3 075 841 522 ÷ 2 = 1 537 920 761 + 0;
- 1 537 920 761 ÷ 2 = 768 960 380 + 1;
- 768 960 380 ÷ 2 = 384 480 190 + 0;
- 384 480 190 ÷ 2 = 192 240 095 + 0;
- 192 240 095 ÷ 2 = 96 120 047 + 1;
- 96 120 047 ÷ 2 = 48 060 023 + 1;
- 48 060 023 ÷ 2 = 24 030 011 + 1;
- 24 030 011 ÷ 2 = 12 015 005 + 1;
- 12 015 005 ÷ 2 = 6 007 502 + 1;
- 6 007 502 ÷ 2 = 3 003 751 + 0;
- 3 003 751 ÷ 2 = 1 501 875 + 1;
- 1 501 875 ÷ 2 = 750 937 + 1;
- 750 937 ÷ 2 = 375 468 + 1;
- 375 468 ÷ 2 = 187 734 + 0;
- 187 734 ÷ 2 = 93 867 + 0;
- 93 867 ÷ 2 = 46 933 + 1;
- 46 933 ÷ 2 = 23 466 + 1;
- 23 466 ÷ 2 = 11 733 + 0;
- 11 733 ÷ 2 = 5 866 + 1;
- 5 866 ÷ 2 = 2 933 + 0;
- 2 933 ÷ 2 = 1 466 + 1;
- 1 466 ÷ 2 = 733 + 0;
- 733 ÷ 2 = 366 + 1;
- 366 ÷ 2 = 183 + 0;
- 183 ÷ 2 = 91 + 1;
- 91 ÷ 2 = 45 + 1;
- 45 ÷ 2 = 22 + 1;
- 22 ÷ 2 = 11 + 0;
- 11 ÷ 2 = 5 + 1;
- 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.
12 303 366 090(10) = 10 1101 1101 0101 0110 0111 0111 1100 1010(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 34.
- 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, 34,
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 12 303 366 090(10) converted to signed binary in one's complement representation: