22 lines
375 B
VHDL
22 lines
375 B
VHDL
ARCHITECTURE studentVersion OF sawtoothGen IS
|
|
|
|
signal counter : unsigned(bitNb-1 downto 0);
|
|
|
|
BEGIN
|
|
|
|
count: process(clock, reset)
|
|
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;
|
|
|
|
END ARCHITECTURE studentVersion;
|
|
|