Professional Documents
Culture Documents
Generic(N:Integer:=4);
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
enable : in STD_LOGIC;
q : out STD_LOGIC_VECTOR (N-1 downto 0));
end mod_n1v;
begin
--process( clk,reset)
--begin
--if reset='1' then
--clkout<='0';
--count <=0;
--elsif(clk' event and clk='1') then
--if(count = 49999999) then
--clkout <= not clkout;
--count <= 0;
--else
--count <= count+1;
--end if;
--end if;
--end process;
process(clk , reset)
begin
if (reset='1') then
count1<=(others=>'0');
elsif(clk'event and clk='1')then
if(enable='1')then
count1 <= count1+'1';
end if;
end if;
q <= count1;
end process;
end Behavioral;
Test Bench
entity test_mod is
-- Port ( );
end test_mod;