Professional Documents
Culture Documents
Counter 1Hz
Counter 1Hz
Counter 1Hz
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity counter_4_bit is
reset : in STD_LOGIC;
dir : in STD_LOGIC;
end counter_4_bit;
component clock_div is
reset : in STD_LOGIC;
end component;
begin
process (clock1,reset)
begin
if(reset='1') then
count_int<="0000";
elsif clock1='1' and clock1'event then
if dir='1' then
else
end if;
end if;
end process;
count<=count_int;
end Behavioral;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity clock_div is
reset : in STD_LOGIC;
end clock_div;
signal count:integer;
begin
process(reset,clk)
begin
if reset='1' then
count<=0;
clout<='0';
count<=count + 1;
if count=50000000 then
clout<=not clout;
count<=0;
end if;
end if;
end process;
end Behavioral;