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;
- 564 564 779 ÷ 2 = 282 282 389 + 1;
- 282 282 389 ÷ 2 = 141 141 194 + 1;
- 141 141 194 ÷ 2 = 70 570 597 + 0;
- 70 570 597 ÷ 2 = 35 285 298 + 1;
- 35 285 298 ÷ 2 = 17 642 649 + 0;
- 17 642 649 ÷ 2 = 8 821 324 + 1;
- 8 821 324 ÷ 2 = 4 410 662 + 0;
- 4 410 662 ÷ 2 = 2 205 331 + 0;
- 2 205 331 ÷ 2 = 1 102 665 + 1;
- 1 102 665 ÷ 2 = 551 332 + 1;
- 551 332 ÷ 2 = 275 666 + 0;
- 275 666 ÷ 2 = 137 833 + 0;
- 137 833 ÷ 2 = 68 916 + 1;
- 68 916 ÷ 2 = 34 458 + 0;
- 34 458 ÷ 2 = 17 229 + 0;
- 17 229 ÷ 2 = 8 614 + 1;
- 8 614 ÷ 2 = 4 307 + 0;
- 4 307 ÷ 2 = 2 153 + 1;
- 2 153 ÷ 2 = 1 076 + 1;
- 1 076 ÷ 2 = 538 + 0;
- 538 ÷ 2 = 269 + 0;
- 269 ÷ 2 = 134 + 1;
- 134 ÷ 2 = 67 + 0;
- 67 ÷ 2 = 33 + 1;
- 33 ÷ 2 = 16 + 1;
- 16 ÷ 2 = 8 + 0;
- 8 ÷ 2 = 4 + 0;
- 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.
564 564 779(10) = 10 0001 1010 0110 1001 0011 0010 1011(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 30.
- 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, 30,
3) so that the first bit (leftmost) could be zero
(we deal with a positive number at this moment)
=== is: 32.
4. Get the positive binary computer representation on 32 bits (4 Bytes):
If needed, add extra 0s in front (to the left) of the base 2 number, up to the required length, 32.
Decimal Number 564 564 779(10) converted to signed binary in one's complement representation: