没有合适的资源?快使用搜索试试~ 我知道了~
南北方向和东西方向的共六个颜色灯(红黄绿)按给定延迟时间循环点亮。选用5个LED指示灯显示时间(以二进制)
资源推荐
资源详情
资源评论
library ieee;
use ieee.std_logic_1164.all;
entity yt is
port(clk:in std_logic;
time_counter:buffer integer range 0 to 49;
r1,y1,g1,r2,y2,g2:out std_logic);
end entity yt;
architecture one of yt is
Type FSM_ST is (s0,s1,s2,s3);
signal current_state,next_state:FSM_ST;
signal clk1:std_logic;
begin
oneSecond:process(clk)
variable count:integer range 0 to 999_999;
begin
if(clk='1' and clk'event) then
if count=999_999 then
count:=0;
else count:=count+1;
end if;
if(count<500_000) then
clk1<='0';
else
clk1<='1';
end if;
end if;
end process;
count_time:process(clk1)
begin
if(clk1='1' and clk1'event) then
use ieee.std_logic_1164.all;
entity yt is
port(clk:in std_logic;
time_counter:buffer integer range 0 to 49;
r1,y1,g1,r2,y2,g2:out std_logic);
end entity yt;
architecture one of yt is
Type FSM_ST is (s0,s1,s2,s3);
signal current_state,next_state:FSM_ST;
signal clk1:std_logic;
begin
oneSecond:process(clk)
variable count:integer range 0 to 999_999;
begin
if(clk='1' and clk'event) then
if count=999_999 then
count:=0;
else count:=count+1;
end if;
if(count<500_000) then
clk1<='0';
else
clk1<='1';
end if;
end if;
end process;
count_time:process(clk1)
begin
if(clk1='1' and clk1'event) then
资源评论
xufangfanglemon
- 粉丝: 5
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功