ZKX's LAB

eda数字时钟程序 VHDL数字时钟完整程序代码(要求要有元件例化,并

2021-03-11知识5

课程设计任务书 课程设计名称 EDA课程设计 学生姓名 专业班级 设计题目 多功能数字钟设计 一、课程设计目的 1、综合运用EDA技术,独立完成一个课题的设计,考察运用所学知识,解决实际问题的能力;2、结合理论知识,考察阅读参考资料、文献、手VHDL数字时钟完整程序代码(要求要有元件例化,并

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_。

EDA编程数字钟能进行正常的时、分、秒,小时计时要求为12进制,分和秒为60进制循环,要求整点和12点整报时 1.分秒六十进制电路模块count60的VHDL程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity wj7157_count60 isport(clk:in std_logic;bcd10,bcd1:buffer std_logic_vector(3 downto 0);present:in std_logic;co:out std_logic);end wj7157_count60;architecture rtl of wj7157_count60 issignal co_1:std_logic;beginprocess(clk,present)beginif present='0' then bcd1;else if clk='1' and clk'event thenif bcd1=\"1001\"then bcd1;else bcd1;end if;end if;end if;end process;process(clk,present,bcd1)beginif present='0' then bcd10;co_1;else if clk='1' and clk'event thenif bcd1=\"1000\"and bcd10=\"0101\"then co_1;elsif bcd1=\"1001\"and bcd10=\"0101\"then bcd10;co_1;elsif bcd1=\"1001\"then bcd10;co_1;end if;end if;end if;end process;co;end rtl;3.时十二进制电路模块count12的VHDL程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity wj7157_count12 isport(clk:in std_logic;bcd10,bcd1:buffer std_logic_vector(3 downto 0));end wj7157_count12;architecture rtl 。

EDA设计数字时钟

求高手帮忙编一段EDA程序,数字钟的 /以下代码只包含分和秒,如果需要小时,可自行添加module clock(clk,dig_r,seg_r);input clk;output[7:0]dig_r;output[7:0]seg_r;reg sec;reg[7:0]dig_r;reg[7:0]seg_r;reg[24:0]count;reg[15:0]hour;reg[3:0]disp_dat;always@(posedge clk)begincount=count+1'b1;if(count=25'd24000000)begincount=25'd0;sec=~sec;endendalways@(negedge sec)beginhour[3:0]=hour[3:0]+1'b1;if(hour[3:0]=4'ha)beginhour[3:0]=4'h0;hour[7:4]=hour[7:4]+1'b1;if(hour[7:4]=4'h6)beginhour[7:4]=4'h0;hour[11:8]=hour[11:8]+1'b1;if(hour[11:8]=4'ha)beginhour[11:8]=4'h0;hour[15:12]=hour[15:12]+1'b1;if(hour[15:12]=4'h6)hour[15:12]=4'h0;endendendendalways@(posedge clk)begincase(count[17:15])3'd0:disp_dat=hour[3:0];3'd1:disp_dat=hour[7:4];3'd2:disp_dat=4'ha;3'd3:disp_dat=hour[11:8];3'd4:disp_dat=hour[15:12];3'd5:disp_dat=4'ha;3'd6:disp_dat=8'h00;3'd7:disp_dat=8'h00;endcasecase(count[17:15])3'd0:dig_r=8'b11111110;3'd1:dig_r=8'b11111101;3'd2:dig_r=8'b11111011;3'd3:dig_r=8'b11110111;3'd4:dig_r=8'b11101111;3'd5:dig_r=8。

请问一下,你那个eda数字钟设计程序 还在吗? hi,不知道您是否要以下这一个?我假设你的E,D,A三个字母就是接三个七段显示器module display_edaoutput_e,output_d,output_a,clk,rst_napply 3 DFFs and let them wrap around all the timereg dff_e,dff_d,dff_a;always@(posedge clk or negedge rst_n)beginif(~rst_n)beginoutput_e;output_d;output_a;endelsebeginoutput_e;output_d;output_a;endendendmodule焊个电路板把三个七段显示器接到output_e,output_d,otuput_a就ok了

eda数字时钟程序 VHDL数字时钟完整程序代码(要求要有元件例化,并

#eda数字时钟程序#eda电子时钟

随机阅读

qrcode
访问手机版