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;
- 234 568 752 ÷ 2 = 117 284 376 + 0;
- 117 284 376 ÷ 2 = 58 642 188 + 0;
- 58 642 188 ÷ 2 = 29 321 094 + 0;
- 29 321 094 ÷ 2 = 14 660 547 + 0;
- 14 660 547 ÷ 2 = 7 330 273 + 1;
- 7 330 273 ÷ 2 = 3 665 136 + 1;
- 3 665 136 ÷ 2 = 1 832 568 + 0;
- 1 832 568 ÷ 2 = 916 284 + 0;
- 916 284 ÷ 2 = 458 142 + 0;
- 458 142 ÷ 2 = 229 071 + 0;
- 229 071 ÷ 2 = 114 535 + 1;
- 114 535 ÷ 2 = 57 267 + 1;
- 57 267 ÷ 2 = 28 633 + 1;
- 28 633 ÷ 2 = 14 316 + 1;
- 14 316 ÷ 2 = 7 158 + 0;
- 7 158 ÷ 2 = 3 579 + 0;
- 3 579 ÷ 2 = 1 789 + 1;
- 1 789 ÷ 2 = 894 + 1;
- 894 ÷ 2 = 447 + 0;
- 447 ÷ 2 = 223 + 1;
- 223 ÷ 2 = 111 + 1;
- 111 ÷ 2 = 55 + 1;
- 55 ÷ 2 = 27 + 1;
- 27 ÷ 2 = 13 + 1;
- 13 ÷ 2 = 6 + 1;
- 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.
234 568 752(10) = 1101 1111 1011 0011 1100 0011 0000(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 28.
- 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, 28,
3) so that the first bit (leftmost) could be zero
(we deal with a positive number at this moment)
=== is: 32.
4. Get the positive binary computer representation on 32 bits (4 Bytes):
If needed, add extra 0s in front (to the left) of the base 2 number, up to the required length, 32.
Decimal Number 234 568 752(10) converted to signed binary in one's complement representation: