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;
- 1 100 001 111 011 234 ÷ 2 = 550 000 555 505 617 + 0;
- 550 000 555 505 617 ÷ 2 = 275 000 277 752 808 + 1;
- 275 000 277 752 808 ÷ 2 = 137 500 138 876 404 + 0;
- 137 500 138 876 404 ÷ 2 = 68 750 069 438 202 + 0;
- 68 750 069 438 202 ÷ 2 = 34 375 034 719 101 + 0;
- 34 375 034 719 101 ÷ 2 = 17 187 517 359 550 + 1;
- 17 187 517 359 550 ÷ 2 = 8 593 758 679 775 + 0;
- 8 593 758 679 775 ÷ 2 = 4 296 879 339 887 + 1;
- 4 296 879 339 887 ÷ 2 = 2 148 439 669 943 + 1;
- 2 148 439 669 943 ÷ 2 = 1 074 219 834 971 + 1;
- 1 074 219 834 971 ÷ 2 = 537 109 917 485 + 1;
- 537 109 917 485 ÷ 2 = 268 554 958 742 + 1;
- 268 554 958 742 ÷ 2 = 134 277 479 371 + 0;
- 134 277 479 371 ÷ 2 = 67 138 739 685 + 1;
- 67 138 739 685 ÷ 2 = 33 569 369 842 + 1;
- 33 569 369 842 ÷ 2 = 16 784 684 921 + 0;
- 16 784 684 921 ÷ 2 = 8 392 342 460 + 1;
- 8 392 342 460 ÷ 2 = 4 196 171 230 + 0;
- 4 196 171 230 ÷ 2 = 2 098 085 615 + 0;
- 2 098 085 615 ÷ 2 = 1 049 042 807 + 1;
- 1 049 042 807 ÷ 2 = 524 521 403 + 1;
- 524 521 403 ÷ 2 = 262 260 701 + 1;
- 262 260 701 ÷ 2 = 131 130 350 + 1;
- 131 130 350 ÷ 2 = 65 565 175 + 0;
- 65 565 175 ÷ 2 = 32 782 587 + 1;
- 32 782 587 ÷ 2 = 16 391 293 + 1;
- 16 391 293 ÷ 2 = 8 195 646 + 1;
- 8 195 646 ÷ 2 = 4 097 823 + 0;
- 4 097 823 ÷ 2 = 2 048 911 + 1;
- 2 048 911 ÷ 2 = 1 024 455 + 1;
- 1 024 455 ÷ 2 = 512 227 + 1;
- 512 227 ÷ 2 = 256 113 + 1;
- 256 113 ÷ 2 = 128 056 + 1;
- 128 056 ÷ 2 = 64 028 + 0;
- 64 028 ÷ 2 = 32 014 + 0;
- 32 014 ÷ 2 = 16 007 + 0;
- 16 007 ÷ 2 = 8 003 + 1;
- 8 003 ÷ 2 = 4 001 + 1;
- 4 001 ÷ 2 = 2 000 + 1;
- 2 000 ÷ 2 = 1 000 + 0;
- 1 000 ÷ 2 = 500 + 0;
- 500 ÷ 2 = 250 + 0;
- 250 ÷ 2 = 125 + 0;
- 125 ÷ 2 = 62 + 1;
- 62 ÷ 2 = 31 + 0;
- 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.
1 100 001 111 011 234(10) = 11 1110 1000 0111 0001 1111 0111 0111 1001 0110 1111 1010 0010(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 50.
- 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, 50,
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 1 100 001 111 011 234(10) converted to signed binary in two's complement representation:
Spaces were used to group digits: for binary, by 4, for decimal, by 3.