0% found this document useful (0 votes)
88 views11 pages

Code Converter

The document describes the conversion between binary and gray codes. It shows the truth tables and K-maps to realize the conversions using logic gates. For a 3-bit binary to gray conversion, G2 is simply B2, G1 is B2 XOR B1, and G0 is B1 XOR B0. The reverse gray to binary conversion follows similar logic: B2 is G2, B1 is G2 XOR G1, and B0 is G0 XOR G1 XOR G2.

Uploaded by

PS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views11 pages

Code Converter

The document describes the conversion between binary and gray codes. It shows the truth tables and K-maps to realize the conversions using logic gates. For a 3-bit binary to gray conversion, G2 is simply B2, G1 is B2 XOR B1, and G0 is B1 XOR B0. The reverse gray to binary conversion follows similar logic: B2 is G2, B1 is G2 XOR G1, and B0 is G0 XOR G1 XOR G2.

Uploaded by

PS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 11

CODE CONVERTER

BINARY TO GRAY CODE


CONVERTER
• Formulate the truth Binary Gray Code
table for the system B2 B1 B0 G2 G1 G0
• Lets analyze the 3 bit 0 0 0 0 0 0
binary to gray code
conversion 0 0 1 0 0 1
0 1 0 0 1 1
0 1 1 0 1 0
1 0 0 1 1 0
1 0 1 1 1 1
1 1 0 1 0 1
1 1 1 1 0 0
K-map for realization G2
B2B1 00 01 11 10
B0
0 1 1
1 1 1

K-Map G2 = B2
K-map for realization for G1
B2B1 00 01 11 10
B0
0 1 1
1 1 1

K-Map G1 = B2B’1 + B’2B1 = B2ΘB1 ,


where Θ is Xor operation
K-map for realization for G0
B2B1 00 01 11 10
B0
0 1 1
1 1 1

K-Map G0 = B0B’1 + B’0B1 = B1ΘB0 ,


where Θ is Xor operation
Binary to Gray Converter

MSB G2
B2

G1
B1

G0
LSB B0
GRAY TO BINARY CODE CONVERSION
Gray Code Binary
G2 G1 G0 B2 B1 B0
0 0 0 0 0 0
0 0 1 0 0 1
0 1 1 0 1 0
0 1 0 0 1 1
1 1 0 1 0 0
1 1 1 1 0 1
1 0 1 1 1 0
1 0 0 1 1 1
K-map for realization B2
G2G1 00 01 11 10
G0
0 1 1
1 1 1

K-Map B2 = G2
K-map for realization B1
G2G1 00 01 11 10
G0
0 1 1
1 1 1

K-Map B1 = G2G’1 + G’2G1 = G2ΘG1 , where Θ is Xor operation


Note: This can also be written as B1 = B2ΘG1 , since G2=B2
K-map for realization B2
G2G1 00 01 11 10
G0
0 1 1
1 1 1
K-Map B0 = G’2G’1G0 + G’2G1G’0 + G2G’1G’0 + G2G1G0

= G’2[G’1G0 + G1G’0] + G2[G’1G’0 + G1G0]

= G’2.(G1 ΘG0) + G2.(G1ОG0), where Θ indicates Xor


operation and О indicates Xnor operation.
Assuming .(G1 ΘG0) is X, then we can write this as
= G’2.X + G2.X’, since xnor is not of xor operation
= X ΘG2= G0 ΘG1ΘG2, i.e.
B0= G0 ΘB1, Since, B1= G1ΘG2,
Gray to Binary Converter
MSB

B2 G2

G1
B1

G0
LSB B0

You might also like