welcome to this sparse club...
I too once was a first class victim of this bit game and got walloped on a number of occasions till some generous tips by
yoda masters on this ranch came by

.
Here's the rant:-
STEP 1: -128 = 10000000,
STEP 2: (byte)(b >> 1)
makes life somewhat easy, that we only need to go for the last 8 bits (phew !), which at this moment is:
10000000
and the 'shift >> 1' results in:
11000000 ; the extreme right '0' drops off a cliff and meets a horrible death and the space created on the extreme left gets gobbled up with a '1'
STEP 3 : moment one sees that the extreme left side is a '1', it's always a (-)ve #. (take it for granted)
so apply a thumb rule here:
(i) flip the bits
00111111
(ii) add 1
00111111
00000001 +
___________
01000000
in this funky arithmetic[ called 2's complement ...which I never got at school

] 01+01 = 10, '0' gets put down and the '1' gets carried over.
the final '01000000' amounts to 64 , but STEP 3 sez: it's a (-)ve #, so to top the icing, the answer = - 64.
hope this helps a tad bit
