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;
- 2 316 632 329 ÷ 2 = 1 158 316 164 + 1;
- 1 158 316 164 ÷ 2 = 579 158 082 + 0;
- 579 158 082 ÷ 2 = 289 579 041 + 0;
- 289 579 041 ÷ 2 = 144 789 520 + 1;
- 144 789 520 ÷ 2 = 72 394 760 + 0;
- 72 394 760 ÷ 2 = 36 197 380 + 0;
- 36 197 380 ÷ 2 = 18 098 690 + 0;
- 18 098 690 ÷ 2 = 9 049 345 + 0;
- 9 049 345 ÷ 2 = 4 524 672 + 1;
- 4 524 672 ÷ 2 = 2 262 336 + 0;
- 2 262 336 ÷ 2 = 1 131 168 + 0;
- 1 131 168 ÷ 2 = 565 584 + 0;
- 565 584 ÷ 2 = 282 792 + 0;
- 282 792 ÷ 2 = 141 396 + 0;
- 141 396 ÷ 2 = 70 698 + 0;
- 70 698 ÷ 2 = 35 349 + 0;
- 35 349 ÷ 2 = 17 674 + 1;
- 17 674 ÷ 2 = 8 837 + 0;
- 8 837 ÷ 2 = 4 418 + 1;
- 4 418 ÷ 2 = 2 209 + 0;
- 2 209 ÷ 2 = 1 104 + 1;
- 1 104 ÷ 2 = 552 + 0;
- 552 ÷ 2 = 276 + 0;
- 276 ÷ 2 = 138 + 0;
- 138 ÷ 2 = 69 + 0;
- 69 ÷ 2 = 34 + 1;
- 34 ÷ 2 = 17 + 0;
- 17 ÷ 2 = 8 + 1;
- 8 ÷ 2 = 4 + 0;
- 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 316 632 329(10) = 1000 1010 0001 0101 0000 0001 0000 1001(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 316 632 329(10) converted to signed binary in one's complement representation: