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 110 011 111 110 110 ÷ 2 = 555 005 555 555 055 + 0;
- 555 005 555 555 055 ÷ 2 = 277 502 777 777 527 + 1;
- 277 502 777 777 527 ÷ 2 = 138 751 388 888 763 + 1;
- 138 751 388 888 763 ÷ 2 = 69 375 694 444 381 + 1;
- 69 375 694 444 381 ÷ 2 = 34 687 847 222 190 + 1;
- 34 687 847 222 190 ÷ 2 = 17 343 923 611 095 + 0;
- 17 343 923 611 095 ÷ 2 = 8 671 961 805 547 + 1;
- 8 671 961 805 547 ÷ 2 = 4 335 980 902 773 + 1;
- 4 335 980 902 773 ÷ 2 = 2 167 990 451 386 + 1;
- 2 167 990 451 386 ÷ 2 = 1 083 995 225 693 + 0;
- 1 083 995 225 693 ÷ 2 = 541 997 612 846 + 1;
- 541 997 612 846 ÷ 2 = 270 998 806 423 + 0;
- 270 998 806 423 ÷ 2 = 135 499 403 211 + 1;
- 135 499 403 211 ÷ 2 = 67 749 701 605 + 1;
- 67 749 701 605 ÷ 2 = 33 874 850 802 + 1;
- 33 874 850 802 ÷ 2 = 16 937 425 401 + 0;
- 16 937 425 401 ÷ 2 = 8 468 712 700 + 1;
- 8 468 712 700 ÷ 2 = 4 234 356 350 + 0;
- 4 234 356 350 ÷ 2 = 2 117 178 175 + 0;
- 2 117 178 175 ÷ 2 = 1 058 589 087 + 1;
- 1 058 589 087 ÷ 2 = 529 294 543 + 1;
- 529 294 543 ÷ 2 = 264 647 271 + 1;
- 264 647 271 ÷ 2 = 132 323 635 + 1;
- 132 323 635 ÷ 2 = 66 161 817 + 1;
- 66 161 817 ÷ 2 = 33 080 908 + 1;
- 33 080 908 ÷ 2 = 16 540 454 + 0;
- 16 540 454 ÷ 2 = 8 270 227 + 0;
- 8 270 227 ÷ 2 = 4 135 113 + 1;
- 4 135 113 ÷ 2 = 2 067 556 + 1;
- 2 067 556 ÷ 2 = 1 033 778 + 0;
- 1 033 778 ÷ 2 = 516 889 + 0;
- 516 889 ÷ 2 = 258 444 + 1;
- 258 444 ÷ 2 = 129 222 + 0;
- 129 222 ÷ 2 = 64 611 + 0;
- 64 611 ÷ 2 = 32 305 + 1;
- 32 305 ÷ 2 = 16 152 + 1;
- 16 152 ÷ 2 = 8 076 + 0;
- 8 076 ÷ 2 = 4 038 + 0;
- 4 038 ÷ 2 = 2 019 + 0;
- 2 019 ÷ 2 = 1 009 + 1;
- 1 009 ÷ 2 = 504 + 1;
- 504 ÷ 2 = 252 + 0;
- 252 ÷ 2 = 126 + 0;
- 126 ÷ 2 = 63 + 0;
- 63 ÷ 2 = 31 + 1;
- 31 ÷ 2 = 15 + 1;
- 15 ÷ 2 = 7 + 1;
- 7 ÷ 2 = 3 + 1;
- 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.
1 110 011 111 110 110(10) = 11 1111 0001 1000 1100 1001 1001 1111 1001 0111 0101 1101 1110(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 50.
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, 50,
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 1 110 011 111 110 110(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:
1 110 011 111 110 110(10) = 0000 0000 0000 0011 1111 0001 1000 1100 1001 1001 1111 1001 0111 0101 1101 1110
Spaces were used to group digits: for binary, by 4, for decimal, by 3.