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;
- 3 092 596 902 ÷ 2 = 1 546 298 451 + 0;
- 1 546 298 451 ÷ 2 = 773 149 225 + 1;
- 773 149 225 ÷ 2 = 386 574 612 + 1;
- 386 574 612 ÷ 2 = 193 287 306 + 0;
- 193 287 306 ÷ 2 = 96 643 653 + 0;
- 96 643 653 ÷ 2 = 48 321 826 + 1;
- 48 321 826 ÷ 2 = 24 160 913 + 0;
- 24 160 913 ÷ 2 = 12 080 456 + 1;
- 12 080 456 ÷ 2 = 6 040 228 + 0;
- 6 040 228 ÷ 2 = 3 020 114 + 0;
- 3 020 114 ÷ 2 = 1 510 057 + 0;
- 1 510 057 ÷ 2 = 755 028 + 1;
- 755 028 ÷ 2 = 377 514 + 0;
- 377 514 ÷ 2 = 188 757 + 0;
- 188 757 ÷ 2 = 94 378 + 1;
- 94 378 ÷ 2 = 47 189 + 0;
- 47 189 ÷ 2 = 23 594 + 1;
- 23 594 ÷ 2 = 11 797 + 0;
- 11 797 ÷ 2 = 5 898 + 1;
- 5 898 ÷ 2 = 2 949 + 0;
- 2 949 ÷ 2 = 1 474 + 1;
- 1 474 ÷ 2 = 737 + 0;
- 737 ÷ 2 = 368 + 1;
- 368 ÷ 2 = 184 + 0;
- 184 ÷ 2 = 92 + 0;
- 92 ÷ 2 = 46 + 0;
- 46 ÷ 2 = 23 + 0;
- 23 ÷ 2 = 11 + 1;
- 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.
3 092 596 902(10) = 1011 1000 0101 0101 0100 1000 1010 0110(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 32.
- 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, 32,
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 3 092 596 902(10) converted to signed binary in one's complement representation: