vhdl - How to send a floating point number to FPGA from HPS? -


i using altera de0 nano soc fpga. want know how send floating point number fpga hps.

let float ex_hps = 6000.9282; sent via avalon memory mapping interface. if avalon_write_data address has 32 bits data length (which can set qsys), in fpga side number stored in 32-bit std_logic_vector right?

does std_logic_vector contains float number fixed point type (13 downto -14) original value? or how put number fixed point number ex_fpga(13 downto -14) in fpga side in vhdl?

this have looked yourself.

you need map float integer in c first, using knowledge system.

#include <math.h>  unsigned int preparefortransmission(float inputvalue) {     if (inputvalue < 0) return 0; /* underflow error: clip */     if (inputvalue >= powf(2.0f, 14)) return (unsigned int)pow(2.0, 28) - 1; /* overflow error: clip */     return (unsigned int)(inputvalue * pow(2.0, 14) + 0.5); /* +0.5 round */ } 

then in vhdl can port unsigned std_logic_vector(27 downto 0) ufixed(13 downto -14). (hopefully) know how that.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -