does anyone know how to find the decimal equivalent of the four-bit one's complement number: 1111
Printable View
does anyone know how to find the decimal equivalent of the four-bit one's complement number: 1111
Isn't that 15? If you would have done this:
0000 - 0
0001 - 1
0010 - 2
0011 - 3
0100 - 4
0101 - 5
0110 - 6
0111 - 7
1000 - 8
1001 - 9
1010 - 10
1011 - 11
1100 - 12
1101 - 13
1110 - 14
1111 - 15
you would have seen it. ;)
I think it's zero. Because the first bit is the sign bit and if it's one then you inverse the rest of them. So you get negative zero, zero.
Are you asking for assembly code or just theory here?
Edit: Oh and Jacob, isn't it a bit easier to do this...
1111 = 1+2+4+8 = 15 ... ;)
It's indeed 0, or more precisely, -0. 1's complement has the concept of negative 0.
thanks penagate and CornedBee. your answer makes sense to me.