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

10 replies · 3K views · last reply
Fatima Hasan
Messages
315
Reaction score
14

Homework Statement


Block diagram of a circuit to be designed with two groups of inputs, A and B, each with an indicator lamp for invalid BCD, and a row of output lines grouped under Outputs.


Homework Equations


-

The Attempt at a Solution


Here's my work :
Logic circuit schematic built from four 4-bit comparator blocks labelled L85, two adder blocks labelled CO, OR and AND gates, and a row of seven-segment style displays on the right.

When I added 0000 0001 to 0000 0000 , I didn't get the correct answer .
Could someone check where is my mistake please ?
 
Attachments
  • Logic circuit schematic built from several 7485-style 4-bit magnitude comparators labelled L85 and 7483 adders labelled CO, with OR and AND gates and output seven-segment display blocks on the right.
    Untitled.png
    19.2 KB · Views: 416
  • Block diagram of a circuit to be designed with two groups of inputs, A and B, each with an indicator lamp for invalid BCD, and a row of output lines grouped under Outputs.
    Capture.png
    22.7 KB · Views: 1,006
  • Logic circuit schematic built from four 4-bit comparator blocks labelled L85, two adder blocks labelled CO, OR and AND gates, and a row of seven-segment style displays on the right.
    Untitled.png
    19.2 KB · Views: 774
Last edited:
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) :
Logic circuit schematic built from several 74LS85 magnitude comparators, multiplexer blocks and OR gates, with red wires routed to a row of seven-segment style output displays at right.

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
  • Logic circuit schematic with four 74LS85 magnitude comparators, two adders, OR gates and a row of seven-segment displays, wired with red lines and power labelled +5V.
    A3.png
    15.6 KB · Views: 400
  • Logic circuit schematic built from several 74LS85 magnitude comparators, multiplexer blocks and OR gates, with red wires routed to a row of seven-segment style output displays at right.
    A3.png
    16.7 KB · Views: 552
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 :
Logic circuit schematic in a simulator: four L85 4-bit magnitude comparators, two 4-bit adders, OR and AND gates, and rows of seven-segment displays, with A>B inputs tied to +5V.
 
Attachments
  • Logic circuit schematic built from four L85 4-bit magnitude comparators, multiplexers, OR and AND gates, and seven-segment displays, with the A>B inputs tied to +5V.
    9.png
    14.6 KB · Views: 418
  • Logic circuit schematic in a simulator: four L85 4-bit magnitude comparators, two 4-bit adders, OR and AND gates, and rows of seven-segment displays, with A>B inputs tied to +5V.
    9.png
    17.8 KB · Views: 500
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 .
Logic circuit schematic built from L85 4-bit magnitude comparators, 4-bit adders, OR and AND gates, wired with red connections and driving a row of seven-segment displays on the right.

But I still didn't get the correct answer .
 
Attachments
  • Logic circuit schematic built from L85 4-bit magnitude comparators, 4-bit adders, OR and AND gates, wired with red connections and driving a row of seven-segment displays on the right.
    6.png
    19.5 KB · Views: 458
Last edited:
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.
 
willem2 said:
so a lamp or LED gets lid whenever A or B has digits that are invalid.
It lids when A = 1100 :
Logic circuit schematic of two L85 magnitude comparators, multiplexers and an OR gate feeding a row of seven-segment displays, built in a digital logic simulator.
 
Attachments
  • Logic circuit schematic of two L85 magnitude comparators, multiplexers and an OR gate feeding a row of seven-segment displays, built in a digital logic simulator.
    6.png
    17.9 KB · Views: 474
  • Logic circuit diagram built from four 4-bit adder blocks labelled 74LS83 and several OR and AND gates, with input switches on the left and seven-segment displays on the right.
    6.png
    16.3 KB · Views: 362