优秀毕业论文——基于FPGA的数字钟设计文档格式.docx

上传人:b****9 文档编号:13090931 上传时间:2022-10-04 格式:DOCX 页数:12 大小:226.42KB
下载 相关 举报
优秀毕业论文——基于FPGA的数字钟设计文档格式.docx_第1页
第1页 / 共12页
优秀毕业论文——基于FPGA的数字钟设计文档格式.docx_第2页
第2页 / 共12页
优秀毕业论文——基于FPGA的数字钟设计文档格式.docx_第3页
第3页 / 共12页
优秀毕业论文——基于FPGA的数字钟设计文档格式.docx_第4页
第4页 / 共12页
优秀毕业论文——基于FPGA的数字钟设计文档格式.docx_第5页
第5页 / 共12页
点击查看更多>>
下载资源
资源描述

优秀毕业论文——基于FPGA的数字钟设计文档格式.docx

《优秀毕业论文——基于FPGA的数字钟设计文档格式.docx》由会员分享,可在线阅读,更多相关《优秀毕业论文——基于FPGA的数字钟设计文档格式.docx(12页珍藏版)》请在冰豆网上搜索。

优秀毕业论文——基于FPGA的数字钟设计文档格式.docx

二.数字钟各具体模块

2.1分频器(fengp)模块

本系统共需3种频率时钟信号(10MHz、1Hz、1KHz)。

为减少输入引脚,本系统采用分频模块,只需由外部提供10MHz基准时钟信号,其余两种频率时钟信号由分频模块得到。

分频器管脚

分频器代码:

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

entityfengpisport(clk0:

instd_logic;

clk_1Hz,clk_1kHz:

outstd_logic);

endentity;

architectureoneoffengpis

signalq1Hz:

integerrange0to9999999;

signalq1kHz:

integerrange0to9999;

begin

process(clk0)begin

ifclk0'

eventandclk0='

1'

then

ifq1Hz<

5000000-1thenclk_1Hz<

='

0'

;

q1Hz<

=q1Hz+1;

elsifq1Hz=10000000-1thenq1Hz<

=0;

else clk_1Hz<

endif;

ifq1kHz<

5000-1thenclk_1kHz<

q1kHz<

=q1kHz+1;

elsifq1kHz=10000-1thenq1kHz<

else clk_1kHz<

endif;

endprocess;

end;

2.260(count60)进制计数校时模块

本模块要实现的功能是:

正常计时、校时、校分在每个状态下都会

产生不同控制信号实现相应的功能。

60进制计数器管脚图

60进制计数器代码:

libraryieee;

entitycount60isport(clk,set:

CLR:

instd_logic:

co:

outstd_logic;

h,l:

bufferstd_logic_vector(3downto0));

endentity;

architectureoneofcount60issignalco1,set1:

std_logic;

set1<

=set;

co<

=(set1orco1);

process(clk,CLR)begin

ifCLR='

thenh<

="

0000"

l<

else

ifclk'

eventandclk='

--ifstart='

then

--h<

=d(7downto4);

--l<

=d(3downto0);

if(h="

0101"

andl="

1001"

)thenco1<

h<

ifl<

"

thenl<

=l+1;

ifh<

thenh<

=h+1;

co1<

endprocess;

2.324(count24)进制计数器模块

24进制计数器管脚图

24进制计数器时代码:

entitycount24isport(clk:

--d:

instd_logic_vector(7downto0)

---co:

architectureoneofcount24isbegin

process(clk,CLR)begin

elsifclk'

--ifstart='

-- h<

-- l<

ifh="

orh="

0001"

thenifl="

ifl="

0011"

0010"

else

2.3译码显示模块(display)

该显示用的是动态扫描电路

译码显示器管脚图

译码显示器代码:

useieee.std_logic_arith.all;

entitydisplayisport(clk:

hh,hl,mh,ml,sh,sl:

instd_logic_vector(3downto0);

sg:

outstd_logic_vector(6downto0);

bt:

outstd_logic_vector(7downto0));

architectureoneofdisplayissignala:

integerrange0to10;

signalcnt:

integerrange0to7;

--实现动态扫描

beginP1:

process(cnt,hh,hl,mh,ml,sh,sl)begin

casecntis

when

=>

bt

<

=

00000001"

a

conv_integer(hh);

1

00000010"

conv_integer(hl);

2

00000100"

10;

jiangefu"

-"

3

00001000"

conv_integer(mh);

4

00010000"

conv_integer(ml);

5

00100000"

6

01000000"

conv_integer(sh);

7

10000000"

conv_integer(sl);

whenothers=>

null;

endcase;

endprocessP1;

p2:

process(clk)begin

if(clk'

)thencnt<

=cnt+1;

endprocessp2;

P3:

process(a)begin

caseais

sg

0111111"

0000110"

1011011"

1001111"

1100110"

1101101"

1111101"

0000111"

8

1111111"

9

1101111"

when10=>

sg<

="

1000000"

sg<

endprocessP3;

2.4数字钟顶层设计模块

数字钟顶层设计模块管脚图

数字钟顶层设计模块代码:

entitydclockisport(clk,s1,s0,k0:

sg7:

bt8:

architectureoneofdclockiscomponentfengp

port(clk0:

clk_1Hz,clk_1kHz:

endcomponent;

componentcount60

port(clk,set:

---d:

co:

endcomponent;

componentcount24port(clk:

instd_log

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 表格模板

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1