



免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
汉字点阵显示VHDL源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity hzxs isport(clk1,clk2:in std_logic; rd:out std_logic; we: out std_logic; ledw:out std_logic_vector(2 downto 0);d:out std_logic_vector(0 downto 7); end hzxs;architecture hav of hzxs issignal count:std_logic_vector(0 to 2);signal a: std_logic_vector(3 downto 0);begin process(clk2)begin if clk2event and clk2=1 thencount=count+1;end if;ledw=count;a(2 downto 0)=count;end process;process(clk1)beginif clk1event and clk1=1 thena(3)ddddddddddddddddd=00000000;end case;end process;rd=1;we=0;end hav;数字抢答器VHDL源程序1)抢答器QDQlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity qdq isport(clr:in std_logic; a,b,c,d:in std_logic; an,bn,cn,dn:out std_logic); end qdq;architecture hav of qdq issignal ss:std_logic_vector(0 to 3);beginssan=1;bn=0;cn=0;dnan=0;bn=1;cn=0;dnan=0;bn=0;cn=1;dnan=0;bn=0;cn=0;dnan=0;bn=0;cn=0;dn=0;end case; elsif clr=0 thenan=0;bn=0;cn=0;dn=0;end if;end process;end hav;2)计分器JFQlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity jfq isport(en1:in std_logic; clk3:in std_logic; bs:out std_logic_vector(3 downto 0); ss:out std_logic_vector(3 downto 0); gs:out std_logic_vector(3 downto 0); add:in std_logic; dec:in std_logic);end jfq;architecture hav of jfq isbeginprocess(clk3,en1,add,dec)variable ssw:std_logic_vector(3 downto 0);variable bsw:std_logic_vector(3 downto 0);beginbsw:=0001;if clk3=1 and clk3event then if en1=1 then if add=1 then if ssw=1001 then bsw:=bsw+1; ssw:=0000; else ssw:=ssw+1; end if;elsif dec=1 then if ssw=1111 then bsw:=bsw-1; ssw:=1001; else ssw:=ssw-1; end if; end if;end if;end if;ss=ssw; bs=bsw; gs=0000;end process; end hav;3) 选择器XZQlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity xzq isport( a1,b1:in std_logic; abw:in std_logic_vector(0 to 3); asw:in std_logic_vector(0 to 3); agw:in std_logic_vector(0 to 3); bbw:in std_logic_vector(0 to 3); bsw:in std_logic_vector(0 to 3); bgw:in std_logic_vector(0 to 3); obw:out std_logic_vector(0 to 3); osw:out std_logic_vector(0 to 3); ogw:out std_logic_vector(0 to 3);end xzq;architecture hav of xzq isbeginprocess(a1,b1)begin if a1=1 and b1=0 thenobw=abw;osw=asw;ogw=agw; elsif a1=0 and b1=1 thenobw=bbw;osw=bsw;ogw=bgw; end if;end process;end hav;4)译码器YMQlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity ymq isport( clk2:in std_logic; bw:in std_logic_vector(3 downto 0); sw:in std_logic_vector(3 downto 0); gw:in std_logic_vector(3 downto 0); y:out std_logic_vector(7 downto 0); ledw:out std_logic_vector(2 downto 0);end ymq;architecture hav of ymq issignal knum:std_logic_vector(3 downto 0);signal count:std_logic_vector(2 downto 0);beginprocess(clk2)begin if clk2event and clk2=1 then if count2 then count=count+1;else count=000;end if;end if;end process;ledw=count;knum=gw when count=0 else sw when count=1 else bw when count=2 ;y=00111111 when knum=0000 else 00000110 when knum=0001 else 01011011 when knum=0010 else 01001111 when knum=0011 else 01100110 when knum=0100
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025贵州省临床检验中心第十三届贵州人才博览会引才考前自测高频考点模拟试题(含答案详解)
- 2025广西贵港市覃塘区三里镇面储备村(社区)“两委”后备人才88人模拟试卷及一套完整答案详解
- 2025商务合同范本:企业间合作协议书模板简化版
- 嘉兴市房地产经纪人考试(房地产经纪职业导论)题库及答案(2025下半年)
- 2025辽宁锦州医科大学开展“锦医英才计划”教学名师遴选工作考前自测高频考点模拟试题及参考答案详解
- 2025年度福建省血液中心招聘6人考前自测高频考点模拟试题及答案详解(新)
- 2025年甘肃省庆阳市新庄煤矿面向社会招聘生产性灵活用工206人考前自测高频考点模拟试题及一套参考答案详解
- 2025江西吉安市吉州区社会福利院招聘编外工作人员1人(三)模拟试卷(含答案详解)
- 2025江西农业大学高层次人才招聘101人模拟试卷及答案详解(新)
- 2025二手房购房合同全书
- 2024镇江市高等专科学校辅导员招聘笔试真题
- 四川省中小学教育技术装备标准 (试行)
- 拆除改造工程方案
- 大阪驾照考试题库及答案
- 房建试验培训
- 第一章 有理数 单元测试(含解析) 2025-2026学年人教版(2024)七年级数学上册
- 中国古代水利工程
- 传染学艾滋病患者的护理
- T/CECS 10011-2022聚乙烯共混聚氯乙烯高性能双壁波纹管材
- 智能化项目管理的前沿探索-洞察阐释
- 园林工程全套课件
评论
0/150
提交评论