microcreat 发表于 2009-7-16 14:38:28

怎样分析下面的程序?

div:process ( CLK_RST,CLK_IN,CLK_CS )
      begin
      if ( CLK_RST = '0' ) then
       CLK_CLK <= '1';
        CLK_CNT <= ( others => '0' );               
      elsif ( CLK_IN' event and CLK_IN = '1' and CLK_CS = '0' ) then                
       if ( CLK_CNT = CLK_NUM )        then
             CLK_CLK <= not CLK_CLK;
             CLK_CNT <= ( others => '0' );                               
          end if;
          CLK_CNT <= CLK_CNT + 1;                                  
      end if;
      end process div;

div:process ( CLK_RST,CLK_IN,CLK_CS )
      begin
      if ( CLK_RST = '0' ) then
         CLK_CLK <= '1';
        CLK_CNT <= ( others => '0' );               
      elsif ( CLK_IN' event and CLK_IN = '1' and CLK_CS = '0' ) then
            CLK_CNT <= CLK_CNT + 1;               
       if ( CLK_CNT = CLK_NUM )        then
             CLK_CLK <= not CLK_CLK;
             CLK_CNT <= ( others => '0' );                               
          end if;                                  
      end if;
      end process div;

第一个好像是进行512分频,第个个才进行CLK_NUM 分频!

zkf0100007 发表于 2009-7-16 22:37:53

( CLK_IN' event and CLK_IN = '1' and CLK_CS = '0' )
门控时钟,不太好吧!

microcreat 发表于 2009-7-17 11:27:29

哦!那怎样菜是好点的呢》一般的!谢谢了!

zkf0100007 发表于 2009-7-17 23:20:11

if ( CLK_IN' event and CLK_IN = '1' )then
    if( CLK_CS = '0') then
       .....

microcreat 发表于 2009-7-18 17:56:54

好,谢谢了!
页: [1]
查看完整版本: 怎样分析下面的程序?