# Homework Help design a combinational circuit

#### gato pro

Joined Sep 18, 2020
18
Hello, i need some help to solve this exercise, it is a homework problem from my university. I have to use TTL IC's.
The problem says:

A combinational circuit has as inputs two numbers (A, B) of four bits each, which must be natural BCD (from 0 to 9), two operating mode inputs (x, y) and the output is displayed on two 7-segment displays. If some of the numbers is not BCD, regardless of the inputs (x, y) a zero should be displayed. If the inputs are BCD, it must respond to the following operation table:

X Y Function
0 1 B
1 0 A
1 1 A+B

can someone give me a help to start it?
Thanks!

#### dl324

Joined Mar 30, 2015
16,162
Welcome to AAC!
can someone give me a help to start it?
The way homework help works is you need to post your best effort so we can see the technique you're trying to use and where you're having problems. Then we can offer guidance.

#### Alec_t

Joined Sep 17, 2013
14,009
Does the '+' sign signify logical OR, or arithmetic addition?

#### gato pro

Joined Sep 18, 2020
18
Welcome to AAC!
The way homework help works is you need to post your best effort so we can see the technique you're trying to use and where you're having problems. Then we can offer guidance.
I know, I apologize but I really have no idea how to approach the exercise.

Does the '+' sign signify logical OR, or arithmetic addition?

#### djsfantasi

Joined Apr 11, 2010
9,131
Break it into smaller problems.
• How do you convert 2 bits into 1-of-4?
• How do you add two bits? Two four bit numbers?
• Given two bits, how do you select one or the other?
• Given a four bit value, how do you tell if it’s greater than 1001?
• Sub-problem: What is 9 in BCD?
There may be other smaller problems, but you asked for help on how to start.

#### ronsimpson

Joined Oct 7, 2019
2,797
Break the project down to small pieces.
I may not understand, but I think:
Inputs A0...A3, B0...B3, X, Y Outputs Aa0...Aa3, Bb0...Bb3 and (I would ad Cc0 for over flow, if the output is larger than 99)
Next block
Inputs Aa0...Aa3, Bb0...Bb3 Outputs Aaa0...Aaa6, Bbb0...Bbb6 (seven segment display)
Inputs 0...9 must make the seven segments display work, but 10...15 must have a "0" displayed. (should be "blank")
There are common ICs on the market that make this: But that is not right for your project but you can find the logic to do this in the internet and modify it. Or you can use the IC and add a function ahead of it to convert any number larger than 9 to a 0.

Don't reinvent the wheel.

#### dl324

Joined Mar 30, 2015
16,162
I know, I apologize but I really have no idea how to approach the exercise.
As already mentioned, break the problem into smaller parts.
1. What is the maximum number of bits from the adder?
2. How many seven segment digits will you require?
3. Are you going to display as decimal or hexadecimal?
4. How are you going to detect invalid numbers?
5. How are you going to force the display to be zero in that case?
6. How are you going to control what is displayed?
7. etc.

#### gato pro

Joined Sep 18, 2020
18
First of all I want to thank all those who answered me, following their advice I was able to do the following:

At the output of the or gate (red) it would have a 1 if the two numbers of 4 bits each (A and B) are invalid BCDs (from 0 to 9), and according to the problem, I have to show a zero in the displays, can you give me an idea of what to use between the or gate and the 7 segment bcd decoder to do this?

Thanks!

#### ronsimpson

Joined Oct 7, 2019
2,797
74ls157: Strobe turns on/off the outputs. Connect to ground.
Connect "invalid BCD display zero" wire to select. So that when "invalid"=0 data goes to the 74LS247, but when "invalid"=1 then "0000" goes to the display. Of the two inputs one is data and the other are all grounded.

#### dl324

Joined Mar 30, 2015
16,162
I was able to do the following:
Now we have something to work with.

It seems like a bit of overkill to use LS85 to check for numbers > 9 when you could do it with 5-6 gates. What happens if only one of the numbers is invalid and you're displaying the other number?

Have you considered how you're going to multiplex A, B, or A+B to the display?

Are you required to build this or will you be using a simulator?

#### gato pro

Joined Sep 18, 2020
18
Are you required to build this or will you be using a simulator?
I have to implement it using Proteus software

Have you considered how you're going to multiplex A, B, or A+B to the display?
That is what I can not solve, I do not know how to "join" the output of the LS157 to a multiplexer to show A, B or A + B according to the table. Could you give me a help please?

#### dl324

Joined Mar 30, 2015
16,162
I have to implement it using Proteus software
In that case, it would be less work for you to enter the circuits in Proteus. Hopefully it will let you print in black and white without a grid. Screen captures are messy with that grid Proteus seems to use.

That is what I can not solve, I do not know how to "join" the output of the LS157 to a multiplexer to show A, B or A + B according to the table. Could you give me a help please?
How would you handle displaying 1 of 3 different numbers on the display?

#### djsfantasi

Joined Apr 11, 2010
9,131
How about setting one of the two inputs to zero based on the two bit input and always adding them?

As far as multiplexing (or selecting) different inputs, I refer back to one of my smaller tasks. How would you convert a two bit input into a 1 of 4 output? Each of the four different outputs could be used like your comparison circuit and enable only one function. There is a catch here; can you see it?

#### dl324

Joined Mar 30, 2015
16,162
That is what I can not solve, I do not know how to "join" the output of the LS157 to a multiplexer to show A, B or A + B according to the table. Could you give me a help please?
Maybe it would be clearer if you started at the display and worked backwards.

You have 4 different quantities to route to the display: A, B, A+B, or 0. How would you do that?

BTW, have you thought about how you're going to display the numbers on two 7 segment displays? Readily available decoders are BCD to 7 segment. The output of your addition will be 5 binary bits.

#### dl324

Joined Mar 30, 2015
16,162