西安文理学院
物理与机械电子工程学院
课程设计报告
专业班级 10级测控技术与仪器1班
课程 FPGA/CPLD原理及应用
题目秒表的设计
学号
姓名安永哲
同组人李小鹏
成绩
2013年5月
一、设计目的
进一步掌握QUARTUSⅡ软件的使用方法;
会使用VHDL语言设计小型数字电路系统;
掌握应用QUARTUSⅡ软件设计电路的流程;
掌握用扫描方法驱动多个数码管硬件结构,并进一步熟悉七段译码器的硬件接口,掌握秒表VHDL的编程方法。能够应用VHDL的编程方法去完成一些与生活相关的实物。
二、系统总体设计
1. 完成秒/分/时的依次显示并正确计数;
2. 秒/分/时各段个位满10正确进位,秒/分能做到满60向前进位;
3. 报时:实现整点报时,又扬声器发出报时声音;
4。计数起由四个十进制计数器和两个六进制计数器组成;
图1 系统原理框图
脉冲输入
Seltime模块
计数模块
数码管显示
报警模块
三、各模块详细设计
COUNT6模块
根据脉冲的到来实现六进制计数
library ieee;
use ;
use ;
entity count6 is
port (clk,start,clr : in std_logic;
cout : out std_logic;
daout: out std_logic_vector(3 downto 0));
end count6;
architecture xiaopeng of count6 is
signal q0 : std_logic_vector(3 downto 0);
signal q1 : std_logic;
begin
process(clk,clr)
begin
if clr='1' then q0<="0000";
elsif clk'event and clk='1' then
if start='1' then
if q0="0101" then
q0<="0000";
q1<='1';
else q0<=q0+1;
q1<='0';
end if;
end if;
end if;
end process;
daout<=q0;
cout<=q1;
end xiaopeng;
仿真图:
COUNT10模块
根据脉冲的到来实现六进制计数
library ieee;
use ;
use ;
entity count10 is
port (clk,start,clr : in std_logic;
cout : out std_logic;
daout : out std_logic_vector(3 downto 0));
end count10;
architecture xiaopeng of count10 is
signal q0 : std_logic_vector(3 downto 0);
signal q1 : std_logic;
begin
process(clk,clr)
begin
if clr='1' then q0<="0000";
elsif clk'event and clk='1' then
if start='1' then
if q0="1001" then
q0<="0000";
q1<='1';
else q0<=q0+1;
q1<='0';
end if;
end if;
end if;
end process;
daout<=q0;
cout<=q1;
end xiaopeng;
仿真图:
ALERT2模块
library ieee;
use ;
use ;
entity alert2 is
port(clk,I:in std_logic;
q:out std_logic
);
end alert2;
architecture xiaopeng of alert2 is
signal n:integer range 0 to 19;
signal q0:std_logic;
begin
process(clk)
begin
if clk'event a
vhdl下秒表的设计 来自淘豆网www.taodocs.com转载请标明出处.