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;
- 111 010 101 035 ÷ 2 = 55 505 050 517 + 1;
- 55 505 050 517 ÷ 2 = 27 752 525 258 + 1;
- 27 752 525 258 ÷ 2 = 13 876 262 629 + 0;
- 13 876 262 629 ÷ 2 = 6 938 131 314 + 1;
- 6 938 131 314 ÷ 2 = 3 469 065 657 + 0;
- 3 469 065 657 ÷ 2 = 1 734 532 828 + 1;
- 1 734 532 828 ÷ 2 = 867 266 414 + 0;
- 867 266 414 ÷ 2 = 433 633 207 + 0;
- 433 633 207 ÷ 2 = 216 816 603 + 1;
- 216 816 603 ÷ 2 = 108 408 301 + 1;
- 108 408 301 ÷ 2 = 54 204 150 + 1;
- 54 204 150 ÷ 2 = 27 102 075 + 0;
- 27 102 075 ÷ 2 = 13 551 037 + 1;
- 13 551 037 ÷ 2 = 6 775 518 + 1;
- 6 775 518 ÷ 2 = 3 387 759 + 0;
- 3 387 759 ÷ 2 = 1 693 879 + 1;
- 1 693 879 ÷ 2 = 846 939 + 1;
- 846 939 ÷ 2 = 423 469 + 1;
- 423 469 ÷ 2 = 211 734 + 1;
- 211 734 ÷ 2 = 105 867 + 0;
- 105 867 ÷ 2 = 52 933 + 1;
- 52 933 ÷ 2 = 26 466 + 1;
- 26 466 ÷ 2 = 13 233 + 0;
- 13 233 ÷ 2 = 6 616 + 1;
- 6 616 ÷ 2 = 3 308 + 0;
- 3 308 ÷ 2 = 1 654 + 0;
- 1 654 ÷ 2 = 827 + 0;
- 827 ÷ 2 = 413 + 1;
- 413 ÷ 2 = 206 + 1;
- 206 ÷ 2 = 103 + 0;
- 103 ÷ 2 = 51 + 1;
- 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.
111 010 101 035(10) = 1 1001 1101 1000 1011 0111 1011 0111 0010 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 111 010 101 035(10) converted to signed binary in one's complement representation: