0xfb-0xfa
I have first turn to binary
0xfb=11111011
0xfa=11111010
-0xfa=00000101+1=00000110
Now 11111011+00000110=100000001
which is underflow, but it surely incorrect, where did I get it wrong?
It is not clear whether the initial numbers are signed or unsigned. The results will be identical, but the reasoning is slightly different.
Assuming your initial numbers are unsigned, the initial conversion is incorrect. Your data are 8 bits when coded in binary as unsigned. If you want to convert them to 2s complement without truncation, you need an extra bit. So
+0xfb = 0 11111011
+0xfa = 0 11111010
-0xfa = 1 00000110
Now we can compute the addition
(1)
0xfb 0 11111011
-0xfa + 1 00000110
----------
0 00000001
We can notice that there is no overflow. There is a carry out, but we can just ignore it in 2s complement. And the sum of a positive and negative number cannot overflow.
Now, as the two MSB are equal, result can be shortened to 8 bits giving the obvious result of 1.
If initial numbers are signed, most your computation is correct. All the operations can be done on 8 bits. And the result will be on 8 bits.
(1)
0xfb 11111011
-0xfa + 00000110
----------
00000001
There is a carry out, but no over or underflow. The result is correct.