Forum Discussion
TWyar
New Contributor
7 years ago5 bit arithmetic with negative value
I am currently doing a project where I need to display the result of an arithmetic operation. Everything seems to go perfectly, however when I do an operation such as (+A) + (-B), my result is incorr...
Vicky1
Regular Contributor
7 years agoHi,
I think it is working fine just confirm below things,
- have you provided 2`s complement input stimulus for negative input?
- provide 'add' input stimulus & confirm the 'i' value since in logic it depends & decide the addition /subtraction , ensure it from simulation window.
i(2) <= not(add);
i(1) <= as xor bs;
i(0) <= '0' when am >= bm else '1';
Let me know if this has helped resolve the issue you are facing or if you need any further assistance.
Best Regards
Vikas Jathar
(This message was posted on behalf of Intel Corporation)