欢迎来到天天文库
浏览记录
ID:41809310
大小:119.16 KB
页数:3页
时间:2019-09-02
《十六进制计数器作业》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、十六进制计数器作业:libraryleee;useieee.std_loglc_1164.all;useleee.std_loglc_arith.all;useleee.std_loglc_unslgned.all;Hentitycount60IsHport(elk,clr:instd_logic;q:outstd_logic_vector(3downto0));endentity;Sarchitectureb皀cofcount60issignalq_tem:std_logic_vector(3downto0);be
2、ginq<-q_tem;process(elk,clr)beginifclr«101thenq_tem<«rr0000rr;elsifelk1ev皂ntandclk=111th皂nifq_t皂m=rrllllrrthenq_tem<=rr0000rr;elseq_t皂mc=q_t皂m+1;endIf;endif;endprocess;endarchitecturebec;8-3译码器程序如下:libraryieee;useieee•std_logic_1164.all;Sentitybian_ma_qi8_3isHp
3、ort(Y:instd_logic_veccor(7downto0);A:outstd_logic_vector(2downto0))end;Harchitectureiaomoxixiofb1an_ma_qi8_3is
4、HbeginSprocess(Y)beginHcaseYiswhenrr00000001rr=>A<=”ooo”;when”00000020”=>A<=n100rf.whenrr00000100rr=>A<=n010n.when”00001000”=>A<=n110n;whenrr00010000n
5、=>A<=n001n;when”00100000”=>A<=Fl101n;when”01000000”=>A<=rr011f,;whenrr10000000rr=>A<=rfllln;whenothers=>A<=null;endcase;endprocess;endnioiRoxixi;实验结果:NoneValueat0ps)ps30.9m60.9ns90.9ns120.卩ns150(0ns180卩ns2!0.(0ns240.0卅)PS0TOxE[oooooooiXooooooioxoooooiooxooooioo
6、oxoooiooooXooioooooXoioraxwx10000000卫。B000CCO册100乂輙010:110灯奴001期r101瘟oilx111译码器4—7的程序:libraryieee;useieee.std_logic_1164.all;Sentityyimaqi4_7isSport(mrnzprq:instd_logic;aFb#crdFerfrg:outstd_logic);end;Sarchitecturelingofyiniaqi4_7issignalX:std_logic_vector(3dow
7、nto0);signalY:std_logic_veccor(6downto0);beginX<=m&n&p&q;process(X)begincaseXiswhenrr0000n=>Y<=rr0111111rrwhenn0001w=>Y<=n0000111nwhenrr0010n=>Y<=rt1011011rrwhenn0011w=>Y<=n1001111nwhen”0100”=>Y<=“1100110“whenrr0101rf=>Y<=r,1101101rrwhen”0110"=>Y<=n1111100nwhen
8、rr0111n=>Y<=rr0000111nwhenrr1000n=>Ywhenrr1001n=>Y<=rr1100111rrwhenothers=>Y<=null;endcase;a<=Y(0);b<=Y(l);c<=Y(2);d<=Y(3);e<=Y(4);f<=Y(5);g<=Y(6);endprocess;endling;Count9999:libraryieee;useieee・3td_lcgic_1164-all;useieee.atd_lcgic_arith.all;useieee.3td_lcgic_
9、unaigned.all;Sentitycount99991iaSport(clr:instd_lcgic;clklrelks:inatd_lcgic;seg:outstd_lcgic_vector(6downto0);sei:outstd_lcgic_vector(3downto0));endcount99991;Sarchitecturea
此文档下载收益归作者所有