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;
- 19 232 255 296 ÷ 2 = 9 616 127 648 + 0;
- 9 616 127 648 ÷ 2 = 4 808 063 824 + 0;
- 4 808 063 824 ÷ 2 = 2 404 031 912 + 0;
- 2 404 031 912 ÷ 2 = 1 202 015 956 + 0;
- 1 202 015 956 ÷ 2 = 601 007 978 + 0;
- 601 007 978 ÷ 2 = 300 503 989 + 0;
- 300 503 989 ÷ 2 = 150 251 994 + 1;
- 150 251 994 ÷ 2 = 75 125 997 + 0;
- 75 125 997 ÷ 2 = 37 562 998 + 1;
- 37 562 998 ÷ 2 = 18 781 499 + 0;
- 18 781 499 ÷ 2 = 9 390 749 + 1;
- 9 390 749 ÷ 2 = 4 695 374 + 1;
- 4 695 374 ÷ 2 = 2 347 687 + 0;
- 2 347 687 ÷ 2 = 1 173 843 + 1;
- 1 173 843 ÷ 2 = 586 921 + 1;
- 586 921 ÷ 2 = 293 460 + 1;
- 293 460 ÷ 2 = 146 730 + 0;
- 146 730 ÷ 2 = 73 365 + 0;
- 73 365 ÷ 2 = 36 682 + 1;
- 36 682 ÷ 2 = 18 341 + 0;
- 18 341 ÷ 2 = 9 170 + 1;
- 9 170 ÷ 2 = 4 585 + 0;
- 4 585 ÷ 2 = 2 292 + 1;
- 2 292 ÷ 2 = 1 146 + 0;
- 1 146 ÷ 2 = 573 + 0;
- 573 ÷ 2 = 286 + 1;
- 286 ÷ 2 = 143 + 0;
- 143 ÷ 2 = 71 + 1;
- 71 ÷ 2 = 35 + 1;
- 35 ÷ 2 = 17 + 1;
- 17 ÷ 2 = 8 + 1;
- 8 ÷ 2 = 4 + 0;
- 4 ÷ 2 = 2 + 0;
- 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.
19 232 255 296(10) = 100 0111 1010 0101 0100 1110 1101 0100 0000(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 35.
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) is reserved for 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, 35,
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:
Number 19 232 255 296(10), a signed integer number (with sign),
converted from decimal system (from base 10)
and written as a signed binary (in base 2):
19 232 255 296(10) = 0000 0000 0000 0000 0000 0000 0000 0100 0111 1010 0101 0100 1110 1101 0100 0000
Spaces were used to group digits: for binary, by 4, for decimal, by 3.