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;
- 11 011 111 081 ÷ 2 = 5 505 555 540 + 1;
- 5 505 555 540 ÷ 2 = 2 752 777 770 + 0;
- 2 752 777 770 ÷ 2 = 1 376 388 885 + 0;
- 1 376 388 885 ÷ 2 = 688 194 442 + 1;
- 688 194 442 ÷ 2 = 344 097 221 + 0;
- 344 097 221 ÷ 2 = 172 048 610 + 1;
- 172 048 610 ÷ 2 = 86 024 305 + 0;
- 86 024 305 ÷ 2 = 43 012 152 + 1;
- 43 012 152 ÷ 2 = 21 506 076 + 0;
- 21 506 076 ÷ 2 = 10 753 038 + 0;
- 10 753 038 ÷ 2 = 5 376 519 + 0;
- 5 376 519 ÷ 2 = 2 688 259 + 1;
- 2 688 259 ÷ 2 = 1 344 129 + 1;
- 1 344 129 ÷ 2 = 672 064 + 1;
- 672 064 ÷ 2 = 336 032 + 0;
- 336 032 ÷ 2 = 168 016 + 0;
- 168 016 ÷ 2 = 84 008 + 0;
- 84 008 ÷ 2 = 42 004 + 0;
- 42 004 ÷ 2 = 21 002 + 0;
- 21 002 ÷ 2 = 10 501 + 0;
- 10 501 ÷ 2 = 5 250 + 1;
- 5 250 ÷ 2 = 2 625 + 0;
- 2 625 ÷ 2 = 1 312 + 1;
- 1 312 ÷ 2 = 656 + 0;
- 656 ÷ 2 = 328 + 0;
- 328 ÷ 2 = 164 + 0;
- 164 ÷ 2 = 82 + 0;
- 82 ÷ 2 = 41 + 0;
- 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.
11 011 111 081(10) = 10 1001 0000 0101 0000 0011 1000 1010 1001(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 34.
- 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, 34,
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 11 011 111 081(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.