VHDL数字电路设计教程第六章习题答案

VHDL数字电路设计教程第六章习题答案

ID:43326029

大小:71.50 KB

页数:6页

时间:2019-09-29

VHDL数字电路设计教程第六章习题答案_第1页
VHDL数字电路设计教程第六章习题答案_第2页
VHDL数字电路设计教程第六章习题答案_第3页
VHDL数字电路设计教程第六章习题答案_第4页
VHDL数字电路设计教程第六章习题答案_第5页
资源描述:

《VHDL数字电路设计教程第六章习题答案》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、VHDL数字电路设计教程第六章习题答案P6.1libraryieee;useieee.std_logic_l164.all;useieee.std_logic_unsigned.all;entitychp6_lisport(clk:instd_logic;d_out:outstd_logic_vector(5downto0));end;architecturebhvofchp6_lissignalcount:std_logic_vector(5downto0);signaltemp:std_logic_vector(5downto0);beginprocess(clk

2、)beginifclk^ventandelk-Tthencount<=count+1;ifcount二T00000”thencount<=,,000000u;endif;endif;endprocess;process(clk)beginifclkreventandclk=,0,thentemp<=temp+1;iftemp=n01111ir,thentemp<=n000000n;endif;endif;endprocess;d_out<=count+temp;end;P6.3solutionllibraryieee;useieee.std_logic_lI64.al

3、l;entitychp6_3isport(x:instd_Logic_vector(7downto1);y:outstd_logic_vector(2downto0));end;architecturebhvofchp6_3isbeginprocess(x)beginifx(7)=(rtheny<=nlllu;els讦x(6)=Ttheny<=H110M;elsifx(5)=*rthenyv二T01”;elsifx(4)='1'theny<="100";elsifx(3)=Tthenyv二”011”;elsifx(2)二Ttheny<="010";elsifx(l)=

4、,rtheny<=,,001n;elsey<=,,000n;endif;endprocess;end;solution2libraryieee;useieee.std_logic_l164.all;entitychp6_3_2isgeneric(n:integer:=3);port(x:instd_logic_veclor(2**n-ldownto0);y:outintegerrange0to2**i卜1);end;architecturebhvofchp6_3_2isbeginprocess(x)variabletempintegerrange0tobeginfor

5、iinxYangeloopifx(i)=*rthentemp:=i;exit;endif;endloop;y<=temp;endprocess;end;P6.4libraryieee;useieee.std_logic_lI64.all;useieee.sld_logic_unsigned.all;entitychp6_4isgeneric(n:integer:=8);port(clk:instd_logic;clk_out:outsid」ogic);end;architecturebhvofchp6_4issignalrst:std_logic;signaltemp

6、:std_logic_vector(2downto0);beginprocess(clk,rst)beginifrst-1'thentemp<=uOOOn;elsifclk'eventandelk-Tthentemp<=temp+1;endif;endprocess;rst<='1'whentemp二”111”else'O';clk_out<=temp(2);end;P6.5libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entitychp6_5isgeneric(n:inte

7、ger:=7);port(clk:instd_logic;clk_out:outstd_logic);end;architecturebhvofchp6_5issignaltemp:stdgic_vector(2downto0);signalcout:stdgic;beginprocess(clk)beginifclkreventandelk-Tthentemp<=temp+1;iftempi110”thentemp<=n000M;endif;endif;endprocess;cout<-rwhentemp二T10”elseo;clk_out<=co

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

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

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