# Code Conversion, Gray code to binary converter

August 24, 2018 12:33 pm 1 Comment

# Code Conversion, Gray code to binary converter

In this post on a code conversion, we are going to see Gray code to binary conversion using the k-mapping technique.

If you are seeing this topic for the first time, I suggest you have a look at Binary to Gray code conversion. before reading this Gray code to binary converter topic.

Also read: A complete study on logic Gates

## Gray code to Binary converter:

 GRAY CODE INPUT BINARY OUTPUT G3 G2 G1 G0 B3 B2 B1 B0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 0 1 1 0 1 1 0 0 1 0 0 0 1 1 1 0 1 0 1 0 1 0 1 0 1 1 0 0 1 0 0 0 1 1 1 1 1 0 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 1 0 0 1 0 1 1 1 1 0 1 1 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1

A Gray code can be converted into a Binary code by using this following strategy.

0 + o = 0,

o + 1 = 1,

1 + 0 = 1,

1 + 1 = 10 ( 1 is carry)

start from the left and use the above strategy and add the digits.

For example,

The code conversion for 2

Gray Code :                        0             0             1                1

Binary code:                       0         0+0=0    0+1=1       1+1= 10(enter only 0, carry 1 should be added with next digit)

Now let us do Karnaugh mapping.

K-map for B3:

As the first preference should be given to eight pair element, the above mapping is done as per 8 pair mapping.

The Gray code equivalent for B3 is G3.

K-map for B2:

The second preference should be given to 4 paired elements if there are no 8 paired elements. As this rule, the above k – mapping is done for 4 pair elements.

The red framed boxes denote the Mapping of elements.

K-map for B1:

Next, to 4 pair elements, the preference should be given to 2 pair elements. As per this rule, the k -mapping is done for B1.

K-map for B0:

Next, to 2 pair elements, the preference should be given to 1 element. As per this rule, the k – mapping is done for B0.

## Logic Diagram:

The following logic diagram is for Gray code to binary converter.

(In the above conversion, there is no necessity for don’t care conditions, but in other conversions like BCD to Excess-3 there is a need for don’t care conditions in order to proceed k-mapping.)

You may also like:

Top 10 Tech items and gadgets that will disappear in the future

Kirchoff’s Current Law and Kirchoff’s Voltage Law

Methods Of Neutral Grounding

Tags: ,

Categorised in: Digital Logic Circuits

This post was written by ABISHEK