2024-02-23 13:01:05 +00:00
|
|
|
ARCHITECTURE studentVersion OF sawtoothGen IS
|
2024-02-23 15:14:04 +00:00
|
|
|
|
|
|
|
signal counter : unsigned(bitNb-1 downto 0);
|
|
|
|
|
2024-02-23 13:01:05 +00:00
|
|
|
BEGIN
|
2024-02-23 15:14:04 +00:00
|
|
|
|
2024-02-27 10:23:42 +00:00
|
|
|
count: process(clock)
|
2024-02-23 15:14:04 +00:00
|
|
|
begin
|
|
|
|
if reset = '1' then
|
|
|
|
counter <= (others => '0');
|
|
|
|
elsif rising_edge(clock) then
|
|
|
|
if en = '1' then
|
|
|
|
counter <= counter + step;
|
|
|
|
end if;
|
|
|
|
end if;
|
|
|
|
end process count;
|
|
|
|
|
|
|
|
sawtooth <= counter;
|
|
|
|
|
2024-02-23 13:01:05 +00:00
|
|
|
END ARCHITECTURE studentVersion;
|
|
|
|
|