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;
- 110 111 101 019 ÷ 2 = 55 055 550 509 + 1;
- 55 055 550 509 ÷ 2 = 27 527 775 254 + 1;
- 27 527 775 254 ÷ 2 = 13 763 887 627 + 0;
- 13 763 887 627 ÷ 2 = 6 881 943 813 + 1;
- 6 881 943 813 ÷ 2 = 3 440 971 906 + 1;
- 3 440 971 906 ÷ 2 = 1 720 485 953 + 0;
- 1 720 485 953 ÷ 2 = 860 242 976 + 1;
- 860 242 976 ÷ 2 = 430 121 488 + 0;
- 430 121 488 ÷ 2 = 215 060 744 + 0;
- 215 060 744 ÷ 2 = 107 530 372 + 0;
- 107 530 372 ÷ 2 = 53 765 186 + 0;
- 53 765 186 ÷ 2 = 26 882 593 + 0;
- 26 882 593 ÷ 2 = 13 441 296 + 1;
- 13 441 296 ÷ 2 = 6 720 648 + 0;
- 6 720 648 ÷ 2 = 3 360 324 + 0;
- 3 360 324 ÷ 2 = 1 680 162 + 0;
- 1 680 162 ÷ 2 = 840 081 + 0;
- 840 081 ÷ 2 = 420 040 + 1;
- 420 040 ÷ 2 = 210 020 + 0;
- 210 020 ÷ 2 = 105 010 + 0;
- 105 010 ÷ 2 = 52 505 + 0;
- 52 505 ÷ 2 = 26 252 + 1;
- 26 252 ÷ 2 = 13 126 + 0;
- 13 126 ÷ 2 = 6 563 + 0;
- 6 563 ÷ 2 = 3 281 + 1;
- 3 281 ÷ 2 = 1 640 + 1;
- 1 640 ÷ 2 = 820 + 0;
- 820 ÷ 2 = 410 + 0;
- 410 ÷ 2 = 205 + 0;
- 205 ÷ 2 = 102 + 1;
- 102 ÷ 2 = 51 + 0;
- 51 ÷ 2 = 25 + 1;
- 25 ÷ 2 = 12 + 1;
- 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.
110 111 101 019(10) = 1 1001 1010 0011 0010 0010 0001 0000 0101 1011(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 37.
- 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, 37,
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 110 111 101 019(10) converted to signed binary in one's complement representation: