Gray codes are a binary numeral system where two successive values differ in only one bit. They were invented by Emile Baudot in the late 1800s for use in telegraph systems. Forming a Gray code involves starting with all zeros and changing the least significant bit to form each new code word. Implementing a Gray code sequence in an FPGA using a state machine can avoid output glitches, but different synthesis tools may or may not correctly interpret the VHDL to generate a true Gray code sequence rather than a standard binary encoding.