# ALU

7 messages
Open this post in threaded view
|

## ALU

 Can someone please give me some hints as to how to implement the negating part of the ALU ? I'm stuck and I don't want to continue without finishing this first!
Open this post in threaded view
|

## Re: ALU

 Can someone give me ANY hints at all? I've done a lot of googling and i can't find out how to do it/understand how to do it in HDL. :(
Open this post in threaded view
|

## Re: ALU

 Administrator In reply to this post by Thomas Tetlaw Thomas Tetlaw wrote Can someone please give me some hints as to how to implement the negating part of the ALU ? I'm stuck and I don't want to continue without finishing this first! In this context, "negate" has two meanings.  Read 2.2.2 carefully to determine if you need arithmetic negation or logical negation. Check out ybakos' worksheet http://questions-and-answers-forum.32033.n3.nabble.com/ALU-Worksheet-tp95834p95834.htmlAlso, since this is hardware and not software, it is easier to compute everything and choose the result you need than to build a circuit that does conditional computation. If you need more help, send me a private message with your email address and I'll be happy to guide you further. --Mark
Open this post in threaded view
|

## Re: ALU

 cadet1620 wrote Also, since this is hardware and not software, it is easier to compute everything and choose the result you need than to build a circuit that does conditional computation I think that this is a a very important insight.
Open this post in threaded view
|

## Re: ALU

 In reply to this post by cadet1620 Okay, I looked at 2.2.2 and saw that it read bit-wise negation, and now I have code that when n(the negate bit) is 1 and in(the 16-bit input bus) is 1(in decimal) the output is -2. Is this correct output? (I don't know if I should post my whole code as it could be a spoiler.)