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 010 101 010 457 ÷ 2 = 5 505 050 505 228 + 1;
- 5 505 050 505 228 ÷ 2 = 2 752 525 252 614 + 0;
- 2 752 525 252 614 ÷ 2 = 1 376 262 626 307 + 0;
- 1 376 262 626 307 ÷ 2 = 688 131 313 153 + 1;
- 688 131 313 153 ÷ 2 = 344 065 656 576 + 1;
- 344 065 656 576 ÷ 2 = 172 032 828 288 + 0;
- 172 032 828 288 ÷ 2 = 86 016 414 144 + 0;
- 86 016 414 144 ÷ 2 = 43 008 207 072 + 0;
- 43 008 207 072 ÷ 2 = 21 504 103 536 + 0;
- 21 504 103 536 ÷ 2 = 10 752 051 768 + 0;
- 10 752 051 768 ÷ 2 = 5 376 025 884 + 0;
- 5 376 025 884 ÷ 2 = 2 688 012 942 + 0;
- 2 688 012 942 ÷ 2 = 1 344 006 471 + 0;
- 1 344 006 471 ÷ 2 = 672 003 235 + 1;
- 672 003 235 ÷ 2 = 336 001 617 + 1;
- 336 001 617 ÷ 2 = 168 000 808 + 1;
- 168 000 808 ÷ 2 = 84 000 404 + 0;
- 84 000 404 ÷ 2 = 42 000 202 + 0;
- 42 000 202 ÷ 2 = 21 000 101 + 0;
- 21 000 101 ÷ 2 = 10 500 050 + 1;
- 10 500 050 ÷ 2 = 5 250 025 + 0;
- 5 250 025 ÷ 2 = 2 625 012 + 1;
- 2 625 012 ÷ 2 = 1 312 506 + 0;
- 1 312 506 ÷ 2 = 656 253 + 0;
- 656 253 ÷ 2 = 328 126 + 1;
- 328 126 ÷ 2 = 164 063 + 0;
- 164 063 ÷ 2 = 82 031 + 1;
- 82 031 ÷ 2 = 41 015 + 1;
- 41 015 ÷ 2 = 20 507 + 1;
- 20 507 ÷ 2 = 10 253 + 1;
- 10 253 ÷ 2 = 5 126 + 1;
- 5 126 ÷ 2 = 2 563 + 0;
- 2 563 ÷ 2 = 1 281 + 1;
- 1 281 ÷ 2 = 640 + 1;
- 640 ÷ 2 = 320 + 0;
- 320 ÷ 2 = 160 + 0;
- 160 ÷ 2 = 80 + 0;
- 80 ÷ 2 = 40 + 0;
- 40 ÷ 2 = 20 + 0;
- 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 010 101 010 457(10) = 1010 0000 0011 0111 1101 0010 1000 1110 0000 0001 1001(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 44.
- 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, 44,
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 010 101 010 457(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.