- 8
- 0
- 约4.6千字
- 约 8页
- 2016-09-21 发布于重庆
- 举报
vhdl秒表报告
实验:vhdl秒表设计报告
一、验目的:???? 秒表的逻辑结构比较简单,它主要由、显示译码器、分频器、十进制计数器、六进制计数器组成。二、结构组成:??? 1、十进制计数器:用来对秒进行计数;??? 2、进制计数器:用来分别对十秒进行计数;??? 3、分频率器:用来产生的计数脉冲;??? 4、三、实验内容及步骤:??? 1、??? 2、??? 3、??? 4、???四、实验源代码如下:
源代码vhdl语言如下:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity div is
port(inclk:in std_logic;
outclk:out std_logic:=0);
end;
architecture behave of div is
signal temp:integer range 0 to 99999;
signal internal:std_logic:=0;
begin
process(inclk)
begin
if inclkevent and inclk=1
then
if temp=10
then
temp=0;
internal=not internal;
else temp=temp+1;
end if;
outclk=internal;
end if;
end process;
end behave;
2,十进制计数器模块
原理图:
十进制vhdl源码:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity cnt10 is
port(clk,clr,en:in std_logic;
q:buffer std_logic_vector(3 downto 0);
c10:out std_logic);
end;
architecture behave of cnt10 is
begin
process(clr,clk)
begin
if clr=0
then q=0000;
elsif clkevent and clk=1
then
if en=1
then
if q9
then q=q+1;
else q=0000;
end if;
end if;
end if;
end process;
process(q)
begin
if q=0000
then c10=1;
else c10=0;
end if;
end process;
end;
3,六进制计数模块
原理图
源代码:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity cnt6 is
port(clk,clr,en:in std_logic;
q:buffer std_logic_vector(2 downto 0);
c6:out std_logic);
end;
architecture behave of cnt6 is
begin
process(clr,clk)
begin
if clr=0
then q=000;
elsif clkevent and clk=1
then
if en=1
then
if q5
then q=q+1;
else q=000;
end if;
end if;
end if;
end process;
process(q)
begin
if q=000
then c6=1;
else c6=0;
end if;
end process;
end;
4,十进制锁存
原理图:
代码:library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity suo is
port(inp:in std_logic_vector(3 downto 0);
suo:in std
您可能关注的文档
- DCI11传感器.doc
- VC++60调用银海软件医保接口备忘录.doc
- DCI11零部件包装要求33-38页.doc
- VC++手动添加命令消息处理函数实例操作.docx
- VC6-02-4-表23编译错误信息.doc
- Dcpogoa期货每天总结报告.doc
- VC600四轴加工中心故障解剖.doc
- VC60及安装方法.doc
- VCATS现代汽车上越来越多地采用各种模块控制元件.docx
- VCDDVD硬碟的帧率制式分辨率.doc
- (2026春新版)部编版八年级语文下册《第一单元》PPT课件.pptx
- 2018电力监控系统网络安全监测装置技术规范.docx
- 2022电力监控系统安全防护方案审核要点.docx
- 2014电力电缆光伏系统EN 50618欧标.docx
- (2026春新版)人教版二年级数学下册《第三单元 万以内数的认识》教案.docx
- (2026春新版)人教版二年级数学下册《第四单元 万以内的加法和减法》教案.docx
- (2026春新版)人教版二年级数学下册《综合与实践 时间在哪里》教案.docx
- (2026春新版)苏教版二年级数学下册《综合与实践 时间有多长》教案 .pdf
- (2026春新版)部编版三年级语文下册第3单元(教案).docx
- (2026春新版)部编版三年级语文下册第8单元(教案).docx
原创力文档

文档评论(0)