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 563 462 ÷ 2 = 282 281 731 + 0;
- 282 281 731 ÷ 2 = 141 140 865 + 1;
- 141 140 865 ÷ 2 = 70 570 432 + 1;
- 70 570 432 ÷ 2 = 35 285 216 + 0;
- 35 285 216 ÷ 2 = 17 642 608 + 0;
- 17 642 608 ÷ 2 = 8 821 304 + 0;
- 8 821 304 ÷ 2 = 4 410 652 + 0;
- 4 410 652 ÷ 2 = 2 205 326 + 0;
- 2 205 326 ÷ 2 = 1 102 663 + 0;
- 1 102 663 ÷ 2 = 551 331 + 1;
- 551 331 ÷ 2 = 275 665 + 1;
- 275 665 ÷ 2 = 137 832 + 1;
- 137 832 ÷ 2 = 68 916 + 0;
- 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 563 462(10) = 10 0001 1010 0110 1000 1110 0000 0110(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 563 462(10) converted to signed binary in one's complement representation: