range_finder/frequencydivider1.vhd
2020-12-17 15:03:10 +01:00

32 lines
No EOL
663 B
VHDL

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
Entity frequencydivider1 is
Port ( SignalEntree : in std_logic;
Q : out std_logic_vector(12 downto 0);
SignalSortie : out std_logic);
End frequencydivider1;
Architecture Behaviour of frequencydivider1 is
signal D : std_logic_vector(12 downto 0);
Begin
Seq : process(SignalEntree)
Begin
If (SignalEntree'event and SignalEntree='1') then
If (D < 2857) then
D <= D+1;
SignalSortie <= '0';
Elsif (D >= 2857) then
D <="0000000000000";
SignalSortie <= '1';
End If;
End If;
End process seq;
Q <= D;
End Behaviour;