No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Compteur_X.vhd 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ----------------------------------------------------------------------------------
  2. -- Company: INSA-Toulouse
  3. -- Engineer: Paul Faure
  4. --
  5. -- Create Date: 05.07.2021 15:20:28
  6. -- Module Name: Compteur_X - Behavioral
  7. -- Project Name: Processeur sécurisé
  8. -- Target Devices: Basys 3 ARTIX7
  9. -- Tool Versions: Vivado 2016.4
  10. -- Description: Compteur la coordonnée X du VGA
  11. --
  12. -- Dependencies:
  13. -- - None
  14. ----------------------------------------------------------------------------------
  15. library IEEE;
  16. use IEEE.STD_LOGIC_1164.ALL;
  17. use work.ScreenProperties.all;
  18. entity Compteur_X is
  19. Port ( CLK : in STD_LOGIC;
  20. RST : in STD_LOGIC;
  21. Value : out X_T;
  22. Carry : out STD_LOGIC);
  23. end Compteur_X;
  24. architecture Behavioral of Compteur_X is
  25. signal current : X_T := 0;
  26. signal intern_Carry : STD_LOGIC := '0';
  27. begin
  28. process
  29. begin
  30. wait until CLK'event and CLK = '1';
  31. if (RST = '0') then
  32. current <= 0;
  33. else
  34. current <= current + 1;
  35. if (current = screen_width + X_PulseWidth + X_FrontPorch + X_BackPorch - 1) then
  36. intern_Carry <= '1';
  37. current <= 0;
  38. else
  39. intern_Carry <= '0';
  40. end if;
  41. end if;
  42. end process;
  43. Value <= current;
  44. Carry <= intern_Carry;
  45. end Behavioral;