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;
- 2 740 293 748 650 ÷ 2 = 1 370 146 874 325 + 0;
- 1 370 146 874 325 ÷ 2 = 685 073 437 162 + 1;
- 685 073 437 162 ÷ 2 = 342 536 718 581 + 0;
- 342 536 718 581 ÷ 2 = 171 268 359 290 + 1;
- 171 268 359 290 ÷ 2 = 85 634 179 645 + 0;
- 85 634 179 645 ÷ 2 = 42 817 089 822 + 1;
- 42 817 089 822 ÷ 2 = 21 408 544 911 + 0;
- 21 408 544 911 ÷ 2 = 10 704 272 455 + 1;
- 10 704 272 455 ÷ 2 = 5 352 136 227 + 1;
- 5 352 136 227 ÷ 2 = 2 676 068 113 + 1;
- 2 676 068 113 ÷ 2 = 1 338 034 056 + 1;
- 1 338 034 056 ÷ 2 = 669 017 028 + 0;
- 669 017 028 ÷ 2 = 334 508 514 + 0;
- 334 508 514 ÷ 2 = 167 254 257 + 0;
- 167 254 257 ÷ 2 = 83 627 128 + 1;
- 83 627 128 ÷ 2 = 41 813 564 + 0;
- 41 813 564 ÷ 2 = 20 906 782 + 0;
- 20 906 782 ÷ 2 = 10 453 391 + 0;
- 10 453 391 ÷ 2 = 5 226 695 + 1;
- 5 226 695 ÷ 2 = 2 613 347 + 1;
- 2 613 347 ÷ 2 = 1 306 673 + 1;
- 1 306 673 ÷ 2 = 653 336 + 1;
- 653 336 ÷ 2 = 326 668 + 0;
- 326 668 ÷ 2 = 163 334 + 0;
- 163 334 ÷ 2 = 81 667 + 0;
- 81 667 ÷ 2 = 40 833 + 1;
- 40 833 ÷ 2 = 20 416 + 1;
- 20 416 ÷ 2 = 10 208 + 0;
- 10 208 ÷ 2 = 5 104 + 0;
- 5 104 ÷ 2 = 2 552 + 0;
- 2 552 ÷ 2 = 1 276 + 0;
- 1 276 ÷ 2 = 638 + 0;
- 638 ÷ 2 = 319 + 0;
- 319 ÷ 2 = 159 + 1;
- 159 ÷ 2 = 79 + 1;
- 79 ÷ 2 = 39 + 1;
- 39 ÷ 2 = 19 + 1;
- 19 ÷ 2 = 9 + 1;
- 9 ÷ 2 = 4 + 1;
- 4 ÷ 2 = 2 + 0;
- 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.
2 740 293 748 650(10) = 10 0111 1110 0000 0110 0011 1100 0100 0111 1010 1010(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 42.
- 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, 42,
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 2 740 293 748 650(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.