Hai Karthik
First convert -5 into bit
pattern using 2's complement and shift 2 bits to right as follows: Remember left most bit represents sign of a bit, if it is 1 it is negative otherwise it is postive.
conversion of -5 into bit pattern:
first take +5 and convert into bit pattern(for the convenience I am giving 4 bits only, you can extend upto 8,16 or 32 as required)
5= 0101; Now 2's complement for conversion to -5, which is as follows:
first flip the bits 0101 as 1010 and add 1 to it, resultant bits are as
1010
1
____
1011
Hence -5 is equivalent to 1011
Now apply -5>>2 = 1110, which is nothing but -2
To
test whether it is -2 or not, you can test with 2's complement again as exaplained above, then you will get +2(test it).