VHDL的数字频率计实现

VHDL的数字频率计实现

ID:37898392

大小:31.50 KB

页数:5页

时间:2019-06-02

VHDL的数字频率计实现_第1页
VHDL的数字频率计实现_第2页
VHDL的数字频率计实现_第3页
VHDL的数字频率计实现_第4页
VHDL的数字频率计实现_第5页
资源描述:

《VHDL的数字频率计实现》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、5us转换为2slibraryieee;useieee.std_logic_1164.all;entityfdivisport(clk:instd_logic;q:outstd_logic);endfdiv;architectureaoffdivisbeginprocess(clk)variablecnt:integerrange0to199999;variableff:std_logic;beginifclk'eventandclk='1'thenifcnt<199999thencnt:=cnt+1;elsecnt

2、:=0;ff:=notff;endif;endif;q<=ff;endprocess;enda;20MHz转换成1Hzlibraryieee;useieee.std_logic_1164.all;entityfdivisport(clk:instd_logic;q:outstd_logic);endfdiv;architectureaoffdivisbeginprocess(clk)variablecnt:integerrange0to99999;variableff:std_logic;beginifclk'eve

3、ntandclk='1'thenifcnt<99999thencnt:=cnt+1;elsecnt:=0;ff:=notff;endif;endif;q<=ff;endprocess;enda;libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;useIEEE.STD_LOGIC_ARITH.ALL;useIEEE.STD_LOGIC_UNSIGNED.ALL;entitycounter10isPort(clk:inSTD_LOGIC;clr:inSTD_LOGIC;en:inSTD_LOG

4、IC;count:outSTD_LOGIC_VECTOR(3downto0);cn_out:outSTD_LOGIC);endcounter10;architectureBehavioralofcounter10isSIGNALq:STD_LOGIC_VECTOR(3downto0);beginprocess(clk,clr,en)beginifclr='1'thenq<="0000";elsifclk'eventandclk='1'thenifen='1'thenifq<9thenq<=q+1;elseq<="00

5、00";endif;endif;endif;endprocess;process(q)beginifq=9thencn_out<='1';elsecn_out<='0';endif;endprocess;count<=q;endBehavioral;libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;useIEEE.STD_LOGIC_ARITH.ALL;useIEEE.STD_LOGIC_UNSIGNED.ALL;entityload1isPort(load:inSTD_LOGIC;din

6、:inSTD_LOGIC_VECTOR(23downto0);dout:outSTD_LOGIC_VECTOR(23downto0));endload1;architectureBehavioralofload1isbeginbeginifload'eventandload='1'thendout<=din;endif;endprocess;endBehavioral;libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;useIEEE.STD_LOGIC_ARITH.ALL;useIEEE.

7、STD_LOGIC_UNSIGNED.ALL;entityledisa:outSTD_LOGIC;b:outSTD_LOGIC;c:outSTD_LOGIC;d:outSTD_LOGIC;e:outSTD_LOGIC;f:outSTD_LOGIC;g:outSTD_LOGIC);endled;architectureBehavioralofledisbeginprocess(d_in)typedata_outisarray(0to6)ofstd_logic;variableoutp:data_out;begincas

8、ed_iniswhen"0000"=>outp:="1110010";when"0001"=>outp:="0110000";when"0010"=>outp:="1101101";when"0011"=>outp:="1111001";when"0100"=>outp:="0110011";when"0101"=>outp:="1011011

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。