新闻  |   论坛  |   博客  |   在线研讨会
看了ilove的异步复位同步释放博文有感
0750long | 2009-05-09 11:07:02    阅读:1586   发布文章

看了ilove的异步复位同步释放博文有感

 

        在博文中特权TX介绍说“Altera推荐的双层叠复位方式”,并且提供了基于Verilog的源代码。

        最近设计中有异步复位,就直接引用特权同学的代码,改成VHDL使用。代码如下:

       library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;


entity Rst_Async2Sync is  
    port (
      clkin :            in std_logic;
    async_rst :          in std_logic; 
    sync_rst :         out std_logic  
     ); 
end Rst_Async2Sync;
       
architecture rtl of Rst_Async2Sync is
signal Sync_rst1,Sync_rst2: std_logic;
begin

process(clkin,async_rst)
begin
   if async_rst='1' then
      Sync_rst1 <= '1';
   elsif clkin'event and clkin='1' then
      Sync_rst1 <= '0';
   end if;  
end process;
process(clkin,async_rst)
begin
   if async_rst='1' then
      Sync_rst2 <= '1';
   elsif clkin'event and clkin='1' then
      Sync_rst2 <= Sync_rst1;
   end if;  
end process;
sync_rst <= Sync_rst2;

end ;

经过QuartusII9.0编译后,在map viewer下可以看到其结果为:

点击看大图

*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。

参与讨论
登录后参与讨论
推荐文章
最近访客