Forum Discussion
Altera_Forum
Honored Contributor
13 years agoaltfp_add_sub
I work with floating point addition and I got a pb in the execution on the fpga when I want to execute my program on a fpga 2s60es, the result is zero Please please i want a solution it 's urgent ...
Altera_Forum
Honored Contributor
13 years agoaclr and clken are both active high, so when you write 1 to aclr you keep the IP in constant reset. Similarly by writing 0 to clken you are disabling it.
The second problem is that in C you can't directly write floating point values to a hardware register. The compiler will cast your floating point values to integer, i.e. it will write 0x00000001 to PIO_0 and 0x00000002 to PIO_1. You will have to generate the correct values in hexadecimal yourself or use a dirty C trick with pointers to avoid automatic casting.