From 8830cf7589d85984ec8e74178589e4c9ff75f0cd Mon Sep 17 00:00:00 2001 From: epilef Date: Fri, 10 Mar 2017 09:28:30 -0300 Subject: [PATCH] Cambio de Rango MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Se cambió a variables de 12bits --- FiltroHDL/Filter.vhd | 6 ++++-- FiltroHDL/filter_pkg.vhd | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/FiltroHDL/Filter.vhd b/FiltroHDL/Filter.vhd index cd31d10..f973667 100644 --- a/FiltroHDL/Filter.vhd +++ b/FiltroHDL/Filter.vhd @@ -44,7 +44,9 @@ architecture Behavioral of Filter is --~ Acumulador: - signal accum: integer range -MAX_RANGE to MAX_RANGE := 0; + constant INIT_VAL: integer range -MAX_RANGE to MAX_RANGE := 0; + signal accum: integer range -MAX_RANGE to MAX_RANGE := INIT_VAL; + signal i : integer range 0 to N-1 := 0; signal i_rst : std_logic := '0'; @@ -121,7 +123,7 @@ begin if ( enable = '1' ) then if ( i_rst = '1' ) then i <= 0; - accum <= 0; + accum <= INIT_VAL; else if ( i < N-1 ) then diff --git a/FiltroHDL/filter_pkg.vhd b/FiltroHDL/filter_pkg.vhd index 3821880..80208f0 100644 --- a/FiltroHDL/filter_pkg.vhd +++ b/FiltroHDL/filter_pkg.vhd @@ -3,7 +3,7 @@ use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; package filter_pkg is - constant MAX_RANGE : integer := 511; + constant MAX_RANGE : integer := 2047; type array_of_integers is array(integer range <>) of integer range -MAX_RANGE to MAX_RANGE; @@ -21,7 +21,7 @@ package filter_pkg is SIMETRIC : boolean := TRUE; - CONSTANTS : array_of_integers := (-4,-3,-2,-1,0,1,2,3,4,5) + CONSTANTS : array_of_integers := (1,2,3,4,5,6,7,8,9,10) ); port (