1
0
SEm-Labos/01-WaveformGenerator/WaveformGenerator/hdl/lowpass_studentVersion.vhd

18 lines
493 B
VHDL
Raw Normal View History

2024-02-23 13:01:05 +00:00
ARCHITECTURE studentVersion OF lowpass IS
2024-03-01 14:12:05 +00:00
signal accumulator: unsigned((signalBitNb-1)+shiftBitNb downto 0);
2024-02-23 13:01:05 +00:00
BEGIN
2024-03-01 14:12:05 +00:00
process(clock)
begin
if reset = '1' then
accumulator <= (others => '0');
elsif rising_edge(clock) then
accumulator <= accumulator + resize(lowpassIn,signalBitNb+shiftBitNb) - shift_right(accumulator, shiftBitNb);
end if;
end process;
lowpassOut <= resize(shift_right(accumulator, shiftBitNb), signalBitNb);
2024-02-23 13:01:05 +00:00
END ARCHITECTURE studentVersion;