blob: d114c872a2ced72fe3d13953cae008a1717606e0 (
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
28
29
30
|
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity top is
port (
clk, en : in std_logic;
a, b : in std_logic;
p, q : out std_logic
);
end entity;
architecture arch of top is
begin
process (clk, en, a)
variable tmp : std_logic;
begin
if en = '1' then
tmp := a;
p <= tmp;
else
p <= '0';
end if;
if rising_edge(clk) then
tmp := b;
q <= tmp;
end if;
end process;
end architecture;
|