1111 1111 1111 1111 1111 1111 1111 1011 => 11
can anybody explain me how it become -5?
If the MSB is 1, then it is a -ve number. Now, to find out the actual decimal value, apply 2's complement.
2's complement :
1) change 1's to 0's and vice versa
2) Add 1 to the LSB
1111 1111 1111 1111 1111 1111 1111 1011 on negation becomes
0000 0000 0000 0000 0000 0000 0000 0100 which on adding 1 becomes
0000 0000 0000 0000 0000 0000 0000 0101 which is nothing but 5. Since the MSB was 1, it is a -ve number and so the decimal equivalent is -5.
How I wish I can get back to my digi elex class !
!
Arvind
[ December 15, 2005: Message edited by: Arvind Sampath ]