library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity led is
port (
clkin:in std_logic;
clkout:out std_logic
);
end entity;
architecture behave of led is
signal mlow:std_logic_vector(9 downto 0);
signal mhigh:std_logic_vector(15 downto 0);
signal mcur:std_logic_vector(15 downto 0);
signal mtype:std_logic;
begin
process(clkin)
begin
if(clkin'event and clkin='1')then
mcur<=mcur+1;
if(mcur="1111111111111111")then
mhigh<=(others=>'0');
mcur<=(others=>'0');
end if;
mlow <=mlow+1;
if(mlow="1111111111")then
mlow<=(others=>'0');
mhigh<=mhigh+1;
end if;
if( mhigh="1111111111111111")then
mhigh<=(others=>'0');
mtype<=not mtype;
end if;
if(mtype='1')then
if(mcur > mhigh)then
clkout<=&
vhdl呼吸灯源码
最新推荐文章于 2025-02-28 12:27:48 发布