Altera_Forum
Honored Contributor
10 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. This is my code:
value =IORD_ALTERA_AVALON_PIO_DATA(base); to read the 24-bit signed signal. I define it as alt_32 value=0; The problem is it always give me positive value every time read from this line even though I am sure it is negative value from VHDL code. printf("\n value= %d \n", value); Any idea what went wrong??? sorry for the simple question... Thank you in advance