I proposed this method of converting a two's complement binary number to decimal to my professor and he said it was wrong. Some older guy in the class just shook his head at me and gave me a condescending stare. I'm willing to admit I'm wrong when I'm wrong but I can't find a case where it doesn't work.
Take a two's complement binary representation of -38
1 0 1 1 0 1 0
The method I was taught is, starting at the right, keep the bits until you encounter a 1. Then flip all bits after that one. Which gives
0 1 0 0 1 1 0 = 38
The method I thought was easier since it doesn't involve any binary manipulations is treat the most significant bit as having a minus sign. So you would simply calculate the answer as
1*(-64) + 0*(32) + 1*(16) + 1*(8) + 0*(4) + 1*(2) + 0*1 = -38
What is wrong with my method?