Modify conditional operators in moving_average.vhd for Quartus compatibility
This commit is contained in:
parent
a20890e126
commit
66ed1d846b
@ -66,13 +66,22 @@ begin
|
||||
overflow <= '1';
|
||||
end if;
|
||||
if (enable = '1') then
|
||||
accumulator <= accumulator + unsigned("0" & data_in) - unsigned("0" & fifo_out) when (fifo_full = '1') else accumulator + unsigned("0" & data_in);
|
||||
if (fifo_full = '1') then
|
||||
accumulator <= accumulator + unsigned("0" & data_in) - unsigned("0" & fifo_out);
|
||||
else
|
||||
accumulator <= accumulator + unsigned("0" & data_in);
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
end process;
|
||||
|
||||
average <= std_logic_vector(((log2c(WINDOW_SIZE)-1 downto 0 => '0') & accumulator(DATA_WIDTH-1 downto log2c(WINDOW_SIZE))) + 1)
|
||||
when (ENABLE_ROUNDING and accumulator(log2c(WINDOW_SIZE)-1) = '1')
|
||||
else std_logic_vector(((log2c(WINDOW_SIZE)-1 downto 0 => '0') & accumulator(DATA_WIDTH-1 downto log2c(WINDOW_SIZE))));
|
||||
average_prc: process(all)
|
||||
begin
|
||||
if (ENABLE_ROUNDING and accumulator(log2c(WINDOW_SIZE)-1) = '1') then
|
||||
average <= std_logic_vector(((log2c(WINDOW_SIZE)-1 downto 0 => '0') & accumulator(DATA_WIDTH-1 downto log2c(WINDOW_SIZE))) + 1);
|
||||
else
|
||||
average <= std_logic_vector(((log2c(WINDOW_SIZE)-1 downto 0 => '0') & accumulator(DATA_WIDTH-1 downto log2c(WINDOW_SIZE))));
|
||||
end if;
|
||||
end process;
|
||||
end architecture;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user