1. Divide the number repeatedly by 2:
Keep track of each remainder.
We stop when we get a quotient that is equal to zero.
- division = quotient + remainder;
- 88 000 034 ÷ 2 = 44 000 017 + 0;
- 44 000 017 ÷ 2 = 22 000 008 + 1;
- 22 000 008 ÷ 2 = 11 000 004 + 0;
- 11 000 004 ÷ 2 = 5 500 002 + 0;
- 5 500 002 ÷ 2 = 2 750 001 + 0;
- 2 750 001 ÷ 2 = 1 375 000 + 1;
- 1 375 000 ÷ 2 = 687 500 + 0;
- 687 500 ÷ 2 = 343 750 + 0;
- 343 750 ÷ 2 = 171 875 + 0;
- 171 875 ÷ 2 = 85 937 + 1;
- 85 937 ÷ 2 = 42 968 + 1;
- 42 968 ÷ 2 = 21 484 + 0;
- 21 484 ÷ 2 = 10 742 + 0;
- 10 742 ÷ 2 = 5 371 + 0;
- 5 371 ÷ 2 = 2 685 + 1;
- 2 685 ÷ 2 = 1 342 + 1;
- 1 342 ÷ 2 = 671 + 0;
- 671 ÷ 2 = 335 + 1;
- 335 ÷ 2 = 167 + 1;
- 167 ÷ 2 = 83 + 1;
- 83 ÷ 2 = 41 + 1;
- 41 ÷ 2 = 20 + 1;
- 20 ÷ 2 = 10 + 0;
- 10 ÷ 2 = 5 + 0;
- 5 ÷ 2 = 2 + 1;
- 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.
88 000 034(10) = 101 0011 1110 1100 0110 0010 0010(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 27.
- 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, 27,
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 88 000 034(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.