- 8
- 0
- 约9.67千字
- 约 17页
- 2016-12-29 发布于重庆
- 举报
基于vhdl的数字钟设计
1、主控模块电路图
主控模块代码:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity control is
port(clk,k,set,reset,trans : in std_logic;
jh,jm,js,nh,nm,ns,flashh,flashm,flashs,selct :out std_logic);
end control;
architecture behav of control is
type states is(s0,s1,s2,s3,s4,s5,s6,s7);
signal current_state,next_state :states;
begin
process (reset,clk,next_state,current_state,k,set)
begin
if (reset=1)then
current_state=s0;
elsif(clkevent and clk=1)then
current_state=next_state;
end if;
case current_state is
when s0=
flashh=0;flashm=0;flashs=0;jh=0;jm=0;js=0; nh=0;nm=0;ns=0;selct=1;
if(trans=1)then next_state=s4;
elsif(set=1 ) then
next_state=s1;
else
next_state=s0;
end if;
when s1=
flashh=1;flashm=0;flashs=0;jh=1;jm=0;js=0; nh=0;nm=0;ns=0;selct=1;
if (set=1)then
next_state=s2;
else
next_state=s1;
end if;
when s2=
flashh=0;flashm=1;flashs=0;jh=0;jm=1;js=0; nh=0;nm=0;ns=0;selct=1;
if (set=1) then
next_state=s3;
else
next_state=s2;
end if;
when s3=
flashh=0;flashm=0;flashs=1;jh=0;jm=0;js=1; nh=0;nm=0;ns=0;selct=1;
if ( set=1 ) then
next_state=s0;
else
next_state=s3;
end if;
when s4=
flashh=0;flashm=0;flashs=0;jh=0;jm=0;js=0; nh=0;nm=0;ns=0;selct=0;
if ( trans=1 ) then
next_state=s0;
elsif ( set=1 ) then
next_state=s5;
else
next_state=s4;
end if;
when s5=
flashh=1;flashm=0;flashs=0;jh=0;jm=0;js=0; nh=1;nm=0;ns=0;selct=0;
if (set=1) then
next_state=s6;
else
next_state=s5;
end if;
when s6=
flashh=0;flashm=1;flashs=0;jh=0;jm=0;js=0; nh=0;nm=1;ns=0;selct=0;
if (set=1 ) then
next_state=s7;
else
next_state=s6;
end if;
when s7=
flashh=0;flashm=0;flashs=1;jh=0;jm=0;js=0; nh=0;nm=0;ns=1;selct=0;
If (set=1) then
next_state=s4;
else
next_state=s7;
end if;
end case;
end process;
end behav;
主控模块仿真图
2、计时校时模块
计时校时代码
二选一
library ieee;
use ieee.std_logic_1164.all;
entity mux2_1 is
port(d0,d1,en :in std_logic;
sel :in std_logic;
y :out std_logic);
end
您可能关注的文档
- vc++程序代码java.doc
- VC++界面类编程实例.doc
- vc++笔试面试宝典.doc
- VC++编写ActiveX控件.doc
- VC++的DLL.doc
- VC++链表程序.doc
- vc++鼠标消息.doc
- VC++环境下连接SQL_Server数据库方法指导.doc
- VC+ADO+ORACLE开发.doc
- VC60下bmp位图的读取与显示.doc
- 2026河南大学出版社招聘专业技术人员备考试题附答案详解.docx
- 2026甘肃平凉市儿童康复医疗中心招聘非在编人员5人备考试题及答案详解一套.docx
- 2026浙江嘉兴市海宁皮革时尚小镇投资开发有限公司招聘1人备考试题及答案详解1套.docx
- 2026浙江金华浙农科(武义)农业产业发展研究院有限公司招聘1人备考试题及参考答案详解1套.docx
- 四六级作文高分句型精选课件.pptx
- RevisionHappytime(教学分析(课件)-人教PEP版(一起)英语二年级上册.pptx
- 初中七年级英语下册 Unit 7 Abilities ic Strip Wele to the Unit 精品教案.docx
- Unit1Reading1课件译林版英语八年级下册.pptx
- UNIT6IWANTANICECREAM!PERIOD1(课件)-教科版英语一年级下册(1).pptx
- 高考地理二轮复习课件-天气系统专题(1).pptx
最近下载
- 人美版美术一年级下册《第一单元 春天的故事》大单元教学设计2026.docx VIP
- 公转私借款合同范本.docx VIP
- IATF16949:2016中文版本含ISO9001全文依据2025年11月SI更新(包括SI1-30).pdf
- 4.成人斯蒂尔病诊疗指南2025版.pptx
- 第一单元《春天的故事》大单元(教学设计)人美版2025美术一年级下册.docx VIP
- ISO42001-2023人工智能管理体系程序文件.docx VIP
- 一种火炬排放系统密封器.pdf VIP
- 提高住院患者大小便标本送检率PDCA.pptx VIP
- DB61_T 2093.5-2025 猕猴桃生产第5部分:花粉生产.docx VIP
- 无锡市轨道交通工程临时用电监理实施细则.doc VIP
原创力文档

文档评论(0)