ok... I just had to relearn twos compliment (it's been a few years). but I'm glad to say that I can still do it on paper!
you know how two's compliment works? (I'll explain for anyone that doesn't).
the most significant bit is the signed bit. (SB)0000000
(0)xxxxxxx = positive (whatever the seven last bits are)
(1)xxxxxxx = negative (whatever the last 7 bits are after conversion).
I'll use 4 bit numbers to make it a bit simpler.
Code:
positive negative
0000 = 0 0000 = 0
0001 = 1 1111 = 1
0010 = 2 1110 = 2
0011 = 3 1101 = 3
0100 = 4 1100 = 4
0101 = 5 1011 = 5
0110 = 6 1010 = 6
0111 = 7 1001 = 7
1000 = 8
to convert from a two's compliment number to a positive number you need to 'flip all the bits' (change 1 to 0 and 0 to 1), then add 1
e.g 3 = 1101
change that to 0010.
then add 1
0011
7 = 1001
= 0110
=0111 = 7
got it? (if not then say so. I'll try to explain a bit better, also try writing it out on paper and practising a bit with smaller numbers first).
so let's look at the numbers that you have
Quote:
11010101 + 01101011 = ???????

11010101 => 00101010 => 00101011 = 43 (1 + 2 + 8 + 32)
e.g 11010101 = 43
01101011 = 107 (1 + 2 + 8 + 32 + 64) (it is positive so no need for a conversion)
43 + 107 = 64 = 01000000
so my head agrees with your calculator.
Now this is where it get's a bit more interesting
Quote:
00101011 + 01101011 = 10010110 (106 Dec.)

00101011 = 43 (1+2+8+32)
01101011 = 107 (1+2+8+32+64)
43 + 107 = 150 = (128+1642) = (10010110)
AND you are correct that 10010110 = 106
10010110 => 01101001 => 01101010 = (2+8+32+64 = 106)
Basically in order to use positive integers over 127 AND use negative numbers (so you need a signed bit) you can't use 8bit integers, you have to move to 16 bit.
what you have when trying to write 150, but you actually write 106 is an overflow error.
to go off on a tangent, this is why 32bit computers can only access a certain amount of ram, you can't count higher than the address space allows.
this is why old hard disks used to have a 127GB limit.
and why windows XP (before the patch to allow big disk support) has a 127GB limit on disks.
it's all to do with the amount of bits used to write down a number.
anyway... back to your question.
you did 43 + 107 (which does equal 150)
what you should have done
(minus)43 + 107.
which does, in either base 2 (binary) or base 10 (decimal) [or any other base]
equal 64
__________________