已阅读5页,还剩2页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity EDA1 is port(clk,en: in std_logic; lampa,lampb: out std_logic_vector(3 downto 0); acount,bcount: out std_logic_vector(7 downto 0);end EDA1;architecture a of EDA1 is signal numa,numb: std_logic_vector(7 downto 0); signal tempa,tempb: std_logic; signal statea,stateb: std_logic_vector(2 downto 0); signal ared,bred,agreen,bgreen,ayellow,byellow,aleft,bleft: std_logic_vector(7 downto 0); begin acount=numa; bcount=numb; x1:process(en) begin if en=0 then ared=01010101; ayellow=00000101; agreen=01000000; aleft=00010101; bred=01100101; byellow=00000101; bgreen=00110000; bleft=00010101; end if; end process; x2:process(clk,en) begin if clk=1 and clkevent then if en=1 then if tempa=0 then tempanuma=agreen; lampa=0010; stateanuma=ayellow; lampa=0100; stateanuma=aleft; lampa=0001; stateanuma=ayellow; lampa=0100; stateanuma=ared; lampa=1000; statealampa1) then if numa(3 downto 0)=0 then numa(3 downto 0)=1001; numa(7 downto 4)=numa(7 downto 4)-1; else numa(3 downto 0)=numa(3 downto 0)-1; end if; else if numa=1 then tempa=0; numa=numa-1; end if; end if; end if; else lampa=1000; statea=000; tempa=0; end if; end if; end process x2; x3:process(clk,en) begin if clk=1 and clkevent then if en=1 then if tempb=0 then tempbnumb=bred; lampb=1000; statebnumb=bgreen; lampb=0010; statebnumb=byellow; lampb=0100; statebnumb=bleft; lampb=0001; statebnumb=byellow; lampb=0100; stateblampb1) then if numb(3 downto 0)=0 then numb(3 downto 0)=1001; numb(7 downto 4)=numb(7 downto 4)-1; else numb(3 downto 0)=numb(3 downto 0)-1; end if; else if numb=1 then tempb=0; numb=numb-1; end if; end if; end if; else lampb=1000; stateb=000; tempbdisplaydisplaydisplaydisplaydisplaydisplaydisplaydisplaydisplaydisplaydisplay=1110011; end case; end process; end led_arch; library ieee;use ieee.std_logic_1164.all;entity EDA3 is port(cl,sn: in std_logic; lama,lamb: out std_logic_vector(3 downto 0); disp1,disp2,disp3,disp4: out std_logic_vector(6 downto 0);end EDA3;architecture a of EDA3 is signal m,n: std_logic_vector(7 downto 0); component EDA2 port( data: in std_logic_vector(3 downto 0); display: out std_logic_vector(6 downto 0); end component; component EDA1 port(clk,en : in std_logic; lampa,lampb: out std_logic_vector(3 downto 0); acount,bcount: out std_logic_vector(7 downto 0); end component; begin u1 : EDA1 port map(cl,sn,lama,lamb,m,n); u2 : EDA2 port map(m(3 downto 0),disp1);
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年教育行业在线教育平台数字化教学模式研究报告及未来发展趋势预测
- 网络安全监察考试题库及答案解析
- 传染科护理学题库及答案解析
- 2025年生物科技农业行业生物农业技术发展与农产品质量安全研究报告及未来发展趋势预测
- 2025年服装行业工业0技术在服装行业的应用研究报告及未来发展趋势预测
- 《初中历史专题研究:中国古代史教学教案》
- 文档管理分类标准化指南
- 安全注册工程师万题库及答案解析
- 安全C2科目题库及答案解析
- 数据保护安全利用承诺书4篇
- 架子鼓教学基础课件
- 绝缘检测仪操作技术课件
- 2025年江苏社会工作者考试真题-江苏社会工作者考试真题及答案
- 2025年江苏省选调生考试综合知识试题
- 牙克石市矿产资源开发环境承载力评价报告
- 2025年分布式光伏发电项目并网验收调试报告
- T/CECS 10047-2019绿色建材评价预拌混凝土
- 桥架安装承包合同范本
- 十八项医疗核心制度考试题和答案
- 地铁安检人员培训大纲
- 公司3s管理制度
评论
0/150
提交评论