基于简易时钟的设计

基于简易时钟的设计

ID:8477738

大小:30.50 KB

页数:7页

时间:2018-03-29

基于简易时钟的设计_第1页
基于简易时钟的设计_第2页
基于简易时钟的设计_第3页
基于简易时钟的设计_第4页
基于简易时钟的设计_第5页
资源描述:

《基于简易时钟的设计》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

1、简易时钟的设计1.分频电路的设计--实体名:fen100--功能:对输入时钟进行24000分频,得到100Hz信号,--作为数码显示管位扫描信号--接口:clk-时钟输入--qout-100Hz输出信号-------------------------------------------------libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entityfen100isport(clk:instd_logic;rst:instd

2、_logic;qout:outstd_logic);endfen100;architecturebehaveoffen100isconstantcounter_len:integer:=23999;beginprocess(clk,rst)variablecnt:integerrange0tocounter_len;beginif(rst='0')thencnt:=0;elsifclk'eventandclk='1'thenifcnt=counter_lenthencnt:=0;elsecnt:=cnt+1;endif;casecntiswhen0tocounter_len/2

3、=>qout<='0';whenothers=>qout<='1';endcase;endif;endprocess;endbehave;--实体名:fen1--功能:对输入时钟进行分频,得到1Hz信号--接口:clk-时钟输入--qout-秒输出信号-------------------------------------------------libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entityfen1isport(cl

4、k:instd_logic;rst:instd_logic;qout:outstd_logic);endfen1;architecturebehaveoffen1isconstantcounter_len:integer:=;beginprocess(clk,rst)variablecnt:integerrange0tocounter_len;beginif(rst='0')thencnt:=0;elsifclk'eventandclk='1'thenifcnt=counter_lenthencnt:=0;elsecnt:=cnt+1;endif;casecntiswhen0t

5、ocounter_len/2=>qout<='0';whenothers=>qout<='1';endcase;endif;endprocess;endbehave;2.60进制--功能:60进制计数器--接口:clk-时钟输入--qout1-个位BCD输出--qout2-十位BCD输出--carry-进位信号输出-------------------------------------------------libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_log

6、ic_arith.all;entityfen60isport(clk:instd_logic;rst:instd_logic;qout1:outstd_logic_vector(3downto0);qout2:outstd_logic_vector(3downto0);carry:outstd_logic);endfen60;architecturebehaveoffen60issignaltem1:std_logic_vector(3downto0);signaltem2:std_logic_vector(3downto0);beginprocess(clk,rst)begi

7、nif(rst='0')thentem1<="0000";tem2<="0000";elsifclk'eventandclk='1'theniftem1="1001"thentem1<="0000";iftem2="0101"thentem2<="0000";carry<='1';elsetem2<=tem2+1;carry<='0';endif;elsetem1<=tem1+1;endif;endif;qout1<=tem1;qout2<=tem2;endprocess;endbehave

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

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

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