-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdut.vhdl
51 lines (42 loc) · 769 Bytes
/
dut.vhdl
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
library ieee;
use ieee.std_logic_1164.all;
entity dut is
port(
clk_in: in std_logic;
a1_in: in std_logic;
b1_out: out std_logic := '0';
a2_in: in std_logic;
b2_out: out std_logic := '0'
);
end;
architecture rtl of dut is
signal cnt: integer range 0 to 20 := 0;
signal a2_prev: std_logic := '0';
begin
process(clk_in)
begin
if rising_edge(clk_in) then
if cnt /= 20 then
cnt <= cnt + 1;
end if;
end if;
end process;
process(clk_in)
begin
if rising_edge(clk_in) then
a2_prev <= a2_in;
b1_out <= not a1_in;
if cnt = 20 then
b1_out <= a1_in;
end if;
end if;
end process;
process(all)
begin
b2_out <= a2_prev;
if cnt = 20 then
b2_out <= not a2_in;
end if;
-- b2_out <= not a2_in;
end process;
end;