1 / 5
文档名称:

时钟分频.doc

格式:doc   大小:194KB   页数:5页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

时钟分频.doc

上传人:小sjj 2021/8/20 文件大小:194 KB

下载得到文件列表

时钟分频.doc

相关文档

文档介绍

文档介绍:1 日期2011年12月14日
EDA实验报告
山农大电子
实验名称时钟分频
实验目的
学****数控分频器的设计、分析和测试方法。
实验原理
数控分频器的功能就是当在输入端给定不同输入数据时,将对输入的时钟 信号有不同的分频比,数控分频器就是用计数值可并行预置的加法计数器设计 完成的,方法是将计数溢出位与预置数加载输入信号相接即可。
实验要求
将clock5连接至4096Hz,编写分频逻辑,将其分频至1Hz,2Hz, 8Hz, 16Hz, 编写四选一 MUX,可用按键控制选择分频后的某时钟。扩展实验 3中的计数
器,使其能计数0-99,并编写顶层文件例化分频逻辑、选择器、计数器,使计 数器在不同的频率下计数。
实验步骤
【1】分频逻辑:
library ieee;
use 」o ;
use un sig ; en tity dvf is
port(clk:in std」ogic;
s: in std_logic_vector(1 downto 0);
clke nd:out std_logic);
sig nal clk4_tmp:std」o gic;
signal cnt2048:integer range 0 to 2048;
signal cnt1024:integer range 0 to 1024;
sig nal cn t512:i nteger range 0 to 512; sig nal cn t256:i nteger range 0 to 256; beg in
fen1: process(clk)
end; architecture one of dvf is sig nal clk1_tmp:std」o gic; sig nal clk2_tmp:std」o gic; sig nal clk3_tmp:std」o gic;
beg in
if clk'event and clk='1' then
if cn t2048<2047 the n cnt2048<=c nt2048+1;
else
2 日期2011年12月14日
cn t2048<=0; clk1_tmpv=N0T clk1_tmp ;
end if;
end if;
end process;
fen2: process(clk)
begi n
if clk'eve nt and clk='1' then
if cnt1024<1023 the n
cn t1024<=cnt1024+1; else
cn t1024<=0; clk2_tmpv=NOT clk2_tmp ;
end if;
end if;
end process;
fen8: process(clk)
begi n
if clk'eve nt and clk='1' then
if cnt512<511 then
cn t512<=c nt512+1;
else
cn t512<=0; clk3_tmpv=NOT clk3_tmp ;
end if;
end if;
end process;