>>4 => shift byte 4 position to the right. so you keep only the 4 high bits
& $F => Bitwise and with hex F. so you keep only the 4 low bits

everything is in the PBP manual section 4.17