




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1libraryuseuseentitydecoderisport(a,b,c:instd_logic;d1,d2:instd_logic;d_out:outstd_logic);
指令 architecturemainofdecodersignals:std_logic_vector(2downto0);casesiswhen"001"=>d_out<=d1andd2;when"010"=>d_out<=d1ord2;when"011"=>d_out<=d1;--d1notwhen"100"=>d_out<=(d1andnotd2)or(notd1andd2);when"101"=>d_out<=(d1andd2)or(notd1andnotd2);whenothers=>d_out<='Z';endcase;endprocess;libraryuseuseentitystate_stepperisport(clk,dir:instd_logic;q:outstd_logic_vector(3downto
architecturessofstate_stepperistypestate_typeis(s0,s1,s2,s3);signalstate:state_type;signalq_out:std_logic_vector(3downto0);ifclk'eventandclk='1'thencasestateiswhens0=>endif;whens1=>endif;whens2=>endif;whens3=>endif;endcase;endif;endwithstateq_out<="0001""0010""0100""1000"endss;library useuseieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entityCTR60isq:outstd_logic_vector(7downto0);c:outstd_logic);endarchitecturebehaveofCTR60signalIQ:std_logic_vector(7downto0);process(clr,clk,IQ)isif(clr='1')thenIQ<=" elsif(clk'eventandclk='1')thenif(IQ(7downto0)=" IQ(7downto0)<=" elsif(IQ(3downto0)="1001")thenIQ(3downto0)<="0000";IQ(7downto4)<=IQ(7downto4)+1;elseIQ(3downto0)<=IQ(3downto0)+1;endendif;endprocess;endbehave;library useuseieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entityCTR24isq:outstd_logic_vector(7downto0));endCTR24;architecturebehaveofCTR24signalIQ:std_logic_vector(7downto0);process(clr,clk,IQ)isif(clr='1')thenIQ<=" elsif(clk'eventandclk='1')thenif(IQ(7downto0)=" IQ(7downto0)<=" endif;endprocess;endbehave;
elsif(IQ(3downto0)="1001")thenIQ(3downto0)<="0000";IQ(7downto4)<=IQ(7downto4)+1;elseIQ(3downto0)<=IQ(3downto0)+1;endif;library useuseieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entitycontrolish_in:instd_logic_vector(7downto0);m_in:instd_logic_vector(7downto0);s_in:instd_logic_vector(7downto0);H_OUT:outstd_logic_vector(7downto0);M_OUT:outstd_logic_vector(7downto0);S_OUT:outstd_logic_vector(7downto0);en:outstd_logic;F_out:outstd_logic_vector(2downto0));endcontrol;architecturebehaveofcontroltypestate_typeis(s0,s1,s2,s3,s4,s5,s6);signalstate:state_type;signalIQH:std_logic_vector(7downto0);signalIQM:std_logic_vector(7downto0);signalIQS:std_logic_vector(7downto0); if(mode'eventandmode='1')thencasestateiswhens0=>state<=s1;whens1=>state<=s2;whens2=>state<=s3;whens3=>state<=s4;whens4=>state<=s5;whens5=>state<=s6;whenendcase;endif;end if(mode'eventandmode='1')thencasestateiswhens0=>whens1=>if(IQH(7downto4)="0010")thenIQH(7downto4)<="0000";elseIQH(7downto4)<=IQH(7downto4)+1;endif;IQH(3downto0)<=h_in(3downto0);whens2=>if(IQH(3downto0)="1001")thenIQH(3downto0)<="0000";elseIQH(3downto0)<=IQH(3downto0)+1;endif;IQH(7downto4)<=h_in(7downto4);whens3=>if(IQM(7downto4)="0101")thenIQM(7downto4)<="0000";elseIQM(7downto4)<=IQM(7downto4)+1;endif;IQM(3downto0)<=m_in(3downto0);whens4=>if(IQM(3downto0)="1001")thenIQM(3downto0)<="0000";elseIQM(3downto0)<=IQM(3downto0)+1;endif;IQM(7downto4)<=m_in(7downto4);whens5=>if(IQS(7downto4)="0101")thenIQS(7downto4)<="0000";elseIQS(7downto4)<=IQS(7downto4)+1;endif;IQS(3downto0)<=s_in(3downto0);whens6=>if(IQS(3downto0)="1001")thenIQS(3downto0)<="0000";elseIQS(3downto0)<=IQS(3downto0)+1;endif;IQS(7downto4)<=s_in(7downto4);endcase;endendprocess;endbehave;library useuseieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entitydivideisclk_out:outendarchitecturebehaveofdivideissignalsignalcout:integerrange0to199999;if(CLK_IN'eventandCLK_IN='1')thenif(cout<=50000)thenelsif(cout<99999)elsecout<=0;endif;endif;endprocess;endbehave;library useuseieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entityscanisf_in:instd_logic_vector(2downto0);H_IN:instd_logic_vector(7downto0);M_IN:instd_logic_vector(7downto0);S_IN:instd_logic_vector(7downto0);Segctr:outstd_logic_vector(7downto0);q_out:outstd_logic_vector(3downtoendarchitecturescaofscantypestate_typeis(s0,s1,s2,s3,s4,s5);signalstate:state_type;signalQ:std_logic_vector(3downto0); if(clk'eventandclk='1')thencasestateiswhens0=>state<=s1;whens1=>state<=s2;whens2=>state<=s3;whens3=>state<=s4;whens4=>state<=s5;whenendcase;endif;end casestatewhens0=>Segctr(6downto0)<=" elseSegctr<=" endQ<=H_IN(7downto4);whens1=>Segctr(5downto0)<="000000";elseSegctr<=" endQ<=H_IN(3downto0);whens2=>Segctr(7downtoSegctr(4downto0)<="00000";elseSegctr<=" endQ<=M_IN(7downto4);whens3=>Segctr(7downtoSegctr(3downto0)<="0000";elseSegctr<=" endQ<=M_IN(3downto0);whens4=>Segctr(7downtoSegctr(2downto0)<="000";elseSegctr<=" endQ<=S_IN(7downto4);whens5=>Segctr(7downtoSegctr(1downto0)<="00";elseSegctr<=" Q<=S_IN(3downto0);endif;endcase;endprocess;endlibrary --顯示譯模塊disuseuseieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entitydisyisport(a:instd_logic_vector(3downto0);f:outstd_logic_vector(7downto0));enddisarchitecturedataofdisyiscasea whenothers=>f<=" endcase;endprocess;enddata;library useentitytri_gateport(indate,en:instd_logic;yout:outstd_logic);endarchitecturetrioftri_gateisendif;endprocess;endtri;library useuseieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entityClockisSeg7:outstd_logic_vector(7downto0);Segctr:outstd_logic_vector(7downto0));endarchitecturedigital_clockofClocksignalCM,CS,CLK1Hz,CLK_COU,EN:std_logic;signalHour:std_logic_vector(7downto0);signalMinute:std_logic_vector(7downto0);signalSecond:std_logic_vector(7downtosignalHSCAN:std_logic_vector(7downto0);signalMSCAN:std_logic_vector(7downto0);signalSSCAN:std_logic_vector(7downto0);signalflash:std_logic_vector(2downto0);signalY:std_logic_vector(3downto0);componentCTR60isport(clr,clk:instd_logic;q:outstd_logic_vector(7downto0);c:outstd_logic);endcomponentcomponentCTR24isport(clr,clk:instd_logic;q:outstd_logic_vector(7downto0));endcomponentCTR24;componentcontrolisport(mode,set:instd_logic;h_in:instd_logic_vector(7downto0);m_in:instd_logic_vector(7downto0);s_in:instd_logic_vector(7downto0);H_OUT:outstd_logic_vector(7downto0);M_OUT:outstd_logic_vector(7downto0);S_OUT:outstd_logic_vector(7downto0);en:outstd_logic;F_out:outstd_logic_vector(2downto0));endcomponentcontrol;componentdivideisport(CLK_IN:instd_logic;clk_out:outstd_logic);endcomponentdivide;componentscanisport(clk,clk1:instd_logic;f_in:instd_logic_vector(2downto0);H_IN:instd_logic_vector(7downto0);M_IN:instd_logic_vector(7downto0);S_IN:instd_logic_vector(7downto0);Segctr:outstd_logic_vector(7downto0);q_out:outstd_logic_vector(3downtoendcomponentcomponentdisyport(a:instd_lo
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度高級(jí)管理人員競(jìng)業(yè)限制及保密協(xié)議書(shū)
- 全站儀基礎(chǔ)知識(shí)
- 二零二五年度模特與剪輯師合作拍攝合同
- 二零二五年度企業(yè)廉潔自律行為規(guī)范執(zhí)行監(jiān)督協(xié)議
- 二零二五年度房地產(chǎn)買(mǎi)賣(mài)合同糾紛法庭調(diào)解和解協(xié)議
- 二零二五年度文化產(chǎn)品推廣居間合同服務(wù)費(fèi)用約定
- 2025年度環(huán)保搬遷回遷房購(gòu)房服務(wù)協(xié)議
- 二零二五年度企業(yè)間商業(yè)房產(chǎn)贈(zèng)與合同范本
- 2025年度汽車(chē)金融分期購(gòu)車(chē)合同
- 2025春季行政班子會(huì)議上校長(zhǎng)講話:老師累死累活!學(xué)生還是學(xué)不好
- DG-T 076-2024 采茶機(jī)標(biāo)準(zhǔn)規(guī)范
- 《分娩機(jī)轉(zhuǎn)》課件
- 軍隊(duì)文職備考(面試)近年考試真題(參考300題)
- 金融業(yè)稅收優(yōu)惠政策指引
- 乳腺癌課件教學(xué)課件
- 第五期健康講座乳腺癌與宮頸癌防治知識(shí)
- 2025年神經(jīng)內(nèi)科??谱o(hù)士培訓(xùn)計(jì)劃范文
- 葉圣陶杯作文
- 電子商務(wù)平臺(tái)供貨方案及風(fēng)險(xiǎn)控制措施
- 文獻(xiàn)檢索與利用
- 2學(xué)會(huì)寬容 第1課時(shí)(說(shuō)課稿)-2023-2024學(xué)年道德與法治六年級(jí)下冊(cè)統(tǒng)編版
評(píng)論
0/150
提交評(píng)論