求eda数字钟设计程序 1.Topclock(元件例化 顶层文件)Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_arith.all;Use ieee.std_logic_unsigned.all;Entity topclock isPort(clk,clr,en,m1,h1:in std_logic;alarm:out std_logic;secs,secg,mins,ming,hours,hourg:buffer std_logic_vector(3 downto 0));End;2.秒模块程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity SECOND isport(clk,clr:in std_logic;sec1,sec0:out std_logic_vector(3 downto 0);co:out std_logic);end SECOND;architecture SEC of SECOND isbeginprocess(clk,clr)variable cnt1,cnt0:std_logic_vector(3 downto 0);beginif clr='1' thencnt1:=\"0000;cnt0:=\"0000;elsif clk'event and clk='1' thenif cnt1=\"0101\"and cnt0=\"1000\"thencoa);u2:min1 port map(clr=>;clr,alarm=>;alarm,mins=>;mins,ming=>;ming,clkm=>;b,enmin=>;c);u3:hour1 port map(clr=>;clr,hours=>;hours,hourg=>;hourg,clkh=>;d);u4:madapt port map(en=>;en,m1=>;m1,clk=>;clk,secin=>;a,minset=>;b);u5:hadapt port map(en=>;en,h1=>;h1,clk=>;clk,minin=>;c,hourset=>;d);end;
eda数字电子钟程序 数码管的扫描显示:LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;字模输出模块 USE IEEE.STD_LOGIC_UNSIGNED.ALL;ENTITY SEL IS PORT(CLK:IN STD_LOGIC;。
EDA设计数字时钟 2.微秒模块采用VHDL语言输入方式,以时钟clk,清零信号clr以及暂停信号STOP为进程敏感变量,程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity MINSECONDb isport(clk,clrm,.
求 EDA 的 数字时钟 程序 。 是 VHDL 语言的。 输入1Hz的时钟作为秒信号,秒计数满60后向分计数进1,分计数满60后向时计数进1。当计数到24:60:60自动回到00:00:00;library ieee;use ieee.std_logic_1164.all;entity clock isport(clk:in std_logic;输入1Hz的时钟作为秒信号clr:in std_logic;异步清零信号s:out integer range 0 to 60;秒min:out integer range 0 to 60;分h:out integer range 0 to 24-时end clock;architecture clock of clock isbeginprocess(clk,clr)variable count1:integer range 0 to 60;秒计数variable count2:integer range 0 to 60;分计数variable count3:integer range 0 to 24;时计数begins;min;h;if(clr='1')thencount1:=0;count2:=0;count3:=0;elsif(clk'event and clk='1')thencount1:=count1+1;if(count1=60)thencount1:=0;count2:=count2+1;if(count2=60)thencount2:=0;count3:=count3+1;if(count3=24)thencount3:=0;end if;end if;end if;end if;end process;end clock;
EDA数字钟设计 1.Topclock(元件例化 顶层文件)Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_arith.all;Use ieee.std_logic_unsigned.all;Entity topclock isPort(clk,clr,en,m1,h1:in std_logic;alarm:out std_logic;secs,secg,mins,ming,hours,hourg:buffer std_logic_vector(3 downto 0));End;2.秒模块程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity SECOND isport(clk,clr:in std_logic;sec1,sec0:out std_logic_vector(3 downto 0);co:out std_logic);end SECOND;architecture SEC of SECOND isbeginprocess(clk,clr)variable cnt1,cnt0:std_logic_vector(3 downto 0);beginif clr='1' thencnt1:=\"0000;cnt0:=\"0000;elsif clk'event and clk='1' thenif cnt1=\"0101\"and cnt0=\"1000\"thenco;cnt0:=\"1001;elsif cnt0cnt0:=cnt0+1;elsecnt0:=\"0000;if cnt1cnt1:=cnt1+1;elsecnt1:=\"0000;co;end if;end if;end if;sec1;sec0;end process;end SEC;3.分模块程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity MINUTE isport(clk,en:in std_logic;min1,min0:out std_。