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;
- 1 111 010 000 001 847 ÷ 2 = 555 505 000 000 923 + 1;
- 555 505 000 000 923 ÷ 2 = 277 752 500 000 461 + 1;
- 277 752 500 000 461 ÷ 2 = 138 876 250 000 230 + 1;
- 138 876 250 000 230 ÷ 2 = 69 438 125 000 115 + 0;
- 69 438 125 000 115 ÷ 2 = 34 719 062 500 057 + 1;
- 34 719 062 500 057 ÷ 2 = 17 359 531 250 028 + 1;
- 17 359 531 250 028 ÷ 2 = 8 679 765 625 014 + 0;
- 8 679 765 625 014 ÷ 2 = 4 339 882 812 507 + 0;
- 4 339 882 812 507 ÷ 2 = 2 169 941 406 253 + 1;
- 2 169 941 406 253 ÷ 2 = 1 084 970 703 126 + 1;
- 1 084 970 703 126 ÷ 2 = 542 485 351 563 + 0;
- 542 485 351 563 ÷ 2 = 271 242 675 781 + 1;
- 271 242 675 781 ÷ 2 = 135 621 337 890 + 1;
- 135 621 337 890 ÷ 2 = 67 810 668 945 + 0;
- 67 810 668 945 ÷ 2 = 33 905 334 472 + 1;
- 33 905 334 472 ÷ 2 = 16 952 667 236 + 0;
- 16 952 667 236 ÷ 2 = 8 476 333 618 + 0;
- 8 476 333 618 ÷ 2 = 4 238 166 809 + 0;
- 4 238 166 809 ÷ 2 = 2 119 083 404 + 1;
- 2 119 083 404 ÷ 2 = 1 059 541 702 + 0;
- 1 059 541 702 ÷ 2 = 529 770 851 + 0;
- 529 770 851 ÷ 2 = 264 885 425 + 1;
- 264 885 425 ÷ 2 = 132 442 712 + 1;
- 132 442 712 ÷ 2 = 66 221 356 + 0;
- 66 221 356 ÷ 2 = 33 110 678 + 0;
- 33 110 678 ÷ 2 = 16 555 339 + 0;
- 16 555 339 ÷ 2 = 8 277 669 + 1;
- 8 277 669 ÷ 2 = 4 138 834 + 1;
- 4 138 834 ÷ 2 = 2 069 417 + 0;
- 2 069 417 ÷ 2 = 1 034 708 + 1;
- 1 034 708 ÷ 2 = 517 354 + 0;
- 517 354 ÷ 2 = 258 677 + 0;
- 258 677 ÷ 2 = 129 338 + 1;
- 129 338 ÷ 2 = 64 669 + 0;
- 64 669 ÷ 2 = 32 334 + 1;
- 32 334 ÷ 2 = 16 167 + 0;
- 16 167 ÷ 2 = 8 083 + 1;
- 8 083 ÷ 2 = 4 041 + 1;
- 4 041 ÷ 2 = 2 020 + 1;
- 2 020 ÷ 2 = 1 010 + 0;
- 1 010 ÷ 2 = 505 + 0;
- 505 ÷ 2 = 252 + 1;
- 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 111 010 000 001 847(10) = 11 1111 0010 0111 0101 0010 1100 0110 0100 0101 1011 0011 0111(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.
Decimal Number 1 111 010 000 001 847(10) converted to signed binary in one's complement representation: