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;
- 974 294 967 562 ÷ 2 = 487 147 483 781 + 0;
- 487 147 483 781 ÷ 2 = 243 573 741 890 + 1;
- 243 573 741 890 ÷ 2 = 121 786 870 945 + 0;
- 121 786 870 945 ÷ 2 = 60 893 435 472 + 1;
- 60 893 435 472 ÷ 2 = 30 446 717 736 + 0;
- 30 446 717 736 ÷ 2 = 15 223 358 868 + 0;
- 15 223 358 868 ÷ 2 = 7 611 679 434 + 0;
- 7 611 679 434 ÷ 2 = 3 805 839 717 + 0;
- 3 805 839 717 ÷ 2 = 1 902 919 858 + 1;
- 1 902 919 858 ÷ 2 = 951 459 929 + 0;
- 951 459 929 ÷ 2 = 475 729 964 + 1;
- 475 729 964 ÷ 2 = 237 864 982 + 0;
- 237 864 982 ÷ 2 = 118 932 491 + 0;
- 118 932 491 ÷ 2 = 59 466 245 + 1;
- 59 466 245 ÷ 2 = 29 733 122 + 1;
- 29 733 122 ÷ 2 = 14 866 561 + 0;
- 14 866 561 ÷ 2 = 7 433 280 + 1;
- 7 433 280 ÷ 2 = 3 716 640 + 0;
- 3 716 640 ÷ 2 = 1 858 320 + 0;
- 1 858 320 ÷ 2 = 929 160 + 0;
- 929 160 ÷ 2 = 464 580 + 0;
- 464 580 ÷ 2 = 232 290 + 0;
- 232 290 ÷ 2 = 116 145 + 0;
- 116 145 ÷ 2 = 58 072 + 1;
- 58 072 ÷ 2 = 29 036 + 0;
- 29 036 ÷ 2 = 14 518 + 0;
- 14 518 ÷ 2 = 7 259 + 0;
- 7 259 ÷ 2 = 3 629 + 1;
- 3 629 ÷ 2 = 1 814 + 1;
- 1 814 ÷ 2 = 907 + 0;
- 907 ÷ 2 = 453 + 1;
- 453 ÷ 2 = 226 + 1;
- 226 ÷ 2 = 113 + 0;
- 113 ÷ 2 = 56 + 1;
- 56 ÷ 2 = 28 + 0;
- 28 ÷ 2 = 14 + 0;
- 14 ÷ 2 = 7 + 0;
- 7 ÷ 2 = 3 + 1;
- 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.
974 294 967 562(10) = 1110 0010 1101 1000 1000 0001 0110 0101 0000 1010(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 974 294 967 562(10) converted to signed binary in one's complement representation: