add gray code

how to generate gray code