Forum Discussion
Altera_Forum
Honored Contributor
16 years agoFloating point pachage
Hi, I need to use the Floating-point numbers and i have to compile “fixed_generic_pkg.vhdl” and “fixed_generic_pkg-body.vhdl” first, i'm using Quartus II 9.0 (32-bit) Thank you very much
Altera_Forum
Honored Contributor
16 years agoThese are the IEEE fixed point packages. They define types and functions that make using fixed point numbers easier in VHDL. There is a similar floating point ppackage, but I wouldnt recommend using it for synthesis.
the fixed point packages mike life alot easier when perforimg mathmatical operations on fixed point:
signal A : ufxied(4 downto -3); --3 bits fractional
signal B : ufixed(4 downto -3); -3 bits fractional
signal AtB : ufixed(9 downto -6);
signal ApB : ufixed(5 downto -3)
process(clk)
begin
if rising_edge(clk) then
AtB <= A * B;
ApB <= A + B;
end if;
end process;