发信人: bobby (*bobbymm,锁定你做我一生的目标*), 信区: ECE
标  题: [合集]一个VHDL的问题
发信站: 哈工大紫丁香 (2002年09月26日02:31:03 星期四), 站内信件


────────────────────────────────────────
 peak (嗡嗡)                          于 Mon Aug 26 16:08:03 2002) 说道:

我想用一个16进制的计数器实现对输入的16M信号c16M分别进行2,4,8,32分频,其中32

分频我用计数器的进位端来实现的,可是仿真的时候wave信号总是一点反映没有。其他信

没有问题,我我看不出我的程序有什么问题,大家帮我查一查吧,先谢谢了
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;

entity counter16 is 
     port(c16M,en:in std_logic;
          wave,bclk,dclk,fsck:out std_logic);
          
end counter16;

architecture rtl of counter16 is
     signal counter16_4:std_logic_vector(7downto 0);
     signal a,carry16 : std_logic;

begain
      a<=en;
      process(c16M,a,count16_4)
      begin
          if(c16M='1' and c16M'event)then
             if(a='1')then
                count16_4<=count16_4+'1';
             elsif(count16_4="1111")then
                count16_4<="0000";
                carry16<=not carry16;
             end if;
          end if;
      end process ;
      bclk<=count16_4(2);
      dclk<=count16_4(1);
      fsck<=count16_4(0);
      wave<=carry16;
end rtl;



────────────────────────────────────────
 bobby (*bobbymm,锁定你做我一生的目标*)  于 Mon Aug 26 16:51:01 2002) 说道:

【 在 peak (嗡嗡) 的大作中提到: 】
: 我想用一个16进制的计数器实现对输入的16M信号c16M分别进行2,4,8,32分频,?..

: 分频我用计数器的进位端来实现的,可是仿真的时候wave信号总是一点反映没有。?..
: 号
: 没有问题,我我看不出我的程序有什么问题,大家帮我查一查吧,先谢谢了
: library IEEE;
: use IEEE.std_logic_1164.all;
: use IEEE.std_logic_unsigned.all;

: entity counter16 is 
:      port(c16M,en:in std_logic;
:           wave,bclk,dclk,fsck:out std_logic);
:           
: end counter16;

: architecture rtl of counter16 is
:      signal counter16_4:std_logic_vector(7downto 0);
:      signal a,carry16 : std_logic;

: begain
~~~~~~~~~~??begin??

:       a<=en;
:       process(c16M,a,count16_4)
:       begin
:           if(c16M='1' and c16M'event)then
:              if(a='1')then
:                 count16_4<=count16_4+'1';
:              elsif(count16_4="1111")then
:                 count16_4<="0000";
:                 carry16<=not carry16;
:              end if;
:           end if;
:       end process ;
:       bclk<=count16_4(2);
:       dclk<=count16_4(1);
:       fsck<=count16_4(0);
:       wave<=carry16;
: end rtl;





────────────────────────────────────────
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:1.348毫秒