Showing posts with label gray. Show all posts
Showing posts with label gray. Show all posts

Binary to Gray Code Converter

This post is to teach you how to convert binary number to corresponding Gray code. The conversion is so simple. You can see it..

If an n bit binary number is represented by Bn Bn-1 ...B1 and its Gray code equivalent by Gn Gn-1...G1 where Bn and Gn are the most significant bits (MSBs), then the Gray code bits are obtained from the binary code as follows. The symbol ⊕ stands for the Exclusive OR (XOR) operation explained below.

The conversion procedure is as follows: