- combine in/out_width to max_width

- uses ieee_proposed.fixed_pkg


git-svn-id: http://moon:8086/svn/vhdl/trunk@167 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2008-12-30 04:32:07 +00:00
parent d9ba866ed0
commit 4fe3a1c636
4 changed files with 35 additions and 55 deletions
+6 -7
View File
@@ -21,8 +21,11 @@ LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
library ieee_proposed;
use ieee_proposed.math_utility_pkg.all;
use ieee_proposed.fixed_pkg.all;
library work;
use work.fixed_pkg.all;
use work.fixed_util_pkg.all;
---- Uncomment the following library declaration if instantiating
@@ -35,11 +38,7 @@ Generic
(
max_diff_delay : integer := 1;
max_width : integer := 32;
max_width_frac : integer := 20;
in_width : integer := 32;
in_width_frac : integer := 20;
out_width : integer := 32;
out_width_frac : integer := 20
max_width_frac : integer := 20
);
Port
(
@@ -95,7 +94,7 @@ comb_proc:
dout <= (shi(max_width, max_width_frac) downto slo(max_width, max_width_frac) => '0');
elsif vld_in = '1' then
vld_out <= '1';
dout <= resize(x0 - x1, shi(out_width, out_width_frac), slo(out_width, out_width_frac));
dout <= resize(x0 - x1, shi(max_width, max_width_frac), slo(max_width, max_width_frac));
end if;
end if;
end process;