1
0
This repository has been archived on 2024-10-30. You can view files and clone it, but cannot push or open issues or pull requests.
SEm-ExamMidterm2024/VHD/hdl/ex_24_1_3_studentVersion.vhd

29 lines
553 B
VHDL
Raw Normal View History

2024-03-22 12:16:48 +00:00
architecture studentVersion of ex_24_1_3 is
2024-03-22 12:48:57 +00:00
signal counter : unsigned(timerBitNb-1 downto 0);
2024-03-22 12:16:48 +00:00
begin
2024-03-22 12:48:57 +00:00
process(reset, clock) begin
if reset = '1' then
counter <= (others => '0');
elsif rising_edge(clock) then
if testMode = '0' then
counter <= counter - 1;
else
counter <= counter - 2**(timerBitNb - testModeBitNb);
end if;
end if;
end process;
process(counter)
begin
if counter = 0 then
pwmEn <= '1';
else
pwmEn <= '0';
end if;
end process;
2024-03-22 12:16:48 +00:00
end studentVersion;