基于vhdl语言的数字电子钟设计内容摘要:

ount1660)then if(count=1011001)then enhour_1=39。 139。 count=0000000。 else count=count+7。 end if。 else count=0000000。 end if。 elsif(count1660)then count=count+1。 enhour_1=39。 039。 after 100 ns。 else count=0000000。 end if。 end if。 end process。 end fun。 模块源程序如下: library ieee。 use。 use。 entity hour is port(clk,reset:in std_logic。 daout:out std_logic_vector(5 downto 0) )。 end entity hour。 architecture fun of hour is signal count:std_logic_vector(5 downto 0)。 begin daout=count。 process(clk,reset) begin if(reset=39。 139。 )then count=000000。 elsif(clk39。 event and clk=39。 139。 )then if(count(3 downto 0)=1001)then if(count1623)then count=count+7。 else count=000000。 end if。 elsif(count1623)then count=count+1。 else count=000000。 end if。 end if。 end process。 end fun。 模块源程序如下: library ieee。 use。 entity clock_top is port(clk,reset,setmin,sethour:in std_logic。 second_daout,minute_daout:out std_logic_vector(6 downto 0)。 hour_daout:out std_logic_vector(5 downto 0) )。 end clock_top。 architecture a of clock_top is ponent second port(clk,reset,setmin:in std_logic。 daout:out std_logic_vector(6 downto 0)。 enmin:out std_logic)。 end ponent。 ponent minute port(clk,reset,clk1,sethour:in std_logic。 enhour:out std_logic。 daout:out std_logic_vector(6 downto 0))。 end ponent。 ponent hour port(clk,reset:in std_logic。 daout:out std_logic_vector(5 downto 0))。 end ponent。 signal enmin_re,enhour_re:std_logic。 begin u1:second port map(reset=reset, clk=clk, setmin=setmin, enmin=enmin_re, daout=second_daout)。 u2:minute port map(clk=enmin_re, reset=reset, clk1=clk, sethour=sethour, enhour=enhour_re, daout=minute_daout)。 u3:hour port map(clk=enhour_re, reset=reset, daout=hour_daout)。 end a。 (二) 硬件设计 利用 QuartusII 把程序写入实验板,根据上面的输入输出引脚,锁定到芯片引脚。 本实验运用的芯片是 EPF10K10LC844,还有 利用了 6 个 LED 显示,分别显示时、分、秒各两个,没有利用译码器,利用的 LED 是 8引脚的。 本次验证利用实验板的模式 7,根据板的说明书,锁定引脚并下载程序。 引脚锁定 如下表 : 端子名称 锁定引脚 端子名称 锁定引脚 clk pin_93 Minute[2] pin_67 sethour pin_7 Minute[3] pin_68 Setmin pin_4 Minute[4] pin_69 reset pin_10 Minute[5] pin_70 hour[0] pin_73 Minute[6] pin_71 hour[1] pin_74 Second[0] pin_39 hour[2] pin75 Second[1] pin_40 hour[3] pin_76 Second[2] pin_41 hour[4] pin_77 Second[3] pin_42 hour[5] pin_78 Second[4] pin_。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。