8086 program to convert binary to Grey code

MicroprocessorMicrocontroller8086

In this program we will see how to find the gray code from a binary number.

Problem Statement

Write 8086 Assembly language program to find the equivalent gray code from a binary number. The number is stored at location 2500 and store the result at 2600.

Discussion

To convert binary to gray code, we have to shift the number one bit to the right, then XOR with the previous number. Thus the gray code will be generated.

 

For a number 2C (0010 1100) the gray code will be 3A (0011 1010)

Input

Address
Data


2500
2C


 

Flow Diagram

 

Program

 

Output

Address
Data


2600
3A


raja
Published on 12-Mar-2019 10:55:37
Advertisements