0% found this document useful (0 votes)
14 views6 pages

Gray Code

The document explains the concept of Gray code, a binary numbering system where two successive values differ by only one bit, making it useful for applications like error detection and communication. It also contrasts Gray code with traditional binary code, detailing the conversion methods between the two, particularly using Karnaugh maps. The conclusion emphasizes the significance of Gray codes in various technological applications.

Uploaded by

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

Gray Code

The document explains the concept of Gray code, a binary numbering system where two successive values differ by only one bit, making it useful for applications like error detection and communication. It also contrasts Gray code with traditional binary code, detailing the conversion methods between the two, particularly using Karnaugh maps. The conclusion emphasizes the significance of Gray codes in various technological applications.

Uploaded by

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

INTRODUCTION

Binary Number is the default way to store numbers, but in many applications, binary numbers
are difficult to use and a variety of binary numbers is needed. This is why Gray codes are
very useful. Gray code has a property that two successive numbers differ in only one bit
because of this property gray code does the cycling through various states with minimal effort
and is used in K-maps, error correction, communication, etc.

What is Gray and Binary code ?


Gray Code :-
A binary numbering system in which two successive values only differ by one bit is called
gray code, often referred to as reflected binary code or unit distance code. Frank Gray created
it in 1953, and today it is a common tool for error detection and repair in digital
communication and data storage systems.

The binary numeral system is ordered in the reflected binary code, also known as the Gray
code, so that two subsequent values only differ in one bit (binary digit). In the typical

1
sequence of binary numbers produced by the hardware that could provide an error or
ambiguity during the change from one number to the next, gray codes are highly helpful.

Binary code:-
Binary code, code used in digital computers, based on a binary number system in which there
are only two possible states, off and on, usually symbolized by 0 and 1. Whereas in a decimal
system, which employs 10 digits, each digit position represents a power of 10 (100, 1,000,
etc.), in a binary system each digit position represents a power of 2 (4, 8, 16, etc.).

A binary code signal is a series of electrical pulses that represent numbers, characters, and
operations to be performed. A device called a clock sends out regular pulses, and components
such as transistors switch on (1) or off (0) to pass or block the pulses. In binary code, each
decimal number (0–9) is represented by a set of four binary digits, or bits. The four
fundamental arithmetic operations (addition, subtraction, multiplication, and division) can all
be reduced to combinations of fundamental Boolean algebraic operations on binary numbers.
(See the table below for how the decimal numbers from 0 to 10 are represented in binary.

Gray to binary conversion :-

Gray codes are used in rotary and optical encoders, Karnaugh maps, and error detection. The
hamming distance of two neighbors Gray codes is always 1 and also

first Gray code and last Gray code also has Hamming distance is always 1, so it is also called
Cyclic codes. You can convert a Gray code to Binary number using two methods.

Using Karnaugh (K) – map:-

2
You can construct Gray codes using other methods but they may not be performed in
parallel like given above method. For example, 3 bit Gray codes can be contracted using K-
map which is given as following below.:

A B A⊕B
Decimal Gray code Binary code
0 0 000 0 000 0
1 0 001 1 001 1
2 011 010
Using 3 1 010 0 011 1

(⊕) operation – 5
Exclusive-Or 4 110 100
1 111
1 101
0
6 101 110
This is very simple 7 100 111 method to get
Binary number from Gray code. These are following steps for n-bit binary numbers −

1. The Most Significant Bit (MSB) of the binary code is always equal to the MSB of
the given gray code.
2. Other bits codes are

Formulae for Gray to Binary conversion:-


b3=b4⊕g3
b2=b3⊕g2
b1=b2⊕g1
b0=b1⊕g0

3
Logical circuit diagram of gray code binary code conversion

Here’s an example to understand the conversion:

4
Conclusion :-
In conclusion we learned conversion of gray code to binary code. In this the most significant
bit of the binary code is always equal to the MSB of the given gray code. Gray codes are used
in rotory and optical encoders, k-maps, and error detections.

5
REFERENCES:-

Websites like

www.geeksforgeeks.com

www.wikipedia.com

You might also like