answersLogoWhite

0


Best Answer

Hexidecimal (Base 16)

0000 = 0

0001 = 1

0010 = 2

0011 = 3

0100 = 4

0101 = 5

0110 = 6

0111 = 7

1000 = 8

1001 = 9

1010 = A

1011 = B

1100 = C

1101 = D

1110 = E

1111 = F

BCD (Binary coded decimal is just 0 through 9 above)

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

Binary coded decimal (BCD) requires a minimum of 4 bits to represent all possible digits from 0 to 9. There are ten possible configurations for a BCD with the following corresponding Gray codes, which also require a minimum of 4 bits:

Digit : BCD : Gray

0 : 0000 : 0000

1 : 0001 : 0001

2 : 0010 : 0011

3 : 0011 : 0010

4 : 0100 : 0110

5 : 0101 : 0111

6 : 0110 : 0101

7 : 0111 : 0100

8 : 1000 : 1100

9 : 1001 : 1101

To convert from BCD to Gray, you must be familiar with the XOR binary logic gate. This gate has two inputs (hence it is a binary gate) and one output. When either input is true, but not both, the output is true. The truth table for all possible inputs p and q can therefore be summarised as follows:

p q output

0 0 0

0 1 1

1 0 1

1 1 0

To implement a conversion from BCD to Gray, we use the following algorithm:

Step 1: Fix the MSB (most-significant bit). This bit is always the same for both codes, regardless of length. If there are no more bits, we're done, otherwise proceed to step 2.

Step 2: XOR the first and second BCD bit to fix the next Gray bit.

Step 3: Disregard the first BCD bit.

Step 4. If there are two or more BCD bits remaining, go to step 2. Otherwise we're done.

For example, to convert BCD 0101 we proceed as follows:

(Fix MSB = 0)101

(0 XOR 1 = 1)01

(1 XOR 0 = 1)1

(0 XOR 1 = 1)

Thus BCD 0101 is Gray 0111. Consulting the table above will confirm this to be true.

Implementing this algorithm electronically is beyond the scope and capability of this wiki. However, see related links, below, for further information.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you convert bcd into Gray code?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Program to convert bcd to gray code using 8051 microcontroller.?

66666


BCD to Gray Code Converter?

BCD refers to Binary Code Decimal there are no diagrams it is just a numbers system GRAY code is a means to make one reliable state to change at a time eliminating false coding because of transitions in counters and such


What is bcd to gray code converter?

A BCD to Gray code converter is a digital circuit that converts Binary Coded Decimal (BCD) input to Gray code output. Gray code is a binary numeral system where two consecutive values differ in only one bit. The converter is often used in digital systems where minimizing errors during digital-to-analog conversions is critical.


How do you convert excess-3 to gray code?

help PLA use convert excess-3 to gray code


How do you convert bcd to ascii hex code?

Multiply by 16. ANSWER: The answer is bcd 11 = 3 111 = 7 1111 i= F 01111 =E and so foirth


How do you convert BCD to decimal?

explain decimal to BCD encoder


What are different types of binary code?

BCD codes,gray code,error detecting code,ASCII character code,Excess 3 code


Write a program to convert a 2 digit BCD number into hexadecimal number?

Write a program to convert a 2-digit BCD number into hexadecimal


Convert 01011101101 to bcd?

12


How will bcd convert into 7segment display?

BCD can be converted into 7segment display by using an encoder.


What is a 4 BCD code?

A 4 BCD code is a 4 decimal-digit BCD code, thus a 16 digit binary-code. You take the decimal number 3545. It's BCD code is 0011 0101 0100 0101 where every 4 bits represent a decimal digit.


2 Write a program to convert a 2-digit BCD number into hexadecimal?

WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL