Originally posted by JUNILU LACAR:
[B]<pre>
0111 1111 // 127
0111 1110 // 126
---------
1111 1101 // 1 in sign bit, take as negative (two's complement)
*****
Hi Junilu
Can u pl tell me how 127 and 126 was added up ( I mean whethere 1 and 0 is 1 or 1 and 1 is 1 , How?)
*********
1111 1101 // this is a negative number. To find out its magnitude
0000 0010 // invert all bits to get 1's complement
0000 0001 // then add 1 to get 2's complement
---------
Similarly, here How this 2's complement is arrived? whether 0 and 1 is one etc. ??
Thanks
padmini
0000 0011 // 3 therefore, 1111 1101 is -3
[This message has been edited by padmini Babu (edited July 05, 2001).]