WD interview question

Decimal to gray function with logic gates