In the comments - the value of b in debug:

byte b = 80; // 1010_0000 b >>>= 7; // b = 0 

b after the shift was 0000_0000 , although the shift is unsigned and should have been 0000_0001 .

What is wrong and then how to get the "sign" bit?

    1 answer 1

    You have an error in the code. The binary number 1010_0000 in decimal will be 160 . And 80 in decimal, in binary will be 0101_0000 . 0101_0000 with an unsigned shift of seven digits to the left, it really gives 0