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 367 ÷ 2 = 55 505 050 683 + 1;
- 55 505 050 683 ÷ 2 = 27 752 525 341 + 1;
- 27 752 525 341 ÷ 2 = 13 876 262 670 + 1;
- 13 876 262 670 ÷ 2 = 6 938 131 335 + 0;
- 6 938 131 335 ÷ 2 = 3 469 065 667 + 1;
- 3 469 065 667 ÷ 2 = 1 734 532 833 + 1;
- 1 734 532 833 ÷ 2 = 867 266 416 + 1;
- 867 266 416 ÷ 2 = 433 633 208 + 0;
- 433 633 208 ÷ 2 = 216 816 604 + 0;
- 216 816 604 ÷ 2 = 108 408 302 + 0;
- 108 408 302 ÷ 2 = 54 204 151 + 0;
- 54 204 151 ÷ 2 = 27 102 075 + 1;
- 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 367(10) = 1 1001 1101 1000 1011 0111 1011 1000 0111 0111(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 367(10) converted to signed binary in one's complement representation: