Forum Discussion
Altera_Forum
Honored Contributor
11 years agoHow to read a 24-bit signed signal from VHDL block fed in Nios II system - always +ve
HI, I have a very simple question but I have no idea what went wrong. Basically I have a 24-bit signed signal from VHDL block fed into Nios II system. I use C code for NIos II system. ...
Altera_Forum
Honored Contributor
11 years agoThe easiest way to sign extend a number is:
wire numAs24 = -24'd1245
wire numAs32 = {{(8){numAs24}},numAs24};
Granted the above is in Verilog, but it should be easy to turn it into the equivalent VHDL. Basically all it does is copy bit 23 into all of the upper bits.