1. Start with the positive version of the number:
|-1 511 913 602| = 1 511 913 602
2. 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 511 913 602 ÷ 2 = 755 956 801 + 0;
- 755 956 801 ÷ 2 = 377 978 400 + 1;
- 377 978 400 ÷ 2 = 188 989 200 + 0;
- 188 989 200 ÷ 2 = 94 494 600 + 0;
- 94 494 600 ÷ 2 = 47 247 300 + 0;
- 47 247 300 ÷ 2 = 23 623 650 + 0;
- 23 623 650 ÷ 2 = 11 811 825 + 0;
- 11 811 825 ÷ 2 = 5 905 912 + 1;
- 5 905 912 ÷ 2 = 2 952 956 + 0;
- 2 952 956 ÷ 2 = 1 476 478 + 0;
- 1 476 478 ÷ 2 = 738 239 + 0;
- 738 239 ÷ 2 = 369 119 + 1;
- 369 119 ÷ 2 = 184 559 + 1;
- 184 559 ÷ 2 = 92 279 + 1;
- 92 279 ÷ 2 = 46 139 + 1;
- 46 139 ÷ 2 = 23 069 + 1;
- 23 069 ÷ 2 = 11 534 + 1;
- 11 534 ÷ 2 = 5 767 + 0;
- 5 767 ÷ 2 = 2 883 + 1;
- 2 883 ÷ 2 = 1 441 + 1;
- 1 441 ÷ 2 = 720 + 1;
- 720 ÷ 2 = 360 + 0;
- 360 ÷ 2 = 180 + 0;
- 180 ÷ 2 = 90 + 0;
- 90 ÷ 2 = 45 + 0;
- 45 ÷ 2 = 22 + 1;
- 22 ÷ 2 = 11 + 0;
- 11 ÷ 2 = 5 + 1;
- 5 ÷ 2 = 2 + 1;
- 2 ÷ 2 = 1 + 0;
- 1 ÷ 2 = 0 + 1;
3. Construct the base 2 representation of the positive number:
Take all the remainders starting from the bottom of the list constructed above.
1 511 913 602(10) = 101 1010 0001 1101 1111 1000 1000 0010(2)
4. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 31.
- 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, 31,
3) so that the first bit (leftmost) could be zero
(we deal with a positive number at this moment)
=== is: 32.
5. 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.