Binary to gray conversion, Essays (university) of Digital Logic Design and Programming

Digital logic design

Typology: Essays (university)

2015/2016

Uploaded on 01/22/2016

Abebekebede
Abebekebede 🇪🇹

4.5

(17)

5 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Binary-to-Gray code Conversion
Conversion between binary code and Gray code is sometimes useful. The
following rules explain how to convert from a binary number to a Gray code
word:
1. The most significant bit (left-most) in the Gray code is the same as the
corresponding MSB in the binary number.
2. Going from left to right, add each adjacent pair of binary code bits to
get the next Gray code bit. Discard carries.
For example, the conversion of the binary number 10110 to Gray code is as
follows:
1
+
0
+
1
+
1
+
0 Binary
1 1 1 0 1 Gray
The Gray code is 1 1 101.
Gray -to- Binary Conversion
To convert from Gray code to binary, use a similar method; however, there
are some differences. The following rules apply:
1. The most significant bit (left-most) in the binary code is the same as
the corresponding bit in the Gray code.
2. Add each binary code bit generated to the Gray code bit in the next
adjacent position. Discard carries.
For example, the conversion of the Gray code word 11011 to binary is as
follows:
1 1 0 1 1 Gray
+
+
+
+
1 0 0 1 0 Binary
The binary number is 10010.
id8649500 pdfMachine by Broadgun Software - a great PDF writer! - a great PDF creator! - http://www.pdfmachine.com http://www.broadgun.com

Partial preview of the text

Download Binary to gray conversion and more Essays (university) Digital Logic Design and Programming in PDF only on Docsity!

Binary-to-Gray code Conversion

Conversion between binary code and Gray code is sometimes useful. The following rules explain how to convert from a binary number to a Gray code word:

  1. The most significant bit (left-most) in the Gray code is the same as the corresponding MSB in the binary number.
  2. Going from left to right, add each adjacent pair of binary code bits to get the next Gray code bit. Discard carries. For example, the conversion of the binary number 10110 to Gray code is as follows:

1 + 0 + 1 + 1 + 0 Binary

1 1 1 0 1 Gray

The Gray code is 1 1 101.

Gray -to- Binary Conversion

To convert from Gray code to binary, use a similar method; however, there are some differences. The following rules apply:

  1. The most significant bit (left-most) in the binary code is the same as the corresponding bit in the Gray code.
  2. Add each binary code bit generated to the Gray code bit in the next adjacent position. Discard carries. For example, the conversion of the Gray code word 11011 to binary is as follows:

1 1 0 1 1 Gray

+ + + + 1 0 0 1 0 Binary

The binary number is 10010.