Altera_Forum
Honored Contributor
15 years agosimple verilog question...
hi there!
im trying to determine the root cause of an error i keep getting. Basically I'm trying to convert a 2's complement value, lets say binary X to decimal Y (i do this by multiplying it with a constant [i.e. 625]). 1) so I do this, and it works perfectly. assign X_n = ~X - 1; always@(posedge CLK) begin Y = X_n * 625; end 2)BUT I can't do this: always@(posedge CLK) begin Y = (~X - 1) * 625; end I get a weird number with the second case. Does anyone know why?? Thanks in advance! This question has been bugging me for some time.