- 1、本文档共6页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
VHDL语言设计的电子时钟
VHDL语言设计的电子时钟
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity is
port(inclk,reset,pause,settime,tszhh,set:in std_logic;
light:in std_logic;
outa,outb,outc:out std_logic_vector(0 to 6);
bitout:out std_logic_vector(2 downto 0));
end szz;
architecture arth_szz of szz is
signal a,b,c,d,e,f,g,h,i,j,h1,h2,m1,m2,f1,f2:std_logic_vector(3 downto 0);
signal mda:std_logic_vector(14 downto 0);
signal mdb:std_logic_vector(9 downto 0);
signal mseg:std_logic_vector(3 downto 0);
signal bit:std_logic_vector(2 downto 0);
signal fpa,fpb:std_logic;
signal fpc:std_logic_vector(0 to 6);
signal led:std_logic_vector(24 downto 0);
signal outaa,outbb,outcc:std_logic_vector(0 to 6);
type tshzh_st is (s0,s1,s2);
signal cs,ns:tshzh_st;
begin
process(light)
begin
if lightevent and light=1 then
if led=20000 then
led=(others=0);
else
led=led+1000;
end if;
end if;
end process;
process(inclk)
begin
if (inclkevent and inclk=1) then
if mda=led then
mda=mda+1;
fpa=1;fpc=(others=1);
else
if mda=24999 then
mda=mda+1;
fpa=0;fpc=(others=0);
else mda=(others=0);
end if;
end if;
end if;
end process;
process(fpa,inclk)
begin
if (fpaevent and fpa=1) then
if mdb=9 then
mdb=(others=0);
fpb=not fpb;
else
mdb=mdb+1;
end if;
end if;
end process;
process(fpb,inclk)
begin
if (fpbevent and fpb=1) then
if pause=0 then
if a=9 then
a=(others=0);
if b=9 then
b=(others=0);
if settime=0 then
if c=9 then
c=(others=0);
if d=5 then
d=(others=0);
if e=9 then
e=(others=0);
if f=5 then
f=(others=0);
if g=3 and h=2 then
g=0000;h=0000;
elsif g=9 then
g=(others=0);h=h+1;
else
g=g+1;
end if;
else f=f+1;
end if;
else e=e+1;
end
您可能关注的文档
- 社区建设面临的问题与对策浅析4).doc
- 福利院义工策划.doc
- 磁致伸缩效应在生物传感器中的应用.pdf
- 法国大革命的文化5.ppt
- 私募投资或收购业务流程.doc
- 离散时间信号与系统(第一章).ppt
- 稳态与环境期中考试.doc
- 移库图解与技巧.doc
- 科学探究题专题复习课件.ppt
- 第10章-C语言高级程序应用.ppt
- 2024年中国钽材市场调查研究报告.docx
- 2024年中国不锈钢清洗车市场调查研究报告.docx
- 2024年中国分类垃圾箱市场调查研究报告.docx
- 2024年中国水气电磁阀市场调查研究报告.docx
- 2024年中国绿藻片市场调查研究报告.docx
- 2010-2023历年初中毕业升学考试(青海西宁卷)数学(带解析).docx
- 2010-2023历年福建厦门高一下学期质量检测地理卷.docx
- 2010-2023历年初中数学单元提优测试卷公式法(带解析).docx
- 2010-2023历年初中毕业升学考试(山东德州卷)化学(带解析).docx
- 2010-2023历年初中毕业升学考试(四川省泸州卷)化学(带解析).docx
文档评论(0)