# Combinational circuit that calculates sum

#### Giorgos Alexakis

Joined Feb 8, 2019
17
Hello everyone ,
This is an exam question I'm trying to figure out for my finals tomorrow.
"Draw a combinational circuit that calculates the sum S=4A+3B where A=a1a0 B=b1b0 (2bit unsigned). You can use only half adders and full adders but keep it to the minimum".

#### ericgibbs

Joined Jan 29, 2010
18,007
hi Giorgos,
Please post your attempt at answering the question, so that we can guide you through the problem.
E

#### Giorgos Alexakis

Joined Feb 8, 2019
17
hi Giorgos,
Please post your attempt at answering the question, so that we can guide you through the problem.
E
I was thinking of using carry lookahead with Pi=Ai xor Bi , Gi=Ai Bi but i get confused with multiplication as with two bits I can only represent numbers from 0 to 3

#### WBahn

Joined Mar 31, 2012
29,161
How were you planning on using carry-lookahead if you are only allowed to use half-adders and full-adders?

Hint: You can do this with just three components.

#### Giorgos Alexakis

Joined Feb 8, 2019
17
How were you planning on using carry-lookahead if you are only allowed to use half-adders and full-adders?

Hint: You can do this with just three components.
Do you mean this : Si=Pi xor Ci , Ci+1=Gi+Pi Ci ??

#### WBahn

Joined Mar 31, 2012
29,161
Do you mean this : Si=Pi xor Ci , Ci+1=Gi+Pi Ci ??
What is "this"?
Is it your attempt at a solution?

Draw (and post) a sketch of how you would hook up nothing but half-adders and/or full-adders to implement this circuit. Just take your best shot.

Do you understand how to get 2A from A without any components at all?

#### Giorgos Alexakis

Joined Feb 8, 2019
17
What is "this"?
Is it your attempt at a solution?

Draw (and post) a sketch of how you would hook up nothing but half-adders and/or full-adders to implement this circuit. Just take your best shot.
S(sum) P(propagation) G(generation) C(carry)

#### Attachments

• 18 KB Views: 5

#### WBahn

Joined Mar 31, 2012
29,161
S(sum) P(propagation) G(generation) C(carry)

Now make and attempt to use one or more of those, and/or one or more half-adders, to implement the desired function.

This can be done with just two half-adders.

#### Giorgos Alexakis

Joined Feb 8, 2019
17

This can be done with just two half-adders.
I hope its something like this... I consider 3 as a binary which is 11 and I named it Z. I used the multiplication logic

#### Attachments

• 79.6 KB Views: 5

#### WBahn

Joined Mar 31, 2012
29,161
I hope its something like this... I consider 3 as a binary which is 11 and I named it Z. I used the multiplication logic

You have to make your circuit using NOTHING but what is available in those two baskets.

You do not have AND gates.

You do not have XOR gates.

Nothing else!

Your schematic must consist of nothing but boxes labeled HA and/or boxes labeled FA and wires connecting them.

A HA has two inputs ('a' and 'b') and two outputs ('sum' and 'carry').

A FA has three inputs ('a', 'b', 'c') and two outputs ('sum' and 'carry').

#### Giorgos Alexakis

Joined Feb 8, 2019
17

You have to make your circuit using NOTHING but what is available in those two baskets.

You do not have AND gates.

You do not have XOR gates.

Nothing else!

Your schematic must consist of nothing but boxes labeled HA and/or boxes labeled FA and wires connecting them.

A HA has two inputs ('a' and 'b') and two outputs ('sum' and 'carry').

A FA has three inputs ('a', 'b', 'c') and two outputs ('sum' and 'carry').
So something like this for 3B ??.And if that is correct I can do it with just one FA right ?

#### Attachments

• 69.5 KB Views: 2

#### WBahn

Joined Mar 31, 2012
29,161
So something like this for 3B ??.And if that is correct I can do it with just one FA right ?
Remember, A and B are both two-bit values.

#### Giorgos Alexakis

Joined Feb 8, 2019
17
Remember, A and B are both two-bit values.
I'm sorry i can't understand how to do it

#### WBahn

Joined Mar 31, 2012
29,161
I'm sorry i can't understand how to do it
Say I have three wires going into a box that represent a 3-bit value with A = <A2,A1,A0>.

Now say I have five wires coming out of the box that represent a 6-bit value with Y = <Y5,Y4,Y3,Y2,Y1,Y0>

Inside the box I connect a wire from A2 to both Y5 and Y2, from A1 to both Y4 and Y1, and from A0 to both Y3 and Y0.

What is the mathematical relationship between Y and A?

#### Giorgos Alexakis

Joined Feb 8, 2019
17
Say I have three wires going into a box that represent a 3-bit value with A = <A2,A1,A0>.

Now say I have five wires coming out of the box that represent a 6-bit value with Y = <Y5,Y4,Y3,Y2,Y1,Y0>

Inside the box I connect a wire from A2 to both Y5 and Y2, from A1 to both Y4 and Y1, and from A0 to both Y3 and Y0.

What is the mathematical relationship between Y and A?
A=2Y ?

#### WBahn

Joined Mar 31, 2012
29,161
Nope.

Draw it out and put in a few values and see what the output values are?

Do you see the pattern?

#### Giorgos Alexakis

Joined Feb 8, 2019
17
Nope.

Draw it out and put in a few values and see what the output values are?

Do you see the pattern?
You know i have to get some sleep, its too late here .Im taking my final exam in 6 hours .Thank you for your responses
If i don't pass at least I hope to understand the problems for the next time so Im going to reply after the results maybe.

#### WBahn

Joined Mar 31, 2012
29,161
You know i have to get some sleep, its too late here .Im taking my final exam in 6 hours .Thank you for your responses
If i don't pass at least I hope to understand the problems for the next time so Im going to reply after the results maybe.
Get some sleep and do the best you can. At this point, if you don't know it, cramming another few hours isn't going to make a magical difference -- you'll pass our you won't. If you don't, you have a much better idea of what you are in for and how much sooner you need to get a handle on things.

Good luck.