Design a logic circuit to add two 2-BCD decade numbers

Click For Summary

Discussion Overview

The discussion revolves around designing a logic circuit to add two 2-BCD (Binary-Coded Decimal) decade numbers. Participants are addressing issues related to circuit configuration, error handling for invalid BCD inputs, and troubleshooting incorrect outputs during the addition process.

Discussion Character

  • Homework-related
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant reports an issue with the addition of two BCD numbers, indicating a discrepancy in the expected output.
  • Another participant suggests that the addition was performed incorrectly, pointing out the specific binary values being added.
  • A participant expresses confusion about unexpected outputs (represented as XX) and speculates on potential causes, such as unconnected inputs or fluctuating signals.
  • There is a discussion about the implications of connecting certain outputs to +5V, with a warning that this could lead to undefined behavior in the circuit.
  • One participant describes their approach to connecting comparator outputs to generate an error signal for invalid BCD digits, but still encounters issues with the circuit's performance.
  • Another participant emphasizes the importance of not tying outputs directly to power or ground, suggesting that this could lead to incorrect circuit behavior.
  • There is a mention of using a lamp or LED to indicate invalid BCD conditions, which could simplify the error signaling process.

Areas of Agreement / Disagreement

Participants express differing views on the correct configuration of the circuit and the handling of invalid BCD inputs. There is no consensus on the best approach to resolve the issues being faced, and multiple competing ideas are presented.

Contextual Notes

Participants highlight limitations related to circuit behavior when outputs are improperly connected, as well as the complexity of the circuit design. There are unresolved questions regarding the proper handling of invalid BCD inputs and the resulting outputs.

Fatima Hasan
Messages
315
Reaction score
14

Homework Statement


Capture.png


Homework Equations


-

The Attempt at a Solution


Here's my work :
Untitled.png

When I added 0000 0001 to 0000 0000 , I didn't get the correct answer .
Could someone check where is my mistake please ?
 

Attachments

  • Untitled.png
    Untitled.png
    19.2 KB · Views: 389
  • Capture.png
    Capture.png
    22.7 KB · Views: 985
  • Untitled.png
    Untitled.png
    19.2 KB · Views: 748
Last edited:
Physics news on Phys.org
It looks like you are adding 0001 0000 to 0000 0000 and the answer is correct..
 
willem2 said:
It looks like you are adding 0001 0000 to 0000 0000 and the answer is correct..
I added 0000 0001 not 0001 0000 and the answer was 0000 0XX1 0000 .
Why I didn't get 0000 0000 0001 ?
 
Fatima Hasan said:
I added 0000 0001 not 0001 0000 and the answer was 0000 0XX1 0000 .
Why I didn't get 0000 0000 0001 ?
The only 1 input I can see is going into the adder on the bottom left, and this must be the adder for the most significant digit, since it has a carry in coming from the other adders. I have no idea where those XX come from. Could be unconnected inputs, inputs that are between a 1 and a 0 or inputs that are changing, and I don't see any of that.
 
willem2 said:
The only 1 input I can see is going into the adder on the bottom left, and this must be the adder for the most significant digit, since it has a carry in coming from the other adders. I have no idea where those XX come from. Could be unconnected inputs, inputs that are between a 1 and a 0 or inputs that are changing, and I don't see any of that.

I've solved it again and disconnected +5V from (A>B) :
A3.png

I got the correct answer which is 0000 0001 0000 , but the question mentioned that the circuit will work if A and B are invalid BCD (A > 1001 and B > 1001 ) .So , should I connect +5V to A>B ( A > 1001 which is invalid BCD ) as I did in my first solution ?
 

Attachments

  • A3.png
    A3.png
    15.6 KB · Views: 368
  • A3.png
    A3.png
    16.7 KB · Views: 527
Fatima Hasan said:
I got the correct answer which is 0000 0001 0000 , but the question mentioned that the circuit will work if A and B are invalid BCD (A > 1001 and B > 1001 ) .So , should I connect +5V to A>B ( A > 1001 which is invalid BCD ) as I did in my first solution ?
Those are outputs, so tying them to +5 V will get you undefined behavior. You should use the outputs of the 2 comparators that check A to produce an error signal that is 1 whenever one of the digits of A is out of range.
 
willem2 said:
Those are outputs, so tying them to +5 V will get you undefined behavior. You should use the outputs of the 2 comparators that check A to produce an error signal that is 1 whenever one of the digits of A is out of range.
Here's when I connected the (A>B) of the 2 comparators to +5V :
9.png
 

Attachments

  • 9.png
    9.png
    14.6 KB · Views: 380
  • 9.png
    9.png
    17.8 KB · Views: 477
Fatima Hasan said:
Here's when I connected the (A>B) of the 2 comparators to +5V :
That is as I would expect. You are not using the outputs of the 4 comparators on the left to produce an error signal.
If you do use the comparators, you should connect all inputs. Do you understand what the inputs and outputs of the comparator are meant for? I think you use those. http://www.sycelectronica.com.ar/semiconductores/74LS85.pdf
 
willem2 said:
That is as I would expect. You are not using the outputs of the 4 comparators on the left to produce an error signal.
If you do use the comparators, you should connect all inputs. Do you understand what the inputs and outputs of the comparator are meant for? I think you use those. http://www.sycelectronica.com.ar/semiconductores/74LS85.pdf
I connected the cascade inputs of all the comparators as follows :

A<Bin and A>Bin = Ground.
A=Bin = Vcc
And the outputs as follows :
A>B =+5V to produce an error signal which is 1 if A or B are invalid BCD.
A=B and A<B = Ground .
6.png

But I still didn't get the correct answer .
 

Attachments

  • 6.png
    6.png
    19.5 KB · Views: 426
Last edited:
  • #10
Fatima Hasan said:
And the outputs as follows :
A>B =+5V to produce an error signal which is 1 if A or B are invalid BCD.
A=B and A<B = Ground .

You should not tie any outputs to either 5V or ground. If you don't understand why that is, this circuit is too complicated for you. The XXX in the output is probably, because you shorted out the power supply, and your simulater doesn't know what to do. You should try to modify the circuit, so a lamp or LED gets lid whenever A or B has digits that are invalid. It's really much easier than the part of the circuit that modifies the digits after the addition.
 
  • #11
willem2 said:
so a lamp or LED gets lid whenever A or B has digits that are invalid.
It lids when A = 1100 :
6.png
 

Attachments

  • 6.png
    6.png
    17.9 KB · Views: 445
  • 6.png
    6.png
    16.3 KB · Views: 333

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
11K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K