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;
- 1 101 100 109 635 ÷ 2 = 550 550 054 817 + 1;
- 550 550 054 817 ÷ 2 = 275 275 027 408 + 1;
- 275 275 027 408 ÷ 2 = 137 637 513 704 + 0;
- 137 637 513 704 ÷ 2 = 68 818 756 852 + 0;
- 68 818 756 852 ÷ 2 = 34 409 378 426 + 0;
- 34 409 378 426 ÷ 2 = 17 204 689 213 + 0;
- 17 204 689 213 ÷ 2 = 8 602 344 606 + 1;
- 8 602 344 606 ÷ 2 = 4 301 172 303 + 0;
- 4 301 172 303 ÷ 2 = 2 150 586 151 + 1;
- 2 150 586 151 ÷ 2 = 1 075 293 075 + 1;
- 1 075 293 075 ÷ 2 = 537 646 537 + 1;
- 537 646 537 ÷ 2 = 268 823 268 + 1;
- 268 823 268 ÷ 2 = 134 411 634 + 0;
- 134 411 634 ÷ 2 = 67 205 817 + 0;
- 67 205 817 ÷ 2 = 33 602 908 + 1;
- 33 602 908 ÷ 2 = 16 801 454 + 0;
- 16 801 454 ÷ 2 = 8 400 727 + 0;
- 8 400 727 ÷ 2 = 4 200 363 + 1;
- 4 200 363 ÷ 2 = 2 100 181 + 1;
- 2 100 181 ÷ 2 = 1 050 090 + 1;
- 1 050 090 ÷ 2 = 525 045 + 0;
- 525 045 ÷ 2 = 262 522 + 1;
- 262 522 ÷ 2 = 131 261 + 0;
- 131 261 ÷ 2 = 65 630 + 1;
- 65 630 ÷ 2 = 32 815 + 0;
- 32 815 ÷ 2 = 16 407 + 1;
- 16 407 ÷ 2 = 8 203 + 1;
- 8 203 ÷ 2 = 4 101 + 1;
- 4 101 ÷ 2 = 2 050 + 1;
- 2 050 ÷ 2 = 1 025 + 0;
- 1 025 ÷ 2 = 512 + 1;
- 512 ÷ 2 = 256 + 0;
- 256 ÷ 2 = 128 + 0;
- 128 ÷ 2 = 64 + 0;
- 64 ÷ 2 = 32 + 0;
- 32 ÷ 2 = 16 + 0;
- 16 ÷ 2 = 8 + 0;
- 8 ÷ 2 = 4 + 0;
- 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.
1 101 100 109 635(10) = 1 0000 0000 0101 1110 1010 1110 0100 1111 0100 0011(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 41.
- 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, 41,
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 1 101 100 109 635(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.