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 606 329 ÷ 2 = 1 287 303 164 + 1;
- 1 287 303 164 ÷ 2 = 643 651 582 + 0;
- 643 651 582 ÷ 2 = 321 825 791 + 0;
- 321 825 791 ÷ 2 = 160 912 895 + 1;
- 160 912 895 ÷ 2 = 80 456 447 + 1;
- 80 456 447 ÷ 2 = 40 228 223 + 1;
- 40 228 223 ÷ 2 = 20 114 111 + 1;
- 20 114 111 ÷ 2 = 10 057 055 + 1;
- 10 057 055 ÷ 2 = 5 028 527 + 1;
- 5 028 527 ÷ 2 = 2 514 263 + 1;
- 2 514 263 ÷ 2 = 1 257 131 + 1;
- 1 257 131 ÷ 2 = 628 565 + 1;
- 628 565 ÷ 2 = 314 282 + 1;
- 314 282 ÷ 2 = 157 141 + 0;
- 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 606 329(10) = 1001 1001 0111 0101 0101 1111 1111 1001(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 606 329(10) converted to signed binary in one's complement representation: