下载此文档

EDA 电子钟.doc


文档分类:通信/电子 | 页数:约5页 举报非法文档有奖
1/5
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/5 下载此文档
文档列表 文档介绍
libraryieee;;;entitycon60vis------定义六十进制计数器(分,秒)port(clk:instd_logic;en:instd_logic;clr:instd_logic;ld:instd_logic;d:instd_logic_vector(7downto0);co:outstd_logic;qh:bufferstd_logic_vector(3downto0);ql:bufferstd_logic_vector(3downto0));endcon60v;architecturebhvofcon60visbeginco<='1'when(qh="0101"andql="1001"anden='1')else'0';process(clk,clr,ld)beginif(clr='0')thenqh<="0000";ql<="0000";elsif(clk'eventandclk='1')thenif(ld='0')thenqh<=d(7downto4);ql<=d(3downto0);elsif(en='1')thenif(ql<9)thenql<=ql+1;elseql<="0000";if(qh<5)thenqh<=qh+1;elseqh<="0000";endif;endif;endif;endif;endprocess;endbhv;libraryieee;;;entitycon24visport(clk:instd_logic;en:instd_logic;clr:std_logic;ld:instd_logic;d:instd_logic_vector(7downto0);co:outstd_logic;qh:bufferstd_logic_vector(3downto0);ql:bufferstd_logic_vector(3downto0));endcon24v;architecturebhvofcon24visbeginco<='1'when(qh="0000"andql="0011"anden='1')else'0';process(clk,clr,ld)beginif(clr='0')thenqh<="0000";ql<="0000";elsif(clk'eventandclk='1')thenif(ld='0')thenqh<=d(7downto4);ql<=d(3downto0);elsif(en='1')thenif(qh="0010"andql="0011")thenqh<="0000";ql<="0000";elseql<=ql+1;if(ql<9)thenql<=ql+1;elseql<="0000";if(qh<2)thenqh<=qh+1;elseqh<="0000";endif;endif;endif;endif;endif;endprocess;endbhv;libraryieee;;entitydianzib

EDA 电子钟 来自淘豆网www.taodocs.com转载请标明出处.