Binary to Gray-code converter

For one of my circuit theory module assessments, I was asked to write a report on my design and testing of a binary function generator. I was asked to convert a decimal number to binary code so the input could be implemented in a circuit. I did all the work in class and at home so I had some spare time to design and build a second circuit in the next lab session for extra credit.
I thought, seeing as I had converted decimal to binary in my last design, I could do a similar circuit but convert binary to gray code instead.

Gray code is a sequence of outputs that changes one bit at a time.

I designed the circuit using karnaugh maps, curiously all the logic functions I came out with were XOR gates. Due to this I could design a 4 bit binary/gray-code converter by simply using a quad XOR chip.

 

The circuit worked perfectly. 

If you would like to recreate this design, feel free to use this circuit diagram below.


The XOR that has its input grounded is acting as a buffer for the D input, so you could have a 5 bit converter if you wired your last bit without a buffer.