Adders,Semiadders Circuit

hp1729

Joined Nov 23, 2015
2,304
Keep in mind that we don't know for sure that this problem and "the big circuit" are related. My guess is that this is a separate problem but that the result of this one is used in "the big circuit". But we don't really know that for sure. It's best if we try to keep a thread focused on the problem of that thread -- if for no other reason than someone reading this thread has no idea what is meant by "the big circuit".
Good point.
Thank you.
 

Thread Starter

Leite33

Joined Nov 28, 2015
57
Well adders and half adders sum inputs like S1=a01+a1+a2+a3. So i think i need one full adder and one half adder only. In full adder will have inputs a0,a1,a2,a3 and output s1=a0+a1+a2+a3 s2=a0+a1+a2+a3 and s3 will be carry and one half adder that will take inputs s1,s2,s3 and will bring my number s2s1s0 that is the number i want. I still not sure if i am right. I think something i miss again
 

Thread Starter

Leite33

Joined Nov 28, 2015
57
Well a full adder have 3 inputs and 2 outputs normal and a Semiadder have 2 inputs and 2 outputs normal. So can i use a full adder with 4 inputs? or its wrong and i jhave to make other combination
 

WBahn

Joined Mar 31, 2012
29,976
If a full adder has three inputs, how can you use it with four?

But what if you use a full adder for three of your outputs? Now what have you reduced the problem to?
 

Thread Starter

Leite33

Joined Nov 28, 2015
57
Yes ok i understand your point but what inputs should i use? My problem says the output will be s0s1s2 that will be the sum of Σ=a0+a1+a2+a3
 

Thread Starter

Leite33

Joined Nov 28, 2015
57
Ok i think i got it i will use 1 full adder and one half-adder (so i have 4 inputs (3 from full adder and one from half adder) and one input i guess will be the carry( the other input of half-adder)) . So after that i will use another hallf adder to connect their outputs i think.
 

WBahn

Joined Mar 31, 2012
29,976
Yes ok i understand your point but what inputs should i use? My problem says the output will be s0s1s2 that will be the sum of Σ=a0+a1+a2+a3
Yes. What's your point? You have the truth table for what you want the outputs to be in terms of the inputs.

Again. What if you use a full adder with three of the inputs? What does that do for you? Draw the truth table!
 

WBahn

Joined Mar 31, 2012
29,976
Ok i think i got it i will use 1 full adder and one half-adder (so i have 4 inputs (3 from full adder and one from half adder) and one input i guess will be the carry( the other input of half-adder)) . So after that i will use another hallf adder to connect their outputs i think.
So show what you are planning. A picture is worth many words -- schematics and logic diagrams are the language of electronics.
 

Thread Starter

Leite33

Joined Nov 28, 2015
57
But my exercise is very clear draw an adder that will have 4 inputs a0,a1,a2,a3
upload_2015-12-7_14-42-20.png

But is my thought right? about 1 full adder and 2 half adder. If you know the solution can you give me an example it will be better for me to understand
 

WBahn

Joined Mar 31, 2012
29,976
But my exercise is very clear draw an adder that will have 4 inputs a0,a1,a2,a3
Yes, it is. And you also said that you are to use only full adders and half adders. So what's your point?

But is my thought right? about 1 full adder and 2 half adder.
How can I know if it is right or wrong unless you show how you plan to connect them?

If you know the solution can you give me an example it will be better for me to understand
No, I will not do your homework for you.[/QUOTE]
 

Thread Starter

Leite33

Joined Nov 28, 2015
57
upload_2015-12-6_9-36-14.png

Dear friend.
Thats why i told you to give me an example. I need 4 inputs how i will use a five input? Do i need it to use it? And about the outputs i need only one output finally that will be s1s2s0
 

WBahn

Joined Mar 31, 2012
29,976
Your "one output" s2s1s0 (NOT s1s2s0!) is a THREE BIT output consisting of THREE one-bit signals. Each of the lines in your diagram is a ONE BIT signal, so your output consists of three of these signals.

