全文预览

基于vhdl的数字时钟设计

上传者:幸福人生 |  格式:doc  |  页数:28 |  大小:29KB

文档介绍
;--设置端口Р architecture bea of self1 isР signal m:std_logic;Р signal t:std_logic;Р beginР p1:process(ok2,ok3,c); --ok2和ok3触发进程 beginР if ok2'event and ok2='0' then m<=not m;--由ok2 的动作产生m的电平信号Р end if;Р if m='1' then ck<=not(ok3);--把按键ok3的脉冲信号给输出 else ck<=c;--否则把正常计数时钟给输出 end if;Р end process p1;--结束进程Р end bea;Р 3.1.4秒、分六十进制模块cantsixtyР 7Р 邵阳学院课程设计Р 本设中秒、分的六十进制是由个位的十进制和十位的六进制进行组合实现的。当个位记到9时自动向高位进一,同时个位自动清零。当十位记到5并且个位记到9时,自动产生一个进位脉冲,同时个位和十位分别从零开始重新计数。Р 由VHDL语言生成的模块图和程序说明如下:Р 图3.4六十进制模块Р library ieee;Р use ieee.std_logic_1164.all;Р use ieee.std_logic_unsigned.all;Р entity cantsixty isР port(clk:in std_logic;Р reset:in std_logic;Р out1:out std_logic_vector(3 downto 0);Р out2:out std_logic_vector(3 downto 0);Р c:out std_logic);Р end;Р architecture beh of cantsixty is

收藏

分享

举报
下载此文档