You specified that your number is in the additional code. For further conversion, you need to get a direct number code. Therefore, let\'s perform the conversion from additional code to direct code.
to do this, first perform the conversion from the additional code to the reverse by subtracting 1 bit, then get the direct code by inverting all the bits except the signed one.
| | | | | | | | | |
| 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | дополнительный код |
| | | | | | - | 1 | -1 bit |
| 1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | обратный код |
| 1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | прямой код |
got It:11000101
This transfer is possible in two ways: direct transfer and using the decimal system.
first, let\'s make a direct transfer.
Fill in the number with missing zeros on the left
let\'s make a direct translation from binary to post-binary like this:
0110001012 = 011 000 101 = 011(=3) 000(=0) 101(=5) = 3058
answer: 101110112 = 3058 (2 byte)
now let\'s make the transfer using the decimal system.
let\'s translate to decimal like this:
the Sign bit is not included in the translation!
1∙27+1∙26+0∙25+0∙24+0∙23+1∙22+0∙21+1∙20 = 1∙128+1∙64+0∙32+0∙16+0∙8+1∙4+0∙2+1∙1 = 128+64+0+0+0+4+0+1 = 19710
Since the number is signed and has a signed bit, the result will have a negative sign
got It: 0110001012 =-19710
Translate the number -19710 в octal like this:
the Integer part of the number is divided by the base of the new number system:
| 197 | 8 | | |
| -192 | 24 | 8 | |
| 5 | -24 | 3 | |
| 0 | | |
 |
the result of the conversion was:
-19710 = 3058
We found that Your number is negative. However, at the moment octal the number cannot be represented in additional code.
answer: 101110112 = 3058 (2 byte)