In embedded systems, a 32-bit configuration register often contains several packed fields.
Your task is to extract a 5-bit field located at bit positions 10 to 14 from a 32-bit register value.
If this field’s value is less than 31, increment it by 1. Then write the updated value back to the same bit positions in the register, leaving all other bits unchanged.
Use only bitwise operations to extract, modify, and update the register.