ALU control lines?
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
ALU control lines?

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Computer Architecture
Author Message
Paminu
Guest





Posted: Tue Aug 02, 2005 4:15 pm    Post subject: ALU control lines? Reply with quote

I saw an illustration of an ALU where input to Bnegate and CarryIn came from
the same signal.

Are Bnegate and CarryIn always the same?
Back to top
Joe Pfeiffer
Guest





Posted: Tue Aug 02, 2005 4:15 pm    Post subject: Re: ALU control lines? Reply with quote

Paminu <jadajada@asd.com> writes:

Quote:
I saw an illustration of an ALU where input to Bnegate and CarryIn came from
the same signal.

Are Bnegate and CarryIn always the same?

Why do you suppose they are the same in the illustration you're
looking at? Does that help you to see whether they should always be
the same?
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
New Mexico State University http://www.cs.nmsu.edu/~pfeiffer
skype: jjpfeifferjr
Back to top
Guest






Posted: Tue Aug 02, 2005 4:16 pm    Post subject: Re: ALU control lines? Reply with quote

If all you want to do is Add and Subtract.....

a - b = a + negate(b) + 1
Back to top
Paminu
Guest





Posted: Wed Aug 03, 2005 12:15 am    Post subject: Re: ALU control lines? Reply with quote

rhnlogic wrote:

Quote:
Paminu wrote:
MitchAlsup@aol.com wrote:

If all you want to do is Add and Subtract.....

a - b = a + negate(b) + 1

Note the above equation is for a subtract without either a borrow
or a reverse annuity with per clock cycle compound interest.

I have made a 1-bit ALU where Binvert and cIn get the same signal (from
Bnegate). But the result is incorrect when I would like to make the
following addition:

a = 0
b = 0
cIn = 1

Why did you choose to call this input "cIn" , instead of "Binvert"
or something else even more appropriate?


There are both cIn (carryIn) and binvert. Point is that Bnegate goes to both
cIn and binvert. If Bnegate is 1 then cIn and binvert is also 1. But when
binvert is 1, negate(b) is choosen and this results in:

0+1+1= 10

instead of:

0+0+1 = 1
Back to top
rhnlogic
Guest





Posted: Wed Aug 03, 2005 12:15 am    Post subject: Re: ALU control lines? Reply with quote

Paminu wrote:
Quote:
MitchAlsup@aol.com wrote:

If all you want to do is Add and Subtract.....

a - b = a + negate(b) + 1

Note the above equation is for a subtract without either a borrow
or a reverse annuity with per clock cycle compound interest.

Quote:
I have made a 1-bit ALU where Binvert and cIn get the same signal (from
Bnegate). But the result is incorrect when I would like to make the
following addition:

a = 0
b = 0
cIn = 1

Why did you choose to call this input "cIn" , instead of "Binvert"
or something else even more appropriate?


IMHO. YMMV.
--
rhn
Back to top
Paminu
Guest





Posted: Wed Aug 03, 2005 12:15 am    Post subject: Re: ALU control lines? Reply with quote

Joe Pfeiffer wrote:

Quote:
Paminu <jadajada@asd.com> writes:

I saw an illustration of an ALU where input to Bnegate and CarryIn came
from the same signal.

Are Bnegate and CarryIn always the same?

Why do you suppose they are the same in the illustration you're
looking at? Does that help you to see whether they should always be
the same?


If a=0, b=0 and cIn=1 the result will be "10", since binvert will also be 1.
But 0+0+1 should be "1" and not "10" so I don't understand why the two
inputs gets the same signal.
Back to top
Paminu
Guest





Posted: Wed Aug 03, 2005 12:15 am    Post subject: Re: ALU control lines? Reply with quote

MitchAlsup@aol.com wrote:

Quote:
If all you want to do is Add and Subtract.....

a - b = a + negate(b) + 1


I have made a 1-bit ALU where Binvert and cIn get the same signal (from
Bnegate). But the result is incorrect when I would like to make the
following addition:

a = 0
b = 0
cIn = 1 (this implies that binvert will also be 1 and therfore negate(b)
will be chosen).

I then get 0(a) + 1(negate(b)) + 1(cIn) = 10
where 0 is the sum and 1 is cOut.


If I seperate the signals and set binvert to 0, I get:
0(a) + 0(b) + 1(cIn) = 1
where 1 is the sum and cOut will be 0.

So I guess that even if I want to make a simple addition I need to seperate
the signals.
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Computer Architecture All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB