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 125 420 569 ÷ 2 = 1 062 710 284 + 1;
- 1 062 710 284 ÷ 2 = 531 355 142 + 0;
- 531 355 142 ÷ 2 = 265 677 571 + 0;
- 265 677 571 ÷ 2 = 132 838 785 + 1;
- 132 838 785 ÷ 2 = 66 419 392 + 1;
- 66 419 392 ÷ 2 = 33 209 696 + 0;
- 33 209 696 ÷ 2 = 16 604 848 + 0;
- 16 604 848 ÷ 2 = 8 302 424 + 0;
- 8 302 424 ÷ 2 = 4 151 212 + 0;
- 4 151 212 ÷ 2 = 2 075 606 + 0;
- 2 075 606 ÷ 2 = 1 037 803 + 0;
- 1 037 803 ÷ 2 = 518 901 + 1;
- 518 901 ÷ 2 = 259 450 + 1;
- 259 450 ÷ 2 = 129 725 + 0;
- 129 725 ÷ 2 = 64 862 + 1;
- 64 862 ÷ 2 = 32 431 + 0;
- 32 431 ÷ 2 = 16 215 + 1;
- 16 215 ÷ 2 = 8 107 + 1;
- 8 107 ÷ 2 = 4 053 + 1;
- 4 053 ÷ 2 = 2 026 + 1;
- 2 026 ÷ 2 = 1 013 + 0;
- 1 013 ÷ 2 = 506 + 1;
- 506 ÷ 2 = 253 + 0;
- 253 ÷ 2 = 126 + 1;
- 126 ÷ 2 = 63 + 0;
- 63 ÷ 2 = 31 + 1;
- 31 ÷ 2 = 15 + 1;
- 15 ÷ 2 = 7 + 1;
- 7 ÷ 2 = 3 + 1;
- 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.
2 125 420 569(10) = 111 1110 1010 1111 0101 1000 0001 1001(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 31.
- 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, 31,
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 2 125 420 569(10) converted to signed binary in one's complement representation: