I spent quite a long time trying to build my ALU, and after a few problems I can't seem to be able to fix this one... I get comparison errors in multiple tests. I then tried multiple codes available on gitHubs etc.. here is one of those that was exactly the same as mine (I mixed my files and cannot find my own anymore) :
I had the feeling that my issue came from negative additions. I (believe that I) fully understand the concept of 2's complement. It looks like my first three lines, using the f as an "Add", give me an opposite (in the mathematical way) of what I should get. Whereas, when I use the "and" function, in line 4 and 5, I get the right result.
Thank you for any clue or any answer :)
ADMIN EDIT: Details of design removed once issue resolved.
First, I paid very close attention to every part of the comparison, as to see where my ALU was off, as you said. I then realized the problem was arround my "Add16" function.
So, it actually was not off anywhere : in fact, I had created my "Add16.hdl" file in another directory, leaving the empty one inside the directory "projects/02". The software tried to use it instead of the BuiltIn one, therefore returning "0" for any "Add16" written in the program.
I took the bad file away and everything goes smooth.
I explain all this in case someone falls in the same trap as I did, sorry for the chitchat.
Thanks a lot WBahn :)