[Home] [Why 10] [Weighted numbers] [Conversions] [Gray code] [ASCII codes]
Gray code
Up ]

 
 

 

Last updated: 29-01-09

Frank Gray got in 1947 a patent at his - reflected binary code - known as the Gray code - Read more in this Wikipedia link

Wheel with 3-bit Gray code

What's special for a Gray code compared with a Binary code?

Answer:   Only one bit changes between a given gray code and its neighbour codes

   
 
 

Wheel with 3-bit Binary code

What could course the problems, using a binary coded wheel? 

Answer:  The wheel must of course be very precise - specially when more the one but should change 0->1 or 1->0.
                      But also the decoders must be very similar (same characteristic) and must be situated precisely @ a strait line.

 

Digital "circuit" for Binary to Gray code conversion

 

Given a 8-bit Binary code = 1 0 1 0 1 1 0 1   how would the corresponding  gray code look like?

Answer:  1 0 1 0 1 1 0 1
                     0 1 0 1 0 1 1 0
                    --------------------- XOR

                    
1 1 1 1 1 0 1 1

Digital "circuit" for Gray to Binary code conversion (may be ... please verify yourself)

 
 

Answer:   Fill out the Carnaugh maps below and find the equations for a Gray to Binary converter
                      For a solution - drag the mouse over the maps below while holding the left button

gray Q2Q1

Q0 00 01 11 10
0 0 0 1 1
1 0 0 1 1

Binary Q2= gray Q2

 

gray Q2Q1

Q0 00 01 11 10
0 0 1 0 1
1 0 1 0 1

Binary Q1= Q2 xor Q1

 

gray Q2Q1

Q0 00 01 11 10
0 0 1 0 1
1 1 0 1 0

Binary Q0= Q2 xor Q1xor Q0

         

Given a 8-bit Gray code = 1 1 1 1 1 0 1 1 how would the corresponding  binary code look like? - test the algorithm from above

                               Gray code
 
1 1 1 1 1 0 1 1
  xor : : : : : :
  0 xor : : : : :
    1 xor : : : :
      0 xor : : :
        1 xor : :
          1 xor :
v v v v v v 0 xor
1 0 1 0 1 1 0 1
                            Binary code

 

   

Hit Counter