# A circuit to convert 4-bit Gray numbers to BCD

I'm sorry for asking this specific question here but can some one please tell me what's wrong with this solution.

Question: design a circuit to convert 4bit Gray numbers to BCD

I have to say I wrote numbers in Gray form in the left hand side of the truth table.

Let's consider a number such 1000 in Gray

My solution:

It's binary equivalent is 1111 and we cannot show that in BCD so output have to be don't care

Here is what my professor says:

Binary equivalent: 1111

Decimal equivalent: 15

BCD equivalent:00010101

I'm completely confused :|

Edit:

As some users noted I wrote grey codes in non sequential order.

But the answer of karnaugh map will remain same. To see this you can compare the link @Jack Creasey added as comment and my karnaugh maps.(also note I just designed this circuit with decoder)

• He's saying that you should have understood that you'd need more than one BCD digit to represent the result. 0001 0101 (BCD) = 1 5 (decimal). Commented Dec 16, 2018 at 12:38
• But how is that possible when there is no clue In question.
– Me.
Commented Dec 16, 2018 at 12:40
• I think my solution is also true am I right?
– Me.
Commented Dec 16, 2018 at 12:41
• Between 3 and 4 you have changed 2 bits. As I understand it, that makes it an illegal gray code. Commented Dec 16, 2018 at 13:00
• The answer needs more than 1 BCD digit since BCD only describes 0-9. You need a full BCD digit and an overflow (single bit) to describe 4 bit Gray in BCD. In simplistic form you would only have 0-9 BCD in a single digit. In full form you need to have the extra bit for the second BCD digit. There are a bunch of 'don't cares' For the simple conversion see this: wwwcourses.sens.buffalo.edu/mae576/ASSIGNMENTS/… Commented Dec 16, 2018 at 15:08

You made some mistakes at gray code. For example line 4 to line 5, you changed two digits.

Solution is something like the following

After that you have to create the Karnaugh map in order to find the function that will transform the input binary to the bcd feed and finally create the circuit, with logic gates.

If the question was just "design a circuit to convert 4bit Gray numbers to BCD", I would say that it's a little incomplete, since it does not define the # of output bits. Anyway...

EDIT

By bad. I thought that there will be a bcd driver, but obviously you have to design that driver. Driver has to be like this

I think the following is somewhat clarifying

• you are right, obviously i simplified them with karnaugh map but i didn't upload them cause the problem was with the truth table
– Me.
Commented Dec 16, 2018 at 15:26
– Me.
Commented Dec 16, 2018 at 17:24
• Could you clarify the task? What is exactly the thing you have to do? As I understand it, the system takes as input 4 bits - one word, it matches it to the gray code corresponding word and finally produces the BCD word - based on the gray code word. If this is true, then your Karnaugh map is wrong, since you need 5 digits and there are no "don't care" bits. Commented Dec 16, 2018 at 18:22
• System will get a 4-bit Gray code and will show its BCD equivalent
– Me.
Commented Dec 17, 2018 at 7:15
• Ok, so you will need 5 output bits, not 4. Let them be { y4, y3, y2, y1, y0 }. If you agree with my analysis above, then there are no "don't care" bits and it's pretty simple to construct the Karnaugh maps for 5 digits and then design your circuit. If you disagree, tell me in which point Commented Dec 17, 2018 at 10:59

• Binary to Gray ( correct your errors)
• 4 bit Gray to 5 bit BCD or {B8=0,B7=0,B6=0,B5}{B4,B3,B2,B1}
• 5 bit BCD in 5 Karnaugh Maps then reduce each
• 5 Maps to 5 logic symbol circuits to complete design, 1 for each 5 bit gray,

Perhaps 10/20 is generous.

• sorry i didn't mention karnaugh map since problem was truth table. i'll edit question to mention that
– Me.
Commented Dec 16, 2018 at 15:31