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;
- 7 284 270 382 040 ÷ 2 = 3 642 135 191 020 + 0;
- 3 642 135 191 020 ÷ 2 = 1 821 067 595 510 + 0;
- 1 821 067 595 510 ÷ 2 = 910 533 797 755 + 0;
- 910 533 797 755 ÷ 2 = 455 266 898 877 + 1;
- 455 266 898 877 ÷ 2 = 227 633 449 438 + 1;
- 227 633 449 438 ÷ 2 = 113 816 724 719 + 0;
- 113 816 724 719 ÷ 2 = 56 908 362 359 + 1;
- 56 908 362 359 ÷ 2 = 28 454 181 179 + 1;
- 28 454 181 179 ÷ 2 = 14 227 090 589 + 1;
- 14 227 090 589 ÷ 2 = 7 113 545 294 + 1;
- 7 113 545 294 ÷ 2 = 3 556 772 647 + 0;
- 3 556 772 647 ÷ 2 = 1 778 386 323 + 1;
- 1 778 386 323 ÷ 2 = 889 193 161 + 1;
- 889 193 161 ÷ 2 = 444 596 580 + 1;
- 444 596 580 ÷ 2 = 222 298 290 + 0;
- 222 298 290 ÷ 2 = 111 149 145 + 0;
- 111 149 145 ÷ 2 = 55 574 572 + 1;
- 55 574 572 ÷ 2 = 27 787 286 + 0;
- 27 787 286 ÷ 2 = 13 893 643 + 0;
- 13 893 643 ÷ 2 = 6 946 821 + 1;
- 6 946 821 ÷ 2 = 3 473 410 + 1;
- 3 473 410 ÷ 2 = 1 736 705 + 0;
- 1 736 705 ÷ 2 = 868 352 + 1;
- 868 352 ÷ 2 = 434 176 + 0;
- 434 176 ÷ 2 = 217 088 + 0;
- 217 088 ÷ 2 = 108 544 + 0;
- 108 544 ÷ 2 = 54 272 + 0;
- 54 272 ÷ 2 = 27 136 + 0;
- 27 136 ÷ 2 = 13 568 + 0;
- 13 568 ÷ 2 = 6 784 + 0;
- 6 784 ÷ 2 = 3 392 + 0;
- 3 392 ÷ 2 = 1 696 + 0;
- 1 696 ÷ 2 = 848 + 0;
- 848 ÷ 2 = 424 + 0;
- 424 ÷ 2 = 212 + 0;
- 212 ÷ 2 = 106 + 0;
- 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.
7 284 270 382 040(10) = 110 1010 0000 0000 0000 0101 1001 0011 1011 1101 1000(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 43.
- 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, 43,
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 7 284 270 382 040(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.