Convert Gray code to decimal using inverse XOR logic
Converting Gray code back to binary (and decimal) requires iterative XOR: the most significant bit stays the same, then each subsequent bit is XOR of the current Gray bit and the previous binary result. This reverse process recovers the original binary value.