VHDL程序题教案资料.doc

VHDL程序题教案资料.doc

ID:61931978

大小:2.84 MB

页数:16页

时间:2021-03-31

VHDL程序题教案资料.doc_第1页
VHDL程序题教案资料.doc_第2页
VHDL程序题教案资料.doc_第3页
VHDL程序题教案资料.doc_第4页
VHDL程序题教案资料.doc_第5页
资源描述:

《VHDL程序题教案资料.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、__________________________________________________1.以下是一位全加器的VHDL设计,试补充完整。libraryieee;--半加器设计useieee.std_logic_1164.all;entityh_adderisport(a,b:instd_logic;co,so:outstd_logic);endh_adder;architecturefh1ofh_adderisbeginso<=not(axor(notb));co<=aandb;endarchit

2、ecturefh1;libraryieee;--或门设计useieee.std_logic_1164.all;entityor2aisport(a,b:instd_logic;c:outstd_logic);endor2a;architecturertlofor2aisbeginc<=aorbafter10ns;endrt;libraryieee;--全加器设计useieee.std_logic_1164.all;entityf_adderISport(ain,bin,cin:instd_logic;cout

3、,sum:outstd_logic);endentityf_adder;architecturefd1OFf_adderIScomponenth_adderport(a,b:instd_logic;co,so:outstd_logic);endcomponent;componentor2a____________________________________________________________________________________________________port(a,b:ins

4、td_logic;c:outstd_logic);endcomponent;signald,e,f:std_logic;beginu1:h_adderportmap(a=>ain,b=>bin,co=>d,so=>e);u2:h_adderportmap(a=>e,b=>cin,co=>f,so=>sum);u3:or2aportmap(a=>d,b=>f,c=>cout);endarchitecturefd1;2.以下是含有使能端且具有同步清零的加减计数器的VHDL设计,试补充完整。libraryieee;

5、useieee.std_logic_1164.all;entitycounterisport(updown,enable,clear,clk:instd_logic;q:outintegerrange0to255);endcounter;architectureaofcounterisbeginprocess(clk)variablecnt:integerrange0to(7);variabledirection:(8);beginif(updown='1')thendirection:=1;else(9)e

6、ndif;if(clk'eventandclk='1')thenifclear='0'thencnt:=0;____________________________________________________________________________________________________elseifenable='1'then(10)endif;endif;endif;q<=cnt;endprocess;enda;______________________________________

7、______________________________________________________________(7)255(8)integer(9)direction:=-1;(10)cnt:=cnt+direction____________________________________________________________________________________________________1.以下是8位分频器程序设计LIBRARYIEEE;USEIEEE.STD_LO

8、GIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYPULSEISPORT(CLK:INSTD_LOGIC;D:INSTD_LOGIC_VECTOR(7DOWNTO0);FOUT:OUTSTD_LOGIC);END;ARCHITECTUREoneOFPULSEISSIGNALFULL:STD_LOGIC;BEGINP_REG:PROCESS(CLK)V

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。