Jerker Hammarberg (DST) wrote:
> I put together a generic floating point package that performs addition,
> subtraction, multiplication and comparison. Contrary fphdl
> (www.eda.org/fphdl), it is synthesizable with Xilinx XST - that's why
> I made my own. Anyway, I present it here in the hope that anyone may
> wants to look through it for
> * possible optimizations, particularly for implementation size,
> * language misuse or simplifications,
> * bugs,
> * or actually, any possible improvements.
Consider:
1. A simple testbench with an assertion for each function.
2. numeric_std:
-- use ieee.std_logic_arith.all;
use ieee.numeric_std.all;
m := "01" & shift_left((m(size-3 downto 0))
to_integer(to_unsigned(leftshift,EXPSIZE)));
-- m := "01" & shl(m(size-3 downto 0),
-- conv_unsigned(leftshift, EXPSIZE));
-- rsres := shr(rsarg1, rsarg2);
rsres := shift_right(rsarg1, to_integer(rsarg2));
-- return conv_std_logic_vector(result, TOTALSIZE);
return std_logic_vector(result);
-- return conv_std_logic_vector(result, TOTALSIZE);
return std_logic_vector(result);
-- Mike Treseler