vhdl语言编写--9秒倒计时器

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;--------------------------------------------------------------------------------------------ENTITYCNT9ISPORT(CLK,en:INSTD_LOGIC;PLD,ENB:INSTD_LOGIC;-------PLD±íʾ¸´Î»ÐźÅWARN:OUTSTD_LOGIC;S0:OUTSTD_LOGIC_VECTOR(6DOWNTO0));------------ÒëÂëÊä³ö£¬S0Ϊ¸öλENDCNT9;--------------------------------------------------------------------------------------------ARCHITECTUREAOFCNT9ISSIGNALSS:STD_LOGIC_VECTOR(3DOWNTO0);-------------SS±íʾ¸öλBEGINPRO1:PROCESS(CLK,en,ENB)VARIABLETMPA:STD_LOGIC_VECTOR(3DOWNTO0);VARIABLETMPWARN:STD_LOGIC;BEGINIFen='1'THENTMPA:=1001;TMPWARN:='0';ELSIFCLK'EVENTANDCLK='1'THENTMPA:=TMPA-1;iftmpa='0'thenTMPWARN:='1';ENDIF;ENDIF;SS=TMPA;WARN=TMPWARN;PROCESS(SS)BEGINCASESSIS--------------------------¸öλÏÔʾ²¿·ÖWHEN0000=S0=0111111;--ÏÔʾ0WHEN0001=S0=0000110;--ÏÔʾ1WHEN0010=S0=1011011;--ÏÔʾ2WHEN0011=S0=1001111;--ÏÔʾ3WHEN0100=S0=1100110;--ÏÔʾ4WHEN0101=S0=1101101;--ÏÔʾ5WHEN0110=S0=1111101;--ÏÔʾ6WHEN0111=S0=0000111;--ÏÔʾ7WHEN1000=S0=1111111;--ÏÔʾ8WHEN1001=S0=1101111;--ÏÔʾ9WHENOTHERS=S0=0000000;ENDCASE;ENDPROCESS;ENDA;

1 / 2
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功