Assigning to the float32 type produces the error below in questa 2024.3 on eda playground.
** Error: testbench.vhd(9): Real literal 0 is not of type ieee.float_pkg.float32.
** Error: testbench.vhd(14): Real literal 0.5 is not of type ieee.float_pkg.float32.
** Error: testbench.vhd(15): Real literal 0.25 is not of type ieee.float_pkg.float32.
What are suitable values for assignment to float32 type?
Example code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.FLOAT_PKG.ALL;
entity FloatExample is
end FloatExample;
architecture Behavioral of FloatExample is
signal a, b, c : float32 := 0.0;
begin
process
begin
-- Assign values to float32 variables
a <= 0.5;
b <= 0.25;
-- Perform floating-point addition
c <= a + b;
wait;
end process;
end Behavioral;
to_float().