GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Engineering  >  Electronics Engineering

 Print  |  
Question:  Binary to Gray code conversion

Answer: Design binary to gray code converter


August 08, 2008 06:58:27 #1
 jbharath478   Member Since: August 2008    Total Comments: 1 

RE: Binary to Gray code conversion
 
It is easy to convert the binary number to gray number. First, for example take a binary number i.e ,101101.


Step 1: 101101 first write the MSB as it is i.e, darken bit i.e, 1

Step 2: add MSB and bit next to the MSB i.e, 1+0=1

Step 3: again add 0 and 1 we get i.e, 0+1=1
Step 4: again add 1 and 1 we get 1+1=0

Step 5: in previous step carry is occurred so neglect that carry . note that don't add carry to next add numbers
then again add 1+0 1+0=1

step 6: add 0+1 0+1= 1

Answer: Gray Code is : 111011
     

 

Back To Question