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;
- 10 977 675 159 ÷ 2 = 5 488 837 579 + 1;
- 5 488 837 579 ÷ 2 = 2 744 418 789 + 1;
- 2 744 418 789 ÷ 2 = 1 372 209 394 + 1;
- 1 372 209 394 ÷ 2 = 686 104 697 + 0;
- 686 104 697 ÷ 2 = 343 052 348 + 1;
- 343 052 348 ÷ 2 = 171 526 174 + 0;
- 171 526 174 ÷ 2 = 85 763 087 + 0;
- 85 763 087 ÷ 2 = 42 881 543 + 1;
- 42 881 543 ÷ 2 = 21 440 771 + 1;
- 21 440 771 ÷ 2 = 10 720 385 + 1;
- 10 720 385 ÷ 2 = 5 360 192 + 1;
- 5 360 192 ÷ 2 = 2 680 096 + 0;
- 2 680 096 ÷ 2 = 1 340 048 + 0;
- 1 340 048 ÷ 2 = 670 024 + 0;
- 670 024 ÷ 2 = 335 012 + 0;
- 335 012 ÷ 2 = 167 506 + 0;
- 167 506 ÷ 2 = 83 753 + 0;
- 83 753 ÷ 2 = 41 876 + 1;
- 41 876 ÷ 2 = 20 938 + 0;
- 20 938 ÷ 2 = 10 469 + 0;
- 10 469 ÷ 2 = 5 234 + 1;
- 5 234 ÷ 2 = 2 617 + 0;
- 2 617 ÷ 2 = 1 308 + 1;
- 1 308 ÷ 2 = 654 + 0;
- 654 ÷ 2 = 327 + 0;
- 327 ÷ 2 = 163 + 1;
- 163 ÷ 2 = 81 + 1;
- 81 ÷ 2 = 40 + 1;
- 40 ÷ 2 = 20 + 0;
- 20 ÷ 2 = 10 + 0;
- 10 ÷ 2 = 5 + 0;
- 5 ÷ 2 = 2 + 1;
- 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.
10 977 675 159(10) = 10 1000 1110 0101 0010 0000 0111 1001 0111(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 34.
- 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, 34,
3) so that the first bit (leftmost) could be zero
(we deal with a positive number at this moment)
=== is: 64.
4. Get the positive binary computer representation on 64 bits (8 Bytes):
If needed, add extra 0s in front (to the left) of the base 2 number, up to the required length, 64.
Decimal Number 10 977 675 159(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.