39. Bitwise Rotation and Counting-II

Question.5

A protocol parser contains this code:

uint16_t reg = received_word;
uint16_t sync = 0x00F0;
for (int i = 0; i < 16; i++) {
   if (reg == sync) return i;
   reg = (reg << 1) | (reg >> 15);
}

What technique is this code demonstrating?

Need Help? Refer to the Quick Guide below

Select Answer