We don't have anything specific, but it's simple binary math.

In base-10, moving digits one place to the left is equivalent to multiplying by 10: 3.14, 31.4, 314. Shifting the digits one place to the right is equivalent to dividing by 10.

Base-2 works the same way: shifting bits left is equivalent to multiplication by 2: 0001 (1), 0010 (2), 0100 (4), 1000 (8). Shifting them right is equivalent to dividing by 2.

Normal binary multiplication and division are fairly logic-intensive, but multiplication and division by 2 end up producing the same results as shifting the bits left or right. Microcontroller logic units have shift circuits, so you can use those instead of the math circuits.

The upshot is that these lines of code produce the same results:

- Code: Select all | TOGGLE FULL SIZE
`uint8_t x = 10; // 0000 1010`

x *= 4; // x now equals 40: 0010 1000

x /= 4; // x now equals 10: 0000 1010

x <<= 2; // x now equals 40: 0010 1000

x >>= 2; // x now equals 10: 0000 1010

but the bit-shifting version uses simpler hardware, and in many cases will execute faster.