What are the required steps to convert base 10 integer
number -596 193 517 951 012 567 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. Start with the positive version of the number:
|-596 193 517 951 012 567| = 596 193 517 951 012 567
2. 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;
- 596 193 517 951 012 567 ÷ 2 = 298 096 758 975 506 283 + 1;
- 298 096 758 975 506 283 ÷ 2 = 149 048 379 487 753 141 + 1;
- 149 048 379 487 753 141 ÷ 2 = 74 524 189 743 876 570 + 1;
- 74 524 189 743 876 570 ÷ 2 = 37 262 094 871 938 285 + 0;
- 37 262 094 871 938 285 ÷ 2 = 18 631 047 435 969 142 + 1;
- 18 631 047 435 969 142 ÷ 2 = 9 315 523 717 984 571 + 0;
- 9 315 523 717 984 571 ÷ 2 = 4 657 761 858 992 285 + 1;
- 4 657 761 858 992 285 ÷ 2 = 2 328 880 929 496 142 + 1;
- 2 328 880 929 496 142 ÷ 2 = 1 164 440 464 748 071 + 0;
- 1 164 440 464 748 071 ÷ 2 = 582 220 232 374 035 + 1;
- 582 220 232 374 035 ÷ 2 = 291 110 116 187 017 + 1;
- 291 110 116 187 017 ÷ 2 = 145 555 058 093 508 + 1;
- 145 555 058 093 508 ÷ 2 = 72 777 529 046 754 + 0;
- 72 777 529 046 754 ÷ 2 = 36 388 764 523 377 + 0;
- 36 388 764 523 377 ÷ 2 = 18 194 382 261 688 + 1;
- 18 194 382 261 688 ÷ 2 = 9 097 191 130 844 + 0;
- 9 097 191 130 844 ÷ 2 = 4 548 595 565 422 + 0;
- 4 548 595 565 422 ÷ 2 = 2 274 297 782 711 + 0;
- 2 274 297 782 711 ÷ 2 = 1 137 148 891 355 + 1;
- 1 137 148 891 355 ÷ 2 = 568 574 445 677 + 1;
- 568 574 445 677 ÷ 2 = 284 287 222 838 + 1;
- 284 287 222 838 ÷ 2 = 142 143 611 419 + 0;
- 142 143 611 419 ÷ 2 = 71 071 805 709 + 1;
- 71 071 805 709 ÷ 2 = 35 535 902 854 + 1;
- 35 535 902 854 ÷ 2 = 17 767 951 427 + 0;
- 17 767 951 427 ÷ 2 = 8 883 975 713 + 1;
- 8 883 975 713 ÷ 2 = 4 441 987 856 + 1;
- 4 441 987 856 ÷ 2 = 2 220 993 928 + 0;
- 2 220 993 928 ÷ 2 = 1 110 496 964 + 0;
- 1 110 496 964 ÷ 2 = 555 248 482 + 0;
- 555 248 482 ÷ 2 = 277 624 241 + 0;
- 277 624 241 ÷ 2 = 138 812 120 + 1;
- 138 812 120 ÷ 2 = 69 406 060 + 0;
- 69 406 060 ÷ 2 = 34 703 030 + 0;
- 34 703 030 ÷ 2 = 17 351 515 + 0;
- 17 351 515 ÷ 2 = 8 675 757 + 1;
- 8 675 757 ÷ 2 = 4 337 878 + 1;
- 4 337 878 ÷ 2 = 2 168 939 + 0;
- 2 168 939 ÷ 2 = 1 084 469 + 1;
- 1 084 469 ÷ 2 = 542 234 + 1;
- 542 234 ÷ 2 = 271 117 + 0;
- 271 117 ÷ 2 = 135 558 + 1;
- 135 558 ÷ 2 = 67 779 + 0;
- 67 779 ÷ 2 = 33 889 + 1;
- 33 889 ÷ 2 = 16 944 + 1;
- 16 944 ÷ 2 = 8 472 + 0;
- 8 472 ÷ 2 = 4 236 + 0;
- 4 236 ÷ 2 = 2 118 + 0;
- 2 118 ÷ 2 = 1 059 + 0;
- 1 059 ÷ 2 = 529 + 1;
- 529 ÷ 2 = 264 + 1;
- 264 ÷ 2 = 132 + 0;
- 132 ÷ 2 = 66 + 0;
- 66 ÷ 2 = 33 + 0;
- 33 ÷ 2 = 16 + 1;
- 16 ÷ 2 = 8 + 0;
- 8 ÷ 2 = 4 + 0;
- 4 ÷ 2 = 2 + 0;
- 2 ÷ 2 = 1 + 0;
- 1 ÷ 2 = 0 + 1;
3. Construct the base 2 representation of the positive number:
Take all the remainders starting from the bottom of the list constructed above.
596 193 517 951 012 567(10) = 1000 0100 0110 0001 1010 1101 1000 1000 0110 1101 1100 0100 1110 1101 0111(2)
4. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 60.
- 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, 60,
3) so that the first bit (leftmost) could be zero
(we deal with a positive number at this moment)
=== is: 64.
5. 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:
596 193 517 951 012 567(10) = 0000 1000 0100 0110 0001 1010 1101 1000 1000 0110 1101 1100 0100 1110 1101 0111
6. Get the negative integer number representation:
To get the negative integer number representation on 64 bits (8 Bytes),
... change the first bit (the leftmost), from 0 to 1...
-596 193 517 951 012 567(10) Base 10 integer number converted and written as a signed binary code (in base 2):
-596 193 517 951 012 567(10) = 1000 1000 0100 0110 0001 1010 1101 1000 1000 0110 1101 1100 0100 1110 1101 0111
Spaces were used to group digits: for binary, by 4, for decimal, by 3.