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;
- 1 774 653 754 ÷ 2 = 887 326 877 + 0;
- 887 326 877 ÷ 2 = 443 663 438 + 1;
- 443 663 438 ÷ 2 = 221 831 719 + 0;
- 221 831 719 ÷ 2 = 110 915 859 + 1;
- 110 915 859 ÷ 2 = 55 457 929 + 1;
- 55 457 929 ÷ 2 = 27 728 964 + 1;
- 27 728 964 ÷ 2 = 13 864 482 + 0;
- 13 864 482 ÷ 2 = 6 932 241 + 0;
- 6 932 241 ÷ 2 = 3 466 120 + 1;
- 3 466 120 ÷ 2 = 1 733 060 + 0;
- 1 733 060 ÷ 2 = 866 530 + 0;
- 866 530 ÷ 2 = 433 265 + 0;
- 433 265 ÷ 2 = 216 632 + 1;
- 216 632 ÷ 2 = 108 316 + 0;
- 108 316 ÷ 2 = 54 158 + 0;
- 54 158 ÷ 2 = 27 079 + 0;
- 27 079 ÷ 2 = 13 539 + 1;
- 13 539 ÷ 2 = 6 769 + 1;
- 6 769 ÷ 2 = 3 384 + 1;
- 3 384 ÷ 2 = 1 692 + 0;
- 1 692 ÷ 2 = 846 + 0;
- 846 ÷ 2 = 423 + 0;
- 423 ÷ 2 = 211 + 1;
- 211 ÷ 2 = 105 + 1;
- 105 ÷ 2 = 52 + 1;
- 52 ÷ 2 = 26 + 0;
- 26 ÷ 2 = 13 + 0;
- 13 ÷ 2 = 6 + 1;
- 6 ÷ 2 = 3 + 0;
- 3 ÷ 2 = 1 + 1;
- 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 774 653 754(10) = 110 1001 1100 0111 0001 0001 0011 1010(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 774 653 754(10) converted to signed binary in one's complement representation: