Untitled


SUBMITTED BY: bitcoinsachen

DATE: Jan. 18, 2017, 7:19 a.m.

FORMAT: Text only

SIZE: 402 Bytes

HITS: 1046

  1. library IEEE;
  2. use IEEE.std_logic_1164.all;
  3. architecture behavior of pwm is
  4. signal s_count: integer range 0 to 20000:=0;
  5. begin
  6. p_pwm_generate:process(clk)
  7. begin
  8. if clk'event and clk='1' then
  9. if s_count = 19999 then
  10. s_count <=0;
  11. else
  12. s_count<=s_count+1;
  13. end if;
  14. if ((s_count < 14200+5000)and(s_count >5000)) then
  15. o<='1';
  16. else o<='0';
  17. end if;
  18. end if;
  19. end process;
  20. end behavior;

comments powered by Disqus