在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 1518|回复: 1

问个分频器的疑问

[复制链接]
发表于 2009-10-20 19:15:46 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
这是一个4分频的代码,仿真的波形是正确的
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity div is
port(clk:in std_logic;
div_clkut std_logic);
end div;
architecture bhv of div is
signal count:integer;
begin
process(clk)
begin
if(clk'event and clk='1')
then
if(count=3)then
count<=0;
else count<=count+1;
if count<2
then
div_clk<='0';
else
div_clk<='1';
end if;
end if;
end if;
end process;
end bhv;



以下是稍改的2分频
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity div is
port(clk:in std_logic;
div_clkut std_logic);
end div;
architecture bhv of div is
signal count:integer:=0;
begin
process(clk)
begin
if(clk'event and clk='1')
then
if(count=1)then
count<=0;
else count<=count+1;
if count<1
then
div_clk<='0';
else
div_clk<='1';
end if;
end if;
end if;
end process;
end bhv;
输出的DIV_CLK为0.
平台是quartus
求教高手是什么问题??谢谢了
发表于 2010-5-31 17:02:47 | 显示全部楼层
111111111111111111111111111
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-12 08:29 , Processed in 0.025087 second(s), 9 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表