Why are there two different truth tables for BCD to Gray?

  • Thread starter Thread starter Differentiate1
  • Start date Start date
  • Tags Tags
    Code Converter
Click For Summary
The discussion revolves around the confusion regarding the two different truth tables for converting Binary-Coded Decimal (BCD) to Gray Code. The standard rules for conversion using the 8421 BCD code do not align with some example problems encountered, leading to questions about exceptions or variations in BCD codes. The participants emphasize the importance of specifying which BCD code is being used, as different codes may yield different Gray Code results. There is also a focus on implementing a BCD to Gray Code converter using a programmable array logic (PAL) device, with concerns about meeting the requirement for collecting four different product terms. Ultimately, clarity on the specific BCD and Gray Code definitions is crucial for accurate conversion and implementation.
Differentiate1
Messages
34
Reaction score
0
Having a bit of trouble understanding why there are two different truth tables for BCD to Gray.

Using ABCD as the BCD and WXYZ as the Gray,
The way I learned it is:
1) MSB of BCD (A) = MSB of Gray (W)
2) A ⊕ B = X
3) B ⊕ C = Y
4) C ⊕ D = Z
5) Since BCD only ranges from 0 - 9, 10 - 15 become "don't cares"

Following the rules, chart prints:
http://i.imgur.com/IPsPoAS.png

However, while browsing through examples of converting BCD to Gray, I found these:
Example Problem
Example Problem 2

The rules I posted don't work in the Example Problems.

Are there some sort of exceptions that may alter the Gray Code?
 
Last edited:
Engineering news on Phys.org
There are at least 3 different BCD-codes:

BCD-Codes.jpg


Maybe that's the cause to confusion?

But why not choose the one you like, practise some Karnough mapping and make your own truth table ?

Observe: BCD4221(5) is wrong: It must be 1001 or 0111
 
Last edited:
Thanks for the reply,

The problem I'm facing requires me to,
"implement a BCD to Gray Code converter using a 4x16x4 PAL where each output collects 4 different product terms."

I completed the problem using the 8421 BCD code to Gray, but the solutions solved it the way shown here: Example Problem
Would using the 8421 BCD to Gray functions where
W = A
X = A'B
Y = A'BC' + B'C
Z = A'BC'D + B'C'D + AD + BCD + B'CD'

be considered correct in this problem still? I'm skeptical regarding my answer since the question requested "output collects 4 different product terms." I'm assuming that part just means the OR gates in the PAL needs to collect 4 connections from the AND gates.
 
Last edited:
The rules here:
Differentiate1 said:
1) MSB of BCD (A) = MSB of Gray (W)
2) A ⊕ B = X
3) B ⊕ C = Y
4) C ⊕ D = Z

matches the BCD and gray-codes here:

IPsPoAS.png


In your examples in #1, there are other gray-codes, and of course your rules will not match these.

For example, how have you found: Z = A'BC'D + B'C'D + AD + BCD + B'CD' in #3 ? That's not right.
 
Yeah that's not right.
Re-did the K-Map and found Z = A'C'D + B'C'D + A'CD'

But how would you solve the problem in the example using their BCD-Gray Code instead of the 8421 choice?
Certainly the rules will not work in that.
 
Differentiate1 said:
Re-did the K-Map and found Z = A'C'D + B'C'D + A'CD'

I cannot find out what you are doing. Which BCD-code and which gray-code ar you using?

As for the BCD- and gray-codes shown in #4, the result is:

Z = C ⊕ D = ( C * !D ) + ( !C * D )

( ! means "not" )
 
What mathematics software should engineering students use? Is it correct that much of the engineering industry relies on MATLAB, making it the tool many graduates will encounter in professional settings? How does SageMath compare? It is a free package that supports both numerical and symbolic computation and can be installed on various platforms. Could it become more widely used because it is freely available? I am an academic who has taught engineering mathematics, and taught the...

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 28 ·
Replies
28
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
2
Views
1K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 2 ·
Replies
2
Views
8K