EDA实验设计参考.docx
上传人:王子****青蛙 上传时间:2024-09-12 格式:DOCX 页数:6 大小:283KB 金币:10 举报 版权申诉
预览加载中,请您耐心等待几秒...

EDA实验设计参考.docx

EDA实验设计参考.docx

预览

在线预览结束,喜欢就下载吧,查找使用更方便

10 金币

下载此文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entitycounterisport(clk,clk1,en,clr:instd_logic;ledout:outstd_logic_vector(6downto0);scanout:outstd_logic_vector(1downto0);co:outstd_logic);endcounter;architectureaofcounterissignalcnt:std_logic_vector(7downto0);signalled:std_logic_vector(6downto0);signalscan:std_logic:='0';signalhex:std_logic_vector(3downto0);beginprocess(clk)beginif(clk'eventandclk='1')thenifen='1'thenifclr='1'thencnt<=(others=>'0');elseifcnt="00111111"thencnt<="00000000";co<='1';elsecnt<=cnt+'1';co<='0';endif;endif;endif;endif;endprocess;process(clk1)beginifclk1'eventandclk1='1'thenscan<=notscan;endif;endprocess;ledout<=led;scanout<="10"whenscan='0'else"01";hex<=cnt(7downto4)whenscan='1'elsecnt(3downto0);withhexselectled<="1111001"when"0001","0100100"when"0010","0110000"when"0011","0011001"when"0100","0010010"when"0101","0000010"when"0110","1111000"when"0111","0000000"when"1000","0010000"when"1001","0001000"when"1010","0000011"when"1011","1000110"when"1100","0100001"when"1101","0000110"when"1110","0001110"when"1111","1000000"whenothers;enda;设计一个带计数使能、同步复位、带进位输出的增1二十进制计数器,计数结果由共阴极七段数码管显示。libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entitycounterisport(clk,clk1,en,clr:instd_logic;co,scanout:outstd_logic;ledout:outstd_logic_vector(6downto0));endcounter;architecturertlofcounterissignalcnt:std_logic_vector(7downto0);signalled:std_logic_vector(6downto0);signalscan:std_logic;signalhex:std_logic_vector(3downto0);beginprocess(clk)beginif(clk'eventandclk='1')thenifclr='1'thencnt<=(others=>'0');elsifen='1'thenifcnt="00001001"thencnt<="00010000";co<='0';elsifcnt="00011001"thencnt<="00000000";co<='1';elsecnt<=cnt+'1';co<='0';endif;endif;endif;endprocess;process(clk1)beginifclk1'eventandclk1='1'thenscan<=notscan;endif;endprocess;ledout<=notled;scanout<=scan;hex<=cnt(7downto4)whenscan='1'elsecnt(3downto0);withh