1. Divide the number repeatedly by 2:
Keep track of each remainder.
We stop when we get a quotient that is equal to zero.
- division = quotient + remainder;
- 1 129 662 544 ÷ 2 = 564 831 272 + 0;
- 564 831 272 ÷ 2 = 282 415 636 + 0;
- 282 415 636 ÷ 2 = 141 207 818 + 0;
- 141 207 818 ÷ 2 = 70 603 909 + 0;
- 70 603 909 ÷ 2 = 35 301 954 + 1;
- 35 301 954 ÷ 2 = 17 650 977 + 0;
- 17 650 977 ÷ 2 = 8 825 488 + 1;
- 8 825 488 ÷ 2 = 4 412 744 + 0;
- 4 412 744 ÷ 2 = 2 206 372 + 0;
- 2 206 372 ÷ 2 = 1 103 186 + 0;
- 1 103 186 ÷ 2 = 551 593 + 0;
- 551 593 ÷ 2 = 275 796 + 1;
- 275 796 ÷ 2 = 137 898 + 0;
- 137 898 ÷ 2 = 68 949 + 0;
- 68 949 ÷ 2 = 34 474 + 1;
- 34 474 ÷ 2 = 17 237 + 0;
- 17 237 ÷ 2 = 8 618 + 1;
- 8 618 ÷ 2 = 4 309 + 0;
- 4 309 ÷ 2 = 2 154 + 1;
- 2 154 ÷ 2 = 1 077 + 0;
- 1 077 ÷ 2 = 538 + 1;
- 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.
1 129 662 544(10) = 100 0011 0101 0101 0100 1000 0101 0000(2)
3. 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.
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.
Number 1 129 662 544(10), a signed integer number (with sign), converted from decimal system (from base 10) and written as a signed binary in one's complement representation:
1 129 662 544(10) = 0100 0011 0101 0101 0100 1000 0101 0000
Spaces were used to group digits: for binary, by 4, for decimal, by 3.