LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; --USE IEEE.STD_LOGIC_ARITH.ALL; --USE IEEE.STD_LOGIC_UNSIGNED.ALL;
entity led is port(led1,led2,led3,led4:out bit;clk:in bit); end led;
architecture led_blink of led is
begin process(clk) variable s1:integer:=0; variable s2:integer:=0; begin i1:if (clk'event and clk='1') then s1:=s1+1;
if(s1>20000) then s2:=s2+1;
if(s2>2500 and s2<5000) then led1<='1'; led2<='0'; led3<='1'; led4<='0'; elsif(s2>=5000) then led1<='0'; led2<='1'; led3<='0'; led4<='1'; s2:=0; end if; s1:=0; end if;
文章评论(0条评论)
登录后参与讨论