- 1、本文档共11页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
下载可编辑
下载可编辑
.
.专业.整理.
交通灯控制器课程设计
该交通信号控制器控制十字路甲 、乙两条道路的红、黄和绿三色灯,指挥车辆和行人
安全通行。
功能要求如下:
只有在小路上发现汽车时,高速公路上的交通灯才可能变成红灯 。
当汽车行驶在小路上时,小路的交通灯保持为绿灯,但不能超过给定的时间。(20s)
高速公路灯转为绿色后,即使小路上有汽车岀现,而高速公路上并无汽车,也将在给定的时间 内保持绿灯。(60s)。
设计如下:
1hz分频器
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity fen_pin1 is
port(clk100hz:in std_logic;
clk1hz:out std_logic);
end fen_pin1;
architecture bhv of fen_pin1 is
signal qan:std_logic_vector(3 downto 0);
signal qbn:std_logic_vector(3 downto 0);
signal cin:std」o gic;
begin
process(clk100hz)
begin
if(clk100hz'event and clk100hz='1')then
if qan="1001"then qan<="0000";cin<='1';
else qanv=qan+1;cin<='0';
end if;
end if;
end process;
process(clk100hz,cin)
begin
if(clk100hz'event and clk100hz='1')then
if cin='1' then
if qbn="1001" then qbn<="0000";
else qbn<=qbn+1;
end if ;
end if ;
end if ;
end process;
process(qan,qbn)
begin
if (qan="1001"and qbn="1001")then clk1hz<='1';
else clk1hz<='0';
end if;
end process;
end bhv;
2hz分频器
library ieee;
use ieee.std_logic_1164.all;
entity fen_pin2 is
port (clk100hz:in std_logic;
clk2hz:out std_logic);
end fen_pin2;
architecture bhv of fen_pin2 is
begin
process(clk100hz)
variable cnt:integer range 0 to 24;
variable tmp:std_logic;
begin
if(clk100hz'event and clk100hz='1')then
if cnt=24 then
cnt:=0;
tmp:=not tmp;
else
cnt:=cnt+1;
end if;
end if;
clk2hz<=tmp;
end process;
end bhv;
――主干道控制
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity contralz is
port(clk:in std_logic;
ra,ga,ya:out std_logic;
timeah,timeal:out std_logic_vector(3 downto 0));
end contralz;
architecture bhv of contralz is
type rg is(green,red,yellow2);
begin
process(clk)
variable a:std_logic;
variable th,tl:std_logic_vector(3 downto 0);
variable state:rg;
begin
if clk'event and clk='1'then
case state is
when green=>if a='0'then
th:="0101";
tl:="1001";
a:='1';
ga<='1';
ra<='0';
ya<='0';
else
if not(th="0000"and tl="0001")then
if tl="0000"then
tl:="1001";
th:=th-1
您可能关注的文档
- 1月广东省普通高中学业水平考试化学试卷(完整版含参考答案)(推荐文档).docx
- 2020届新课标高考理科数学仿真模拟测试.docx
- Android中的签名机制.docx
- centos6.5+mhvtl+gui+iscsi-tgt虚拟磁带库的安装与应用.docx
- EDA数字时钟设计说明.docx
- FANUC编写数控刀架的PMC程序文件.docx
- HSZ联合站工艺的设计123.docx
- HYRZ-902变压器绕组变形测试仪使用说明书精品文档8页.docx
- ISO9001质量管理体系的表单_9001[全套]表格.docx
- JAVA学生管理系统课程设计报告.docx
- 全国创新奖汇报:过程管理.pptx
- 回归热型结节性非化脓性脂膜炎预防和措施课件.pptx
- 高考政治一轮复习4.11寻觅社会的真谛必修市赛课公开课一等奖省名师优质课获奖PPT课件.pptx
- 回归热型结节性非化脓性脂膜炎健康宣讲.pptx
- 围生期心肌病的预防.pptx
- 高考政治复习第二单元为人民服务的政府第四课我国政府受人民的监督ppt市赛课公开课一等奖省名师优质课获.pptx
- 围生期心肌病危害及预防课件.pptx
- 高考政治复习3.4发展先进文化单元总结市赛课公开课一等奖省名师优质课获奖PPT课件.pptx
- 泪囊肿瘤的科普知识课件.pptx
- 高考政治复习单元整合提升4发展社会主义市场经济市赛课公开课一等奖省名师优质课获奖PPT课件.pptx
文档评论(0)