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;
- 100 010 110 109 883 ÷ 2 = 50 005 055 054 941 + 1;
- 50 005 055 054 941 ÷ 2 = 25 002 527 527 470 + 1;
- 25 002 527 527 470 ÷ 2 = 12 501 263 763 735 + 0;
- 12 501 263 763 735 ÷ 2 = 6 250 631 881 867 + 1;
- 6 250 631 881 867 ÷ 2 = 3 125 315 940 933 + 1;
- 3 125 315 940 933 ÷ 2 = 1 562 657 970 466 + 1;
- 1 562 657 970 466 ÷ 2 = 781 328 985 233 + 0;
- 781 328 985 233 ÷ 2 = 390 664 492 616 + 1;
- 390 664 492 616 ÷ 2 = 195 332 246 308 + 0;
- 195 332 246 308 ÷ 2 = 97 666 123 154 + 0;
- 97 666 123 154 ÷ 2 = 48 833 061 577 + 0;
- 48 833 061 577 ÷ 2 = 24 416 530 788 + 1;
- 24 416 530 788 ÷ 2 = 12 208 265 394 + 0;
- 12 208 265 394 ÷ 2 = 6 104 132 697 + 0;
- 6 104 132 697 ÷ 2 = 3 052 066 348 + 1;
- 3 052 066 348 ÷ 2 = 1 526 033 174 + 0;
- 1 526 033 174 ÷ 2 = 763 016 587 + 0;
- 763 016 587 ÷ 2 = 381 508 293 + 1;
- 381 508 293 ÷ 2 = 190 754 146 + 1;
- 190 754 146 ÷ 2 = 95 377 073 + 0;
- 95 377 073 ÷ 2 = 47 688 536 + 1;
- 47 688 536 ÷ 2 = 23 844 268 + 0;
- 23 844 268 ÷ 2 = 11 922 134 + 0;
- 11 922 134 ÷ 2 = 5 961 067 + 0;
- 5 961 067 ÷ 2 = 2 980 533 + 1;
- 2 980 533 ÷ 2 = 1 490 266 + 1;
- 1 490 266 ÷ 2 = 745 133 + 0;
- 745 133 ÷ 2 = 372 566 + 1;
- 372 566 ÷ 2 = 186 283 + 0;
- 186 283 ÷ 2 = 93 141 + 1;
- 93 141 ÷ 2 = 46 570 + 1;
- 46 570 ÷ 2 = 23 285 + 0;
- 23 285 ÷ 2 = 11 642 + 1;
- 11 642 ÷ 2 = 5 821 + 0;
- 5 821 ÷ 2 = 2 910 + 1;
- 2 910 ÷ 2 = 1 455 + 0;
- 1 455 ÷ 2 = 727 + 1;
- 727 ÷ 2 = 363 + 1;
- 363 ÷ 2 = 181 + 1;
- 181 ÷ 2 = 90 + 1;
- 90 ÷ 2 = 45 + 0;
- 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.
100 010 110 109 883(10) = 101 1010 1111 0101 0110 1011 0001 0110 0100 1000 1011 1011(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 47.
- 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, 47,
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 100 010 110 109 883(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.