Determine whether a number conforms to the principle of 8-bit bitmap

To determine whether a number conforms to the principle of 8-bit bitmap, first see whether the number of 1s in the binary representation of the number does not exceed 8. If it does not exceed 8, then see whether these n 1s (n<=8) can Put it in 8 binary digits at the same time, if you can put it in, then see if these eight binary digits can be rotated right by even digits to get the number we want to use. If it can, then this number conforms to the 8-bit bitmap principle and is legal The immediate value. Otherwise, it does not match.

Guess you like

Origin blog.csdn.net/zilan23/article/details/104482743