To construct a circuit that converts a binary coded decimal to its Gray code.
Ic7486, LEDs, 330ohm resistor, connecting wires, PCB and a dc power supply.
The advantage of the Gray code over the straight binary code sequence is that only one bit in the code group changes when going from one number to the next. The Gray code is used in applications where the binary sequence of numbers may produce error or ambiguity during the transition from one number to the next. If binary numbers are used, a change from 0111 to 1000 may produce an intermediate erroneous number 1001 if the rightmost bit takes longer to change in value than the other three bits. The Gray code eliminates this problem since only one bit changes in value during any transition between two numbers.
We get: [pic]
G0 = B0, G1 = B0 EX-OR B1, G2 = B1 EX-OR B2, G3 = B2 EX-OR B3
IC7486 is a quad 2-input exclusive-OR gate. Pin 7 is grounded and Pin 14 connected to Vcc to power the chip. Out of the four ex-OR gates in the IC three are used to construct a BCD to gray coded decimal.
Inputs B0 and B1 are fed to pin 1 and pin2 of the IC respectively. The first output G0 is same as the first input B0 so is taken out directly from the input to the LED. The second output is provided by pin 3 of the IC. Similarly the rest of the output signals are supplied by pin6 and pin11 when their respective input signals are connected as per the circuit diagram.
Gray code has a unique property that every subsequent digit differs from the previous digit by a single bit. Due to this unique property they are used in shaft encoders.