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;
- 26 087 112 621 ÷ 2 = 13 043 556 310 + 1;
- 13 043 556 310 ÷ 2 = 6 521 778 155 + 0;
- 6 521 778 155 ÷ 2 = 3 260 889 077 + 1;
- 3 260 889 077 ÷ 2 = 1 630 444 538 + 1;
- 1 630 444 538 ÷ 2 = 815 222 269 + 0;
- 815 222 269 ÷ 2 = 407 611 134 + 1;
- 407 611 134 ÷ 2 = 203 805 567 + 0;
- 203 805 567 ÷ 2 = 101 902 783 + 1;
- 101 902 783 ÷ 2 = 50 951 391 + 1;
- 50 951 391 ÷ 2 = 25 475 695 + 1;
- 25 475 695 ÷ 2 = 12 737 847 + 1;
- 12 737 847 ÷ 2 = 6 368 923 + 1;
- 6 368 923 ÷ 2 = 3 184 461 + 1;
- 3 184 461 ÷ 2 = 1 592 230 + 1;
- 1 592 230 ÷ 2 = 796 115 + 0;
- 796 115 ÷ 2 = 398 057 + 1;
- 398 057 ÷ 2 = 199 028 + 1;
- 199 028 ÷ 2 = 99 514 + 0;
- 99 514 ÷ 2 = 49 757 + 0;
- 49 757 ÷ 2 = 24 878 + 1;
- 24 878 ÷ 2 = 12 439 + 0;
- 12 439 ÷ 2 = 6 219 + 1;
- 6 219 ÷ 2 = 3 109 + 1;
- 3 109 ÷ 2 = 1 554 + 1;
- 1 554 ÷ 2 = 777 + 0;
- 777 ÷ 2 = 388 + 1;
- 388 ÷ 2 = 194 + 0;
- 194 ÷ 2 = 97 + 0;
- 97 ÷ 2 = 48 + 1;
- 48 ÷ 2 = 24 + 0;
- 24 ÷ 2 = 12 + 0;
- 12 ÷ 2 = 6 + 0;
- 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.
26 087 112 621(10) = 110 0001 0010 1110 1001 1011 1111 1010 1101(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 35.
- 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, 35,
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 26 087 112 621(10) converted to signed binary in one's complement representation: