blob: bf2c70e1409ae7e836de4dee7f9f411cd1058724 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
library ieee;
use ieee.std_logic_1164.all;
entity dff02 is
port (q : out std_logic;
d : std_logic;
en : std_logic;
rst : std_logic;
clk : std_logic);
end dff02;
architecture behav of dff02 is
signal t : std_logic := '1';
begin
process (clk, rst) is
begin
if rst = '1' then
t <= '1';
elsif rising_edge (clk) then
if en = '1' then
t <= d;
end if;
end if;
end process;
q <= t;
end behav;
|