Example Code

Converting Gray Code to Binary

Code and Documents

Attachment

This VI, graytobinary.vi, converts a binary number in Gray code to a standard binary representation. Gray-coded binary is used widely with absolute encoders in industry due to the property that each transition involves only a single bit change, ensuring that there are no indeterminate states.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors