首页 新闻资讯 技术资料 论坛 网站地图
开发工具 SOPC 传感控制 嵌入式系统 AD/DA IC设计 综合电子技术
电子元器件搜索:
IC库存(8958万) PDF资料(329万) IC价格 IC求购 资讯 技术资料
维库电子市场网是知名的电子元器件交易网站, 为电子生产企业提供IC库存和技术资料查询服务。
位置: 首页 > 详细信息
  [求助]关于在ise(Project Navigator v5.1)中的编程问...
出处:综合电子论坛 时间: 2005-01-13
风之子 发布于 2005-1-13 0:30:00
表情[求助]关于在ise(Project Navigator v5.1)中的编程问题
要求设计一个2.5分频的分频器,我用vhdl编的代码在quartus2  4.0中编译通过,波形正确,但是把程序放到Project Navigator v5.1中运行时,功能仿真就不能通过,请问各位大虾,这是什么原因,原代码如下:


library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity counter is                
    port(clk,reset,en:in std_logic;       --输入:clk=100MHz,en 使能信号
            clk_out,Q:buffer std_logic);  --输出:clk_out=40MHz,Q=20MHz
end counter;
architecture behavior of counter is
  signal count:std_logic_vector(1 downto 0);
  signal clk_in:std_logic;
begin
clk_in<=clk xor Q;
process(clk_in,reset)     --三分频器;
  begin
     if reset='1' then
        count<="00";
     else
        if(clk_in 'event and clk_in='1')then
           if(en='1')then
              if(count="10")then
                   count<="00";
                   clk_out<='1';
              else
                   count<=count+1;
                   clk_out<='0';
              end if;
           end if;
        end if;
     end if;
end process;
process(clk_out)         --D触发器
begin
   if(clk_out'event and clk_out='1')then
      Q<=not Q;
   end if;
end process;
end behavior;

风之子 发布于 2005-1-13 9:12:00
表情问的简单一点,好像在ise中做反馈和在QUARTUS中做反馈不一样,但是具体不同在哪里,我不知道,还请各位大虾指点!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
风之子 发布于 2005-1-13 9:55:00
表情是不是很简单,所以大家不回答呀??
风之子 发布于 2005-1-13 10:12:00
表情还是我自己来回答吧,我在很偶然的情况下将代码改成下面的形式,在ise中功能仿真和时序仿真就都对了,不知道为什么要这么改,但是我改对了,贴出来,希望以后的人少走弯路!
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity counter is                
    port(clk,reset,en:in std_logic;       --输入:clk=100MHz,en 使能信号
            clk_out,Q:inout std_logic);  --输出:clk_out=40MHz,Q=20MHz
end counter;
architecture behavior of counter is
  signal count:std_logic_vector(1 downto 0);
  signal clk_in:std_logic;
  signal i:std_logic;
begin
process(clk,i)  
  begin
        if( i='1')then
           clk_in<=not clk;
   else clk_in<=clk; end if;
  
end process;
process(clk_in,reset)     --三分频器;
  begin
     if reset='1' then
        count<="00";
     else
        if(clk_in 'event and clk_in='1')then
           if(en='1')then
              if(count="10")then
                   count<="00";
                   clk_out<='1';
              else
                   count<=count+1;
                   clk_out<='0';
              end if;
           end if;
        end if;
     end if;
end process;
process(clk_out)         --D触发器
begin
   if(clk_out'event and clk_out='1')then  --Q<=not Q;
      if Q='1' then
  Q<='0';i<='0';
  else Q<='1';i<='1';end if;
   end if;
end process;
end behavior;
关闭】 【打印
相关专题  
嵌入式软件
军工/航空航天
开发工具
嵌入式硬件
电源系列
嵌入式系统
嵌入式开发新闻
数控系统
AD/DA
传感控制
综合电子技术
汽车电子
医疗电子
存储器
消费电子
软件开发
计算机外设
接口电路
工业控制
IC设计
安防产品
CPLD/FPGA
SOPC
通信产品
测试测量

© 2007 百斯嵌入式开发网 网站地图