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;
- 10 800 108 215 ÷ 2 = 5 400 054 107 + 1;
- 5 400 054 107 ÷ 2 = 2 700 027 053 + 1;
- 2 700 027 053 ÷ 2 = 1 350 013 526 + 1;
- 1 350 013 526 ÷ 2 = 675 006 763 + 0;
- 675 006 763 ÷ 2 = 337 503 381 + 1;
- 337 503 381 ÷ 2 = 168 751 690 + 1;
- 168 751 690 ÷ 2 = 84 375 845 + 0;
- 84 375 845 ÷ 2 = 42 187 922 + 1;
- 42 187 922 ÷ 2 = 21 093 961 + 0;
- 21 093 961 ÷ 2 = 10 546 980 + 1;
- 10 546 980 ÷ 2 = 5 273 490 + 0;
- 5 273 490 ÷ 2 = 2 636 745 + 0;
- 2 636 745 ÷ 2 = 1 318 372 + 1;
- 1 318 372 ÷ 2 = 659 186 + 0;
- 659 186 ÷ 2 = 329 593 + 0;
- 329 593 ÷ 2 = 164 796 + 1;
- 164 796 ÷ 2 = 82 398 + 0;
- 82 398 ÷ 2 = 41 199 + 0;
- 41 199 ÷ 2 = 20 599 + 1;
- 20 599 ÷ 2 = 10 299 + 1;
- 10 299 ÷ 2 = 5 149 + 1;
- 5 149 ÷ 2 = 2 574 + 1;
- 2 574 ÷ 2 = 1 287 + 0;
- 1 287 ÷ 2 = 643 + 1;
- 643 ÷ 2 = 321 + 1;
- 321 ÷ 2 = 160 + 1;
- 160 ÷ 2 = 80 + 0;
- 80 ÷ 2 = 40 + 0;
- 40 ÷ 2 = 20 + 0;
- 20 ÷ 2 = 10 + 0;
- 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.
10 800 108 215(10) = 10 1000 0011 1011 1100 1001 0010 1011 0111(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 10 800 108 215(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.