What is the Decimal value for the 8-bit 2's complement number 11010110?

kevintdiy picture kevintdiy · Feb 18, 2013 · Viewed 7.4k times · Source

This more of a hw question but I cannot figure this one out. I thought it would be 214 but because of the first bit on the left, I am not so sure.

Answer

Guffa picture Guffa · Feb 18, 2013

As it's a 2's complement number, the first bit being one means that it's a negative number.

The value is 214 - 256 = -42.

It can also be calculated as -(~214 + 1) = -(41 + 1) = -42.

Binary that would be -(~11010110 + 1) = -(00101001 + 1) = -00101010.