R
Rain
Guest
I defined a memory with basic data type std_logic_vector. I want to
store floating-point number in it. I defined a floating-point unit
which fetches operands from the memory directly, performs fp
calculation (+/-/*) in behavioral manner, and stores the result back
to the memory. Something like this:
...
din0 = mem(addr0);
din1 = mem(addr1);
result = din0 * din1; -- behavioral description
mem(addr2) = result;
...
Where din0, din1, result are all real. Since VHDL is strict with data
type, I think such assignment between std_logic_vector and real
signals cannot be made directly. What's the possible solution to this?
How can I store real numbers in a std_logic_vector memory?
Thanks!
store floating-point number in it. I defined a floating-point unit
which fetches operands from the memory directly, performs fp
calculation (+/-/*) in behavioral manner, and stores the result back
to the memory. Something like this:
...
din0 = mem(addr0);
din1 = mem(addr1);
result = din0 * din1; -- behavioral description
mem(addr2) = result;
...
Where din0, din1, result are all real. Since VHDL is strict with data
type, I think such assignment between std_logic_vector and real
signals cannot be made directly. What's the possible solution to this?
How can I store real numbers in a std_logic_vector memory?
Thanks!