Getting a negative output when doing VHDL subtraction

Status
Not open for further replies.

venkyatit

Newbie level 3
Joined
Oct 1, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
UK
Activity points
1,306
Hi. I am new to VHDL. My code appears to be working fine if two variables (defined as integers) are added. It is even working when subtracting (C<=A-B), only if variable A is greater than B.
However, when B is greater than A then the output is incorrect (normally zero), whereas I am looking for a negative output. I tried using signed variables but could n't get my head around it.

Can someone help me?
 

Re: VHDL subtraction

Hi,

Can you post your VHDL code? This makes it easier for us to help you.

Devas
 

Re: VHDL subtraction

Thanks. I have posted it with a different subject. ( Issue with VHDL subtraction).
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…