Skip to content

VLSIFacts

Let's Program the Transistors

  • Home
  • DHD
    • Digital Electronics
    • Fault Tolerant System Design
    • TLM
    • Verification
    • Verilog
    • VHDL
    • Xilinx
  • Embedded System
    • 8085 uP
    • 8086 uP
    • 8051 uC
  • VLSI Technology
    • Analog Electronics
    • Memory Devices
    • VLSI Circuits
  • Interview
    • Interview Experience
    • Training Experience
    • Question Bank
  • Notifications
  • QUIZ
  • Community
  • Job Board
  • Contact Us

Binary to Gray Code Conversion and Vice Versa

Posted on March 18, 2023June 19, 2025 By vlsifacts No Comments on Binary to Gray Code Conversion and Vice Versa

In this article, we will learn about the conversion of binary to Gray code and vice versa. You can refer to the gray code table, where we have already shown the gray codes of 3-bit numbers, that is, the decimal numbers from 0 to 7. In this article, we will learn the conversion techniques so that you can convert from binary to Gray or vice versa for any bit length.

Conversion from Binary to Gray Code

The following steps are followed to convert a binary number to a corresponding Gray code.

  • The most significant bit (left-most) in the Gray code is the same as the corresponding MSB in the binary number.
  • Going from left to right, add each adjacent pair of binary code bits to get the next Grey code bit. Discard carry.

Example: Convert the binary number 101110 to Gray code

Solution:

An example of conversion from binary to Gray

So, the final Gray code is 1011102 = 111001Gray

Learn about other code conversions:

Number System Conversion
BCD Code Conversion
Excess-3 Code Conversion

Conversion from Gray Code to Binary

The following steps are followed to convert a Gray code to a corresponding binary number.

  • The most significant bit (left-most) in the binary code is the same as the corresponding MSB in the Gray code.

Example: Convert the Grey code 111001 to binary number

Solution:

An example of conversion from Gray to binary

So, the final binary number is 111001Gray = 1011102

Previous          Table of Content          Next

Spread the Word

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to email a link to a friend (Opens in new window) Email
  • Click to print (Opens in new window) Print

Like this:

Like Loading...

Discover more from VLSIFacts

Subscribe to get the latest posts sent to your email.

Related posts:

  1. All about Gray Code
  2. Use of Gray code in a Mechanical Encoding Disc
  3. Applications of Gray Code
  4. Synopsys – Interview Questions – based on Synthesis and Simulation
Digital Electronics Tags:Binary to Gray, Gray Code, Gray Code Conversion, Gray to Binary

Post navigation

Previous Post: Use of Gray code in a Mechanical Encoding Disc
Next Post: Applications of Gray Code

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Top Posts & Pages

  • NAND and NOR gate using CMOS Technology
  • AND and OR gate using CMOS Technology
  • Circuit Design of a 4-bit Binary Counter Using D Flip-flops
  • Truth Tables, Characteristic Equations and Excitation Tables of Different Flipflops
  • ASCII Code

Copyright © 2026 VLSIFacts.

Powered by PressBook WordPress theme

%d