Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------------------------------------------------
- -- Company:
- -- Engineer:
- --
- -- Create Date: 16:53:25 12/01/2011
- -- Design Name:
- -- Module Name: guigui - Behavioral
- -- Project Name:
- -- Target Devices:
- -- Tool versions:
- -- Description:
- --
- -- Dependencies:
- --
- -- Revision:
- -- Revision 0.01 - File Created
- -- Additional Comments:
- --
- ----------------------------------------------------------------------------------
- library IEEE; -- Uncomment the following library declaration if instantiating
- use IEEE.STD_LOGIC_1164.ALL; -- any Xilinx primitives in this code.
- use IEEE.STD_LOGIC_ARITH.ALL; -- library UNISIM;
- use IEEE.STD_LOGIC_UNSIGNED.ALL; -- use UNISIM.VComponents.all;
- entity guigui is -- ouverture de la "boîte"
- Port ( clk : in STD_LOGIC; -- Declarations
- reset : in STD_LOGIC; -- des
- Q : out Std_logic; -- variables
- Cpt_H : out Std_logic_vector(9 downto 0);
- HS : out Std_logic);
- end guigui; -- fermeture de la "boîte"
- architecture Behavioral of guigui is -- Début architecture
- Signal Qint: Std_logic ; -- Declarations
- Signal a : Std_logic_vector(9 downto 0); --
- begin -- Début
- Q<=Qint; -- Q prend la valeur de Qint
- Cpt_H<=a; -- Compt_H prend la valeur de a
- process (CLK, reset) -- début du "sous-programme"
- begin -- Début
- if (reset='1') then Qint<='0'; -- Si reset = 1 alors Qint = 0
- elsif (CLK'event and CLK='1') then Qint<=not(Qint); -- Sinon front montant de CLK alors on inverse Qint
- end if;
- end process; -- Fin "sous-programme"
- process (Qint, reset) -- Début du "sous-programme"
- begin -- Début
- if (reset='1') then a<="0000000000"; -- Si reset = 1 alors a = 0
- elsif (Qint'event and Qint='1') then -- Sinon front montant de Qint alors
- if (a="1100011111") then a<="0000000000"; -- Si a = 799 alors on fixe a = 0
- else a<=a+1; -- donc on incremente de 1 la variable a
- end if; -- fin de la deuxiéme boucle if
- end if; -- fin de la premiére boucle if
- end process; -- fin du "sous-programme"
- HS<='1' when (a<"0001100000") else '0'; -- HS prend la valeur 1 quand a = 48
- end Behavioral; -- Fin de architecture
Add Comment
Please, Sign In to add comment