Add[16]

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Add[16]

andre
how do i create an add[16]? not sure how the carry would move 2 the next bit!
Reply | Threaded
Open this post in threaded view
|

Re: Add[16]

ybakos
Consider how you created the full adder from the half adder.

And consider what you want to happen (I suggest using pencil and paper if you haven't already): you want the carry out of one adder to become _what_ for the next adder?

Let us know if you're still stuck.
Reply | Threaded
Open this post in threaded view
|

Re: Add[16]

andre
no worries. got the answer. it was quite straight forward. thank you.

How do i input a logic 1 into an input? how do i write that? is it a=1
Reply | Threaded
Open this post in threaded view
|

Re: Add[16]

ybakos
I'll have to double check and refresh my memory... but I believe it is true, not 1.
Reply | Threaded
Open this post in threaded view
|

Re: Add[16]

myles
I understand about the carry in/out except in the case of the first and last. Should this be a chain? If so, just not sure where to get input from.
Reply | Threaded
Open this post in threaded view
|

Re: Add[16]

cadet1620
Administrator
myles wrote
I understand about the carry in/out except in the case of the first and last. Should this be a chain? If so, just not sure where to get input from.
The TECS Add16 part does not support carry chaining. There is no carry into the rightmost adder, and the carry out from the leftmost adder is ignored.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Add[16]

myles
Ok, what is this: "you want the carry out of one adder to become _what_ for the next adder?" in relation to? I have a book about code that showed inside a multi-bit add with carry output going to c input, that's the direction I was going.

I'm using FullAdder, not sure if/how I should utilize 3rd input and 2nd output.
Reply | Threaded
Open this post in threaded view
|

Re: Add[16]

cadet1620
Administrator
myles wrote
Ok, what is this: "you want the carry out of one adder to become _what_ for the next adder?" in relation to? I have a book about code that showed inside a multi-bit add with carry output going to c input, that's the direction I was going.

I'm using FullAdder, not sure if/how I should utilize 3rd input and 2nd output.
Right.  Carry out to carry in of the next higher bit.

Since there is no carry into the rightmost bit set c=false, or use a half-adder for bit 0.

Since overflow is ignored, you don't need to connect anything to the carry out from bit 15.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Add[16]

myles
Can I PM what I have? I looks right to me but it's failing halfway through, think I need different perspective.