My recommendation was to apply three of your input signals to the three inputs of a full adder. That's not the only way to do it, but it is one way to start out. That means that you now have two output signals from that full adder plus the other input signal that hasn't been used yet. The two output signals from the full adder constitute a two-bit signal that tells you the sum of those three signals. If you have the sum of three signals plus a fourth signal, what do you need to do in order to get the sum of all four signals?
 

Thread Starter

Leite33

Joined Nov 28, 2015
57
Can you just make an example of what you're saying? I really appreciate your help, but i can't actually translate the exact meaning of what you're writing to me, and Google Translator doesn't helps. So it would be great if you could make a little example of all this.
Thank you.
 

WBahn

Joined Mar 31, 2012
29,976
Go look up how multi-bit adders are constructed.

Although far from the simplest solution, you have four numbers that you want to add together:

S = A + B + C + D

So let's say that I give you a bunch of boxes that can add two numbers together.

S = ( (A+B) + (C+D) )

So I need three boxes.

I send A and B into one and get G out:

G = A + B

I send C and D into another and get H out:

H = C + D

I send G and H into the third and get S out:

S = G + H

And I'm done.

One subtle point is that, in general, the third box is not the same as the first two. The first two boxes need to be able to handle, as input, any and all values that A, B, C, and D can take on. But the third box has to be able to handle, as input, any and all values that G and H can take on, which can be twice as big as any of the values that the original inputs can have.
 

Thread Starter

Leite33

Joined Nov 28, 2015
57
I got your point and is very nice thought but i am still not sure how i will connect the 1 adder and 2 half adder.
upload_2015-12-6_22-16-18.png
 

WBahn

Joined Mar 31, 2012
29,976
In your diagram above you have two outputs (Co from HA0 and HA1) that are connected together. In standard logic you cannot connect two outputs together because then they fight (known as "contention" and produce unpredictable results).

So your first layer produces two two-bit numbers. That's fine (not the most efficient approach, but that this stage the focus is on getting ANY approach that is valid).

This means that you still have four signals (two from each half adder) but now they represent information differently. Your problem now is to add two two-bit numbers to get a single three-bit number. Look up how to make a two-bit adder from half adders and full adders. If you just Google "two bit adder" you will get plenty of information.

Another other way to approach it (and which I have suggested several times) is to put three of the four input signals into a full adder. Now you have three signals -- the two from the adder and the remaining input signal. Now, you might be tempted to just throw these three signals at another full adder, but you need to think about the information that is available and how it is represented -- a full adder takes three one-bit numbers and you have one one-bit number and one two-bit number -- very different.
 

Thread Starter

Leite33

Joined Nov 28, 2015
57
In your diagram above you have two outputs (Co from HA0 and HA1) that are connected together. In standard logic you cannot connect two outputs together because then they fight (known as "contention" and produce unpredictable results).

So your first layer produces two two-bit numbers. That's fine (not the most efficient approach, but that this stage the focus is on getting ANY approach that is valid).

This means that you still have four signals (two from each half adder) but now they represent information differently. Your problem now is to add two two-bit numbers to get a single three-bit number. Look up how to make a two-bit adder from half adders and full adders. If you just Google "two bit adder" you will get plenty of information.

Another other way to approach it (and which I have suggested several times) is to put three of the four input signals into a full adder. Now you have three signals -- the two from the adder and the remaining input signal. Now, you might be tempted to just throw these three signals at another full adder, but you need to think about the information that is available and how it is represented -- a full adder takes three one-bit numbers and you have one one-bit number and one two-bit number -- very different.
 

WBahn

Joined Mar 31, 2012
29,976
You are starting to move in the right direction, but you need to really consider the format of the information you are using.

Your approach is basically "design by happening" -- you are making random connections between components hoping that, at some point, something will just "happen" to work like you want it to. That is NOT the way to design anything (although it often seems like that's how governments come up with laws).

From HA0, the Co output indicates how many sets of "two" that your inputs contain. But by sending that signal into FA0 you are putting that signal on the same footing as the other two signals going into it which both represent how many sets of "one" are in that input.

Have you looked at the logic behind a two-bit adder (and adder that takes two two-bit numbers and adds them together to produce a three-bit output)?
 
Top