What are the required steps to convert base 10 integer
number 439 397 866 167 862 094 to signed binary code (in base 2)?
- A signed integer, written in base ten, or a decimal system number, is a number written using the digits 0 through 9 and the sign, which can be positive (+) or negative (-). If positive, the sign is usually not written. A number written in base two, or binary, is a number written using only the digits 0 and 1.
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;
- 439 397 866 167 862 094 ÷ 2 = 219 698 933 083 931 047 + 0;
- 219 698 933 083 931 047 ÷ 2 = 109 849 466 541 965 523 + 1;
- 109 849 466 541 965 523 ÷ 2 = 54 924 733 270 982 761 + 1;
- 54 924 733 270 982 761 ÷ 2 = 27 462 366 635 491 380 + 1;
- 27 462 366 635 491 380 ÷ 2 = 13 731 183 317 745 690 + 0;
- 13 731 183 317 745 690 ÷ 2 = 6 865 591 658 872 845 + 0;
- 6 865 591 658 872 845 ÷ 2 = 3 432 795 829 436 422 + 1;
- 3 432 795 829 436 422 ÷ 2 = 1 716 397 914 718 211 + 0;
- 1 716 397 914 718 211 ÷ 2 = 858 198 957 359 105 + 1;
- 858 198 957 359 105 ÷ 2 = 429 099 478 679 552 + 1;
- 429 099 478 679 552 ÷ 2 = 214 549 739 339 776 + 0;
- 214 549 739 339 776 ÷ 2 = 107 274 869 669 888 + 0;
- 107 274 869 669 888 ÷ 2 = 53 637 434 834 944 + 0;
- 53 637 434 834 944 ÷ 2 = 26 818 717 417 472 + 0;
- 26 818 717 417 472 ÷ 2 = 13 409 358 708 736 + 0;
- 13 409 358 708 736 ÷ 2 = 6 704 679 354 368 + 0;
- 6 704 679 354 368 ÷ 2 = 3 352 339 677 184 + 0;
- 3 352 339 677 184 ÷ 2 = 1 676 169 838 592 + 0;
- 1 676 169 838 592 ÷ 2 = 838 084 919 296 + 0;
- 838 084 919 296 ÷ 2 = 419 042 459 648 + 0;
- 419 042 459 648 ÷ 2 = 209 521 229 824 + 0;
- 209 521 229 824 ÷ 2 = 104 760 614 912 + 0;
- 104 760 614 912 ÷ 2 = 52 380 307 456 + 0;
- 52 380 307 456 ÷ 2 = 26 190 153 728 + 0;
- 26 190 153 728 ÷ 2 = 13 095 076 864 + 0;
- 13 095 076 864 ÷ 2 = 6 547 538 432 + 0;
- 6 547 538 432 ÷ 2 = 3 273 769 216 + 0;
- 3 273 769 216 ÷ 2 = 1 636 884 608 + 0;
- 1 636 884 608 ÷ 2 = 818 442 304 + 0;
- 818 442 304 ÷ 2 = 409 221 152 + 0;
- 409 221 152 ÷ 2 = 204 610 576 + 0;
- 204 610 576 ÷ 2 = 102 305 288 + 0;
- 102 305 288 ÷ 2 = 51 152 644 + 0;
- 51 152 644 ÷ 2 = 25 576 322 + 0;
- 25 576 322 ÷ 2 = 12 788 161 + 0;
- 12 788 161 ÷ 2 = 6 394 080 + 1;
- 6 394 080 ÷ 2 = 3 197 040 + 0;
- 3 197 040 ÷ 2 = 1 598 520 + 0;
- 1 598 520 ÷ 2 = 799 260 + 0;
- 799 260 ÷ 2 = 399 630 + 0;
- 399 630 ÷ 2 = 199 815 + 0;
- 199 815 ÷ 2 = 99 907 + 1;
- 99 907 ÷ 2 = 49 953 + 1;
- 49 953 ÷ 2 = 24 976 + 1;
- 24 976 ÷ 2 = 12 488 + 0;
- 12 488 ÷ 2 = 6 244 + 0;
- 6 244 ÷ 2 = 3 122 + 0;
- 3 122 ÷ 2 = 1 561 + 0;
- 1 561 ÷ 2 = 780 + 1;
- 780 ÷ 2 = 390 + 0;
- 390 ÷ 2 = 195 + 0;
- 195 ÷ 2 = 97 + 1;
- 97 ÷ 2 = 48 + 1;
- 48 ÷ 2 = 24 + 0;
- 24 ÷ 2 = 12 + 0;
- 12 ÷ 2 = 6 + 0;
- 6 ÷ 2 = 3 + 0;
- 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.
439 397 866 167 862 094(10) = 110 0001 1001 0000 1110 0000 1000 0000 0000 0000 0000 0000 0011 0100 1110(2)
3. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 59.
- 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, 59,
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:
439 397 866 167 862 094(10) Base 10 integer number converted and written as a signed binary code (in base 2):
439 397 866 167 862 094(10) = 0000 0110 0001 1001 0000 1110 0000 1000 0000 0000 0000 0000 0000 0011 0100 1110
Spaces were used to group digits: for binary, by 4, for decimal, by 3.