A 4-bit Binary to Gray code converter changes a 4-bit binary number into its equivalent Gray code.
In Gray code, only one bit changes at a time between consecutive numbers
A 4-bit Gray to Binary converter changes Gray code back to binary. The first binary bit matches the first Gray bit, and each next bit is found by XORing the previous binary bit with the current Gray bit.