
EDA课程设计——《数字钟》体会怎么写啊
课程设计感悟 通过这次设计,既复习了以前所学的知识,也进一步加深了对EDA的了解,让我对它有了更加浓厚的兴趣。
特别是当每一个子模块编写调试成功时,心里特别的开心。
但是在画顶层原理图时,遇到了不少问题,最大的问题就是根本没有把各个模块的VHD文件以及生成的器件都全部放在顶层文件的文件夹内,还有就是程序设计的时候考虑的不够全面,没有联系着各个模式以及实验板的情况来编写程序,以至于多考虑编写了译码电路而浪费了很多时间。
在波形仿真时,也遇到了一点困难,想要的结果不能在波形上得到正确的显示:在分频模块中,设定输入的时钟信号后,却只有二分频的结果,其余三个分频始终没反应。
后来,在数十次的调试和老师的指点之后,才发现是因为规定的信号量范围太大且信号的初始值随机,从而不能得到所要的结果。
还有的仿真图根本就不出波形,怎么调节都不管用,后来才知道原来是路径不正确,路径中不可以有汉字。
真是细节决定成败啊
总的来说,这次设计的数字钟还是比较成功的,有点小小的成就感,终于觉得平时所学的知识有了实用的价值,达到了理论与实际相结合的目的,不仅学到了不少知识,而且锻炼了自己的能力,使自己对以后的路有了更加清楚的认识,同时,对未来有了更多的信心。
求关于EDA数字时钟答辩需要的问题
越全越好
有好评
输入的时钟信号。
输出的时钟信号。
有无有分频。
分频的时钟的作用。
如何得到分频时钟。
其实都不难。
理解就好。
大五师兄飘过
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 is Port(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<='1';cnt0:=1001;elsif cnt0<1001 thencnt0:=cnt0+1;elsecnt0:=0000;if cnt1<0101 thencnt1:=cnt1+1;elsecnt1:=0000;co<='0';end if;end if;end if;sec1<=cnt1;sec0<=cnt0;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_logic_vector(3 downto 0); co:out std_logic);end MINUTE;architecture MIN of MINUTE isbeginprocess(clk)variable cnt1,cnt0:std_logic_vector(3 downto 0);beginif clk'event and clk='1' thenif en='1' thenif cnt1=0101 and cnt0=1000 thenco<='1';cnt0:=1001;elsif cnt0<1001 thencnt0:=cnt0+1;elsecnt0:=0000;if cnt1<0101 thencnt1:=cnt1+1;elsecnt1:=0000;co<='0';end if;end if;end if;end if;min1<=cnt1;min0<=cnt0;end process;end MIN;4.时模块程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity HOUR isport(clk,en:in std_logic; h1,h0:out std_logic_vector(3 downto 0));end HOUR;architecture hour_arc of HOUR isbeginprocess(clk)variable cnt1,cnt0:std_logic_vector(3 downto 0);beginif clk'event and clk='1' thenif en='1' thenif cnt1=0010 and cnt0=0011 thencnt1:=0000;cnt0:=0000;elsif cnt0<1001 thencnt0:=cnt0+1;end if;end if;end if;h1<=cnt1;h0<=cnt0;end process;end hour_arc;----5.扫描模块程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity SELTIME is port( clk:in std_logic; sec1,sec0,min1,min0,h1,h0:in std_logic_vector(3 downto 0); daout:out std_logic_vector(3 downto 0); sel:out std_logic_vector(2 downto 0));end SELTIME;architecture fun of SELTIME is signal count:std_logic_vector(2 downto 0);begin sel<=count; process(clk) begin if(clk'event and clk='1') then if(count>=101) then count<=000; else count<=count+1; end if; end if; case count is when000=>daout<= sec0; when001=>daout<= sec1; when010=>daout<= min0; when011=>daout<= min1; when100=>daout<=h0; when others =>daout<=h1; end case; end process;end fun;6.显示模块程序library ieee;use ieee.std_logic_1164.all;entity DISPLAY is port(d:in std_logic_vector(3 downto 0); q:out std_logic_vector(6 downto 0));end DISPLAY;architecture disp_are of DISPLAY isbegin process(d) begincase d is when0000 =>q<=0111111; when0001 =>q<=0000110; when0010 =>q<=1011011; when0011 =>q<=1001111; when0100 =>q<=1100110; when0101 =>q<=1101101; when0110 =>q<=1111101; when0111 =>q<=0100111; when1000 =>q<=1111111; when others =>q<=1101111;end case; end process;end disp_are;-----7.定时闹钟模块程序 library ieee;use ieee.std_logic_1164.all;entity ALERT isport(m1,m0,s1,s0:in std_logic_vector(3 downto 0); clk:in std_logic; q500,qlk:out std_logic);end ALERT;architecture sss_arc of ALERT is begin process(clk) begin if clk'event and clk='1' then if m1=0101 and m0=1001 and s1=0101 then if s0=0001 or s0=0011 or s0=0101 or s0=0111 then q500<='1'; else q500<='0'; end if; end if;if m1=0101 and m0=1001 and s1=0101 and s0=1001 thenqlk<='1';elseqlk<='0';end if;end if;end process;end sss_arc;Architecture one of topclock is Component second1 Port( clks,clr:in std_logic; secs,secg: buffer std_logic_vector(3 downto 0); cout1: out std_logic); End Component; Component min1 Port(clkm,clr:in std_logic; mins,ming:buffer std_logic_vector(3 downto 0); enmin,alarm: out std_logic); End Component; Component hour1 Port(clkh,clr:in std_logic; hours,hourg:buffer std_logic_vector(3 downto 0)); End Component; Component madapt Port(en,m1,clk,secin:in std_logic; minset:out std_logic); End Component; Component hadapt Port(en,h1,clk,minin:in std_logic; hourset:out std_logic); End Component; signal a,b,c,d: std_logic; begin u1:second1 port map(clr=>clr, secs=>secs,secg=>secg,clks=>clk, cout1=>a); 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;以上回答你满意么
怎么用256Hz的时钟产生17000Hz的时钟
做EDA课程设计需要用的。
用乘法电路进行混频
谁能帮我写一个eda六十进制时钟信号的编程(还要有清零端),谢谢各位了。
library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity cnt10 isport(clk,rst,en:in std_logic;cq:out std_logic_vector(3 downto 0);cout:out std_logic);end cnt10;architecture behav of cnt10 isbeginprocess(clk,rst,en)variable cqi:std_logic_vector(3 downto 0);beginif rst='1' then cqi:=(others=>'0');elsif clk'event and clk='1' thenif en='1' thenif cqi<9 then cqi:=cqi+1;cout<='0'; else cqi:=(others=>'0');cout<='1';end if;end if;end if;cq<=cqi;end process;end behav;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jia isport(cl,rs,e:in std_logic;c:out std_logic_vector(7 downto 0);ct:out std_logic);end entity jia;architecture one of jia iscomponent cnt10port(clk,rst,en:in std_logic;cq:out std_logic_vector(3 downto 0);cout:out std_logic);end component;signal a,b:std_logic;beginu1:cnt10 port map(clk=>cl,rst=>rs,en=>e,cout=>a,cq=>c(3 downto 0));process(a)variable cqi:std_logic_vector(3 downto 0);beginif rs='1' then cqi:=(others=>'0');elsif a'event and a='1' thenif e='1' thenif cqi<5 then cqi:=cqi+1;ct<='0'; else cqi:=(others=>'0');ct<='1';end if;end if;end if;c(7 downto 4)<=cqi;end process;end architecture one;
EDA数字时钟
到这里看看吧
应该就是你要的答案



