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 290 200 411 ÷ 2 = 645 100 205 + 1;
- 645 100 205 ÷ 2 = 322 550 102 + 1;
- 322 550 102 ÷ 2 = 161 275 051 + 0;
- 161 275 051 ÷ 2 = 80 637 525 + 1;
- 80 637 525 ÷ 2 = 40 318 762 + 1;
- 40 318 762 ÷ 2 = 20 159 381 + 0;
- 20 159 381 ÷ 2 = 10 079 690 + 1;
- 10 079 690 ÷ 2 = 5 039 845 + 0;
- 5 039 845 ÷ 2 = 2 519 922 + 1;
- 2 519 922 ÷ 2 = 1 259 961 + 0;
- 1 259 961 ÷ 2 = 629 980 + 1;
- 629 980 ÷ 2 = 314 990 + 0;
- 314 990 ÷ 2 = 157 495 + 0;
- 157 495 ÷ 2 = 78 747 + 1;
- 78 747 ÷ 2 = 39 373 + 1;
- 39 373 ÷ 2 = 19 686 + 1;
- 19 686 ÷ 2 = 9 843 + 0;
- 9 843 ÷ 2 = 4 921 + 1;
- 4 921 ÷ 2 = 2 460 + 1;
- 2 460 ÷ 2 = 1 230 + 0;
- 1 230 ÷ 2 = 615 + 0;
- 615 ÷ 2 = 307 + 1;
- 307 ÷ 2 = 153 + 1;
- 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.
1 290 200 411(10) = 100 1100 1110 0110 1110 0101 0101 1011(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.
Decimal Number 1 290 200 411(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.