# One's Complement: Integer -> Binary: 496 916 632 435 730 664 Convert the Integer Number to a Signed Binary in One's Complement Representation. Write the Base Ten Decimal System Number as a Binary Code (Written in Base Two)

## Signed integer number 496 916 632 435 730 664(10) converted and written as a signed binary in one's complement representation (base 2) = ?

### 1. Divide the number repeatedly by 2:

#### We stop when we get a quotient that is equal to zero.

• division = quotient + remainder;
• 496 916 632 435 730 664 ÷ 2 = 248 458 316 217 865 332 + 0;
• 248 458 316 217 865 332 ÷ 2 = 124 229 158 108 932 666 + 0;
• 124 229 158 108 932 666 ÷ 2 = 62 114 579 054 466 333 + 0;
• 62 114 579 054 466 333 ÷ 2 = 31 057 289 527 233 166 + 1;
• 31 057 289 527 233 166 ÷ 2 = 15 528 644 763 616 583 + 0;
• 15 528 644 763 616 583 ÷ 2 = 7 764 322 381 808 291 + 1;
• 7 764 322 381 808 291 ÷ 2 = 3 882 161 190 904 145 + 1;
• 3 882 161 190 904 145 ÷ 2 = 1 941 080 595 452 072 + 1;
• 1 941 080 595 452 072 ÷ 2 = 970 540 297 726 036 + 0;
• 970 540 297 726 036 ÷ 2 = 485 270 148 863 018 + 0;
• 485 270 148 863 018 ÷ 2 = 242 635 074 431 509 + 0;
• 242 635 074 431 509 ÷ 2 = 121 317 537 215 754 + 1;
• 121 317 537 215 754 ÷ 2 = 60 658 768 607 877 + 0;
• 60 658 768 607 877 ÷ 2 = 30 329 384 303 938 + 1;
• 30 329 384 303 938 ÷ 2 = 15 164 692 151 969 + 0;
• 15 164 692 151 969 ÷ 2 = 7 582 346 075 984 + 1;
• 7 582 346 075 984 ÷ 2 = 3 791 173 037 992 + 0;
• 3 791 173 037 992 ÷ 2 = 1 895 586 518 996 + 0;
• 1 895 586 518 996 ÷ 2 = 947 793 259 498 + 0;
• 947 793 259 498 ÷ 2 = 473 896 629 749 + 0;
• 473 896 629 749 ÷ 2 = 236 948 314 874 + 1;
• 236 948 314 874 ÷ 2 = 118 474 157 437 + 0;
• 118 474 157 437 ÷ 2 = 59 237 078 718 + 1;
• 59 237 078 718 ÷ 2 = 29 618 539 359 + 0;
• 29 618 539 359 ÷ 2 = 14 809 269 679 + 1;
• 14 809 269 679 ÷ 2 = 7 404 634 839 + 1;
• 7 404 634 839 ÷ 2 = 3 702 317 419 + 1;
• 3 702 317 419 ÷ 2 = 1 851 158 709 + 1;
• 1 851 158 709 ÷ 2 = 925 579 354 + 1;
• 925 579 354 ÷ 2 = 462 789 677 + 0;
• 462 789 677 ÷ 2 = 231 394 838 + 1;
• 231 394 838 ÷ 2 = 115 697 419 + 0;
• 115 697 419 ÷ 2 = 57 848 709 + 1;
• 57 848 709 ÷ 2 = 28 924 354 + 1;
• 28 924 354 ÷ 2 = 14 462 177 + 0;
• 14 462 177 ÷ 2 = 7 231 088 + 1;
• 7 231 088 ÷ 2 = 3 615 544 + 0;
• 3 615 544 ÷ 2 = 1 807 772 + 0;
• 1 807 772 ÷ 2 = 903 886 + 0;
• 903 886 ÷ 2 = 451 943 + 0;
• 451 943 ÷ 2 = 225 971 + 1;
• 225 971 ÷ 2 = 112 985 + 1;
• 112 985 ÷ 2 = 56 492 + 1;
• 56 492 ÷ 2 = 28 246 + 0;
• 28 246 ÷ 2 = 14 123 + 0;
• 14 123 ÷ 2 = 7 061 + 1;
• 7 061 ÷ 2 = 3 530 + 1;
• 3 530 ÷ 2 = 1 765 + 0;
• 1 765 ÷ 2 = 882 + 1;
• 882 ÷ 2 = 441 + 0;
• 441 ÷ 2 = 220 + 1;
• 220 ÷ 2 = 110 + 0;
• 110 ÷ 2 = 55 + 0;
• 55 ÷ 2 = 27 + 1;
• 27 ÷ 2 = 13 + 1;
• 13 ÷ 2 = 6 + 1;
• 6 ÷ 2 = 3 + 0;
• 3 ÷ 2 = 1 + 1;
• 1 ÷ 2 = 0 + 1;

## How to convert signed integers from the decimal system to signed binary in one's complement representation

### Follow the steps below to convert a signed base 10 integer number to signed binary in one's complement representation:

• 1. If the number to be converted is negative, start with the positive version of the number.
• 2. Divide repeatedly by 2 the positive representation of the integer number that is to be converted to binary, keeping track of each remainder, until we get a quotient that is equal to ZERO.
• 3. Construct the base 2 representation of the positive number, by taking all the remainders starting from the bottom of the list constructed above. Thus, the last remainder of the divisions becomes the first symbol (the leftmost) of the base two number, while the first remainder becomes the last symbol (the rightmost).
• 4. Binary numbers represented in computer language must have 4, 8, 16, 32, 64, ... bit length (a power of 2) - if needed, fill in '0' bits in front (to the left) of the base 2 number calculated above, up to the right length; this way the first bit (leftmost) will always be '0', correctly representing a positive number.
• 5. To get the negative integer number representation in signed binary one's complement, replace all '0' bits with '1's and all '1' bits with '0's.

### Example: convert the negative number -49 from the decimal system (base ten) to signed binary one's complement:

• 1. Start with the positive version of the number: |-49| = 49
• 2. Divide repeatedly 49 by 2, keeping track of each remainder:
• division = quotient + remainder
• 49 ÷ 2 = 24 + 1
• 24 ÷ 2 = 12 + 0
• 12 ÷ 2 = 6 + 0
• 6 ÷ 2 = 3 + 0
• 3 ÷ 2 = 1 + 1
• 1 ÷ 2 = 0 + 1
• 3. Construct the base 2 representation of the positive number, by taking all the remainders starting from the bottom of the list constructed above:
49(10) = 11 0001(2)
• 4. The actual bit length of base 2 representation is 6, so the positive binary computer representation of a signed binary will take in this case 8 bits (the least power of 2 that is larger than 6) - add '0's in front of the base 2 number, up to the required length:
49(10) = 0011 0001(2)
• 5. To get the negative integer number representation in signed binary one's complement, replace all '0' bits with '1's and all '1' bits with '0's:
-49(10) = 1100 1110