
If all zeros are on the lsb end, move them to the msb end and add one zero.

Example: 1111 1111 1000 0000 -> 0000 0000 1111 1111

Else (Example):

Input value: 
1111 1001 0111 1000
          ^     ^^^
          |      +-- Y = 3 trailing zeros 
          +--------- second block of zeros at bit position  Z = 8

1. Move Y trailing zeros to position Z - 2, pad with ones

1111 1001 0100 0111
            ^^ ^^^^

2. XOR with (0000 0000 0000 0011 << Z - 2)

1111 1001 1000 0111
          ^^
