门关键词: 压电石英力传感器 其他扬声器 铁粉芯 集成电路元件 笔记本电脑音箱 磁敏电位器 霍尔元件
IC库存(8958万) PDF资料(329万) IC价格 IC求购 资讯 技术资料
电子元器件搜索:
维库电子市场网是知名的电子元器件交易网站,为电子生产企业提供IC库存和技术资料查询服务。
[求助]急需用VHDL语言设计数字钟
新闻出处:中电网论坛 发布时间: 2006-06-25
xionglongfei 发布于 2006-6-25 14:14:00

那位老兄给点建议设!!!



 


阿道法法打法打
linuxarm 发布于 2006-6-25 18:07:00
在属于比较基本的东东啊,在baidu google上一搜就能搜到例程,一般的教科书上也会有介绍的.



library IEEE;

use IEEE.std_logic_1164.all;

use IEEE.std_logic_arith.all;

use IEEE.std_logic_signed.all;



entity myclock is

port (

clk_1khz : in std_logic;

reset : in std_logic;

second : out std_logic_vector (5 downto 0);

minite : out std_logic_vector (5 downto 0);

hour : out std_logic_vector (3 downto 0)

);

end myclock;



architecture rtl of myclock is



begin

process (clk_1khz, reset)



variable ms : std_logic_vector(9 downto 0);

variable mysecond, myminite : std_logic_vector(5 downto 0);

variable myhour : std_logic_vector(3 downto 0);



begin



if reset = '1' then

mysecond := "000000";

myminite := "000000";

myhour := "0000";

ms := (others =>'0');

elsif clk_1khz'event and clk_1khz = '1' then

-- count ms to 1000

ms :=ms+1;

if ms = "1111101000" then

ms := (others => '0');

mysecond := mysecond+1;

if mysecond = "111100" then

mysecond := "000000";

myminite := myminite + 1;

if myminite = "111100" then

myminite := "000000";

myhour := myhour + 1;

if myhour = "1100" then

myhour := "0000";

end if;

end if;

end if;

end if;

end if;



second <= mysecond;

minite <= myminite;

hour <= myhour;

end process;

end architecture;

51 c8051f(f020,f040) msp430 arm(2410,2510) fpga(xc3s4000) dsp(5116 dm642) keilc vc++ matlab linux protel Ten_layerPCB mpegx h.26x Rscode Turbocode ofdm VideoBroadcasting ldpc_code(now!)
关闭】 【打印
 
相关专题
 
友情链接:
© 2007 电子元件网 网站地图