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;
- 34 056 995 640 531 ÷ 2 = 17 028 497 820 265 + 1;
- 17 028 497 820 265 ÷ 2 = 8 514 248 910 132 + 1;
- 8 514 248 910 132 ÷ 2 = 4 257 124 455 066 + 0;
- 4 257 124 455 066 ÷ 2 = 2 128 562 227 533 + 0;
- 2 128 562 227 533 ÷ 2 = 1 064 281 113 766 + 1;
- 1 064 281 113 766 ÷ 2 = 532 140 556 883 + 0;
- 532 140 556 883 ÷ 2 = 266 070 278 441 + 1;
- 266 070 278 441 ÷ 2 = 133 035 139 220 + 1;
- 133 035 139 220 ÷ 2 = 66 517 569 610 + 0;
- 66 517 569 610 ÷ 2 = 33 258 784 805 + 0;
- 33 258 784 805 ÷ 2 = 16 629 392 402 + 1;
- 16 629 392 402 ÷ 2 = 8 314 696 201 + 0;
- 8 314 696 201 ÷ 2 = 4 157 348 100 + 1;
- 4 157 348 100 ÷ 2 = 2 078 674 050 + 0;
- 2 078 674 050 ÷ 2 = 1 039 337 025 + 0;
- 1 039 337 025 ÷ 2 = 519 668 512 + 1;
- 519 668 512 ÷ 2 = 259 834 256 + 0;
- 259 834 256 ÷ 2 = 129 917 128 + 0;
- 129 917 128 ÷ 2 = 64 958 564 + 0;
- 64 958 564 ÷ 2 = 32 479 282 + 0;
- 32 479 282 ÷ 2 = 16 239 641 + 0;
- 16 239 641 ÷ 2 = 8 119 820 + 1;
- 8 119 820 ÷ 2 = 4 059 910 + 0;
- 4 059 910 ÷ 2 = 2 029 955 + 0;
- 2 029 955 ÷ 2 = 1 014 977 + 1;
- 1 014 977 ÷ 2 = 507 488 + 1;
- 507 488 ÷ 2 = 253 744 + 0;
- 253 744 ÷ 2 = 126 872 + 0;
- 126 872 ÷ 2 = 63 436 + 0;
- 63 436 ÷ 2 = 31 718 + 0;
- 31 718 ÷ 2 = 15 859 + 0;
- 15 859 ÷ 2 = 7 929 + 1;
- 7 929 ÷ 2 = 3 964 + 1;
- 3 964 ÷ 2 = 1 982 + 0;
- 1 982 ÷ 2 = 991 + 0;
- 991 ÷ 2 = 495 + 1;
- 495 ÷ 2 = 247 + 1;
- 247 ÷ 2 = 123 + 1;
- 123 ÷ 2 = 61 + 1;
- 61 ÷ 2 = 30 + 1;
- 30 ÷ 2 = 15 + 0;
- 15 ÷ 2 = 7 + 1;
- 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.
34 056 995 640 531(10) = 1 1110 1111 1001 1000 0011 0010 0000 1001 0100 1101 0011(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 45.
- 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, 45,
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 34 056 995 640 531(10) converted to signed binary in one's complement representation: