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;
- 743 677 695 ÷ 2 = 371 838 847 + 1;
- 371 838 847 ÷ 2 = 185 919 423 + 1;
- 185 919 423 ÷ 2 = 92 959 711 + 1;
- 92 959 711 ÷ 2 = 46 479 855 + 1;
- 46 479 855 ÷ 2 = 23 239 927 + 1;
- 23 239 927 ÷ 2 = 11 619 963 + 1;
- 11 619 963 ÷ 2 = 5 809 981 + 1;
- 5 809 981 ÷ 2 = 2 904 990 + 1;
- 2 904 990 ÷ 2 = 1 452 495 + 0;
- 1 452 495 ÷ 2 = 726 247 + 1;
- 726 247 ÷ 2 = 363 123 + 1;
- 363 123 ÷ 2 = 181 561 + 1;
- 181 561 ÷ 2 = 90 780 + 1;
- 90 780 ÷ 2 = 45 390 + 0;
- 45 390 ÷ 2 = 22 695 + 0;
- 22 695 ÷ 2 = 11 347 + 1;
- 11 347 ÷ 2 = 5 673 + 1;
- 5 673 ÷ 2 = 2 836 + 1;
- 2 836 ÷ 2 = 1 418 + 0;
- 1 418 ÷ 2 = 709 + 0;
- 709 ÷ 2 = 354 + 1;
- 354 ÷ 2 = 177 + 0;
- 177 ÷ 2 = 88 + 1;
- 88 ÷ 2 = 44 + 0;
- 44 ÷ 2 = 22 + 0;
- 22 ÷ 2 = 11 + 0;
- 11 ÷ 2 = 5 + 1;
- 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.
743 677 695(10) = 10 1100 0101 0011 1001 1110 1111 1111(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 30.
- 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, 30,
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 743 677 695(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.