You are on page 1of 3

Experiment No.

-6

Title- To study gray code to binary code conversion Objectives - Convert given gray code to the binary code. Apparatus Experimental kit and connecting wires and IC 7486. Theory- Let us convert the gray code 1010 to binary. Step 1- the left most gray digit or msb is the same as the left most gray digit. 1 0 1 0 gray

binary

Step 2 add the left most binary digit to the adjacent one 1 0 1 0 gray + 1 1 binary

Step 3- add the resultant bit to the next gray digit. 1 0 1 0 gray + 1 1 0 binary

Step 4 - again add the resultant bit to last gray digit. 1 0 1 0 gray + 1 1 0 0 binary

Thus, gray code 1010 is converted to binary 1100. The above conversion can also be done by using x-or operation as follows:G0 = b0 G1 b0 = b1 G2 b1 = b2 G3 b2 = b3

Truth table for Gray code to binary conversion Decimal value Gray Code G0 G1 0 0 0 1 0 0 2 0 0 3 0 0 4 0 1 5 0 1 6 0 1 7 0 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 0 13 1 0 14 1 0 15 1 0

G2 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0

G3 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0

Binary Code B0 B1 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1

B2 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

B3 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Observation Table Decimal value 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Gray Code I/P


G
0

Binary Code
B0 B1 B2 B3

Output
LED1 LED2 LED3 LED4

G1

G2

G3

0 0 0 0 0 0 0 0 1 1 1 1 1 1

0 0 0 0 1 1 1 1 1 1 1 1 0 0

0 0 1 1 1 1 0 0 0 0 1 1 1 1

0 1 1 0 0 1 1 0 0 1 1 0 0 1

0 0 0 0 0 0 0 0 1 1 1 1 1 1

0 0 0 0 1 1 1 1 0 0 0 0 1 1

0 0 1 1 0 0 1 1 0 0 1 1 0 0

0 1 0 1 0 1 0 1 0 1 0 1 0 1

Green Green Green Green Green Green Green Green Red Red Red Red Red Red

Green Green Green Green Red Red Red Red Green Green Green Green Red Red

Green Green Red Red Green Green Red Red Green Green Red Red Green Green

Green Red Green Red Green Red Green Red Green Red Green Red Green Red

14 15

1 0 1 0

0 0

1 0

1 1

1 1

1 1

0 1

Red Red

Red Red

Red Red

Green Red

Result: we have found the same result of truth table as in the theory truth table is verified. Precautions:- i) All connections should tight and Right. ii) Properly supply GND and VCC to the IC.

You might also like