Forum Discussion
Altera_Forum
Honored Contributor
15 years agoWritting floating point numbers using IOWR IORD
Hi, I'm trying to read a custom register which has a 32 bit floating point value, from the NIOS in the c-code using the Macro IORD(base,offset). If I assign this to a variable defined as flo...
Altera_Forum
Honored Contributor
15 years agoBe aware that the C compiler isn't necessarily required to compile that code in the way that you expect! Read up on 'strict aliasing'.
If you look at how IORD() and IOWR() are defined, you should be able to generate a version for 'float' instead of (probably) 'unsigned int'.