To convert binary to Gray code, start with the MSB (leftmost bit) which remains the same. Then each subsequent Gray code bit is the XOR of the current and previous binary bits. For 011010: MSB stays 0, then XOR(0,1)=1, XOR(1,1)=0, XOR(1,0)=1, XOR(0,1)=1, XOR(1,0)=1. Result: 010111.