Hi Shivani ,
Here Negative numbers are repersented by 2's complement numbers.. since sign bit is setted as 1 ..to get the actual value , we have to take complemet the given bit pattern and we have to add 1
for example
11111111111111111111111111001000 's
complement is
00000000000000000000000000110111 and add 1
00000000000000000000000000000001
--------------------------------------
00000000000000000000000000111000 which is equal to 56 ..since sign bit is 1 the value is -56 ..
Hope this helps for more clarification pls refer
http://www.janeg.ca/scjp/oper/shift.html Regards
Prasanna
scjp 1.4