# 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). – Dave Tweed Dec 16 '18 at 12:38
• But how is that possible when there is no clue In question. – Me. Dec 16 '18 at 12:40
• I think my solution is also true am I right? – Me. Dec 16 '18 at 12:41
• Between 3 and 4 you have changed 2 bits. As I understand it, that makes it an illegal gray code. – Andy aka Dec 16 '18 at 13:00
• He Said The problem is with don't care parts. – Me. Dec 16 '18 at 13:04

• 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. Dec 16 '18 at 15:31
• Please check my edit – Me. Dec 16 '18 at 17:25
• The question has flaws since it is ambiguous without limits of the gray code. Is it all combinations of 4 bits Gray or only all decimal numbers that can fit into 4 bits. But Gray>binary>BCD could be Gray>Octal>decimal>binary>BCD Then the result is the same Gray->Decimal or "GCD" as it were, You got a result but not the simplest using Karnaugh method using minimum gates – Sunnyskyguy EE75 Dec 16 '18 at 17:29
• How many gates does it take to make 9 input OR gates and Johnson counter?? YOu can make it work, but it may not be the simplest or fastest. – Sunnyskyguy EE75 Dec 16 '18 at 18:06

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. Dec 16 '18 at 15:26
• Please check my edit – Me. Dec 16 '18 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. – thece Dec 16 '18 at 18:22
• System will get a 4-bit Gray code and will show its BCD equivalent – Me. Dec 17 '18 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 – thece Dec 17 '18 at 10:59