The reason of Verilog signed math calculation error

Status
Not open for further replies.

EDA_hg81

Advanced Member level 2
Joined
Nov 25, 2005
Messages
507
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Visit site
Activity points
4,808
I am using Microchip Libero SOC to process the incoming data using Verilog.

But I found out the Verilog signed math operation is not correct, such as "01a114" + "ff6a1d" should = 010b31, but the result is "000b31"

Please let me know how to fix this problem.

Many thanks in advance.

 

why the waveform is 32 bits as 01a11400 not 01a114
 

I found out the solution to fix above problem is to break math into steps instead of putting all equation into one line.
 

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