0% found this document useful (0 votes)
19 views5 pages

DT - CO3 - Gray and Binary Code

The document provides study material on combinational logic circuits, specifically focusing on designing code converters for binary and Gray codes using Karnaugh maps (K-maps). It outlines key definitions, conversion methods, and includes solved examples for converting between binary and Gray codes. Additionally, it highlights the applications of Gray code in digital communication and analog to digital conversion.

Uploaded by

Sakshi Dange
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views5 pages

DT - CO3 - Gray and Binary Code

The document provides study material on combinational logic circuits, specifically focusing on designing code converters for binary and Gray codes using Karnaugh maps (K-maps). It outlines key definitions, conversion methods, and includes solved examples for converting between binary and Gray codes. Additionally, it highlights the applications of Gray code in digital communication and analog to digital conversion.

Uploaded by

Sakshi Dange
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Study Material

<Program Code: CO/CM/CW/DE/EJ/ET/EN/EX/EQ/IE/IS/IC/MU> : <Course Code: 22320><Course Name: Digital Techniques>


<Topic Name: Combinational Logic Circuits>
<UO3b.3.><Study Material>

Key words Learning Objective: To design code converter


BINARY CODE, GRAY CODE circuits using K-map

Key Questions Concept Map


 Design binary to gray code
converter using K-map
 Design Gray to Binary code
converter using K-map
 Convert given Gray code
111011100 to binary code.
 Convert given Binary code
10001011 to Gray code.

UO3b.3 Notes: Key Definition-


Gray Code: Gray code: -
 Gray Code system is a binary number system in It is also known asCyclic Code, Reflected
which every successive pair of numbers differs Binary Code (RBC), Reflected Binary (RB) or
in only one bit. It is defined as an ordering of the binary
 It is used in applications in which the normal number system such that each incremental
sequence of binary numbers generated by the value can only differ by one bit. So that two
hardware may produce an error or ambiguity adjacent code numbers differ from each other
during the transition from one number to the by only one bit.
Solved word Problem:
next.
Convert gray code01101 to binary
code. For example, the states of a system may change
from 3(011) to 4(100) as- 011 — 001 — 101 —
100.
 Therefore there is a high chance of a wrong
state being read while the system changes from
Convert Binary code 01001 to gray the initial state to the final state.
code. This could have serious consequences for the
machine using the information.
 The Gray code eliminates this problem since
only one bit changes its value during any
transition between two numbers.
Binary to Gray Code Converter:-

Converting Binary to Gray Code –

Let A,B,C,D be the bits representing the binary


numbers, where D is the LSB and A is the MSB, and
Let G1 G2, G3, G4, be the bits representing the gray
code of the binary numbers, where G4 is the LSB
and G1 is the MSB.
1. The MSB is kept the same. As the MSB of the binary is 0, the MSB of the gray code will be 0 as well (first gray bit)
2. Next, take the XOR of the first and the second binary bit. The first bit is 0, and the second bit is 1. The bits are different so the
resultant gray bit will be 1 (second gray bit)
3. Next, take the XOR of the second and third binary bit. The second bit is 1, and the third bit is 0. These bits are again different so the
resultant gray bit will be 1 (third gray bit)
4. Next, take the XOR of third and fourth binary bit. The third bit is 0, and the fourth bit is 0. As these are the same, the resultant gray
bit will be 0 (fourth gray bit)
5. Lastly, take the XOR of the fourth and fifth binary bit. The fourth bit is 0, and the fifth bit is 1. These bits are different so the
resultant gray bit will be 1 (fifth gray bit)
6. Hence the result of binary to gray code conversion of 01001 is complete, and the equivalent gray code is 01101.
Design of Binary to Gray Code Converter using K-map:-
Truth table:-

One example given below:

K- map for Gray code output:-


:
Designed Binary to Gray code converter:-

Gray to Binary Code Converter:


In a gray to binary code converter, the input is gray code and output is its equivalent binary code.
Let us consider a 4 bit gray to binary code converter.

Gray Code to Binary Conversion:

Gray code to binary conversion is again a very simple and easy process.
Following steps can make your idea clear on this type of conversions.
1. The MSB of the binary number will be equal to the MSB of the given gray code.
2. Now if the second gray bit is 0, then the second binary bit will be the same as the previous or the first bit. If the gray bit is 1 the
second binary bit will alter. If it was 1 it will be 0 and if it was 0 it will be 1.
3. This step is continued for all the bits to do Gray code to binary conversion.
One example given below will make your idea clear.

To design a 4 bit gray to binary code converter, we first have to draw a gray code conversion table, as shown below:
Truth table:-

K-map for B4:


The gray code to binary converter circuit is shown below:
Designed Gray to binary code Converter:-

Applications:-
1. Gray code has applications in analog to digital converters as
well as being used for error correction in digital communication
2. Gray code is used to minimize errors in converting analog
signals to digital signals.

Key Takeaway from this LO:


Design of Half adder and subtractor using K-map, Design of Full adder and subtractor using K-map, Difference between Half and full adder
/subtractor arithmetic circuit,

You might also like