problem in signed and unsigned variable(help me)

Status
Not open for further replies.

amir1985

Newbie level 3
Joined
Mar 6, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,298
I know this, my question is that assumes conditons that we use this data for other blocks,how you can find out that this value is two complementary or not?
 

Dear Amir,

If you have defined the signed reg or wire and , you do not have to worry about then, If it is negative value, It is 2's compliment, e.g. 111010 for -5 and 000101 for +5
even if you are using it in any way.
Try making a simple project of adder etc. with signed regs and wires and test it.
 

I think he is not asking wrt code. Instead he is asking how in run time, a data can be detected for 2's complement.....

I dont think it is that easy to detect....and why would you want to do so?..
 

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