基于VHDL的分频电路.ppt





《基于VHDL的分频电路.ppt》由会员分享,可在线阅读,更多相关《基于VHDL的分频电路.ppt(5页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、基于VHDL的分频电路分频电路介绍 CPLD/FPGA与单片机相比,一个明显得优势就在于它的高速性。但很多外围器件的驱动都需要低频的时钟(若时钟频率太高,则键盘扫描就会出错,七段数码管会闪烁和不稳定就是最好的例子),所以经常需要用到分频电路。常见的分频电路为偶数倍分频和奇数倍分频两种。下面对8分倍分频电路用VHDL做简单介绍。方案设计 如果系统有一个200KHz的时钟,系统要求将其分为100KHz,50KHz,25KHz,并且在这4个频率时钟中选择一个作为输出。下面给出两种设计方案:1.设计一个2分频电路、一个4分频电路、一个8分频电路,直接从200KHz分频到所需要的几个频率的时钟信号(如图
2、1所示)。2.只设计一个2分频电路,用3个2分频电路级联的方式,从200KHz逐级分出所需要的时钟信号(如图2所示)。图1图2下面用VHDL设计一个2分频电路:library ieee;use ieee.std_logic_1164.all;entity FreDevider isport(clock:in std_logic;clockout:out std_logic);end;/元件端口architecture behavior of FreDevider is /元件行为描述signal clk:std_logic;beginprocess(clock)beginif rising_e
3、dge(clock)thenclk=not clk;end if;end process;clockout=clk;end;nlibrary ieee;nuse ieee.std_logic_1164.all;nentity fredevider2 isnport(nclock:in std_logic;nclockout:out std_logicn);nend;narchitecture dcider of fredevider2 isnconstant N:integer:=3;nsignal counter:integer range 0 to N;nsignal clk:std_logic;nbeginnprocess(clock)nbeginnif rising_edge(clock)thennif counter=N thenncounter=0;nclk=not clk;nelsencounter=counter+1;nend if;nend if;nend process;nclockout=clk;nend;
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 基于 VHDL 分频 电路

限制150内