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;
- 805 306 366 972 ÷ 2 = 402 653 183 486 + 0;
- 402 653 183 486 ÷ 2 = 201 326 591 743 + 0;
- 201 326 591 743 ÷ 2 = 100 663 295 871 + 1;
- 100 663 295 871 ÷ 2 = 50 331 647 935 + 1;
- 50 331 647 935 ÷ 2 = 25 165 823 967 + 1;
- 25 165 823 967 ÷ 2 = 12 582 911 983 + 1;
- 12 582 911 983 ÷ 2 = 6 291 455 991 + 1;
- 6 291 455 991 ÷ 2 = 3 145 727 995 + 1;
- 3 145 727 995 ÷ 2 = 1 572 863 997 + 1;
- 1 572 863 997 ÷ 2 = 786 431 998 + 1;
- 786 431 998 ÷ 2 = 393 215 999 + 0;
- 393 215 999 ÷ 2 = 196 607 999 + 1;
- 196 607 999 ÷ 2 = 98 303 999 + 1;
- 98 303 999 ÷ 2 = 49 151 999 + 1;
- 49 151 999 ÷ 2 = 24 575 999 + 1;
- 24 575 999 ÷ 2 = 12 287 999 + 1;
- 12 287 999 ÷ 2 = 6 143 999 + 1;
- 6 143 999 ÷ 2 = 3 071 999 + 1;
- 3 071 999 ÷ 2 = 1 535 999 + 1;
- 1 535 999 ÷ 2 = 767 999 + 1;
- 767 999 ÷ 2 = 383 999 + 1;
- 383 999 ÷ 2 = 191 999 + 1;
- 191 999 ÷ 2 = 95 999 + 1;
- 95 999 ÷ 2 = 47 999 + 1;
- 47 999 ÷ 2 = 23 999 + 1;
- 23 999 ÷ 2 = 11 999 + 1;
- 11 999 ÷ 2 = 5 999 + 1;
- 5 999 ÷ 2 = 2 999 + 1;
- 2 999 ÷ 2 = 1 499 + 1;
- 1 499 ÷ 2 = 749 + 1;
- 749 ÷ 2 = 374 + 1;
- 374 ÷ 2 = 187 + 0;
- 187 ÷ 2 = 93 + 1;
- 93 ÷ 2 = 46 + 1;
- 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.
805 306 366 972(10) = 1011 1011 0111 1111 1111 1111 1111 1011 1111 1100(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 40.
- 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, 40,
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 805 306 366 972(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.