binary to grey code convertor is a digital convertor in which the x-or operation goes on binary bits.
MSB of grey code is remains as same as binary that means the first bit of binary is the first bit of grey code.
2nd bit of grey code is the x-or of (1st and 2nd bits of binary code)
3rd bit of grey code is the x-or of (2nd and 3rd bits of binary code)
4th bit of grey code is the x-or of (3rd and 4th bits of binary code)