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;
- 2 574 607 210 ÷ 2 = 1 287 303 605 + 0;
- 1 287 303 605 ÷ 2 = 643 651 802 + 1;
- 643 651 802 ÷ 2 = 321 825 901 + 0;
- 321 825 901 ÷ 2 = 160 912 950 + 1;
- 160 912 950 ÷ 2 = 80 456 475 + 0;
- 80 456 475 ÷ 2 = 40 228 237 + 1;
- 40 228 237 ÷ 2 = 20 114 118 + 1;
- 20 114 118 ÷ 2 = 10 057 059 + 0;
- 10 057 059 ÷ 2 = 5 028 529 + 1;
- 5 028 529 ÷ 2 = 2 514 264 + 1;
- 2 514 264 ÷ 2 = 1 257 132 + 0;
- 1 257 132 ÷ 2 = 628 566 + 0;
- 628 566 ÷ 2 = 314 283 + 0;
- 314 283 ÷ 2 = 157 141 + 1;
- 157 141 ÷ 2 = 78 570 + 1;
- 78 570 ÷ 2 = 39 285 + 0;
- 39 285 ÷ 2 = 19 642 + 1;
- 19 642 ÷ 2 = 9 821 + 0;
- 9 821 ÷ 2 = 4 910 + 1;
- 4 910 ÷ 2 = 2 455 + 0;
- 2 455 ÷ 2 = 1 227 + 1;
- 1 227 ÷ 2 = 613 + 1;
- 613 ÷ 2 = 306 + 1;
- 306 ÷ 2 = 153 + 0;
- 153 ÷ 2 = 76 + 1;
- 76 ÷ 2 = 38 + 0;
- 38 ÷ 2 = 19 + 0;
- 19 ÷ 2 = 9 + 1;
- 9 ÷ 2 = 4 + 1;
- 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.
2 574 607 210(10) = 1001 1001 0111 0101 0110 0011 0110 1010(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 32.
- 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, 32,
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 2 574 607 210(10) converted to signed binary in one's complement representation: