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 483 420 901 ÷ 2 = 1 241 710 450 + 1;
- 1 241 710 450 ÷ 2 = 620 855 225 + 0;
- 620 855 225 ÷ 2 = 310 427 612 + 1;
- 310 427 612 ÷ 2 = 155 213 806 + 0;
- 155 213 806 ÷ 2 = 77 606 903 + 0;
- 77 606 903 ÷ 2 = 38 803 451 + 1;
- 38 803 451 ÷ 2 = 19 401 725 + 1;
- 19 401 725 ÷ 2 = 9 700 862 + 1;
- 9 700 862 ÷ 2 = 4 850 431 + 0;
- 4 850 431 ÷ 2 = 2 425 215 + 1;
- 2 425 215 ÷ 2 = 1 212 607 + 1;
- 1 212 607 ÷ 2 = 606 303 + 1;
- 606 303 ÷ 2 = 303 151 + 1;
- 303 151 ÷ 2 = 151 575 + 1;
- 151 575 ÷ 2 = 75 787 + 1;
- 75 787 ÷ 2 = 37 893 + 1;
- 37 893 ÷ 2 = 18 946 + 1;
- 18 946 ÷ 2 = 9 473 + 0;
- 9 473 ÷ 2 = 4 736 + 1;
- 4 736 ÷ 2 = 2 368 + 0;
- 2 368 ÷ 2 = 1 184 + 0;
- 1 184 ÷ 2 = 592 + 0;
- 592 ÷ 2 = 296 + 0;
- 296 ÷ 2 = 148 + 0;
- 148 ÷ 2 = 74 + 0;
- 74 ÷ 2 = 37 + 0;
- 37 ÷ 2 = 18 + 1;
- 18 ÷ 2 = 9 + 0;
- 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 483 420 901(10) = 1001 0100 0000 0101 1111 1110 1110 0101(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 32.
- 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, 32,
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 483 420 901(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.