Help me -circuit to calculate (A-B)^2

WBahn

Joined Mar 31, 2012
32,925
A thread title of "Help me" is singularly unhelpful. Please try to come up with a more meaningful title.

What kind of "cost analysis" are you expected to do? Determine the per unit cost of manufacturing ten million units in China and setting up distribution centers around the world? Or the cost of the components bought as single quantities needed to breadboard a prototype? What kind of input are you using? What kind of output are you using? Do you need to include the NRE (non-recurring engineering) costs associated with researching and designing the prototype? What?

You have three possible input values for each of two inputs. That's six bits of information and only nine of those are valid. You only need three bits of output. Lots of ways to do it.

You need to show YOUR best attempt to work YOUR homework problem. After seeing your attempt we can then help guide you toward a solution.
 

RBR1317

Joined Nov 13, 2010
715
But first, how would you approach the problem?
Isn't the process pretty much the same for any problem?

1- Determine how many bits of input & output are necessary.
2- Decide how to name each of the bits so they can be tracked in the process.
3- Make a logic table showing output bit values for each combination of input bits.
4- Determine which combinations of input bits are "Don't Care" conditions.
5- Perform a logic minimization, usually with a Karnaugh map.
6- Analyze which minimizations lead to lower cost or chip count.
 

MrAl

Joined Jun 17, 2014
13,720
Isn't the process pretty much the same for any problem?

1- Determine how many bits of input & output are necessary.
2- Decide how to name each of the bits so they can be tracked in the process.
3- Make a logic table showing output bit values for each combination of input bits.
4- Determine which combinations of input bits are "Don't Care" conditions.
5- Perform a logic minimization, usually with a Karnaugh map.
6- Analyze which minimizations lead to lower cost or chip count.
Yeah but is it digital or analog?
 

WBahn

Joined Mar 31, 2012
32,925
Isn't the process pretty much the same for any problem?

1- Determine how many bits of input & output are necessary.
2- Decide how to name each of the bits so they can be tracked in the process.
3- Make a logic table showing output bit values for each combination of input bits.
4- Determine which combinations of input bits are "Don't Care" conditions.
5- Perform a logic minimization, usually with a Karnaugh map.
6- Analyze which minimizations lead to lower cost or chip count.
That covers just one class of problems and there's not enough information provided to determine whether the solution the TS is expected to come up with falls within that family or not.

If the user has the option (or the mandate) to use programmable logic of some type, the approach is quite a bit different. Particularly the cost analysis -- and it still needs to be answered what "cost" is to be analyzed. If the TS can use a LUT based solution then that's a different approach.

Plus, in general, most problems are too big to prepare a logic table unless there is a lot of structure and a lot of don't care conditions (usually on several of the inputs under certain conditions of the other inputs as a result of precedence, since don't cares on the outputs are actually pretty rare).
 

Thread Starter

srichandana

Joined Jul 13, 2019
5
Isn't the process pretty much the same for any problem?

1- Determine how many bits of input & output are necessary.
2- Decide how to name each of the bits so they can be tracked in the process.
3- Make a logic table showing output bit values for each combination of input bits.
4- Determine which combinations of input bits are "Don't Care" conditions.
5- Perform a logic minimization, usually with a Karnaugh map.
6- Analyze which minimizations lead to lower cost or chip count.
Yes the process is same. But this is the problem given to me in the form of case study.They asked us to draw logic circuits and truth tables and then simulate it in circuit lab
 

Thread Starter

srichandana

Joined Jul 13, 2019
5
A thread title of "Help me" is singularly unhelpful. Please try to come up with a more meaningful title.

What kind of "cost analysis" are you expected to do? Determine the per unit cost of manufacturing ten million units in China and setting up distribution centers around the world? Or the cost of the components bought as single quantities needed to breadboard a prototype? What kind of input are you using? What kind of output are you using? Do you need to include the NRE (non-recurring engineering) costs associated with researching and designing the prototype? What?

You have three possible input values for each of two inputs. That's six bits of information and only nine of those are valid. You only need three bits of output. Lots of ways to do it.

You need to show YOUR best attempt to work YOUR homework problem. After seeing your attempt we can then help guide you toward a solution.
 

Thread Starter

srichandana

Joined Jul 13, 2019
5
Actually sir asked us to draw truth tables and with the help of gates draw a logic circuit and then output should be shown in circuit lab by simulation.If it is (a+b)^2 we can use OR gate.But I am not getting how to solve (a-b)^2.
 

MrAl

Joined Jun 17, 2014
13,720
Actually sir asked us to draw truth tables and with the help of gates draw a logic circuit and then output should be shown in circuit lab by simulation.If it is (a+b)^2 we can use OR gate.But I am not getting how to solve (a-b)^2.
Since the range of data is so narrow, look up a digital multiplier and study that.
 

WBahn

Joined Mar 31, 2012
32,925
Actually sir asked us to draw truth tables and with the help of gates draw a logic circuit and then output should be shown in circuit lab by simulation.If it is (a+b)^2 we can use OR gate.But I am not getting how to solve (a-b)^2.
Clearly (a-b)^2 is a mathematical expression, as in your circuit should calculate the square of the difference of 'a' and 'b'.

How do you get that if you had (a+b)^2 instead that you could use an OR gate? Just because it is common practice to use a plus symbol for OR in Boolean logic expressions which just coincidentally happens to be the same symbol that is used for addition in normal arithmetic?

Does that really make sense to you?

I'm still seeing no evidence of any attempt to solve the problem. At the very least, can't you start a table that has every possible valid combination of 'a' and 'b' as inputs? Then could you make a column giving (a-b) for each of those input combinations? Then could you make a column that gives (a-b)^2 for each of those input combinations? Then could you put output columns for however many outputs you need to represent the possible valid outputs and what each of them needs to be for each input combination?

You don't need to know ANY logic or consider a single gate in order to come up with that table.
 
Top