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;
- 14 304 249 491 ÷ 2 = 7 152 124 745 + 1;
- 7 152 124 745 ÷ 2 = 3 576 062 372 + 1;
- 3 576 062 372 ÷ 2 = 1 788 031 186 + 0;
- 1 788 031 186 ÷ 2 = 894 015 593 + 0;
- 894 015 593 ÷ 2 = 447 007 796 + 1;
- 447 007 796 ÷ 2 = 223 503 898 + 0;
- 223 503 898 ÷ 2 = 111 751 949 + 0;
- 111 751 949 ÷ 2 = 55 875 974 + 1;
- 55 875 974 ÷ 2 = 27 937 987 + 0;
- 27 937 987 ÷ 2 = 13 968 993 + 1;
- 13 968 993 ÷ 2 = 6 984 496 + 1;
- 6 984 496 ÷ 2 = 3 492 248 + 0;
- 3 492 248 ÷ 2 = 1 746 124 + 0;
- 1 746 124 ÷ 2 = 873 062 + 0;
- 873 062 ÷ 2 = 436 531 + 0;
- 436 531 ÷ 2 = 218 265 + 1;
- 218 265 ÷ 2 = 109 132 + 1;
- 109 132 ÷ 2 = 54 566 + 0;
- 54 566 ÷ 2 = 27 283 + 0;
- 27 283 ÷ 2 = 13 641 + 1;
- 13 641 ÷ 2 = 6 820 + 1;
- 6 820 ÷ 2 = 3 410 + 0;
- 3 410 ÷ 2 = 1 705 + 0;
- 1 705 ÷ 2 = 852 + 1;
- 852 ÷ 2 = 426 + 0;
- 426 ÷ 2 = 213 + 0;
- 213 ÷ 2 = 106 + 1;
- 106 ÷ 2 = 53 + 0;
- 53 ÷ 2 = 26 + 1;
- 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.
14 304 249 491(10) = 11 0101 0100 1001 1001 1000 0110 1001 0011(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 14 304 249 491(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.