zoukankan      html  css  js  c++  java
  • VHDL_LIB之DFF

    1  D-Flip-Flop with async reset or set

     1 library IEEE;
     2 use ieee.std_logic_1164.all;
     3 
     4 entity FFD is
     5     generic
     6     (
     7         ResetVal    : std_logic := '0';        --! select async set / async reset
     8         ClockFall   : boolean := False         --! select clock edge
     9     );
    10     port
    11     (
    12         RST  :    in    std_logic;              --! Async Reset
    13         C    :    in    std_logic;               --! Clock
    14         D    :    in    std_logic;               --! Input
    15         Q    :    out    std_logic               --! Output
    16     );
    17 end FFD;
    18 
    19 architecture beh of FFD is
    20     signal clock : std_logic;                    --! active clock
    21 
    22 begin
    23 
    24 gckr: if ClockFall = false generate
    25     clock <= C;
    26 end generate;
    27 gckf: if ClockFall = true generate
    28     clock <= not(C);
    29 end generate;
    30 
    31 pFF:    process(RST,clock)
    32         begin
    33             if(RST = '1') then
    34                 Q <= ResetVal;
    35             else
    36                 if(clock'Event and clock = '1') then
    37                     Q    <=    D;
    38                 end if;
    39             end if;
    40         end process pFF;
    41 end beh;

      

    2  D-Flip-Flop with clock enable

    1 -- Port declaration
    2 CE    :    in    std_logic;           --! Clock enable
    3 
    4 -- Clock event
    5     if(clock'Event and clock = '1') then
    6         if (CE = '1') then  Q <= D; 
    7         end if;        
    8     end if; 
  • 相关阅读:
    【转】SQL时间函数
    C#操作Word完全方法
    出水芙蓉,风华绝代记民国才女林徽因
    梅超风:我就是那个多年以前的女子
    厉胜男
    南海恶神
    挪窝
    吴若权——洛可可动画电影馆
    美的慢箭
    机械公敌(I, Robot) 场景设定
  • 原文地址:https://www.cnblogs.com/mengdie/p/4469120.html
Copyright © 2011-2022 走看看