Forum Discussion
Altera_Forum
Honored Contributor
16 years agoHow to write floating-point value to custom logic???
Hi all, I worte a component which is using altfp_sqrt of megafunction, then I checked the simulation with avalon interface signal, it's match the timing and need 17 cycles. All configurations are ...
Altera_Forum
Honored Contributor
16 years agoHello,
You can use a function to copy hexadecimal values using the address like that :
unsigned long F32ToHex (float valueF)
{
unsigned long* valueL = (unsigned long*) &valueF;
return *valueL;
}And you call it as following :
float value = 678.482;
unsigned long hexValue;
hexValue = F32ToHex(value);
IOWR(SQRT_BASE, 0, hexValue);
Jérôme